Learning from Examples
How does an AI learn to tell cats from dogs? Find out about training data, labels and testing, and why more variety makes AI smarter.
Welcome back!
Step 1 of 12Learn
Training an AI
Teaching an AI is called training. Here is how it works for spotting cats and dogs:
- Collect thousands of pictures.
- Give each one a label: "cat" or "dog."
- The AI studies them and finds patterns, like the shape of noses and ears.
- Test it with new pictures it has never seen.
The pictures with labels are called training data.
Step 2 of 12Practice · Put in order
Put the steps of training an AI in order.
Drag the items, or use the arrow buttons, to put them in order.
- Test it with new examples
- Collect lots of examples
- Label each example
- Let the AI find patterns
Step 3 of 12Practice · Fill in the blanks
Fill in the blanks
A tag that says what an example is, like "dog" on a dog photo, is called a .
Step 4 of 12Learn
Why testing matters
After training, people test the AI with new pictures. Why not use the same pictures again? Because the AI might just remember them, like memorizing answers instead of understanding.
Think of a spelling test. If your teacher only tests words you practiced, you might do great. The real test is whether you can spell words you have never seen. AI is tested the same way.
Step 5 of 12Practice · True or false
An AI should be tested with new examples it did not see during training.
Step 6 of 12Try the calculator
How good is the AI?
Scientists check AI by counting how many test examples it got right. Change the numbers to see its score.
- Score
- 90 %
- Mistakes
- 5
Step 7 of 12Practice · Work it out
An AI is tested on 20 pictures and gets 18 right. How many did it get wrong?
Step 8 of 12Learn
Variety makes AI smarter
Imagine an AI trained only on pictures of orange cats. Then it sees a black cat. It might guess "not a cat" because it never learned that cats can be black!
AI can only learn from what it sees. That is why good training data has lots of variety: big cats, small cats, black, white and spotted cats, cats sleeping, jumping and hiding. More variety helps the AI work for everyone and everything.
Step 9 of 12Diagram
Good training data has variety
Tap a shape with to see more.
- Cat photos
- Many colors
Orange, black, white, spotted.
- Big and small
- Many poses
Sleeping, jumping, hiding.
- Light and dark
Sunny and dim photos.
Step 10 of 12Practice · What would you do?
What would you do?
You are training an AI to recognize apples. All your training photos show shiny red apples. What problem might happen?
Step 11 of 12Note
Step 12 of 12Practice · Spot the mistake
Find the wrong word.
Lesson complete!