Students learn about supervised machine learning through building a cat-dog classifier using Google’s Teachable Machine tool, and discuss the reality of algorithmic bias.
Watch a run-through and tutorial of our “Cats, Dogs and Machine Learning” lesson plan, with Google's Teachable Machine:
Ask: What do autocorrect, Alexa, and Snapchat filters have in common? (A: They all use AI)
Ask: What is AI? (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.
Use the “Intro to Supervised Machine Learning” slides (http://bit.ly/mit-supervised-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 students time to each try the demo, ~5-8 minutes. Walk around and prompt students 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:
Great. Now we are going to build a cat-dog classifier using the teachable machine.
Use the “Intro to Algorithmic Bias” slides to facilitate the activity. (http://bit.ly/mit-algorithmic-bias-slides)
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 students 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:
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 students time to re-curate their datasets using the recurating dataset images.
Ask: What did you do to make it work better?
If students say they used less training data, prompt them to think about if it is better to have more vs less data?
So 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?
Why is this a problem?
How does Joy suggest we can fix this problem?
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?
Visit https://machinelearningforkids.co.uk for additional Machine Learning activities.
Visit https://aischool.microsoft.com/machine-learning/learning-paths/ml-crash-course for a deeper explanation of machine learning.
Automation, Computer technology, Trial and error, Problem-solving, Bias.
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.
Dog image by Lum3n.com from Pexels