Jump to main content

Happy or Sad? Exploring Bias in Machine Learning


Grade Range
Group Size
2-3 students
Active Time
70 minutes, plus an optional 60 minutes.
Total Time
70 minutes, plus an optional 60 minutes.
Area of Science
Computer Science
Artificial Intelligence
Key Concepts
artificial intelligence (AI), machine learning, AI bias
Sabine De Brabandere, PhD, Science Buddies
Three outputs from an AI tool that classifies happy and sad faces: two happy face drawings classified as happy and one sad face drawing classified as sad.


Classifying happy and sad faces is an easy task for most humans, but can we teach a machine to do it? In this fun lesson, students will use machine learning to try this out and see how easy it is for bias to creep in. This experiment requires no computer programming skills! In an optional extension, students will also use their imaginations to explore the potential benefits and dangers of artificial intelligence solutions. This lesson will give students an awareness of how prevalent artificial intelligence is, see its benefits, and realize its challenges.

Remote learning adaptation: This lesson plan can be conducted remotely. Students can work independently on the Explore section of the lesson plan using the Student Worksheet and the slides as guides. The Engage and Reflect sections can be conducted over a video chat. The optional reflect section can be done remotely.

Learning Objectives

NGSS Alignment

This lesson helps students prepare for these Next Generation Science Standards Performance Expectations:
This lesson focuses on these aspects of NGSS Three Dimensional Learning:

Science & Engineering Practices
Planning and Carrying Out Investigations. Collect data about the performance of a proposed object, tool, process or system under a range of conditions.

Analyzing and Interpreting Data. Analyze and interpret data to provide evidence for phenomena.
Disciplinary Core Ideas
ETS1.B: Developing Possible Solutions. A solution needs to be tested, and then modified on the basis of the test results, in order to improve it.
Crosscutting Concepts
Influence of Science, engineering and Technology on Society and the Natural World. The use of technologies and any limitations on their use are driven by individual and societal needs, desires, and values; by the findings of scientific research; and by differences in such factors as climate, natural resources, and economic conditions. Thus, technology use varies from region to region and over time.


The materials needed to teach an online machine learning tool to distinguish between happy and sad face drawings.

For each group of 2–3 students.

Background Information for Teachers

This section contains a quick review for teachers of the science and concepts covered in this lesson.

Artificial intelligence (AI) is a branch of computer science that tries to build machines that demonstrate intelligence. Machine learning is a sub-division of AI; its goal is to create machines that can improve and learn over time using data.

A large rectangle labeled 'computer science' with a smaller rectangle labeled 'artificial intelligence' in it. Inside the second rectangle, there is a third, smaller rectangle labeled 'Machine learning'.
Figure 1. Machine learning is a branch of artificial intelligence and is part of computer science.

A widely used machine learning application is image recognition. In image recognition, a computer learns to classify images by analyzing and finding patterns. AIs that use image recognition can do many things like classifying cancerous from non-cancerous tissue in medical images or recognizing a person's face in digital pictures. Interactions with the outside world, for example, a doctor re-classifying an image that the program wrongly classified as cancerous, can help the application refine and improve the accuracy of its algorithm.

Unlike classical computer programs where the decisions and rules are built into the program, machine learning programs construct their algorithm from data and feedback. This allows machine learning programs to find trends and patterns in enormous quantities of data, including patterns that are hard for humans to catch. They can also make predictions and improve themselves without human intervention and can handle complex, changing environments. But machine learning has its limitations. It requires a neutral and complete set of data to learn from, it uses a lot of computer power, and the results need to be taken with some precaution as it is susceptible to systematic errors.

In machine learning, a repeatable and systematic error that favors a specific incorrect outcome is referred to as a bias. It can have a racial or gender component—for example, some commercial face recognition programs are more likely to misclassify female dark-skinned people compared to male light-skinned people—but it can also be as simple as misclassifying high heeled shoes more often than sneakers. The video Machine Learning and Human Bias explains how human bias can creep into machine learning tools.

Learning to write a machine learning program takes dedication and work. Programmers have developed many ways to make machine learning more accessible, and Teachable Machine is one answer to these attempts. It is a web-based tool that allows users to quickly and easily make a teachable computer program without programming. It allows users with no computer programming background to experience the power of artificial intelligence.

In this lesson, students will develop an AI machine that can recognize drawings of happy and sad faces as shown in Figure 2.

Three machine learning outputs next to each other. the first shows a happy face drawing classified as 99% likely to be happy; the second is a  drawing  of a sad face classified as sad with 100% certainty, and the last is a happy face drawing classified as 99% certain to be happy.
Figure 2. Examples of happy and sad face classifications.

After building and testing their AI machines, students can use their first-hand experiences to imagine and explore the potential benefits and dangers of artificial intelligence solutions.

Prep Work (15 minutes)

Engage (5 minutes)

Explore (50 minutes)

Reflect (15 minutes and an optional 60-minute extension activity)


Make Career Connections

Lesson Plan Variations

Free science fair projects.