Image Classification with Prevision.io

Zeineb Ghrib
Prevision.io
4 min readSep 29, 2020

--

In this tutorial, you will learn how to use Prevision.io UI interface to build powerful image classifier without an advanced technical background. The machine Pipeline process is fully automated via Prevision.io platform.

The dataset that will be used is composed of images of different components of a train:

Each image is associated with a label from 4 classes:
1. Faces
2. Pantographs
3. Rails
4. Roofing

How an Image Classification use-case works:

Image classification is dealt as a supervised learning problem: Each image is labelled with its corresponding name, and then the classifier is trained to recognize them using the labeled photos.

In order to launch prevision auto-ml pipeline to the an image dataset you need to follow these steps:

Step1: Upload an Image Folder:

An Image Folder is a ZIP containing the images that will be used to train the models. To upload the file, all you have to do is to drag and drop into the image box (see figure below) within ‘image folders’ space and then click on”upload image folder”:

Step2 : Upload a Previsio.io Dataset:

In order to construct a supervised dataset you need ton construct a csv that would carry out the mapping between the images and their corresponding labels, it should contain (at least):

  • the filename: the name of the images within the image folder
  • the target : the corresponding label

It may contain other features that car be used as predictors to the models (temperature, weather …)

Similarly, you drag and drop to save the dataset , within the ‘Datsets’ space:

Step3: launch a use-case with Prevision.io:

As we deal with a multi-labelled dataset, it is a multi-classification training type: to launch the use case go to the usecases menu and click on the red button ‘new usecase’, then as shown below select:

  1. DATA TYPE : ‘Images’
  2. TRAINING TYPE : ‘Multi-Classification’
  3. DATASET SELECTION : you have to provide the image folder (uploaded on step 1) and the corresponding dataset filename/target mapper (uploaded on step2)

Before launching the use case, some settings are required:

  1. Dataset Configurations: click on ‘configure Dataset’

Then configure the target and the images path columns by choosing the corresponding features

2. Use-Case Config: to configure the use case parameters (models, metric, feature engineering ops…) click on ‘ADVANCED OPTIONS (OPTIONAL)’ tab:

Note that this step is optional : the platform provides reasonable default settings for all the training type use cases, making it easy to quickly create a baseline use-cases.

Within this step you can select/deselect the wanted options

Then to launch the use case click on ‘create and train’

Once the use case launched the platform performs several computations on the image dataset to extract images “embeddings” that will be used as input insted of the initial images. These embeddings are numerical vectors that carry efficient representation of the initial images input.

This image embedding operation is performed for two reasons:

  • Transform the images into numerical vectors that are more ‘appreciated’ by the models: in fact numeric input is less sophisticated than images pixels
  • Reduce the dimensionality of the data input

Once the use case process finished, you can visualize the new generated embedding-features:

Step 4 : Prediction:

To make Prediction in new images: you have to:
1. Upload the ZIP of images you want to predict creating a new Prevision.io image folder (step 1)
2. Upload the corresponding csv ( as explained on step 2)
3. Go to the prediction tab, chose your model and launch the predictions:

In step 4 (see figure above) after launching the prediction, a line will appear within the ‘USER GEBERATED TAB’. Once the status is done you can download the prediction file (step 5).

Conclusion:

In this post you learned how to use Prevision.io, to create an image classification use case, on a future post I will show you how to use the platform to crate an ‘object-detection’ use-case.

Please note that you have free trial access on cloud.prevision.io, all you have to do is to log in and you ll get access to the incredible world of auto ml, you will be able to build the best models without having to write one code line!

--

--