Custom Vision API is an AI service under Cognitive Services provide by the Microsoft which helps you to develop your own image classifications. The primary objective of this classifier is to sort images into tags/classes according to the characteristic.
This article split into three parts as below,
- Create your own model using web interface in seconds.
- Create a web application to get predictions with the classification model
- Extend the web application to train the model more.
Create your own model using the web interface in seconds
Nowadays you don’t want to be a super developer to create a basic intelligence application. Therefore without prior knowledge about development, let’s figure out how to create your own classification using Custom Vision API.
Why I need to build this custom classifier?
My scenario is very small. From childhood we love dogs, right? But till today I cannot identify any dog by its kind. So my intention is to build an application which can suggest me the type of the dog. So with a simple image, I can easily recognize the type of the dog. Let’s start creating our application.
Step 1 – Creating a new project
Before we do anything with the code, let’s create a simple classifier model with the Custom Vision API.
- Go to Custom Vision API.
- Sign into Custom Vision API by your outlook account/ azure account. If you don’t have any subscription associated with your account, then you can only create two projects.
- After you log in to the application, create a new project.
- Fill below fields according to your requirements when creating the project. Give a name and a description for your project. then select the project type as classification.Classification types: Multilabel indicate that you can classify one image to many tags and Multiclass allows only one tag per an image. Here I choose Multilabel.Domain: domain helps to optimize your classification model. Here I choose General.
- After successful creation of the project, you will have below interface to train your model.
Step 2 – Add images with tags
Let’s start to add images to our model. Before that, find more than 5 images from few categories. For my scenario, I will get more images as I can for each type of dog. And then click the add image button, under the Training Images tab.
Step 3 – Train your model
Once you have done all the tagging and uploading the images, you can click on the Train button to train your model.
It will take a few minutes depends on the size of your data you have used train your model and once it has done, it will automatically navigate to the Performance tab and show the results of your training.
Precision – Percentage of the correct tag to respective image out of the all the images.
Recall – Percentage of the correct tags identify by classifier against its same set of images.
Step 4 – Quick test on your model
Now let’s try whether my model has little intelligent to identify the dog type. For that, click the Quick Test button next to the Train button. It prompts you to provide a URL or an image. So provide and check the result tags with their probabilities.
Finally, you have successfully created a custom vision classification model to identify dogs. But you should provide more and more images in different angles, colors etc to get a more accurate result.
In the next part of this article, I will tell you how to get this prediction to our web application. That article will be a little technical. Till then happy coding! Cheers!