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

Students will learn about the basics of machine learning and create their own apps that implement these concepts through image classification. The students will take photos with their mobile devices and the apps will identify objects within those photos. Each classification comes with a confidence level, a value of how confident the app is with its classification. Students will use MIT App Inventor’s machine learning extension called the LookExtension when creating this app.

This Introduction to Machine Learning includes tutorial lessons as well as suggestions for student explorations and project work. The unit also includes supplementary teaching materials: lesson plans, slides, unit outlines, assessments and mappings against the Computer Science Teachers of America (CSTA) computing standards.

NOTE: The LookExtension requires running image classification directly on the mobile device, and not all mobile devices/operating systems currently have the required hardware/software to run the code. Therefore, we suggest testing your devices before attempting this in a classroom setting. So far, we have identified the following device/OS pairs for which the LookExtension will work.

  • Samsung Tab S2, Android 7.0
  • Amazon Fire HD 8, Fire OS
  • Amazon Fire HD 10
  • ASUS Zenpad 3s 10, Android 6.0

Another less expensive option is to use a Chromebook, as most will support the LookExtension. In addition, many Chromebooks now support running Android apps, so the MIT AI2 Companion can be installed directly on the Chromebook, and students can run the App Inventor IDE and the AI2 Companion on the same machine.

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

Lesson 1

10 min Introduction to Unit
Discuss what machine learning is and how it is used.
25 min Play with Teachable Machine
Students go onto the web and use Teachable Machine to get a basic understanding of how machine learning works.
10 min Wrap-up Discussion
Discuss how data is collected and the extent to which information can be used and thoughts on machine learning.

Lesson 2

5 min Introduction to Activity
Introduce the WhatisitApp and compare it to Teachable Machine.
20 min Coding of Whatisit App
  1. Download and import the Whatisit Template in App Inventor.
  2. Students work to finish creating an image classifier app.
  3. They may use either the built in sidebar tutorial or a pdf tutorial.
10 min Testing the Whatisit App
  1. Students run their completed app on their tablets.
  2. Students experiment with the app’s benefits and limitations.
10 min Wrap-up Discussion
Discuss how their app worked based off the tests in terms of advantages, limitations, and ways to improve it.