Principles of AI · Unit 1: Inside the Machine ·  Activity 1.1.2

Train, Test, Trust — Teach a Machine to Classify

Train a model, test it fairly, and decide how far to trust it  ·  Approx. 2 class days

StarringTrain · Learn from LabelsTest · Held-Out ImagesTrust · Confusion Matrix

Quick reference for training, testing, the confusion matrix, and when a model can't be trusted.

Train, Test, Trust infographic: labeled examples, pixels as numbers, train and test split, confusion matrix, accuracy trap, loss and learning, and bias in training data

🧭 Plot Summary

A model is only as good as the examples it learned from, and you can't tell how good it is by asking it about those same examples. In this activity you train an image classifier in Teachable Machine with labeled pictures. Then you do the part that most people skip: you test it on images it has never seen and keep score. Every result goes into a confusion matrix, a four-box table that shows not just how often the model is right, but how it is wrong.

Not all mistakes cost the same. A spam filter that lets one junk email through is annoying. A medical scan model that misses a real problem is dangerous. You'll also see that a model trained on a small or lopsided set of pictures learns the wrong lessons, and that real systems have failed in exactly this way for people who were missing from the data.

What you'll do in this activity

  • Train a Teachable Machine model on your own labeled images, then see what it says about images it has never seen.
  • Keep some images out of training on purpose, so you can test the model honestly instead of grading it on pictures it has already studied.
  • Sort every test result into a confusion matrix, and work out accuracy, precision and recall.
  • Change the training set (smaller, lopsided, missing a kind of image) and watch the matrix change.
  • See how a model learns by guessing a boundary, measuring its loss, and guessing again.
  • Ask who a model was built and tested on, and who gets left out.

Why it matters

Anyone can build a model that looks good in a demo. The skill is knowing how to test it honestly and what to ask before you trust it. You'll use that again in Activity 1.2.2, in the Red-Team Report in Project 1.2.4, and any time you hear "our AI is 99% accurate."

✅ Self-Check Before You Trust It

Check off each item as you get there. These aren't grades. They're your own signal.