Create, Train, and Use Models
models are powerful tools designed to automate labeling and frame classifications in a variety of ways. They are top-level entities, which means they can be attached to several Projects to detect and label objects they have been trained to recognize.
This document will teach you how to:
- Create and set up a model.
- Train the model on previously labeled data.
- Use the model to create labels or classifications.
Creating models
To create a model, navigate to Models in the Agents section of the sidebar in the Encord platform, and click the + New model button.
Next, enter details for your model such as a title and optionally a description. Information on other details is given below. When all details for a model have been selected, click the Create model button to complete the model creation process.
Model type
The type of model determines the function you would like it to perform. Click the links below to learn about the different model types available to use within Encord, as well as which frameworks and models are available for each.
Model ontology
The model Ontology consists of the objects and classifications you would like your model to detect and label. Functionally, these are strings of text which are later associated with particular objects in a Project’s Ontology when the model is trained.
Each object and classification you would like your model to learn how to label should have its own model Ontology.
Training models
After creating a model it will have to be trained to learn how to classify, or detect / segment objects within frames or images. Begin by selecting the model you wish to train from the list of models.
Then click the Train model button to begin setting up your model’s training.
-
Select the Project you would like to train your model on. Make sure to select a Project with accurate labels, as high quality labels result in better performing models.
-
Map each model Ontology to an entity in the Project’s Ontology. This step associates the model Ontology to a set of objects or classifications in the Project which is can learn from.
-
Select all Project tasks you would like your model to train on by selecting the checkboxes in the list. A minimum of 5 labels are needed for your model to be trained.
-
Select the number of epochs you would like to include in this training. Epochs refer to the number of iterations through the entire training dataset that should be included in the training process. The default number of epochs is set to 500.
-
Select the batch size for this training. The batch size refers to the number of training examples processed by the model in a single forward and backward pass.
-
Select which training weights should be used. This refers to the model’s initialization weights, which determine how many parameters a model has as well as their weights. Training weights are not available for classification models.
-
If you would like to add training data from a different Project, click the + Add training data tab.
Once all the above has been set and selected click the Train model button. Your model is now being trained - and you can monitor the progress by clicking the bell icon in the top right corner of the Encord app. The icon will appear next to the task when the process has completed.
Training log
After a model has finished training, the ‘Training log’ allows you to study each training iteration and determine how differences in training data affect the model’s performance over time.
It displays the batch size, the number of epochs, and a graph showing how the model’s loss evolved during the course of each training iteration. Training loss will not be recorded for classification models.
Deleting models
Navigate to the Danger zone of the Settings tab to delete a model.
Using models
Once you create and train a model, the model can be attached to Projects and used to create annotations.
Attaching models to Projects
Open the Project you want to attach your model to and navigate to the Models tab. Click + Attach a model.
Select the model you want to attach to the Project, and map each model ontology to the entity in the Project’s ontology you would like to associate it with. In the following example we want the ‘Apple’ model Ontology to correspond with ‘Apple’ in the Project’s Ontology.
Next, select which training iterations you would like to include from your model. Click Attach model when you are done.
Detaching models from Projects
Open the Project you want to detach your model from and navigate to the Models tab. Click the Settings icon and select Detach model.
Downloading models
pytorch
model weights can be downloaded.You can download the learned parameters (known as weights) of a model for each training iteration. These weights are the result of training the model on a specific Dataset.
- Select the training iteration you want to download model weights for.
- Click the Download button.
A file named
weights.pt
is downloaded.
.pt
files.Was this page helpful?