AI Workshop: Recognize The Simpsons!

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:

AI Workshop: Predict Annual Income

Predict annual income

Will somebody earn over 50k a year?

This workshop is about building a model to classify people using demographics to predict whether a person will have an annual income over 50K dollars or not.

The dataset used in this experiment is the US Adult Census Income Binary Classification dataset, which is a subset of the 1994 Census database, using working adults over the age of 16 with an adjusted income index of > 100.

This blog is inspired on the Sample 5: Binary Classification with Web Service: Adult Database from the Azure AI Gallery.

Continue reading “AI Workshop: Predict Annual Income”

AI Workshop – Predict employee leave: will they leave or will they stay?

Predict employee leave

Imagine you are an HR-Manager, and you would like to know which employees are likely to stay, and which might leave your company. Besides you would like to understand which factors contribute to leaving your company. You have gathered data in the past (well, in this case Kaggle simulated a dataset for you, but just imagine), and now you can start with this Predict Employee Leave Hands-On Lab to build your prediction model to see if that can help you.

In this lab, you will learn how to create a machine learning module with Azure Machine Learning Studio that predicts whether an employee will stay or leave your company. We are aware of the limitations of the dataset but the objective of this hands-on lab is to inspire you to explore the possibilities of using machine learning for your own research, and not to build the next HR-solution.

Continue reading “AI Workshop – Predict employee leave: will they leave or will they stay?”