Test it on the Peltarion Platform

A platform to build and deploy deep learning projects.

Even if you’re not an AI superstar.


Single-label image classification / cheat sheet

Target audience: Data scientists and developers

Problem formulation

Use this cheat sheet:
If your input data consists of labeled images containing exactly one of multiple classes. This is called single-label classification.

Example use cases

Please note that data sets, models and other content, including open source software, (collectively referred to as "Content") provided and/or suggested by Peltarion for use in the Platform, may be subject to separate third party terms of use or license terms. You are solely responsible for complying with the applicable terms. Peltarion makes no representations or warranties about Content and specifically disclaim all responsibility for any liability, loss, or risk, which is incurred as a consequence, directly or indirectly, of the use or application of any of the Content.

SkinLiasonMalignant BenignPA3

Images of skin lesions that are either benign or malignant.
(image source)

Cracks in solar panel PA4

Images of solar panels that are either defective or functional.
(image source)

MNIST tagged 8 5 PA2

Images that contain exactly one handwritten number from 0 to 9.
(image source)

Data preparation

Data input requirements

Prepare a zip file with a folder containing all your images and a corresponding index.csv.
The Peltarion Platform supports .jpg or .png.

index csv PA1

Structure of index.csv

The index.csv file is a simple text file where columns are separated by a comma: ",". Each column will be imported as a dataset feature, where the name of the feature is taken from the first line.

You need to give at least two features: the images and their target classes. To specify the images, write the name of the image file, together with their paths inside the zip file if they are located in subfolders.

image label


class 1


class 2

Use same sized images

All of your images need to be the same size. If they are different sizes, you will need to resize them before creating the zip file.

Most of the best-performing deep learning models for images were constructed based on images sized 256x256 or 224x224. If your images are bigger than that, we recommend resizing your images to around this size to maximize the likelihood of getting good performance on your data.

Change preprocessing in the Datasets view

Once uploaded to the platform, choose Preprocessing as No pre-processing for the image column, and One-hot encoding for the class column.

Features Single label image classification PA1


Snippets are pre-built neural network architectures available on the platform. Several are good for image classification.

Image size Recommended snippet

Between 10x10 and 96x96 pixels

ResNetV2 Small

Between 96x96 and 320x320 pixels

ResNetV2 Large

Above 320x320 pixels

We recommend you to resize them to max 320x320.

Try the smallest depth model first

Try the smallest depth model first, since it will be faster to train and may already be complex enough to model your data well.

If the results are not good enough, you can move toward increasingly deep models in later experiments.

The second number next to the snippet name represents the depth of the model; the deeper the model, the more complex it is.

Changes in the Modeling view

On the last Dense block change the number of nodes to the number of classes in your data, and set the Activation to Softmax. In this instance, we set softmax because it models the fact that labels are mutually exclusive (one and only one of them is right).

On the Target block, make sure the loss function is Categorical crossentropy.

Last blocks Single label image classification PA1