GoalExplain how image recognition uses lines, colours, textures and shapes, and why it can make mistakes.
New words
image recognition · a computer system that decides what is in a picture by comparing its lines, colours, textures and shapes with pictures it has learned fromtexture · how the surface of something looks or feels, such as smooth or bumpybias · unfair results, often because the training data did not include enough different examplesnon-player character (NPC) · a character in a game that the computer controls and that reacts to the player
Explanation
Image recognition lets a computer decide what is in a picture. It looks for lines, colours, textures and shapes. It was trained on thousands of pictures, so it can recognise the same object when it looks a little different. A phone that unlocks with your face can still know you after a new haircut, with a scarf on, or in a dim room. Games use AI too: a non-player character can react to what you do. But training data matters. If an AI saw only red apples, it may fail with a green apple, which is a kind of bias. People must check the results, and you must ask permission before you take or share a photo of someone.
Worked examples
Clue
Apple
Banana
Orange
shape
round
long and curved
round
colour
red or green
yellow
orange
texture
smooth
smooth
bumpy
The AI compares the clues in a new picture with the clues it learned. The picture with the most matching clues wins.
Test picture
In the training data?
AI’s guess
red apple
yes
apple
green apple
no
not sure, or wrong
An AI that has seen only red apples may not know a green one. The table shows what can happen. The fix is to add more varied training pictures.
A farm game has a guard dog as a non-player character. The dog watches how far the player is, in steps. If the player is 3 steps away or closer, the dog barks. The flowchart shows the rule.
Class activity
Human image recogniser (no computer): your partner secretly chooses a fruit or vegetable from a picture book or the kitchen. They may give clues only about shape, colour and texture, one clue at a time, and you must guess after each clue. Count how many clues you needed. Then your partner picks something unusual, such as a purple carrot, and you discuss why this is harder. Say how a computer could be helped by seeing many different examples. If you have a computer or tablet, an adult can help you look at a photo and describe its lines, colours and shapes.
Practice
1
A phone camera decides about its flash with this flowchart. Follow it for a brightness of 2 and for a brightness of 4. What does the camera output each time?
Brightness 2: 2 < 4 is yes, so the output is flash on. Brightness 4: 4 < 4 is no (4 is not smaller than 4), so the output is flash off.
2
Use the clues to complete the last column.
Picture
Shape
Colour
Texture
Guess
A
long and curved
yellow
smooth
?
B
round
orange
bumpy
?
Picture A is a banana (long, curved and yellow). Picture B is an orange (round, orange and bumpy).
3
Sara’s phone still unlocks when she wears a scarf. Why does the image recognition still work?
The AI learned from many pictures of her, so it also uses the parts of her face that stay the same, such as the shape of her eyes. It does not need her to look exactly as she did on the first day.
4
A team trains an AI to find birds only with photos taken on sunny days. It fails on a foggy day. Explain the problem and a fix.
The training data had no variety, so the AI is biased towards sunny pictures. The fix is to add photos from foggy, rainy and dark days. People should also check its answers.