Single-Label Classification Model

Run a single-label classification model in a Workflow.

About this block

The Single-Label Classification Model block lets you run a single-label classification model trained on or uploaded to Roboflow.

Single-label classification models return a category for an image. For example, you could use this block to:

  1. Identify what defect is present in an image

  2. Sort images into one or more categories

  3. Identify the type of product in an image

You can run private models stored in your Workspace, or public models on Roboflow Universe.

The Single-Label Classification Model block.

What you can send into this block

You can run the Object Detection Model block on:

  1. An image that you send to your Workflow

  2. A video frame that you send to your Workflow

  3. A cropped region of an image that is calculated in your Workflow (i.e. with a Crop block)

What this block returns

The Single-Label Classification Model block returns the class your model thinks most closely represents the contents of the image. The block also returns a confidence value showing how confident the model thinks it is in its result.

To see the results from your classification model plotted on an image, you need to use a Visualizer block. You may want to use the:

  • Classification Label Visualization block: Show labels from a classification model on an image.

Here is an example showing the results from a single-label classification model with a Classification label Visualization:

The label "loose-straw" appears in the top left corner of the image.

How to configure the block

When you set up this block, you will be asked to choose a model from your Workspace:

To use a model in your Workspace, choose from the list of Your Models.

You can also specify the ID of any model found on Universe. Learn how to find a model on Universe.

To use a Universe model, navigate to the Public Models tab, then paste in the Universe Model ID for the model you want to use.

You can then configure the block using the options available in the Workflows editor.

Use cases

This block is useful for any Workflow that involves running a classification model.

If you need a zero-shot classification model, you may be interested in using CLIP, or trying a multimodal model like Claude.

Predictions format

Expand the card below to see the JSON data returned by this block.

Predictions format

Predictions are returned in the following format:

[
    "model_predictions": {
      "inference_id": "866010bb-e432-4b9c-9b95-35d87f0ffafa",
      "time": 0.28171608800039394,
      "image": {
        "width": 960,
        "height": 1280
      },
      "predictions": [
        {
          "class": "loose-straw",
          "class_id": 4,
          "confidence": 0.5229
        }
      ],
      "top": "loose-straw",
      "confidence": 0.5229,
      "prediction_type": "classification",
      "parent_id": "image",
      "root_parent_id": "image"
    }
  }
]

Last updated

Was this helpful?