BIION-D Docs

Anomaly Detection

Detect anomalies in images using an AI model — produces a heatmap and prediction score.

The Anomaly Detection module runs an anomaly detection model on an input image. It produces an anomaly heatmap and a prediction score that is used to classify the image as compliant, uncertain or defected.

Anomaly Detection module in the action plan editor

Configuration

Field Type Description
model_id string The ID of the anomaly detection model (from the Models page)
image_name string The data registry key of the input image (e.g., Camera_0.frame)
min_threshold float Score below this value ⇒ Good (compliant). Default: 0.4
max_threshold float Score above this value ⇒ Defected. Default: 0.5
is_pretrained boolean If true, always runs inference regardless of execution mode. If false, skips inference in acquisition mode (images are collected for training only)

Behavior

In Inference mode (or when is_pretrained = true):

  1. Reads the input image from the data registry.
  2. Runs the anomaly detection model.
  3. Produces an anomaly_map (heatmap) and a pred_score.
  4. Updates the pipeline compliance based on thresholds.

In Acquisition mode (when is_pretrained = false):

  1. Reads the input image from the data registry.
  2. Skips inference — the image is saved to the dataset for training purposes.

Compliance Logic

Anomaly Detection result

Condition Compliance Label
pred_score < min_threshold 0 Good
min_threshold ≤ pred_score < max_threshold 1 Uncertain
pred_score ≥ max_threshold 2 Defected

Inputs & Outputs

Direction Key Type Description
Input <image_name> (e.g., Camera_0.frame) image The image to analyze
Output <module_id>.anomaly_map image Heatmap highlighting anomalous regions
Output <module_id>.pred_score float Anomaly prediction score

Additional data stored in the registry:

Key Description
<module_id>.input Reference to the input image key
<module_id>.pred_label Numeric compliance label (0, 1 or 2)

This module requires an image produced by a camera module in a previous block. The image_name field must reference a valid output key from an earlier block.

When Is pretrained is disabled in Acquisition mode, the image is stored for training and the displayed prediction values are placeholders rather than an inference result.