Topics covered:
  • How to train a classification model on one class
  • How to train multiple one-class classification models in an easy way

You can download video tutorial here

Training a model on one class video tutorial

How to train a model to recognise only one type of object or classification
A common scenario is that you want to train a model to recognise only one type of object or classification. You can train a SentiSight model to do this for you. A normal classification model will require you two use at least two labels, so you need to follow this specific guide.
Collect, upload and label your images

To begin, first you need a collection of images that have the relevant label that you want to detect / classify. You will also need to upload a group of ‘background’ images, which are images which do not have the object in the image. For the background images, try to use the same diversity of images that you would expect to have during the production usage of this model.

By having these background images, it allows you to start training a model as you have two classes.

Training your one class model
To start training your one class model, click train and then select Single-label classification, then start training your model. You can track the progress of the model along the top.
Analysing your model’s performance
Once the model has been trained, you can click ‘View training statistics’. From there, click on ‘Show predictions’ to see the predictions made on the uploaded images. It will classify the images either as your label, or as ‘background’.
Training multiple one-class classification models
Another use of this method is for exchanging a multi-label classification model by multiple two-class single-label classification models. By doing this you can often reach a better model accuracy. To use this approach, first set a background label, and then apply the background label to all images. The ‘background’ label will be added as a secondary label, rather than as the default. For single label classification, only the default label is used to train the model. Therefore, you will need to set the default label to background for all images apart from the label that you want to train for. The easiest way to do this is to first set the background label as the default for all images. To do this, click on the third button next to the plus or minus, next to the label. There, you will see an option to set this label as the default for all images. Now, set the label that you want to train on as the default for all of the images. All images that contain that label will now have that label as the default, whereas all others will keep with background as the default. You can now train your single label classification on two classes. By performing these steps for each class you will be able to train multiple single-label classification models instead of one multi-label classification model. This usually achieves a better accuracy, but at the expense of having to train and to use several models instead of one.