Equipment Needed
- Windows PC with Chrome or Edge browser
- Microsoft Paint
- A folder on the desktop called TM_Lesson2
Key Vocabulary
BiasWhen a model learns the wrong pattern from its training data, making unfair or incorrect predictions.
Balanced DatasetA dataset where each class has a similar number of examples and fair representation.
Background TrickWhen the model learns to recognise the background colour instead of the actual shape.
FairnessMaking sure an AI system treats all groups and inputs equally.
Starter Activity (5 minutes)
Imagine this: A school uses AI to pick students for the football team. The AI was only trained on photos of boys. What might go wrong?
Key point: The AI would be biased — it might never pick girls, not because they can't play, but because it was never shown examples of girls playing. This is what bias means in AI.
Main Tasks
Part A: Create a Biased Dataset (The Background Trick)
You are going to deliberately create a biased model to see what goes wrong.
-
Create a folder called
TM_Lesson2on your desktop. Inside, create two folders:Circles_BiasedandTriangles_Biased. -
Open Paint. Draw 10 circles on a YELLOW background. To set a yellow background: use the fill bucket tool to fill the canvas with yellow before drawing your circle. Save them in
Circles_Biased. -
Draw 10 triangles on a BLUE background. Save them in
Triangles_Biased. - Go to Teachable Machine and create a new Image Project. Upload your yellow-background circles as Class 1 (Circle) and blue-background triangles as Class 2 (Triangle).
- Train the model. Now test it with a circle on a BLUE background. What does the model predict?
Expected result: The model predicts "Triangle" because it learned to associate BLUE = Triangle and YELLOW = Circle. It learned the background colour, not the shape. This is the "background trick" bias.
Part B: Fix the Bias — Create a Fair Dataset
-
Create two new folders:
Circles_FairandTriangles_Fair. -
Draw 10 circles — this time on a WHITE background. Vary the size and position. Save them in
Circles_Fair. -
Draw 10 triangles — also on a WHITE background. Save them in
Triangles_Fair. - Create a new project in Teachable Machine. Upload your fair images and train the model.
- Test it again with a circle on a white background. Does it work better now?
Part C: Compare Your Results
| Test Image | Biased Model Prediction | Biased Model Confidence | Fair Model Prediction | Fair Model Confidence |
|---|---|---|---|---|
| Circle (white background) | ||||
| Triangle (white background) | ||||
| Circle (blue background) |
Common Mistakes & Quick Fixes
- Biased model seems to work fine: Make sure you're testing with a shape on the WRONG background (e.g. circle on blue). That's where the bias shows up.
- Fair model still struggles: Add more images with greater variety. Make sure all images have the same white background.
- Forgot to start a new project: You must create a NEW Teachable Machine project for the fair dataset — don't add to the old one.
Challenge / Stretch Task
Can you think of a real-world example where AI bias could cause a serious problem? Write about it below.
Exit Ticket
Expected answers:
- Bias is when a model learns the wrong pattern, making unfair or incorrect predictions.
- All circles had a yellow background and all triangles had a blue background, so the model learned background colour instead of shape.
- By using the same white background for both classes, so the model had to learn the shape itself.
- If AI is biased, it could discriminate against people unfairly (e.g. in hiring, healthcare, policing).