Filter predictions

Overview

Selects a subset of a dataset from the confidence carried by its prediction annotations, and adds the selected assets to a destination dataset or to the node’s own output dataset.

Task decides how assets are scored and picked. Classification reads the image-level tag as the predicted class and the confidence tag beside it as the confidence (older predictions carry it as the class tag’s own value), keeps what falls inside the confidence band, and spreads a fixed budget across the predicted classes. Object detection aggregates the box confidences of each asset into one score, drops everything under the floor, and keeps the highest-scoring assets. Without a destination, rerunning the node writes a new version of the dataset it created the first time, instead of creating another one.

How it works

1

Takes the destination dataset, or the node’s own output dataset — created on the first run, a new empty version of it on a rerun.

2

Loads the source dataset’s images together with their prediction annotations.

3

Scores every asset the way Task demands: one image-level confidence for classification, or the box confidences aggregated by max, mean or min for object detection.

4

Keeps the classification predictions inside the confidence band and samples up to Count of them across classes, or keeps the detections above Min score up to Top K.

5

Adds the selected images and their annotations to the output dataset, refreshes its statistics and inherits the source ontology.

FAQ

The node remembers the dataset it produced, named Confidence Sample for classification or Top-K Filtered for object detection, and writes a new version of it on every rerun. A flow that reruns does not leave a trail of near-identical datasets behind, and earlier results stay in that dataset’s version history. A destination you select is never versioned: each run adds its selection to it.

Classification fills each class up to its quota, then tops the remaining budget up from the assets left over in other classes. When the band matches fewer assets than Count in total, everything that matched is kept.

Yes. Random ordering inside a class uses a fixed seed, so the same dataset and the same settings select the same assets.

Object detection scores it zero, which puts it under any Min score above zero. Classification skips it, because no predicted class can be read from it. The same holds for an asset with no annotation at all.

Task offers only classification and object detection. Classification reads one predicted class per image, so multi-label predictions are not supported. With Min score set to 0, object detection also selects assets that carry no box confidences, because they score zero.

Inputs

Source dataset
datasetRequired

Dataset containing assets with prediction annotations. Key: SRC_DATASET.

Destination dataset
dataset

Where the selected assets go. Leave empty to reuse the dataset an earlier run of this node created, or to start a new one. Key: DST_DATASET.

Task
selectDefaults to classificationRequired

Kind of prediction the source annotations carry, which decides how assets are scored and picked. Key: TASK_TYPE.

Options:

  • Classification (classification)
  • Object detection (object_detection)
Conf min
numberDefaults to 0.5Required

Lowest confidence a prediction may have and still be kept. Minimum: 0.0. Maximum: 1.0. Step: 0.05. Visible when TASK_TYPE is classification. Key: CONF_MIN.

Conf max
numberDefaults to 0.8Required

Highest confidence a prediction may have and still be kept. Set it to 1.0 to take everything above Conf min. Minimum: 0.0. Maximum: 1.0. Step: 0.05. Visible when TASK_TYPE is classification. Key: CONF_MAX.

Count
integerDefaults to 2000Required

How many assets to keep at most. Minimum: 1. Step: 1. Visible when TASK_TYPE is classification. Key: COUNT.

Within range
selectDefaults to randomRequired

Which assets to take when more of them fall inside the band than Count allows. Visible when TASK_TYPE is classification. Key: WITHIN_RANGE.

Options:

  • Random (random)
  • Highest confidence (highest)
  • Lowest confidence (lowest)
Balance
selectDefaults to equalRequired

How to split the Count budget across predicted classes. Visible when TASK_TYPE is classification. Key: BALANCE_MODE.

Options:

  • Equal per class (equal)
  • Proportional to candidates (proportional)
  • None (global) (none)
Score aggregation
selectDefaults to maxRequired

How the confidences of an asset’s predicted boxes are reduced to the one score it is ranked by. Visible when TASK_TYPE is object_detection. Key: SCORE_AGGREGATION.

Options:

  • Max (highest box confidence) (max)
  • Mean (average of all boxes) (mean)
  • Min (all boxes must be confident) (min)
Min score
numberDefaults to 0.5Required

Assets scoring below this are dropped even when Top K still has room. Minimum: 0.0. Maximum: 1.0. Step: 0.05. Visible when TASK_TYPE is object_detection. Key: MIN_SCORE.

Top K
integerDefaults to 5000Required

Maximum number of assets to keep (highest-scoring first). Minimum: 1. Step: 1. Visible when TASK_TYPE is object_detection. Key: TOP_K.

Outputs

Filtered Dataset
dataset

Dataset containing the selected assets. Shown as an artifact. Key: FILTERED_DATASET.

Filtered Count
string

Number of assets the last run selected. Shown on the node as a badge. Selecting the badge opens FILTERED_DATASET. Key: FILTERED_COUNT.

