Skip Navigation

Cats, Dogs & Machine Learning

By Activities from MIT Media Lab 2 hours
Grades 4-6
Science and Technology,
Social Sciences
  • Programming
  • Data
  • Technology and Society
Tools & Languages
Google's Teachable Machine

Key Coding Concepts

  • Algorithms
  • Debugging



a step-by-step sets of operations to be performed to help solve a problem


Artificial Intelligence

is the ability of a machine or computer program to think and make decisions


Machine learning

provides the ability for a machine or program to learn from data or experience

Learners explore supervised machine learning through building a cat-dog classifier using Google’s Teachable Machine tool, and discuss the reality of algorithmic bias.


  • This activity requires WiFi and laptops or chromebooks with webcams


Before the lesson…

  • Introduce the concept of AI
  • Print out cat-dog images and worksheets per pair of learners
  • Divide learners into pairs, with one computer per pair


Ask: What do autocorrect, Alexa, and Snapchat filters have in common? (A: They all use AI)

Ask: What is AI? (A: See Terminology for definition)

These computer programs or machines can be trained to learn from experience, and even learn by themselves in order to make predictions based off of the information (or data) that we give them. This is called “machine learning.”

Ask: Why do you think technology like this is important? (Potential answers: To get answers to questions more quickly (DNA matching, voice-assistant technology), to make things work more efficiently (predicting traffic, timing of stop lights)

Today, we are learning about machine learning by training a computer program to classify cats and dogs.

Activity 1: Intro to Supervised Machine Learning

Use the “Intro to Supervised Machine Learning” slides to introduce the activity. Use presenter mode to view the instructor notes as you teach, or print the slides with notes ahead of time.

Slide 10: Demo how to use the Teachable Machine before having learners open their computers.

*Be sure to note the difference between training data and test data in your demo by saying, “And now I want to test how well my algorithm does with data that is similar but slightly different to what it has seen before”

Give learners time to each try the demo, ~5-8 minutes. Walk around and prompt learners to tell you about their training and test datasets. What happens when they change their pose? What happens when both partners are in the frame?

Have learners close their computers and discuss the following as a class:

  • What happens if you only train one class? (A: Only one prediction)
  • What happens as you increase your dataset? (A: It becomes more accurate)
  • What happens when your test dataset is different from your training dataset? (A: It might not be as accurate)

Great. Now we are going to build a cat-dog classifier using the teachable machine.

Activity 2: Intro to Algorithmic Bias

Use the “Intro to Algorithmic Bias” slides to facilitate the activity.

Say: With your partner, I want you to build a machine that classifies cats and dogs.

Important: While training your classifier, try to only include ONE photo of each of the training images.

Hand out printed cat and dog images and Algorithmic Bias worksheets to each pair.

Ask: You’ll notice that the Teachable Machine is made up of three parts. What are each of these three parts called? (A: (1) dataset, (2) learning algorithm, and (3) prediction. Learners will describe in their own words. Have them guess before sharing the official terms. Have them write down the answer on their worksheet.)

Give learners time to train and test their classifier.

Note: If learners get frustrated by accidentally taking more than one photo and having to reset multiple times, they can continue with a few extra photos. Just have them keep this in mind while recording answers in their worksheet.

Ask: How are your classifiers working?
(Note: Learners should notice that the classifier works better on cats than dogs).

Discuss as a class or in small groups:

  • Is this classifier useful if it only works well on just cats?
  • Why do you think it works better on cats vs dogs?
  • How could we make it better with our training data? (If learners have trouble, ask them to notice similarities in the dataset, e.g., dogs were really fluffy and cat-like/not as diverse)

When algorithms, specifically artificial intelligence systems, have outcomes that are unfair in a systematic way, we call that algorithmic bias. We would say that our cat-dog classifier shows algorithmic bias and that it is biased towards cats since it works really well for them and biased against dogs since it doesn’t work as well for them.

Give learners time to re-curate their datasets using the recurating dataset images.

Ask: What did you do to make it work better?
If learners say they used less training data, prompt them to think about if it is better to have more vs less data?

We’ve seen firsthand how algorithmic bias can occur in our supervised machine learning systems. Now I want us to take some time to watch a video about how it can happen in the real world.

Play Gender Shades facial detection video from slides.


Discuss the following questions with the class:

What problem did Joy identify in the video?

  • [wait for learners to say facial recognition system did not recognize darker, female faces as well as lighter, male faces]
  • If learners need prompting, ask if the technology Joy talked about worked the same for all people.

Why is this a problem?

  • [wait for learners to mention unequal user experiences between groups - “technology doesn’t work unless it works for everyone”]
  • If learners need prompting, ask them if they would all like to be able to use Snapchat filters. Is it wrong if they did not all have access to that technology?

How does Joy suggest we can fix this problem?

  • [wait for learners to mention better dataset curation]
  • If learners need prompting, ask them how they improved their classification algorithms during the Teachable Machines activity.

Learning Outcomes

  1. Understand the basic mechanics of artificial intelligence systems:
    Know that artificial intelligence is a specific type of algorithm and has three specific parts: dataset, learning algorithm, and prediction.
    1. Understand the problem of classification in the supervised machine learning context.
    2. Understand how the quantity of training data affects the accuracy and robustness of a supervised machine learning model.
  2. Understand that all technical systems are socio-technical systems. Understand that socio-technical systems are not neutral sources of information and serve political agendas:
    Know the term “algorithmic bias” in the classification context.
    1. Understand the effect training data has on the accuracy of a machine learning system.
    2. Recognize that humans have agency in curating training datasets.
    3. Understand how the composition of training data affects `the outcome of a supervised machine learning system.

Spend more time on discussions. Optional: if time permits and the classroom environment is safe. Ask: How might you find images to better curate your dataset?

  • [Prompt learners to think about where photos exist - social media, mug shots, ID cards. Which of these would be okay to use as sources of information? Which might lead to more bias? Which might breach privacy?]

Visit for additional Machine Learning activities.

Visit for a deeper explanation of machine learning.

The Teachable Machine by Google.

Activities and slides from:
An Ethics of Artificial Intelligence Curriculum for Middle School Students was created by Blakeley H. Payne with support from the MIT Media Lab Personal Robots Group, directed by Cynthia Breazeal.

Teach lessons that are tied to your existing curriculum!


More Lesson Plans For Grades 4-6

    View All Lesson Plans

    Explore lessons based on components

    The K-12 Computer Science Framework

    Although learning how to build digital projects is a key part of Computer Science education, students should also learn a wider set of skills and competencies that will help them to harness the power of digital technologies as both creators and consumers. A comprehensive approach to K-12 Computer Science education includes learning about the following five focus areas:

    View Framework ➝


    By the end of high school, students should be able to create a simple computer program.

    Computing and Networks

    By the end of high school, students should understand and be able to use the tools and devices commonly used to build digital projects.


    By the end of high school, students should be able to explain how we use computers to create, store, organize, and analyze data.

    Technology and Society

    By the end of high school, students should be able to explore the ways in which technology and society have mutually shaped each other.


    By the end of high school, students should be able to apply design principles to the digital projects they create.