How to train custom image classifier in 5 minutes

Tutorial for using Ximilar Image Recognition service for creating neural network model for categorization without coding.
avatar
David Rajnoch
8. July 2017
blank

Recognize images using Ximilar Recognition API

Today I will show how to set and test custom image classification engine using Ximilar Recognition (formerly known as Vize.ai — Custom image classification API). We will prepare dataset, upload images, train classifier and test our classifier in the web interface. We need no coding experience unless we want to build API in our project. Let’s start now.

Prepare dataset

We want classifier to recognize cat vs dog. First, we will need 20 images of each cat and dog. Let’s google “cat” and “dog” and save 20 images of each. For every category I also searched for different breed so my dataset is as diverse as possible.

blank

Upload dataset to Ximilar App

We will need to create an account through app.ximilar.com or vize.ai. Visit the homepage then click “Log in” and create account through Sign Up form. Then you can login to the platform. Select Image Recognition service on the dashboard page.

blankblank

We are ready to create a new task. A task is classification engine (convolutional network model) that lets us classify our images. On the Overview page, through the Quick Actions section we click on “Add Task” button and pick Categorization task. Fill name of our classifier “Cat vs Dog”. We want to add two categories “Cat” and “Dog”. We can always add and delete category later. Click “Create New” to add category on Task page. We create two of them.

blank

blank

Now, we are going to “Drag and Drop” images to each category.  In Category drag images and drop them into Drag & Drop section. We can see 20 and 20 images uploaded on the image above. Ximilar Recognition service requires that every label has at least 20 images. We can use “Manage Category” button on Label/Category to show images and move them from one category to another.

blank

Train classifier

In this step, we can review our categories. We are ready to click on “TRAIN” button.

blank

A task is in training right now. It can take one to five hours depending on the number of images and complexity of your task. Ximilar Recognition (Vize) uses transfer learning and set of fine-tuned model architectures to reach the best possible accuracy on each task. Time to have a coffee now and wait for training to finish. After task training is finished you will see in the model section below list of trained models: blank

Test classifier

Our model is ready! We reached 94% accuracy on our 40 images dataset. You can view more statistics about trained model when you click on DETAIL button. We can now test it using Classify preview.

Summary

We trained and tested our classifier using Ximilar web interface. This is the most simple way to build image classification engine. We reached 94% accuracy which we can increase to 100% with uploading more images. It is time to experiment with huge possibilities that image classification brings. In developers documentation we can also find sample code to implement REST API into our app.

What kind of application can we build using visual AI? Let me know about your ideas in comments.

Related Articles

A step-by-step guide for using image similarity as a service. Find similar items with accurate & fast API for Image Search.
Read moreJuly 2021
Tips and tricks for developing and improving your custom image recognition models and deploying them as API with the Ximilar platform.
Read moreJuly 2021
With a new custom image similarity service, we are able to build an image search engine for collectible cards trading.
Read moreJune 2021