Lesson 4: Three-Class Model

45–60 minutes Windows PC, Browser, Paint

Today you will…

Equipment Needed

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

  1. 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 images
    • TEST/Triangles/ — 5 new triangle images
    • TEST/Squares/ — 5 new square images
  2. Draw your squares in Paint. Make them different sizes but keep the white background. Remember: vary them!
  3. You can reuse your Lesson 3 circles and triangles if they were on white backgrounds.

Part B: Build the 3-Class Model

  1. Open Teachable Machine and start a new Image Project.
  2. You'll see Class 1 and Class 2 by default. Click "Add a class" to add a third class.
  3. Rename the classes to Circle, Triangle, and Square.
  4. Upload your TRAIN images into the correct classes.
  5. 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

  1. 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.
  2. Add the new images to the same Teachable Machine project and re-train.
  3. Test again with your test images. Did the accuracy improve?

Common Mistakes & Quick Fixes

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:

  1. Confusion is when the model predicts the wrong class — e.g. calling a square a triangle.
  2. Add more training data, add more variety, or make the images clearer.
  3. Because the model has more choices to pick from, so there's more chance of getting confused, especially if classes look similar.
← Lesson 3 Lesson 5 →