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

Recognize images using Ximilar Recognition API

Today, I will show how to set and test a custom image classification engine using Ximilar Image Recognition. We will prepare a dataset, upload images, train the 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 the 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 the different breeds, so my dataset is as diverse as possible.

Upload dataset to Ximilar App

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

We are ready to create a new task. A task is a 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 the Categorization task. Fill the name of our classifier “Cat vs Dog”. We want to add two categories “Cat” and “Dog”. We can always add and delete categories later. Click “Create New” to add a category on the Task page. We create two of them.

Now, we are going to “Drag and Drop” images for 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.

Train classifier

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

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 uses transfer learning and a 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 a list of trained models:

Test classifier

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

Summary

We trained and tested our classifier using Ximilar web interface. This is the simplest way to build an image classification engine. We reached 94% accuracy which we can increase to 100% with uploading more images. It is time to experiment with the 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 the comments.

Related Articles

Enhance your images' resolution without losing quality with a powerful Image Upscaler based on visual AI.
Read moreDecember 2021
With the AI Explainability in Ximilar App, you can see which parts of your images are the most important to your image recognition models.
Read moreDecember 2021
Ximilar introduces a new user interface for training custom image recognition, object detection and similarity search.
Read moreDecember 2021