Equipment Needed
- Windows PC with Chrome or Edge browser
- Microsoft Paint
- A folder on the desktop called TM_Lesson4
Key Vocabulary
Multi-classA model with more than two classes — it has to choose between 3 or more categories.
ConfusionWhen the model mixes up two classes — e.g. predicts "square" when it's actually a "triangle".
ImprovementMaking a model better by adding more data, better data, or fixing problems.
Starter Activity (5 minutes)
Quick quiz: You have learned about circles and triangles. What other shapes could you add? Why might a third shape be harder for the model?
Discussion: Squares might be confused with rectangles; with 3 classes, the model has more options to choose from, so confidence might be lower. Link to real-world classifiers (e.g. identifying dog breeds).
Main Tasks
Part A: Create Your Three-Class Dataset
-
Create a folder
TM_Lesson4. Inside, create:TRAIN/Circles/— 10 circle images (white background)TRAIN/Triangles/— 10 triangle images (white background)TRAIN/Squares/— 10 square images (white background)TEST/Circles/— 5 new circle imagesTEST/Triangles/— 5 new triangle imagesTEST/Squares/— 5 new square images
- Draw your squares in Paint. Make them different sizes but keep the white background. Remember: vary them!
- You can reuse your Lesson 3 circles and triangles if they were on white backgrounds.
Part B: Build the 3-Class Model
- Open Teachable Machine and start a new Image Project.
- You'll see Class 1 and Class 2 by default. Click "Add a class" to add a third class.
- Rename the classes to Circle, Triangle, and Square.
- Upload your TRAIN images into the correct classes.
- Train the model. Then test with your TEST images.
Part C: Record Your Results
Test with 15 test images (5 per class) and record the results:
| # | Actual Shape | Model's Prediction | Confidence | Correct? |
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 | ||||
| 10 | ||||
| 11 | ||||
| 12 | ||||
| 13 | ||||
| 14 | ||||
| 15 |
Accuracy & Confusion Analysis
Part D: Improve Your Model
- Look at which class the model struggled with most. Draw 5 more training images for that class, making them as clear and varied as possible.
- Add the new images to the same Teachable Machine project and re-train.
- Test again with your test images. Did the accuracy improve?
Common Mistakes & Quick Fixes
- Squares look like rectangles: Make sure your squares are roughly equal on all sides. Very stretched shapes will confuse the model.
- Model always picks one class: Check that you have roughly equal numbers of images in each class (balanced dataset).
- Can't add a third class: Click the "+ Add a class" button below the existing classes in Teachable Machine.
Challenge / Stretch Task
Add a 4th class — perhaps a star or a pentagon. How does accuracy change with even more classes?
Exit Ticket
Expected answers:
- Confusion is when the model predicts the wrong class — e.g. calling a square a triangle.
- Add more training data, add more variety, or make the images clearer.
- Because the model has more choices to pick from, so there's more chance of getting confused, especially if classes look similar.