Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Anomaly Heatmap Visualization

Overlay an anomaly detection model's anomaly map on the image as a heatmap.

Draw the anomaly map of an Anomaly Detection Model (PatchCore or FoundAD) over the image it was computed for, so the parts of the image that depart from what the model learned as normal light up.

How This Block Works

  1. Takes the image and the model's anomaly_map and anomaly_threshold as input

  2. Stretches the map (served at the network's square input resolution) onto the image

  3. Places every map value on a fixed scale anchored to the threshold: t = value / (value + threshold), so zero is transparent, the threshold sits at the middle of the ramp, and the ramp saturates as the evidence grows

  4. Colours the scale with the chosen color_map and blends it over the image at the chosen opacity

The scale depends only on the model's threshold, never on the image, so the same colour means the same evidence on every frame and normal images show their map too. The default ROBOFLOW ramp is the yellow-to-red ramp the Roboflow app draws in its model preview, with transparency that fades out where the evidence is low. The OpenCV ramps (JET, TURBO, INFERNO, VIRIDIS, HOT) are opaque colour maps over the same scale; use opacity to see the image through them.

Pass the model block's anomaly_decision_threshold output so the middle of the ramp marks the block's decision (its threshold and confidence); at the default confidence of 0.5 it equals anomaly_threshold.

Common Use Cases

  • Defect localisation: show an operator where an anomalous part differs from normal

  • Model review: compare what the model reacts to against the labelled defect

  • Reports and alerts: attach the heatmap to a notification or dataset upload

Connecting to Other Blocks

The annotated image can be connected to other visualization blocks (for example the Classification Label Visualization to print the verdict on top), data storage blocks, webhook and notification blocks, or video outputs.

Type identifier

Use the following identifier in step "type" field: roboflow_core/anomaly_heatmap_visualization@v1 to add the block as a step in your workflow.

Properties

Name

Type

Description

Refs

name

str

Enter a unique identifier for this step..

❌

copy_image

bool

Enable this option to create a copy of the input image for visualization, preserving the original. Use this when stacking multiple visualizations..

✅

anomaly_threshold

float

The raw anomaly score that anchors the colour ramp; it maps to the middle of the ramp. Connect the model block's anomaly_decision_threshold output so the ramp follows the block's decision..

✅

color_map

str

Colour ramp for the heatmap. ROBOFLOW is the Roboflow app's yellow-to-red ramp, transparent where the evidence is low; the others are opaque OpenCV colour maps..

✅

opacity

float

Opacity of the heatmap overlay, from 0.0 (invisible) to 1.0 (the ramp's own transparency only)..

✅

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Anomaly Heatmap Visualization in version v1 has.

Input and output bindings
  • input

    • image (image): The image to visualize on..

    • copy_image (boolean): Enable this option to create a copy of the input image for visualization, preserving the original. Use this when stacking multiple visualizations..

    • anomaly_map (numpy_array): The anomaly map from the Anomaly Detection Model block: raw local anomaly evidence at the network input resolution..

    • anomaly_threshold (float): The raw anomaly score that anchors the colour ramp; it maps to the middle of the ramp. Connect the model block's anomaly_decision_threshold output so the ramp follows the block's decision..

    • color_map (string): Colour ramp for the heatmap. ROBOFLOW is the Roboflow app's yellow-to-red ramp, transparent where the evidence is low; the others are opaque OpenCV colour maps..

    • opacity (float_zero_to_one): Opacity of the heatmap overlay, from 0.0 (invisible) to 1.0 (the ramp's own transparency only)..

  • output

    • image (image): Image in workflows.

Example JSON definition

Last updated

Was this helpful?