JSON config

Machine-readable node interface for automation and advanced usage.

{
"name": "Filter predictions",
"description": "Selects a subset of a dataset from the confidence of its prediction annotations. For classification, keeps the assets whose predicted confidence falls inside a [Conf min, Conf max] band and samples a budget across the predicted classes, e.g. a mid-confidence band of 'hard' images for active learning. For object detection, scores every asset from its box confidences and keeps the highest-scoring ones above a floor, e.g. to select frames for pseudo-label training.",
"category": "Filter",
"namespace": "ovalbee",
"templateKey": "filter/filter_predictions",
"version": "v1",
"inputs": [
{
"key": "SRC_DATASET",
"label": "Source dataset",
"type": "dataset",
"description": "Dataset containing assets with prediction annotations.",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"creatable": false
}
},
{
"key": "DST_DATASET",
"label": "Destination dataset",
"type": "dataset",
"description": "Where the selected assets go. Leave empty to reuse the dataset an earlier run of this node created, or to start a new one.",
"required": false,
"default": null,
"visibleWhen": null
},
{
"key": "TASK_TYPE",
"label": "Task",
"type": "select",
"description": "Kind of prediction the source annotations carry, which decides how assets are scored and picked.",
"required": true,
"default": "classification",
"visibleWhen": null,
"options": {
"options": [
{
"label": "Classification",
"value": "classification"
},
{
"label": "Object detection",
"value": "object_detection"
}
]
}
},
{
"key": "CONF_MIN",
"label": "Conf min",
"type": "number",
"description": "Lowest confidence a prediction may have and still be kept.",
"required": true,
"default": 0.5,
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "classification"
},
"options": {
"min": 0.0,
"max": 1.0,
"step": 0.05
}
},
{
"key": "CONF_MAX",
"label": "Conf max",
"type": "number",
"description": "Highest confidence a prediction may have and still be kept. Set it to 1.0 to take everything above Conf min.",
"required": true,
"default": 0.8,
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "classification"
},
"options": {
"min": 0.0,
"max": 1.0,
"step": 0.05
}
},
{
"key": "COUNT",
"label": "Count",
"type": "number",
"description": "How many assets to keep at most.",
"required": true,
"default": 2000,
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "classification"
},
"options": {
"type": "integer",
"min": 1,
"step": 1
}
},
{
"key": "WITHIN_RANGE",
"label": "Within range",
"type": "select",
"description": "Which assets to take when more of them fall inside the band than Count allows.",
"required": true,
"default": "random",
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "classification"
},
"options": {
"options": [
{
"label": "Random",
"value": "random"
},
{
"label": "Highest confidence",
"value": "highest"
},
{
"label": "Lowest confidence",
"value": "lowest"
}
]
}
},
{
"key": "BALANCE_MODE",
"label": "Balance",
"type": "select",
"description": "How to split the Count budget across predicted classes.",
"required": true,
"default": "equal",
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "classification"
},
"options": {
"options": [
{
"label": "Equal per class",
"value": "equal"
},
{
"label": "Proportional to candidates",
"value": "proportional"
},
{
"label": "None (global)",
"value": "none"
}
]
}
},
{
"key": "SCORE_AGGREGATION",
"label": "Score aggregation",
"type": "select",
"description": "How the confidences of an asset's predicted boxes are reduced to the one score it is ranked by.",
"required": true,
"default": "max",
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "object_detection"
},
"options": {
"options": [
{
"label": "Max (highest box confidence)",
"value": "max"
},
{
"label": "Mean (average of all boxes)",
"value": "mean"
},
{
"label": "Min (all boxes must be confident)",
"value": "min"
}
]
}
},
{
"key": "MIN_SCORE",
"label": "Min score",
"type": "number",
"description": "Assets scoring below this are dropped even when Top K still has room.",
"required": true,
"default": 0.5,
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "object_detection"
},
"options": {
"min": 0.0,
"max": 1.0,
"step": 0.05
}
},
{
"key": "TOP_K",
"label": "Top K",
"type": "number",
"description": "Maximum number of assets to keep (highest-scoring first).",
"required": true,
"default": 5000,
"visibleWhen": {
"key": "TASK_TYPE",
"operator": "equals",
"value": "object_detection"
},
"options": {
"type": "integer",
"min": 1,
"step": 1
}
}
],
"outputs": [
{
"key": "FILTERED_DATASET",
"label": "Filtered Dataset",
"type": "dataset",
"description": "Dataset containing the selected assets.",
"artifact": true,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "FILTERED_COUNT",
"label": "Filtered Count",
"type": "string",
"description": "Number of assets the last run selected.",
"artifact": false,
"badge": true,
"badgeOpens": "FILTERED_DATASET",
"hidden": false
}
]
}