Stay-at-Home Science: Build your own AI

Discovery Place

Key Concepts

  • Artificial Intelligence
  • Machine Learning

Background:

Have you ever wondered how Artificial Intelligence gets its intelligence? One way we can teach AI is to use Machine Learning. We give our AI a bunch of data, it learns how to categorize the data, and then it gets good at telling the difference between different data!

We can use Google’s Teachable Machine to create our own Machine Learning model! This program is powered by Tensorflow.js, a popular Javascript library. Teachable Machine uses a type of Machine Learning called Transfer Learning. Transfer Learning uses a pretrained model, and then the user adds another layer to the model to create their own retrained model! By using a pretrained model, we do not need to provide as much data as traditional machine learning techniques.

Today we’re going to make our own AI to detect the difference between two different objects!

Materials:

  • A laptop with a stable internet connection
  • A webcam
  • Objects we want to teach the machine

Procedures

First – pull up https://teachablemachine.withgoogle.com, and click Get Started!

We’ll start with an Image Project, so click on that to create one! A standard image model will work just fine.

Once we create our project, we’ll see this screen:


For our project, pick two objects that you want to tell the difference between. For this example, I picked a rubber band ball, and a butterfly pamphlet. Label accordingly.

Click on “Webcam” to upload photos. Try to get a variety of angles of your object. The more photos of the object the better.

Next, click Train! This process takes a minute, but once you’re done, you’ll see your working AI in the preview section.

Try showing your AI something it hasn’t seen before. It’ll probably get a little confused. You can add more classes, to cover more objects, but it would take forever to train it on every possible object!

Topics