Class 7 · Unit 5: Bias and citizenship · Lesson 5.1 · 40 min
What is bias?
The app is "95% correct". It calls a scabbed Ambri leaf healthy. It wasn't lying — it had just never seen a Kashmir sky.
Today you will: Train a leaf detector that's secretly biased · Catch it by testing group by group · Make it fairer — and prove it
Story
Rahat's uncle sells apples in Sopore. His new phone app promises to spot scab, the dark spots that ruin apple leaves.
He points the phone at a leaf from his own orchard. "Healthy," says the app.
Hiba looks closer. "Mamu, that leaf has spots. It's scab."
The uncle scratches his head. "The company said this app is 95% correct."
Later they find out why. The app was trained almost entirely on photos of one apple variety, taken in bright sunshine on another continent. Rahat's uncle grows Ambri, under a grey Kashmir sky.
The app wasn't lying about its 95%. It was 95% correct on the leaves it had seen.
Watch
When AI is unfair without meaning to be — — scan code 7.5.1 in the printed book.
Learn it
The scab app was honest about its 95%: it was 95% correct on the leaves it had seen, sunny leaves of one variety from far away. On Uncle's Ambri leaves under a grey Kashmir sky it failed. That is bias: results that are unfairly tilted, working better for some people, places or things than for others. An AI does not choose to be unfair. Bias comes from the data and from the choices of the people who built it.
Words to know
- Bias when a system's results are unfairly tilted, working better for some people, places or things than others.
- Training data the examples a model learns from. A model learns only from these.
- One-sided data data that leaves some groups out, or has very few of them.
- Overall accuracy the share of all test items the model got right. It can hide failures in one group.
- Group-by-group testing checking accuracy separately for each group (sunny leaves, shady leaves) to find bias.
Step by step: catching hidden bias
A leaf model is tested on 100 photos and gets 90 right: 90% overall. Now break it down:
| Group | Photos | Right | Accuracy |
|---|---|---|---|
| sunny leaves | 80 | 78 | 98% |
| shady leaves | 20 | 12 | 60% |
- Look at the overall number: 90% sounds good.
- Split the results by group: sunny and shady.
- Compare: 98% in sun, but only 60% in shade. In shade it is wrong 4 times in 10.
- Find the cause: the training photos were almost all sunny. The model never learned what scab looks like in shade.
- Fix it and prove it: add shady photos to the training data, train again, and test each group again.
Careful: the question is never only "Is it accurate?" but "Is it accurate for everyone?" When an AI decides something important, such as a loan, a job or a medical check, a small tilt can hurt the same people again and again.
On the laptop
You need: Teachable Machine in the browser (no account) · LibreOffice Calc · unit-5/leaves-healthy-sunny/ and leaves-scab-sunny/ (20 each) · leaves-test-mixed/ (20: shade, cloud, close-ups, other varieties) · later, leaves-extra-shade/
Mission 1: The biased model (groups of 3–4, 11 min)
- ☐1
Teachable Machine → Image Project → Standard image model. Don't sign in. Name the classes
HealthyandScab. - ☐2
Upload
leaves-healthy-sunnyinto Healthy andleaves-scab-sunnyinto Scab. Train Model — don't switch tabs. - ☐3
Predict: will it do better on sunny test leaves or shady ones? Note it.
- ☐4
Preview → File, test each photo in
leaves-test-mixed. Inbias-test.ods, record: Photo · Real answer · Model said · Correct? (Y/N) · Light (sunny / shade / cloudy). - ☐5
Count right answers in sun and in shade or cloud:
=COUNTIFS(E2:E21;"sunny";D2:D21;"Y").
Mission 2: Make it fairer (groups, 9 min)
- ☐6
Add the
leaves-extra-shadephotos to the right classes and train again. - ☐7
Test the same photos. Fill a second column: Model said (after).
- ☐8
Compare. Which group improved most?
No laptop today?
The teacher shows 10 printed leaf cards. The class "trains" a volunteer Model on the 4 sunny cards only, then the Model sorts 6 shade cards. Record the mistakes, add 4 shade cards to training, try again.
Debate it
The leaf app works well for big orchards that bought expensive cameras, and badly for small farmers with old phones.
Is that just bad luck, or is it unfair? Who should fix it: the farmer, the company, or the government?
Check yourself — practice, not a test
1. What does bias in an AI system mean?
- ○ The AI is broken and gives random answers
- ○ The AI's results are unfairly tilted, working better for some than for others
- ○ The AI is slow
- ○ The AI has an opinion like a person
2. If a model is 95% accurate overall, it must be fair to every group.
- ○ True
- ○ False
3. Where does bias in AI usually come from? (choose all that apply)
- ○ Training data that leaves some groups out
- ○ Choices made by the people who build it
- ○ The colour of the laptop
- ○ The AI deciding it dislikes someone
4. To check a model for bias, we ask: is it accurate for ______?
Remember
Don't just ask "Is it accurate?" Ask "Is it accurate for everyone?"
Typing practice
Skill: typing a short paragraph, then fixing it (Term 3 focus, 7 min)
- On typing.com, open an Intermediate paragraph lesson.
- Then type this in a new Writer document, without looking at the keys: "Bias means a system is unfair to some people or things. It often comes from the data."
- Go back and fix every mistake with the arrow keys and Backspace, not by retyping the whole line.