Building a classifier that works
Hiba holds a leaf up to the window. “Hazardous, 96%.” Twenty-eight photos, one desk, four minutes — the model learned the desk.
- Plan classes that don't overlap
- Vary your photos on purpose
- Test in a different place and light
Building a classifier that works
Hiba holds a leaf up to the window. “Hazardous, 96%.” Twenty-eight photos, one desk, four minutes — the model learned the desk.
- Plan classes that don't overlap
- Vary your photos on purpose
- Test in a different place and light
Story
Learn it
Rahat's model scored beautifully and then called a leaf hazardous with 96% confidence, because every training photo was taken on one desk, in one light, in four minutes. It learned the desk. A classifier that works is built with care: clear classes that don't overlap, enough varied examples of each, a test set held back before training, and training where the model will really be used.
Words to know
one group the model chooses between. Classes must not overlap: if an item can honestly belong to two, fix the classes.
about the same number of examples in each class: at least 30 each.
different objects, backgrounds, angles, distances and light in the training photos.
an extra class of empty desks, hands and walls, so the model does not force every picture into a real class.
examples chosen and put aside before training, never used to train.
how strongly the model prefers one answer. It is not the same as being correct.
Step by step: planning a pen / pencil / eraser classifier
- Choose classes that don't overlap: pen, pencil, eraser. (Not "pen" and "blue things": a blue pen is both.)
- Decide the test set first: 5 items per class, set aside, never photographed for training.
- Plan variety: at least 3 different pens, 3 backgrounds (desk, notebook, floor), 2 kinds of light (window, tube light).
- Add a Background class: an empty desk, a hand, the wall.
- Photograph 30 per class where it will be used, turning and moving each object.
- Train, then test on the 15 held-back items, and then in a different part of the room.
Variety beats quantity. Ten bottles photographed in three places teach more than thirty photos of one bottle on one desk.
Careful: high confidence is not correctness. A model can be 96% sure and completely wrong, because confidence only says which answer it prefers, among the classes it knows.
Your missions
classifier-plan.ods · a webcamPlan before you photograph
5 minin groups of 3- 1
Choose three classes you can photograph here — pen / pencil / eraser, chinar leaf / willow leaf / paper, wet / dry / hazardous.
- 2
Could one item belong to two classes? Change your classes now. Where will the model be used? Photograph it there.
- 3
Plan 30 examples per class: at least 3 objects, 3 backgrounds, 2 kinds of light. Choose 5 test items per class to set aside.
Build it
15 min- 4
Four classes: your three, plus
Background(empty desk, a hand, the wall). - 5
Webcam → Hold to Record. Keep moving: turn it, bring it closer, change the background and the light. Photograph the test items separately.
- 6
Train Model, then test the 15 held-back items and record each result.
- 7
Predict: will it survive in a different part of the room? Try it.
Only you can see this ⚠️ Objects only. No photographs of people.
No laptop today?
Design it on paper: three classes that don't overlap, 30 examples each, how you'd vary them, and which items you'd hold back. Then swap plans and try to break each other's: "All your photos are on a desk — what happens outdoors?"
Debate it
Your group's model works perfectly in the computer lab and fails in the school yard.
Nothing about the objects changed. What changed, and whose fault is the failure — the model's, or the people who chose its training photos?
Check yourself · practice, not a test
In the app, students answer these one at a time and each answer is checked straight away. It's practice, never a mark — anything they miss comes back later for another go.
1.Which make a training set better? (choose all)
- APhotographs taken in different light
- BSeveral different objects in each class
- CThirty photos of the same object from the same spot
- DAbout the same number of examples in each class
2.Testing a model on the same photos it trained on tells you how well it will work on new ones.
TrueFalse3.Adding a ______ class of empty desks and walls stops the model forcing every picture into a real class.
4.A model says hazardous with 96% confidence and is wrong. This shows that:
- AThe model is broken and must be deleted
- BConfidence measures preference, not correctness
- C96% is too low to trust
- DThe test photo was invalid
5.A tool that trains a model from your examples without you writing any code is called a ______ platform.
6.Put the build in the right order:
- 1Choose classes that do not overlap
- 2Train the model
- 3Photograph varied training examples
- 4Test on the held-back items
- 5Decide which items will be held back for testing
A model learns what your photos have in common. Make sure that is the thing you meant.
Typing practice
Skill: typing without looking, Term 1 (5 min)
- On typing.com, continue this term's lessons. Cover your hands with a sheet of paper if you find yourself looking down.
- Type your class plan headings for practice:
Class name, how many examples, where photographed, light, background - Target: 28–32 WPM at 93%+.
Written and designed by Faizan Ayoub. © 2026 Faizan Ayoub. All rights reserved.