# Creating a model

Start creating a model by clicking the Add new model button in the model list view.

Add new model
Add new model

Creating a model consists of the following steps:

  1. Select training type
  2. Pick categories
  3. Parameterization
    • Base options
    • Input size
    • Classification parameters:
      • Dataset spread
      • Data augmentation
      • Advanced parameters
    • Object detection parameters
      • Dataset spread
      • Data augmentation
      • Advanced parameters
  4. Merge categories
  5. Start training

# Select training type

First, choose the type of model - Detection or Classification. Once one of them is selected, you will be taken to the next step.

Select training type
Select training type

# Pick categories

In this step, select the categories that you want to use in training the neural network model. The categories are listed under the name of each available dataset. Each category must contain at least 3 images for the network to operate on it.

Pick categories
Pick categories

# Pick parametrization way

Enter the model name (maximum of 50 characters; only Latin letters, numbers and hyphens are allowed) and select the framework to use for training from the list of available frameworks.

You have 2 types of parametrization ways to pick from:

  • manual parametrization
  • automatic parametrization

Pick manual or automatic parametrization
Pick manual or automatic parametrization

# Manual Parametrization

# Basic options

The basic configuration of the model consists of:

  • Template (Optional),
  • Pretrained model.

Parametrization
Parametrization

If you select Pretrained model, all parameter fields will be populated with default values that are the most optimal for the given pretrained model.

It is possible to change these values. However, a radical change of the default parameters may result in a decreased performance of the trained model.

If you want to keep the default values, you can go to the next step - Pick Categories.

# Input size

The input size represents the resolution of the images processed by the neural network. This is the resolution that the network will expect as input. Images from datasets that will be used in the training process will also be scaled to this resolution. For each pretrained model, a list of available options is displayed.

Input size
Input size

# Classification parameters

# Dataset spread

In this section you can set:

  • the number of model training epochs,
  • the percentage division of the dataset into training, test and validation sets.

Optionally, you can set the Early Stop parameter. It means that the model can stop training early if the loss value does not decrease during the specified number of epochs.

Dataset spread
Dataset spread

# Data augmentation for Keras

In this section you can set the following parameters:

  • Random contrast - this layer will randomly adjust the contrast of an image or images by a random factor.
  • Random flip - this layer will flip the images horizontally and/or vertically based on the mode attribute.
    • Vertical
    • Horizontal
    • Vertical and horizontal
  • Random rotation - this layer will apply random rotations to each image, filling in the empty space.
  • Random translation - this layer will apply random translations to each image during training, filling in the empty space.
  • Random zoom - this layer will randomly zoom in or out on each axis of an image independently, filling in the empty space.

Data augmentation for Keras
Data augmentation for Keras

# Data augmentation for PyTorch

In this section you can set the following parameters:

  • Random horizontal flip - horizontally flip the given image randomly with a given probability.
  • Random vertical flip - vertically flip the given image randomly with a given probability.
  • Random rotation - rotate the image by angle.
  • Random invert - inverts the colors of the given image randomly with a given probability.
  • Random autocontrast - autocontrast the pixels of the given image randomly with a given probability.
  • Random perspective - performs a random perspective transformation of the given image with a given probability.
  • Random solarize - solarize the image randomly with a given probability by inverting all pixel values above a threshold.
  • Random adjust sharpness - adjust the sharpness of the image randomly with a given probability.
  • Color jitter - randomly change the brightness, contrast, saturation and hue of an image.

Data augmentation for PyTorch
Data augmentation for PyTorch

# Advanced parameters

The Advanced tab contains advanced parameters, details of which can be found in the documentation of the selected framework:

  • Learning rate - controls how much to change the model in response to the estimated error each time the model weights are updated.
  • Metrics - a function that is used to evaluate the performance of your model. Metric functions are similar to loss functions, except that the results from evaluating a metric are not used when training the model.
  • Activation - a function that is a mathematical “gate” in between the input feeding the current neuron and its output going to the next layer.
  • Batch size - the number of training examples utilized in one iteration. The maximum value is determined by model configuration.
  • Loss - a method of evaluating how well specific algorithm models the given data.
  • Optimizer - an algorithm used to minimize the error function (loss function) and maximize the efficiency of production.
  • Freeze all layers - freezing prevents the weights of a neural network layer from being modified during the backward pass of training. You progressively 'lock-in' the weights for each layer to reduce the amount of computation in the backward pass and decrease training time.

