Your phone gathers all the photos of your cat into one album. Your child asks, "How does it know that's a cat?" Nobody wrote the phone a rule like "pointy ears and whiskers means cat". Instead, the machine was shown a huge number of pictures already marked "cat" or "not a cat", and it worked out for itself what they had in common. This way of learning is called machine learning.
This article walks you through a picture-card game in which your 8-to-12-year-old plays the machine. By the end, your child will understand how a machine learns from examples, and, more importantly, why it sometimes gets things wrong.
Machines learn from labelled examples
There are two ways to make a machine tell cats from dogs:
- Write rules: a programmer spells everything out, such as "pointy ears and whiskers means cat". That's hard, because some cats have folded ears, some dogs have pointy ones, and some photos show a cat from behind.
- Let the machine learn: people collect lots of pictures, each with a label, meaning its correct name ("cat" or "dog"). The machine looks at them over and over, adjusting the way it guesses until it gets most of them right. Then, given a new picture with no label, it makes a guess.
The machine doesn't understand what a cat is. It only finds the features that tend to go with the label "cat" in the examples it has seen. Good examples lead to good guesses; poor examples lead to poor ones. The game below lets your child see that with their own hands.
Making the cards
You need about 20 hand-sized pieces of card, some coloured pens, and someone to be the "teacher" (usually you).
- On each card, draw a very simple cat or dog. Make them different: pointy or floppy ears, whiskers or none, orange, black, white or spotty fur, long or short tails.
- Write the label "cat" or "dog" on the back of each card.
- Split the cards into two sets: about 12 learning cards and the rest as test cards. Your child doesn't see the test cards yet.
The drawings don't need to be good. Slightly messy ones are even better, since real machines also deal with blurry and lopsided photos.
The game: your child is the machine
Round 1: learning. Your child turns over each learning card, looks at the picture and checks the label on the back. They can jot down what they notice, like "cats often have whiskers" or "dogs often have floppy ears". That is their own way of guessing, just like what a machine finds after learning.
Round 2: the test. Show each test card picture side up. Your child guesses "cat" or "dog" and says why. Flip it over to check, and keep count of the correct guesses.
Round 3: more learning. Any card your child got wrong goes into the learning set, and they adjust their way of guessing. Play again with a few fresh test cards. The score usually goes up. Real machines learn like this too: adjust where they went wrong, and repeat many, many times.
After each round, ask: "What helped you guess right most often? What tricked you?"
When the machine learns the wrong thing
The best part is deliberately teaching badly to see what happens. Try one at a time:
- Too few examples: show only three learning cards, then test. Your child will guess more by feel, and get more wrong.
- Examples that are all alike: make every cat in the learning set black and every dog orange. When an orange cat turns up in the test, your child may well say "dog". The guess "black means cat" fits the learning cards but not the real world.
- Learning something irrelevant: draw every dog standing on green grass and every cat sitting on a chair. In the test, draw a cat on grass. Does your child call it a dog? Real machines sometimes make this kind of mistake too, paying attention to the background instead of the animal.
- Wrong labels: secretly swap the labels on two learning cards. Your child will see their guesses drift off.
Each time, say it out loud together: the problem isn't the "machine" (your child), it's the examples the machine was given.
Why good examples matter
From the game, your child can work out for themselves a few things that people who build learning machines always have to think about:
- Enough of them: the more examples, the less the machine has to guess blindly.
- Enough variety: examples need all kinds of fur, shapes and backgrounds, so the machine doesn't latch on to something irrelevant.
- Correct labels: wrong labels teach the machine wrong, and it has no way of knowing.
- Someone checking: a machine can sound very sure and still be wrong, so people still need to check.
With 10-to-12-year-olds you can go further: machines that recognise voices, handwriting or faces also learn from examples. If the examples leave out a certain kind of voice or handwriting, the machine will be worse at it. That's why the people who build these machines need to choose examples carefully and fairly.
These ages are only a rough guide, and every child is different. Six- and seven-year-olds can still enjoy rounds 1 and 2 with fewer cards.
Finding what things have in common and sorting them into groups is what your child does in this game, and what a machine does when it learns. In Dologi, the "Sort into boxes" puzzles in the Math topic ask your child to put objects into the right box by one feature, such as the number of dots on a die. The difference is that your child understands why they are sorting that way.
In short
- Machines learn by looking at lots of labelled examples and finding what they have in common, so they can guess new ones.
- The "teach the machine" game with cat and dog cards lets your child play the machine: learn, test, learn more.
- Too few examples, examples that are all alike, or wrong labels all make the machine guess wrong.
- Machines don't understand the way people do, so good examples and a person checking still matter.
Read more: What is artificial intelligence? How to explain AI to children and Why do apps keep recommending the same videos? How recommendations work, explained for 8-to-12-year-olds.
