Create a model to recognize the main characters of The Simpsons with Microsoft Custom Vision. This repo is part of this blog on DataChangers.
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.
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.
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!
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 the blue button "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).
Give the images the tag "Bart Simpson", so the model can learn how to identify images of Bart Simpson.
Please repeat this for the other characters from The Simpsons as well. You can click on "Add images" from the top menu to add more images.
Now you have done your preparation and you are ready to train the model to recognize the main characters of 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.
In order to train the model, start with clicking on the green "Train" button.
In this case, we go for a quick training.
This will give you a trained model with some key performance indicators like Precision and Recall. We did pretty well :)
Now it's time to test your model and run a quick test. Click on the "Quick Test" button.
This will open a popup to run the test.
You can browse for an unused image. Let's have a look...and yes! We got it right!
As said, this model can only recognize charactars from the Simpsons where it has been trained for. Let's see if you can find images of a new character, and retrain the model. Make sure you check the license of the images you use...
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 Student Performance
- AI Workshop: Predict Bike Demand
- Build a fruit classifier
- Build an object detector