Advanced parameters
Advanced parameters

# Object detection parameters

# Dataset spread

Here you can set parameters referring to dataset usage:

  • Max batches - number of iterations, where 1 iteration means processing of 64 images and we call it 1 batch.
  • Subdivisions - the batch (64) is subdivided by the input value, to get image blocks. The image blocks are run in parallel on the GPU.
  • Burn in - the first n batches (iterations) will increase the learning rate according to the formula:

current\_learning\_rate = learning\_rate ⋅ \left({\frac{iterations}{n}}\right)^{power} , where power=4 by default.

Please note that this parameter cannot be higher than the max batches value.

  • Percentage breakdown of the dataset into training, test and validation sets.

Data spread
Data spread

# Data augmentation

Here you can set how our additional data will be created:

  • Saturation - randomly changes the saturation of images during training.
  • Exposure - randomly changes the exposure (brightness) during training.
  • Hue - randomly changes the hue (color) during training.
  • Blur - blur will be applied randomly in 50% of the time. If 1 - will blur the background except objects with blur_kernel=31, if >1 - will blur the whole image with blur_kernel=blur.
  • Mosaic bound - limits the size of objects when Mosaic is selected (does not allow bounding boxes to leave the borders of their images when Mosaic-data-augmentation is used).
  • Gaussian noise - randomly adds Gaussian noise to the processed images.
  • Adversarial learning - changes all detected objects so that they appear different from the neural network's point of view. Consequently, a neural network launches an adversarial attack on itself.

Data augmentation
Data augmentation

# Advanced parameters

The Advanced tab contains advanced parameters, a detailed description of which can be found in the documentation of the selected framework:

  • Momentum - accumulation of movement, how much the history affects the further change of weights (optimizer).
  • Decay - a weaker updating of the weights for typical features, it eliminates disbalance in dataset (optimizer).
  • Learning rate - controls how much to change the model in response to the estimated error each time the model weights are updated.
  • Resize - randomly resize the image in range of [1 / 1.5 - 1.5x]. The minimum value is 1.1 and the maximum value is 10. We recommend not to exceed the value of 2.0.
  • Jitter - randomly crops and resizes images with changing aspect ratio in range from x(1 - 2 \cdot jitter) \rightarrow x(1 + 2 \cdot jitter) (data augmentation parameter is used only from the last layer).

Advanced parameters
Advanced parameters

# Automatic Parametrization

To simplify and speed up your model testing process, we came up with an “automatic model testing” feature. Instead of going through a an extensive multi-choice form, you can focus on accuracy while we set the rest of parameters for optimal training process.

Ready to try it out? Add a model and go to the Configuration tab. Click on Automated configuration and pick the accuracy level that satisfies you. Then run the entire experiment on the automatically adjusted settings.

# How to read the results

The effectiveness of the training can be evaluated when it is stopped. In the Automatic setting, training will stop for one of two reasons:

  • The model has reached the accuracy you were looking within the reasonable number of epochs. Your dataset provides a good amount of information and the parameters are good. You should still be careful and do some additional testing – such a result also means that your model has reached some level of accuracy that it will not be able to maintan consistently.
  • The model has reached the maximum allowed number of epochs without the expected results. This most likely means that your dataset may need improvements. Consider adding more images or inspecting the existing ones for oddly placed annotations or incorrect categories. If this does not help, consider manual configuration and adjust the parameters until the results are satisfying.

In either case, we will provide you with a model with the highest accuracy achieved.

# Merge categories

The categories selected in the previous step can be combined with each other. The whole process is described in more detail in the Merging datasets categories article.

Merge categories
Merge categories

Merged categories
Merged categories