Coding Ireland STEM Report 2024 Have Your Say
Artificial Intelligence
20 mins
165 points
What you need:

Create an Image Model

In this lesson, you'll create an image model using Google's Teachable Machine to play a rock, paper, scissors game with your webcam!

Note: You will need a webcam or a camera on your computer to create the images for the image model.

Learning Goals Learning Outcomes Teacher Notes

1 - Introduction

In this lesson, you will create an image model using Google's Teachable Machine to recognise rock, paper and scissors hand gestures.

Google's Teachable Machine is a tool that allows you to create machine learning models. You'll train the model to recognize different hand gestures for rock, paper, and scissors.

In another lesson in this course we will use the model to build an AI Rock, Paper, Scissors game.

2 - Open Teachable Machine

First we need to open the Google's Teachable Machine website to create our model.

Click on the Get Started button.

3 - Create an Image Project

Click on the Image Project button to create a new image model project, and then click on the Standard image model option.

This will bring you to the screen where we can create our classes for our image model.

In an AI image model, a class is a category that the model can recognize. For example, in our rock, paper, scissors game, we will have three classes: rock, paper, and scissors. The AI will learn to recognize images of each class and be able to tell them apart.

4 - Create the Classes

There will be two classes already added to your model called 'Class 1' and 'Class 2'.

Add a third class by clicking on the 'Add a class' button and then rename your classes to:

  • Rock
  • Paper
  • Scissors

5 - Add Images to the Rock Class

Now let's create and add the images for the rock gesture to the Rock class.

  1. Click on the Webcam button in the Rock class. This should start using your webcam (you may need to click to allow permissions).
  2. Put your hand in the frame of the camera and make a rock gesture, then click on the 'Hold to Record' button. This will take several quick pictures of your hand.
  3. Repeat this a few times with your hand in different positions but still doing the rock gesture.
  4. Remove any images that show your hand doing the rock gesture. Remember the better quality images we give our model, the better it will perform.

Unlock the Full Learning Experience

Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our courses.

Copyright Notice
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more