Difficulty: beginner
Lesson Type: curriculum unit
Subject: computer science
Grade Level:
  • 6-8
  • 9-12

This AI unit is broken into three parts. In part 1, students learn how to create and train their own image classification model to identify and classify images. In part 2, students use their model in an app using MIT App Inventor to see how their model performs. In part 3, students create another app using the same model. In this app, the image classification becomes a game, where users must match the emotional expression to score points.

NOTE: Not all mobile devices/operating systems currently have the required hardware/software to run the Look extension used in this unit. Please check here to see if your mobile device is on our list of devices where the extension is known to work. If your device is not on the list, we highly recommend testing beforehand to make sure it is compatible. Please see the Teacher Unit Outline below for instructions on testing compatibility.

There is a new version of the classifier at https://classifier.appinventor.mit.edu but these materials refer to the old version at https://classifier.appinventor.mit.edu/oldpic/.


Below is an overview of the 3 forty-five minute lessons.

Lesson 1

10 min Introduction to Unit
Discuss what machine learning is and how it is used. If students have already learned about the App Inventor Look extension, some of this may be skipped.
25 min Train a Model with the Personal Image Classifier
Students open Web browsers on their computers and use http://classifier.appinventor.mit.edu/oldpic/ to create a model of different facial expressions. Students follow PIC Student Guide Lesson 1.
10 min Wrap-up Discussion
Discuss how students think their models performed. Ask about what made their models more or less accurate. What was a good number of images to train the model with?.

Lesson 2

10 min Introduction to Activity
Explain to students they will use the model made in the previous lesson in a prebuilt app. If students need more time to train their model, give them another 5-10 minutes.
15 min Run and Test PIC App
  1. Download and import the PIC template aia in App Inventor, or use the sidebar tutorial to open the template automatically.
  2. Students upload their model from Lesson 1 to the template.
  3. Students test the app and their model using the PIC app.
15 min Wrap-up Discussion
  1. Discuss how their app worked based on accuracy, limitations, and discuss ways to improve their models.
  2. Students may go back to the Classifier website to update their models based on their success in the apps.

Lesson 3

5 min Introduction to Lesson
Explain to students they will create a game app that uses their trained model to assess users’ ability to match a given expression.
30 min Coding Expression Match App
  1. Students may follow the tutorial using the pdf student guide, or using the sidebar tutorial.
  2. Students will create a game app called Expression Match, where the user tries to match a given expression (happy, sad, surprised) and gains points depending on how well they can match the model.
  3. Students test the app to assess how well the model works as a game.
10 min Wrap-up Discussion
  1. Discuss how their game app worked based on accuracy and different users.
    1. How might bias in the training model affect the outcome of a game?
    2. Is it fair?
    3. Does it matter who is playing the game?
  2. Students may go back to the Classifier website to update their models based on how well the model performs.

Teaching Documents