Skip to content

2. Training an Image Classifier

Pick two classes that are genuinely different

Start simple: two classes that are easy to tell apart, like "water bottle" and "coffee mug," or "triangle drawing" and "circle drawing." Save harder, more similar categories for after you've seen this work once.

Add samples

For each class, click Upload and add several image files of that category — different angles, different lighting, different backgrounds if possible. More variety in your examples generally makes for a more reliable model than many nearly-identical photos.

Class "water bottle"   -> 15-20 photos of water bottles, varied angles/backgrounds
Class "coffee mug"     -> 15-20 photos of coffee mugs, varied angles/backgrounds

Train

Click Train Model. Teachable Machine trains entirely in your own browser — you'll see a progress indicator while it works through your examples.

Test immediately

Right after training, use the Preview panel to upload a new image — one you didn't use as a training sample — and see what class it predicts, with a confidence bar for each class.

Try it

Train a two-class model on two genuinely different, non-identifying subjects. Test it with at least 3 new images it's never seen, and record whether each prediction was right.

Tip

If you test with the exact same images you trained on, you're not testing anything — of course it recognizes images it's already seen. Always test with new examples.

Next: Testing and Iterating →