Upload model predictions

To perform model error analysis, use model-assisted labeling, or set up active learning workflows, you can upload your model predictions to Labelbox.

Model predictions are uploaded in a Model Run. A Model Run is a container for the predictions, annotations and metrics of a specific experiment in your ML model development cycle.

Every model prediction can be uploaded with a confidence score. Besides, given the predictions and annotations in a Model Run, Labelbox calculates some auto-generated metrics.

Besides, users can upload custom scalar metrics to the Model Run.

Uploading predictions to a Model Run enables users to evaluate model performance, surface model failures, find and fix labeling errors, and to do active learning.

Uploading predictions to a Model Run enables users to evaluate model performance, surface model failures, find and fix labeling errors, and to do active learning.

How to upload predictions to a Model Run

Step 1: Import data rows

To upload predictions in a Model Run, you'll need to have a set of data rows to upload the predictions on. If you do not already have a set of data rows, you'll need to import data rows in a dataset in Catalog.

To learn how to import data rows via the Python SDK (Step 1), see this tutorial.

To learn more about creating data rows, see Create a dataset in Catalog.

Step 2: Create/select an ontology for your model predictions

When you create a Model - to upload a set of predictions - you'll need to specify the ontology (also called taxonomy) that corresponds to the set of predictions. You may want to re-use an ontology that already exists in Labelbox - e.g. an ontology already used for a labeling project. Or, you may want to use an ontology for your model predictions that does not exist in Labelbox yet. In the latter case, you'll need to create an ontology.

To learn how to create an ontology via the Python SDK (Step 2), see this tutorial.

To learn more about creating ontologies, see Create/modify ontologies.

Step 3: Create a Model and a Model Run

Before you can upload your predictions, you'll need to make sure you have a Model and a Model Run to contain them. You cannot simply upload predictions without specifying which Model and Model Run they'll be associated with. A Model is attached to an ontology: it defines the predictions that can be contained in it. A Model can contain any number of Model Runs. Each Model Run corresponds to an experiment in your ML model development cycle. If you do not already have a Model and a Model Run, you will need to create a Model, then attach the ontology that fits your predictions, and finally create a Model Run.

To learn how to set up a Model and Model Run via the Python SDK (step 3), see this tutorial.

To learn more about creating a Model, see Create a Model and Create a Model Run Create a project.

Step 4: Send a set of data rows to the Model Run

Now that you have your Model, Model Run and ontology configured, you'll need to send a set of data rows to the Model Run.

To learn how to send data rows to a Model Run via the Python SDK (Step 4), see this tutorial.

Step 5: Optionally, send annotations to the Model Run

After you have successfully configured your Model Run with the correct ontology and sent data rows to the Model Run, you can optionally send annotations to the Model Run.

To learn how to send annotations to a Model Run via the Python SDK (Step 5), see this tutorial.

Step 6: Create the predictions payload

πŸ“˜

Uploading confidence scores with each model predictions

Labelbox now supports specifying the confidence score associated with every model prediction. It is optional.

After you have successfully configured your Model Run with the correct ontology and sent data rows (and optionally annotations) to the Model Run, you are ready to prepare the predictions payload. To do this, you will need to use our Python SDK. Each imported prediction will need to reference a feature class within the ontology (see step 2 above) and a specific data row ID. Labelbox support two formats for the predictions payload: NDJSON and Python Annotation types.

Use the table below to find a prediction payload sample for your asset type. The "-" symbol indicates that importing predictions to a Model Run is not supported for that prediction/asset type combination. To learn how to create a prediction payload (Step 6), see this tutorial.

ImageVideoTextDocumentsGeospatialAudioConversational textDICOM
Bounding boxPayloadN/AN/AComing soonComing soonN/AN/A-
PolygonPayload-N/AN/AComing soonN/AN/A-
PointPayloadN/AN/AN/AComing soonN/AN/A-
PolylinePayload-N/AN/AComing soonN/AN/AComing soon
Segmentation maskPayloadN/AN/AN/A-N/AN/AComing soon
Text entityN/AN/APayload-N/AN/A-N/A
Classification - RadioPayloadComing soonPayloadComing soonComing soonComing soon--
Classification - ChecklistPayloadComing soonPayloadComing soonComing soonComing soon--
Classification - Free-form textPayload-PayloadComing soonComing soonComing soon--

πŸ“˜

Not supported

Relationships and Segments cannot be imported as predictions in a Model Run. Import predictions in a Model Run is not supported for HTML assets.

Step 7: Upload the predictions payload to the Model Run

After you have constructed your predictions payload, you are ready to upload the it to the Model Run. To do this you will need to use our Python SDK. See the table in the next section to find the end-to-end tutorial that most closely fits your use case.

To learn how to upload a prediction payload via the SDK (Step 7), see this tutorial.

Steps 1-7: End-to-end Python tutorials

Check out these end-to-end Python tutorials to see how to import predictions to a Model Run (Steps 1-7).

Data TypeGithubColab notebook
ImageOpen in GithubOpen in Colab
TextOpen in GithubOpen in Colab
GeospatialComing soonComing soon

πŸ“˜

Pro-tips

  • Make sure the predictions are in the proper format. Use the charts above to determine whether a prediction type is supported for the asset type you are working with.

What’s Next