Week 28 · 4.5 Augmented reality and AI · 3 lessons
2
Learn from examples
Computing 8: Topic 4.5, pp. 283–299
GoalDescribe how an AI system is trained with examples, and why poor examples give poor results.
New words
training · showing a machine learning system many examples so that it can learnexample data · the labelled items, such as photos with the right answer, used to trainunfair or wrong result · an answer that is not correct for some cases, often because the training examples were poor
Explanation
To train a machine learning system, you show it very many examples and tell it the right answer for each. At first it guesses badly. As it sees more examples, it finds features that go with each answer and builds rules from them. When it meets a new item it checks it against those rules and gives its best answer. If the item is unlike anything it has seen, it can be wrong: a system that has seen only green mangoes may call a yellow mango “not a mango”. More varied examples help it to adapt. People must check the answers, because AI can be wrong or unfair. Never give personal information to an AI chatbot.
many examples with answerstrain→features found: colour, softnessbuild→rules builtuse→new item: guess
Worked examples
Colour
Feel
Answer
yellow
soft
ripe
green
hard
not ripe
yellow
hard
not ripe
yellow
soft
ripe
green
soft
not ripe
yellow
soft
ripe
Work out the pattern yourself, as a machine would. Each row is a training example. Look for the features that go with “ripe”. Yellow and soft fruits are ripe. Fruits that are green, or hard, are not ripe.
Colour
Feel
Rule says
yellow
soft
ripe
green
soft
not ripe
green, but ripe (new kind)
soft
not ripe (wrong)
Use the learned rule on new items. A yellow, soft fruit is ripe. A green, soft fruit is not ripe. The rule works for these. But what about a fruit that is ripe and still green, like some kinds of apple? The system has not seen one, so its rule would call it not ripe. That is a mistake caused by poor examples.
Fix it by adding examples. After seeing several ripe green, soft fruits with the answer “ripe”, the system changes its rule and no longer uses colour alone. More varied examples make the system better, and a person should still check it.
Class activity
Teach a partner (no computer). Prepare 12 cards with a simple invented shape on each (a big red circle, a small blue square …) and secretly decide a rule, such as “red things are yes”. Show your partner six cards at a time, saying yes or no, and let them guess your rule. How many cards did they need? Now hide the “odd” cards on purpose (for example, never show a red square). Show a red square at the end. Does their rule still work? What does that show about poor examples? Never give personal information, such as your name or address, to an AI chatbot, and remember it can be wrong.
Practice
1
A system trained on the six fruit examples sees a yellow, hard fruit. Use the rule “ripe if yellow and soft”. What does it say, and does it agree with the training data?
Colour
Feel
Rule says
yellow
hard
?
It says not ripe. The training data row yellow, hard is “not ripe”, so it agrees.
2
A face-unlock system has only been trained on photos of people with short hair. Why might it fail for someone with long hair?
It has not seen examples like that, so it has no rules for them. It may refuse to unlock or give a wrong answer. More varied training examples would help.
3
Why should a person always check an AI system’s answer?
AI can be wrong or unfair, especially if its training examples were poor or one-sided. A person can notice mistakes and check with another source.
4
Put in order: (a) new examples added; (b) the system gives a wrong answer; (c) the system is trained; (d) the rules change and results improve.