Skip to content

Training Vision Models

This tutorial describes the steps to train Vision models in EdgeFirst Studio. Vision models are models that perform object detection in camera frames or images. EdgeFirst Studio is capable of training ModelPack and Ultralytics object detection models. For a tutorial to train Fusion models, see Training Fusion Models.

Verify Dataset

First ensure that the dataset is ready to be used for training. This means that the dataset meets all of the criteria listed below.

  • Complete Annotations (bounding boxes and/or segmentation masks/polygons)
  • Contains training and validation partitions
  • Contains a dataset tag/version

Complete Dataset

See an example dataset that is ready for training.

Specify Project Experiments

From the "Projects" page, choose the project that contains the dataset you plan to use. In this example, the project chosen is called "My First Project". Next click the "Model Experiments" button as indicated in red.

Model Experiments
Model Experiments

Create Model Experiment

You will be greeted with the "Model Experiments" page. Each model experiment will contain both training and validation sessions. A new project will not have any experiments.

Click on the "New Experiment" button as shown on the top right corner of the page. Enter the name and the description of the experiment marked by the fields shown below. Click on the "Create New Experiment" button to create your experiment.

New Experiment Button
New Experiment Button

Your created experiment will appear like the following below. At the start, this experiment will contain zero training and validation sessions. The next step will show how to start your first training session on this experiment using the dataset in the project.

Created Experiment
Created Experiment

Create Training Session

In the experiment card, click the "Training Sessions" button as indicated in red below.

Training Sessions
Training Sessions

You will be greeted to the "Training Sessions" page as shown below.

Training Sessions Page
Training Sessions Page

Start a training session by clicking on the "Actions" button on the top right corner of the page and then click "+ New Trainer Session" as indicated.

New Session Button
New Session Button

Select the trainer, either "ModelPack" or "Ultralytics". Both trainers run as Studio apps on cloud GPU instances, and Studio opens the launch form of the selected trainer. Provide a name and description of the training session and specify the dataset to be used for training and validation. In this example, the dataset specified is the "Coffee Cup" dataset which was used as an example under the Getting Started. Next specify the training parameters. Additional information on these parameters are provided by hovering over the info button Info Button.

Input Resolution

For ModelPack, we recommend changing the input resolution to 640x360 to maximize detection rates on small datasets.

Large Batch Size

For small datasets, a large batch size may produce poor results. Use a batch size of 4 or 8.

For more information on available "Data Augmentations" please see Vision Augmentations.

The launch forms of both trainers start with the same three groups.

Group Description
Training Session The Name and optional Description of the training session. The name is also used to name the artifacts.
Source Dataset The dataset the session trains and validates on, with its annotation set and tag.

The groups that follow depend on the trainer.

Trainer Groups Parameter Reference
ModelPack Input (Input Resolution, Camera Adaptor, Input Tiling (SAHI), Letterbox Resize), Model Parameters, Training Parameters, Data Augmentation, Export Parameters ModelPack Training Parameters
Ultralytics Input (Input Resolution), Task Selection, Export Parameters, Training (Weights, Enable Training and its training settings) Ultralytics Training Parameters

Click "Start App" to start the training session.

Weights and Enable Training

The two trainers start from different weights.

  • ModelPack always trains. The backbone starts from ImageNet-pretrained weights and the detection and segmentation heads start fresh.
  • Ultralytics has a Weights field and an Enable Training toggle in its Training group. Weights is either Pretrained (COCO) (default), the Ultralytics COCO weights for the selected model, or a previous Ultralytics training session, whose published weights bring their own model definition. Enable Training is off by default.
Weights Enable Training Ultralytics Session Behavior
Pretrained (COCO) Off Default. No training. The session exports the COCO pretrained weights (80 classes) at the selected Input Resolution. This lets you reproduce validation and profiling results from the EdgeFirst Model Zoo on Hugging Face using the published COCO checkpoints.
Pretrained (COCO) On Fine-tunes the COCO pretrained weights on the selected dataset.
A previous training session On Fine-tunes the weights published by that session on the selected dataset.
A previous training session Off No training. The session exports that session's weights at the Input Resolution and Deployment chosen on the form, for example to deploy tile-trained weights whole frame.

A session with Enable Training off validates the exported model and reports the results as its final validation metrics. It runs no epochs, so its loss and learning-rate charts stay empty. See Weights Source for the details.

COCO pretrained weights and dataset compatibility

Pretrained (COCO) weights without training detect the 80 COCO classes. When your dataset classes differ from the COCO classes, the session skips validation, and the model's class outputs do not correspond to your labels. Turn on Enable Training to fine-tune the weights on your dataset.

Session Progress

Once the training session has started, the progress with the stages will be shown on the left and additional information and status is shown on the right.

Training Session
Training Session

The training process begins with cloud instance initialization. Then the dataset is downloaded and cached. Training starts afterwards. At the end of the training process, the model is exported and the model artifacts are published on the training session, available for download.

Completed Session

The completed session will look as follows with the status set to "Complete".

Completed Session
Completed Session

The attributes of the training sessions in EdgeFirst Studio are labeled below.

Training Session Attributes
Training Session Attributes

Training Outcomes

Once the training session completes, you can view the training charts by clicking the "view training session charts" button on the top of the session card.

Training Charts
Training Charts

You can go back to the training session card by pressing the "Back" button as indicated in red below on the top left corner of the page.

Back to the Session Card
Back to the Session Card

The trained model artifacts can be downloaded by clicking the session card. This will open the session details and the models are listed under the "Artifacts" tab as shown below. Click on the downward arrows to download the models to your PC.

Training Session Artifacts
Training Session Artifacts

It is also possible to compare the training metrics for multiple sessions. See Training Sessions in the Model Experiments Dashboard for further details.

Netron

You can visualize the architecture of these models using https://netron.app/.

Next Steps

Now that you have trained your model, you can validate the performance of your model either on target/device or on the cloud.