AI Workshop: Recognize The Simpsons!

Build a model to recognize The Simpsons

Are you familiar with The Simpsons? Do you know the main characters? In case you don’t, this workshop solves your problem! In this AI workshop you learn how to build a model to recognize the main characters of The Simpsons in 5 steps with an image dataset and Microsoft’s Custom Vision service. You need an Azure subscription to do so. If you don’t have one, you can start a trial here.

Step 1: Get The Data

The data for this workshop comes from Henk Boelman as part of the Developers Guide to AI, where you can find a link to The Simpsons Lego dataset. Download this file and unzip it.

Step 2: Set Up The Environment

We are going the build the model to recognize a character of The Simpsons with Microsoft’s Custom Vision service. Please go the the Custom Vision website and sign in. If you don’t have a Microsoft account, you can create one here.

Now create a new project:

  • Give your project a name
  • Give your project a description
  • Select a resource. If you want to create a new you, simply click on “create new” and follow the steps (see screenshots below)
  • Select “Classification” as we want the model to put the images in different “classes”, or characters of The Simpsons in our case
  • Select “Multiclass “Single tag per image”): we have images with only one character on it
  • Select “Retail (compact)”
  • Select “Basic platforms)

Now click on “Create project” and your environment is ready to go!

Recognize The Simpsons: create project
Recognize The Simpsons: create resource
Recognize The Simpsons: create resource group

Step 3: Upload The Images

Now you are ready to upload the images, so you can train the model to recognize them. But we are not going to use all the pictures as we also want to test our model later on.

First, click on “Add images”

Recognize The Simpsons: add images

Go to the folder where you unzipped the images to. We start with Bart Simpson. In order to train the model, we have to inform the model what Bart Simpsons look like. Therefore, select part of the Bart Simpson images and give it a tag (name).

Recognize The Simpsons: upload Bart Simpson

Give the images the tag “Bart Simpson” so the model can learn how to identify images of Bart Simpson.

Recognize The Simpsons: Tag Bart Simpson

Please repeat this for the other characters of The Simpsons as well. You can click on “Add images” from the top menu to add more images.

Recognize The Simpsons: add other characters

Now you have done your preparation and you are ready to train the model to recognize The Simpsons. Note: of course the model will only recognize the characters you entered…so there is room for improvement and you can add more characters to make the model more complete.

Step 4: Train The Model To Recognize The Simpsons

In order to train the model, start with clicking on the green “Train” button.

Recognize The Simpsons: train the model

In this case, we go for a quick training.

Recognize The Simpsons: quick training

This will give you a trained model with some key performance indicators like Precision and Recall. We did pretty well 🙂

Recognize The Simpsons: model performance

Step 5: Test The Model…Can Your Model Recognize The Simpsons?

Now it’s time to test your model and run a quick test. Click on the “Quick Test” button.

Recognize The Simpsons: quick test

This will open a popup to run the test.

Recognize The Simpsons: test an unused image

You can browse for an unused image. Let’s have a look…and yes! We got it right!

Recognize The Simpsons: the result!

If you want to have these instructions, you can fork the corresponding Github repo.

Further exploring AI

This workshop is part of the Global AI Community October sessions.

Of course there is much more to explore. Make sure you sign up for the Global AI Community so you stay up to date.

Want to explore more? Then there are the workshops from Henk Boelman. bundled as the Developers Guide to AI, or other exercises, like:

One Reply to “AI Workshop: Recognize The Simpsons!”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.