JunoJR Learning
← AI Lab
Chapter 5 · Intermediate · 60 min

Teach a Machine

Train your own AI model — no code needed.

In this chapter you'll

  • Explain how machine learning differs from normal programming
  • Train your own AI model from examples — no code
  • Understand classes, training data, and why more/varied data helps
  • Test your model and make it better

🛠️ You'll build: Your own trained recognizer — for example a model that tells a thumbs-up from a thumbs-down, or recyclable from trash — that you test live with your webcam.

So far your AI was already trained by someone else. In this chapter you become the trainer. You'll build a real machine-learning model from your own examples — and you won't write a single line of code to do it.

How machine learning is different

Normal programming: a human writes exact rules. "If the traffic light is red, stop." But how would you write rules for "is this a thumbs-up"? Every hand is different. It's almost impossible.

Machine learning (ML) flips it around:

Instead of writing the rules, you show the computer lots of examples, and it figures out the pattern itself.

The examples are called training data. The categories it learns are called classes. The golden rule:

  • More examples + more variety = a smarter model. (Different angles, lighting, hands, backgrounds.)

Step 1 — Open your training studio

You'll use Teachable Machine — a free tool by Google that trains models right in your browser.

  1. With a grown-up, go to teachablemachine.withgoogle.com.
  2. Click Get Started, then choose a Standard image project.

Stay safe

This step uses your webcam. Do it with a parent or guardian. Point the camera at your hands or objects, not faces, and don't save or share the images. Teachable Machine can train right in your browser — nothing has to be uploaded.

Step 2 — Make your classes

  1. You'll see two boxes ("Class 1", "Class 2"). Rename them to your two categories — for example Thumbs Up and Thumbs Down (or Recyclable and Trash, holding up real objects).
  2. For each class, click Webcam → Hold to Record and capture at least 40–50 images. Move around: change the angle, your distance, the lighting, the background. Variety is everything.

Step 3 — Train and test

  1. Click Train Model. Wait a few seconds while it learns the pattern. (Keep the tab open — it's training on your device.)
  2. Now show your webcam a new thumbs-up. Watch the preview bars: the model gives each class a confidence percentage. A good model lights up the right class strongly.
  3. Try to trick it — different hand, weird angle. Where does it get confused?

Step 4 — Make it better

When it makes mistakes, add more training data for the class it confuses, especially examples like the ones it got wrong. Re-train and test again. This loop — test, find weaknesses, add data, retrain — is exactly how professional ML engineers improve real models.

Check yourself

  • In one sentence, how is ML different from writing normal rules?
  • What are training data and classes?
  • Your model keeps confusing two classes. What's the first thing to try?

Project — Ship your recognizer 🛠️

  1. Pick a fun two-class (or three-class) recognizer and train it well:
    • Thumbs Up / Thumbs Down
    • Recyclable / Trash (great real-world AI use!)
    • Cat toy / Dog toy, or anything around you
  2. Get it working so it's correct most of the time on new examples.
  3. Click Preview (top right) and demo it to someone. Congrats — you trained and shipped a machine-learning model! 🎉
  4. In your "My AI Helpers" doc, write 2 sentences: what it recognizes, and one way you made it more accurate.

Your turn

Add a third class — like "Nothing / empty hand." Models often work better when they have a "none of the above" option. Notice how the confidence bars change when you add it.

Make it simpler · ages 9–11

Keep it to two easy classes with a grown-up — like Smiling face drawing vs Sad face drawing held up on paper. Record lots of pictures, hit Train, and watch the bars move. You just taught a computer!

Level up · ages 13–16

Explore the trade-offs. Train a model with only 10 images per class, then one with 80+. Compare accuracy. Then read what "confidence %" really means — it's the model's estimate, and a confident model can still be wrong (just like Chapter 4!). Bonus: Teachable Machine can export your model — peek at the "Export Model" options to see how a trained model becomes something an app can use.

What you learned

  • ML learns patterns from examples, not hand-written rules.
  • Models need classes and lots of varied training data.
  • You test, find weaknesses, add data, retrain to improve.
  • You trained and shipped a real recognizer.

You've earned the Model Trainer badge. 🏅

You've now used AI and trained AI. Time for the engineer's superpower: code. Next you'll write your very first Python — gently — in Chapter 6: Hello, Python.

🏅 Finish this chapter to earn the Model Trainer badge.