Class 8 · Unit 1: The AI project lifecycle · Lesson 1.3 · 40 min
Training the model
120 photos, all labelled. “Train it on all of them,” says Rahat. “Then how will we ever know if it works?” says Hiba.
Today you will: Train a three-class model · Read its confidence scores · Keep a test set locked away
Story
The photos are in. Following the rules the class agreed, the AI club spent a week photographing what went into the bin behind the science block: the item on a sheet of paper, never a person. One hundred and twenty photos, each one labelled wet, dry or hazardous as it was taken.
Rahat drags the whole folder into Teachable Machine. "Right. Train it on all of them."
Hiba: “All of them? Then how will we know if it works?”
Rahat: “We'll show it a photo.”
Hiba: “Which photo? They're all in there. It has already seen every one. It never sees these. Not today. Not until we're ready to find out the truth.” (She takes twenty photos out of the folder and puts them in a second folder marked test.)
Today you build the model. The rule Hiba just made — keep some examples back — is what makes tomorrow's answer honest.
Watch
How a model is trained — — scan code 8.1.3 in the printed book.
Learn it
Stage 3 is training: building the model, the part of an AI project that does the deciding. Think of it this way: the training data is the textbook, the model is the student, and the labels are the answers at the back. The student reads many worked examples and finds the pattern itself. Nobody hands it a rule, and that is exactly what makes it AI. And before any training starts, some examples are locked away for testing.
Words to know
- Model the part of an AI project that learns the pattern and makes the decision. CBSE calls it the brain of the project.
- Training showing the model labelled examples until it learns the pattern.
- Labelled data data where every example carries its correct answer, like a photo marked wet.
- Class one of the groups the model chooses between: wet, dry, hazardous.
- Confidence score how sure the model says it is, as a percentage. High confidence is not proof.
- Test set examples held back before training, used later to check the model honestly.
Step by step: a written rule vs a learned rule
- A written rule (Class 6):
=IF(A1="red circle","apple","???"). A person decided the rule, and anything unexpected gets "???". - A learned rule: show the model 30 labelled photos of each class. It finds its own pattern of shapes, colours and textures, one no human could write out.
- Before training, lock some away: of 120 photos, put 20 in a test folder and do not open it.
- Train on the other 100, then try new items and read the confidence: "Dry 94%" is sure; "Wet 48%, Dry 45%" means it is nearly guessing.
The real magic is data. The same tool, trained on better examples, becomes a better model. The tool is not the clever part.
Careful: the model is not the program. The same tool, given different photos, trains a different model. And more classes do not make a better model: three well-separated classes with good examples beat six blurred ones.
On the laptop
You need: Teachable Machine (no account) · LibreOffice Calc · waste/train/ (about 30 photos per class) · waste/test/ (20 photos — not opened today)
Mission 1: Three classes (8 min, in pairs)
- ☐1
teachablemachine.withgoogle.com → Image Project → Standard. Don't sign in.
- ☐2
Name the classes Wet, Dry, Hazardous, and upload the matching
waste/train/photos. - ☐3
How many examples does each class have? Note it — you'll need it in Unit 4.
Mission 2: Train and watch (10 min)
- ☐4
Train Model — it trains on this laptop.
- ☐5
Predict: which item from the classroom bin will it be least sure about? Hold up items to the webcam, or upload spare photos.
- ☐6
In Calc, record five items: what it was · what the model said · its top confidence. Note one above 90% and one where the top two were close.
Mission 3: Leave the test folder alone (2 min)
- ☐7
Keep the tab open or export the model for Lesson 1.4.
No laptop today?
Play the student and the textbook: the class sorts twenty picture cards into wet, dry and hazardous; a volunteer studies them for two minutes, then sorts five new cards. Ask what rule they used — that sentence is the model.
Debate it
Another group trains its model on photos taken in bright sunlight, each item placed on a clean white sheet, all photographed on the same afternoon.
- What will happen when the model is shown a wrapper lying in the shade of the bin, at dusk?
- What does that tell you about where training photos should be taken?
- The group's model scores very well in the classroom. Is it a good model? What would you need to know before answering?
Check yourself — practice, not a test
1. In an AI project, the model is:
- ○ The laptop the project runs on
- ○ The part that learns the pattern and makes the decision
- ○ The folder of photographs
- ○ The person who labels the data
2. In machine learning, a programmer writes the rule the model follows.
- ○ True
- ○ False
3. Data that carries the correct answer with each example is called ______ data.
4. Why must some examples be kept out of training?
- ○ To save space on the laptop
- ○ To make training faster
- ○ So the model can later be tested on examples it has never seen
- ○ Because the tool only accepts 30 photos
5. Match each part of the analogy to what it stands for:
The textbook · The student · The answers at the back
Match with: The training data · The labels · The model
Remember
The model is learned from examples, not written as rules. Keep some examples back.
Typing practice
Skill: capitals without looking — the shift key with both hands (6 min)
- On typing.com, open the Intermediate lessons covering capital letters and shift . Use the shift key on the opposite hand to the letter.
- Then type these class names three times, exactly as they are spelt:
Wet Waste · Dry Waste · Hazardous Waste - Term 1 goal: 28–32 words per minute at 93% accuracy.