AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Smart rules, extra layers

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.

Worked examples
ColourFeelAnswer
yellowsoftripe
greenhardnot ripe
yellowhardnot ripe
yellowsoftripe
greensoftnot ripe
yellowsoftripe
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.
ColourFeelRule says
yellowsoftripe
greensoftnot ripe
green, but ripe (new kind)softnot 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.
a mistake is foundnew examples addedrules changebetter guesses
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?
ColourFeelRule says
yellowhard?
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?
3
Why should a person always check an AI system’s answer?
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.