In this lesson, students learn how a computer can be taught to categorize objects. This is something students already have experience with. They can likely separate objects into categories quite easily. They might point out how many animals, vegetables, fruits or vehicles are in an image. For a computer, though, this task can be quite complex.
A computer can be taught to tell objects apart visually if it is given a set of example images. In this class, students first do a non-computer activity that asks a series of questions to help them determine which category an item fits into.
Next, using Google Teachable Machine, the class takes a series of pictures with the teacher’s computer, one of each student, as well as some pictures that have no students in them. Then, the computer will be taught to tell when it is looking at a picture of a person and when it is looking at one without any people in it.
- Introduce machine learning and how it is used in communities
- Explore how machine learning uses questions to determine the category something fits into
- Learn how a computer detects what is happening in the world around it
- Introduce foundation concepts of bias in machine learning
The following is a list of potential new words that students should understand
- Machine Learning
- Teaching computers how to make decisions based on examples it is given
- A way of grouping people or things based on their characteristics
- Can computers learn? (Answer: Yes, today we’ll look at how to teach computers.)
- Can a computer tell the difference between objects? (Answer: Yes, but we need to teach it how.)
- Can a computer use a camera to recognize a person? (Answer: Yes! Students may have seen facial recognition used to unlock phones.)
Science and Technology, Applied Design Skills and Technologies
- Make a product using known procedures or through modelling of others
- Explore the use of simple, available tools and technologies to extend their capabilities
- With support, follow the steps in a simple, teacher-prepared procedure for a test/experiment
- Ask questions that demonstrate curiosity about the world around them
- Make guesses about possible outcomes of simple procedures
- Recognize the causes and consequences of events, decisions or developments
The Ontario Ministry of Education “Grade 1–8 Science and Technology,” Ministry of Education, last modified 2007, accessed June 21, 2021.
The British Columbia Ministry of Education “Applied Design Skills and Technology,” accessed June 21, 2021.
The British Columbia Ministry of Education “Social Studies 3,” accessed June 21, 2021.
- A device (computer / tablet / smartphone) with internet connection and a camera
Is It An Animal?
In this activity, students work in pairs to determine whether their partner has written down the name of an animal, place or thing without asking the question directly. This activity builds students’ ability to ask questions that can differentiate items based on their characteristics. Identifying similarities and differences allows both people and artificial intelligence (AI) in order to group or separate things.
Step 1: Without showing their partner, each learner writes the name of a living thing, plant, food or other object on a piece of paper and places it face down.
Step 2: Each student asks a maximum of five questions to their partner. The aim is to determine whether their partner has written down the name of an animal or something else, without asking directly, Is it an animal?
Partner 1: Writes down ‘tree’ without showing Partner 2
Partner 2: Begins asking their five questions to figure out if Partner 1 wrote down an animal
Partner 2: Is it alive?
Partner 1: Yes.
Partner 2: Does it live in the forest?
Partner 1: Yes.
Partner 2: Does it have legs?
Partner 1: No.
Partner 2: Does it move?
Partner 1: A little…
Partner 2: Does it eat?
Partner 1: No.
Partner 2: – It’s not an animal! What were you thinking of?
Partner 1: A tree!
Then the partners switch who is asking questions.
Introduction and Example
In this activity, the class works together to make a machine learning project. They teach their device to detect when a person is in view of the camera using Google Teachable Machine. The following video shows an example of how this tool can be used.
Go to the Google Teachable Machine website.
Click Image Project then choose Standard Image Model.
Class 1 and Class 2 are the default names for categories. Change these to People and No people by clicking on them and typing in the new names.
Next, add sample images to each category (People and No People) so the computer can learn to tell the two types of content apart. Start by adding photos of people. The more variety of people and types of photo, the better the model will perform. Different lighting, angles and distance can help the model detect people in different situations. Add photos of each student and the teacher using the webcam. If prompted to do so, allow access to the device’s camera. Click and hold the Hold to Record button to take several photos of each student. In a remote teaching environment, have students submit a photo of themselves using the Upload feature. Review the images and remove any that don’t have a person in them.
Next, take some sample images for the No People category. Again, be sure to take a variety of photos but be certain there are no people in any of the photos! Review your photos and remove any that have people in them.
Now that example images have been saved in each category, the model needs to be trained. This process gives the computer a chance to look carefully at each example image. This helps the model to be able to guess quickly whether it is being shown a picture of a person or not. Click Train Model and wait until the process is complete.
When the model has finished training, a live preview of it working will be displayed. This view can be used to test the model! Test the model with students to see if it replies correctly when there are people or no people in the view of the camera.
- Can the model be fooled? How? (Answer: Try showing the camera only part of a person, or a photo of a person)
- What happens if students show one of their hands to the camera, but not their face? How could the model be improved to detect hands better? (Answer: Adding photos of students’ hands to the people category will improve the model)
- Try starting again to create another model with more categories, or a model that uses poses, or sounds instead of images. How well does this work?
Dog vs. Desk
Quick exercise! What is the difference between a dog and a desk? What do they have in common? Make a chart on the board with a column for Dogs and a column for Desks. Have students come up with qualities that can be used to identify the similarities and differences. Place a mark to show if the dog or desk has that quality. Encourage discussion about general rules (not all dogs or desks have four legs, not all dogs fetch, etc.). When more information is provided about an animal or object, guesses about which category it fits into are more accurate.
|Has four legs||X||X|
|Can be indoors our outdoors||X||X|
|Many different sizes||X||X|
|Good to eat off||X|
- “Machine Learning and Human Bias” from Google – Uses relatively plain language to explore bias in machine learning
- “How I’m Fighting Algorithmic Bias” by Joy Buolamwini – This video is perhaps better suited to older students but does a great job of explaining bias in AI
Social Media Resources
We want to see the awesome things you’re creating! Take a photo or video and share your work with us by emailing email@example.com or tagging @pinnguaq on Facebook, Twitter or Instagram. Don’t forget to include the hashtag #LearnWithPinnguaq!