Lesson 2: Bias & Fairness

45–60 minutes Windows PC, Browser, Paint

Today you will…

Equipment Needed

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.

  1. Create a folder called TM_Lesson2 on your desktop. Inside, create two folders: Circles_Biased and Triangles_Biased.
  2. 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.
  3. Draw 10 triangles on a BLUE background. Save them in Triangles_Biased.
  4. 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).
  5. 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

  1. Create two new folders: Circles_Fair and Triangles_Fair.
  2. Draw 10 circles — this time on a WHITE background. Vary the size and position. Save them in Circles_Fair.
  3. Draw 10 triangles — also on a WHITE background. Save them in Triangles_Fair.
  4. Create a new project in Teachable Machine. Upload your fair images and train the model.
  5. 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

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:

  1. Bias is when a model learns the wrong pattern, making unfair or incorrect predictions.
  2. All circles had a yellow background and all triangles had a blue background, so the model learned background colour instead of shape.
  3. By using the same white background for both classes, so the model had to learn the shape itself.
  4. If AI is biased, it could discriminate against people unfairly (e.g. in hiring, healthcare, policing).

Lesson Downloads

Demo Datasets

Biased & balanced example images

Download ZIP

Help Sheet

Step-by-step guide

Download DOCX
← Lesson 1 Lesson 3 →