Skip to navigation

Evaluate classifier

Dockerfile
First run can take longer while the worker pulls the configured Docker image.

Overview

Scores a classifier against ground truth and writes a report with the metrics behind the score.

Pair a labeled dataset with the predictions of a classifier on the same images or video clips, and the run reports how often it was right, where it confuses classes, and how it does per class. The badge shows the weighted F1.

Predict TIMM Evaluate classifier Compare classifiers

Prerequisites

RequirementWhat you need
Ground-truth datasetAn existing Dataset whose annotations you trust as correct.
Prediction datasetThe output of a prediction node on the same images or videos, so every ground-truth asset has a prediction to compare against.

How it works

1

Pairs each image’s or video’s ground-truth class with the class the model predicted for it. The ground truth is the name of its annotation tag, or the value of the tag named in GT class tag.

2

Computes the overall and per-class metrics, splitting the result by asset tag when tags are selected.

3

Writes the report and shows the weighted F1 on the badge.

FAQ

Accuracy hides class imbalance: a model that always answers with the majority class can look excellent. Weighted F1 accounts for how each class actually performs, so it degrades when a rare class is being missed.

A separate section of the report per tag value, which is how you find out that the model is fine overall but poor at night, or on one camera. Leave the tags empty for a single result over the whole dataset.

Yes. The node reads images and videos alike, taking a video’s class from the tags of its whole-video annotation. Clips often keep their true class as the value of one tag, such as ground_truth with values Dumping and Removal: put that tag name in GT class tag. Clips without the tag are left out, or take the class you set in GT class without tag, for example negative.

The per-class numbers and the confusion matrix. An overall score tells you whether the model is good, those tell you what to fix.

Only assets present in both are scored. An image that exists in one dataset and not the other contributes nothing, so a partial prediction run quietly shrinks the evaluation set rather than failing.

Inputs

Ground truth dataset
datasetRequired

Dataset with the ground truth class of each image or video, as the name or the value of a whole-asset annotation tag. Key: GT_DATASET.

GT class tag
string

Annotation tag whose value is the ground truth class, for example: ground_truth. Only tags over the whole image or video count. Leave empty to take the class from the name of the ground truth annotation tag. Key: GT_CLASS_TAG.

GT class without tag
string

Class of a ground truth asset that has no GT class tag, for example: negative. Leave empty to leave such assets out. Used only when GT class tag is set. Key: GT_NO_TAG_CLASS.

Prediction dataset
datasetRequired

Dataset with prediction annotations (e.g. output of a classifier predict node). Key: PRED_DATASET.

Split by tags
asset_tags

Ground truth asset tags to break the report down by, for example weather or camera. Each selected tag value gets its own view of the report, and an empty selection reports on the whole dataset. Values come from GT_DATASET. Key: TAGS.

Outputs

Classification evaluation report
report

Machine-readable classification evaluation report for preview and compatible comparison nodes. Shown as an artifact. Key: REPORT_ID.

Evaluation
model_evaluation

The evaluation row this run recorded on the model version. Empty when the registry could not be reached. Key: EVALUATION_ID.

Weighted F1
string

Weighted F1 score shown as a badge on the node. Shown on the node as a badge. Key: WEIGHTED_F1.

Models and configuration

There is no model to select. The node compares two datasets, so what you configure is the scope of the comparison.

GT class tag names the annotation tag whose value is the true class, such as ground_truth. Leave it empty to take the class from the name of the ground-truth annotation tag. GT class without tag gives a class to the assets that have no such tag.

Split by Tags picks ground-truth asset tags to break the report down by. Each selected tag value gets its own section, computed on that slice only.

Report

The report opens in the preview widget.

It carries the overall metrics, a per-class breakdown showing precision, recall, and F1 for each class, and a confusion matrix naming which classes the model mixes up. When tags are selected, the same set repeats for every tag value, so slices can be compared against the whole.

Runtime

Runs on an ordinary worker. Cost scales with the number of annotations compared, not with image size, because no model is executed.

JSON config

Machine-readable node interface for automation and advanced usage.

{
"name": "Evaluate classifier",
"description": "Compare ground truth and predicted labels, compute classification metrics and generate an evaluation report.",
"category": "Evaluate",
"namespace": null,
"templateKey": "evaluate/evaluate_classifier",
"version": "v1",
"inputs": [
{
"key": "GT_DATASET",
"label": "Ground truth dataset",
"type": "dataset",
"description": "Dataset with the ground truth class of each image or video, as the name or the value of a whole-asset annotation tag.",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"creatable": false
}
},
{
"key": "GT_CLASS_TAG",
"label": "GT class tag",
"type": "string",
"description": "Annotation tag whose value is the ground truth class, for example: ground_truth. Only tags over the whole image or video count. Leave empty to take the class from the name of the ground truth annotation tag.",
"required": false,
"default": "",
"visibleWhen": null
},
{
"key": "GT_NO_TAG_CLASS",
"label": "GT class without tag",
"type": "string",
"description": "Class of a ground truth asset that has no GT class tag, for example: negative. Leave empty to leave such assets out. Used only when GT class tag is set.",
"required": false,
"default": "",
"visibleWhen": null
},
{
"key": "PRED_DATASET",
"label": "Prediction dataset",
"type": "dataset",
"description": "Dataset with prediction annotations (e.g. output of a classifier predict node).",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"creatable": false
}
},
{
"key": "TAGS",
"label": "Split by tags",
"type": "asset_tags",
"description": "Ground truth asset tags to break the report down by, for example weather or camera. Each selected tag value gets its own view of the report, and an empty selection reports on the whole dataset.",
"required": false,
"default": null,
"visibleWhen": null,
"options": {
"ref": "GT_DATASET"
}
}
],
"outputs": [
{
"key": "REPORT_ID",
"label": "Classification evaluation report",
"type": "report",
"kind": "classification_evaluation_report_v1",
"description": "Machine-readable classification evaluation report for preview and compatible comparison nodes.",
"artifact": true,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "EVALUATION_ID",
"label": "Evaluation",
"type": "model_evaluation",
"description": "The evaluation row this run recorded on the model version. Empty when the registry could not be reached.",
"artifact": false,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "WEIGHTED_F1",
"label": "Weighted F1",
"type": "string",
"description": "Weighted F1 score shown as a badge on the node.",
"artifact": false,
"badge": true,
"badgeOpens": null,
"hidden": false
}
],
"runtime": {
"type": "docker",
"devices": [
"cpu"
],
"dockerImage": "ovalbee/node-classifier-inference:0.0.27"
},
"widgets": {
"widget": {
"id": "report-preview",
"settings": {
"reportAsset": {
"type": "variable",
"value": "self.outputs.REPORT_ID"
},
"name": {
"type": "input",
"value": "Open evaluation"
}
}
}
}
}

References