AI Explorers · lesson 14 of 24 · 25 min
Your thumbs-up model was a warm-up. Now you will design a model on purpose, test it fairly, and improve it like a real machine learning engineer.
Plan before you train
Real ML engineers plan first. Answer these on paper before opening the tool:
- Goal: What should the model tell apart? Pick 3 classes of objects you have at home, like “apple,” “banana” and “orange,” or “book,” “phone” and “remote.”
- Background class: Add a fourth class called “Nothing” with photos of your empty desk or table. This gives the model a way to say “none of these.”
- Variety plan: List ways to vary your samples: angle, distance, lighting, hand holding it or not, different backgrounds.
- Test plan: Set aside objects or positions you will not use for training, so you can test fairly later.
Train
In an Image Project, create your 4 classes and capture samples for each. Aim for roughly the same number in every class, around 40 to 60 each. If one class has far more samples than the others, the model may lean toward guessing that class.
After training, Teachable Machine has an Advanced menu with settings like epochs. An epoch is one full pass through all your training samples. More epochs means more practice, but too many can lead to overfitting. The default is a good place to start.
Test like a scientist
Don’t just wave objects around and smile. Run a real test:
- Use your test plan: new angles, a different room or lighting, or a different object of the same kind (a second apple).
- Show each test item and record the top prediction and its confidence.
- Do at least 3 tests per class.
- Calculate accuracy and fill in a mistake table like in lesson 12.
| Test item | True class | Model said | Confidence | Right? |
|---|---|---|---|---|
| Green apple, kitchen light | Apple | Apple | 80% | Yes |
| Banana, far away | Banana | Nothing | 55% | No |
The table above is just a sample layout. Your numbers will be different.
Improve and retrain
Look at your mistakes. Each one is a clue. If the banana far away failed, add more far-away banana samples. If everything looks like “Nothing” in dim light, add dim-light samples to every class. Retrain and test again with the same tests. Did accuracy go up?
This is the real heart of machine learning work: test, find the weak spots, fix the data, repeat.
Try it
- Write your plan: 3 object classes plus “Nothing,” your variety list, and your test items.
- Build the Image Project, collect samples for each class, and train.
- Run at least 12 tests and record them in a table.
- Calculate your accuracy.
- Make one improvement to your data, retrain, and run the same 12 tests again. Write down your before and after accuracy and what you changed.
Check yourself
Why add a “Nothing” class?
It gives the model a way to say none of the objects are present, instead of forcing a wrong guess.
What is an epoch?
One full pass through all the training samples during training.
Your model fails in dim light. What should you do?
Add samples taken in dim light to each class, retrain, and test again.
Key words
- Background class: a class for “none of the above.”
- Epoch: one full pass through the training data.
- Balanced data: having similar numbers of samples in each class.
- Retrain: train again after changing data or settings.
Previous lesson: Meet Teachable Machine
Back to AI Explorers
Next lesson: The bad data experiment
