Synthetic Anomaly Generation and Detection for Safeguarding a Multimodal Perception Model in Autonomous Mobile Systems

Autonomous vehicles and mobile robots plan their path on the area a segmentation model marks as drivable. An unfamiliar object on the road, such as an animal or a tree stump, can still end up inside this area. I added an anomaly detection module to an existing segmentation model that fuses a camera with LiDAR or radar, and built a synthetic anomaly generation pipeline that creates the multimodal test data to evaluate the detector.

Predicted drivable area

Segmentation output for a scene with a generated inflatable pool: the green drivable area still covers part of the pool.

Detector · camera

Camera branch of the detector: the most unusual patches are outlined on the pool.

Detector · LiDAR

LiDAR branch of the detector: the most unusual points are outlined on the pool.

Detector · radar

Radar branch of the detector: the most unusual returns are outlined on the pool.
A generated inflatable pool in a real scene. The segmentation model still marks part of it as drivable (green). In the detector images, colour shows the distance to normal features, and outlines mark the most unusual patches and points, which lie on the pool. Radar is from the camera + radar setup.
Result
Dual-Bank PatchCore separated generated obstacles from control scenes with an AUROC of 0.991 (camera + LiDAR, 1.0 is perfect). With radar it reached 0.914, but the control scenes also stood out there, so this result is less conclusive.
Main finding
Where the detector attaches mattered more than how it scores. Detectors working on each sensor’s features before fusion caught every failed LiDAR or radar and kept separating obstacles in dense camera fog. Detectors on the fused features did neither reliably.

01 · Problem

An obstacle can stay inside the drivable area

A drivable-area segmentation model decides for every pixel whether it is drivable, and path planning builds on that result. Such models are reliable for scenes like those they were trained on. An unfamiliar object can still end up inside the predicted drivable area, which then looks free to drive on.

Original scene

Original road scene with an empty lane. Saved prediction for the original scene: green marks the predicted drivable area.

Same scene with generated obstacle

The same road with a generated inflatable pool in the lane. Saved prediction for the edited scene: the predicted drivable area still covers part of the pool.
The segmentation model still marks part of the pool as drivable.

What was missing

A multimodal safeguard for the drivable area

An object left inside the drivable area is a direct collision risk, so the segmentation model needs an additional safeguard that detects anomalies there. Because the segmentation model is multimodal, the safeguard has to be multimodal too. Existing detectors limited to the drivable area use only the camera, and multimodal ones do not limit detection to it.

→ 02 Approach

Test data with obstacles in every sensor

Public anomaly datasets are mostly camera-only, the multimodal AnoVox (Bogdoll et al., 2024) is fully simulated, and real road obstacles are rare and costly to record.

→ 03 Test data

02 · Approach

Compare each sensor with learned normal data

Inside the segmentation model, each sensor first passes through its own encoder, which turns the raw data into features. A fusion module merges these features, and a decoder outputs the predicted drivable area.

The anomaly detection module attaches to the segmentation model without changing it, and there are three points where a detector can attach. To tell their effect apart from that of the scoring method, I implemented three scoring methods before fusion (Dual) and after fusion (Fused): PatchCore (distance to stored normal features), Mahalanobis (distance to a distribution fitted to normal features) and Patch Autoencoder (error when reconstructing the features). Output entropy, the uncertainty of the segmentation output, is the seventh detector.

Three places where a detector can attach to the segmentation model. The separate encoder features before fusion feed Dual-Bank PatchCore, Dual Mahalanobis and Dual Patch Autoencoder. The fused features entering the decoder feed the three Fused variants. The output probabilities feed output entropy. Thresholding the probabilities yields the predicted drivable area.
Three places to attach a detector.

My detector: Dual-Bank PatchCore

  1. 1

    Only score the predicted drivable area

    Following JSR-Net (Vojíř et al., 2021), the detector only considers the predicted drivable area. Its appearance varies little, so its normal state can be learned. Objects outside it are already recognised by the segmentation model. Radar is the exception and keeps all returns, since the road reflects little radar.

  2. 2

    Score by distance to normal examples

    PatchCore (Roth et al., 2022) comes from industrial inspection of camera images. I carried it over to driving scenes and several sensors: a memory bank stores features of normal drivable area, and a new scene is scored by its distance to them. No labelled anomalies are needed.

  3. 3

    One memory bank per sensor

    The camera and the LiDAR or radar features each get their own bank, taken from the encoders before fusion. A reliability-weighted maximum combines both scores and shifts weight away from the camera in fog.

Dual-Bank PatchCore. Camera features and LiDAR or radar features from the segmentation model each run in their own lane. The predicted drivable area keeps only the drivable area in both lanes, while radar keeps all returns. Each lane compares its features with its own memory bank of normal features and turns the distance into a z-score. A reliability-weighted maximum, which lowers the camera weight in fog, merges both into the anomaly score.
Two sensor branches, one anomaly score. Grey boxes come from the segmentation model, blue boxes belong to Dual-Bank PatchCore.

03 · Test data

Generated obstacles in real scenes

Testing the detector needs unfamiliar obstacles that appear consistently in camera, LiDAR and radar data. Instead of simulating whole scenes, my pipeline edits real ones and generates only the inserted object.

  1. Real camera image of a road with tanker trucks.

    1. Start from a real scene

    A real camera image with its LiDAR and radar point clouds.

  2. The same image with a generated wild boar on the road.

    2. Insert an obstacle into the image

    From a text prompt, Gemini 3.1 Flash Image adds an unfamiliar object to the road.

  3. Object mask of the inserted boar.

    3. Locate the change

    DINOv2 feature differences find the edited region, and SAM refines it into a mask.

  4. Estimated depth map of the edited scene.

    4. Estimate depth

    Depth Anything V2 estimates the object’s depth, calibrated against the real LiDAR points.

  5. The boar transferred into the LiDAR point cloud, shown projected onto the image.

    5. Transfer into LiDAR

    Mask pixels become 3D points matched to the scan’s density and intensity. Real points hidden behind the object are removed.

  6. The boar transferred into the radar point cloud, shown projected onto the image.

    6. Transfer into radar

    The object as sparser radar points. Hidden real returns are removed.

From a real scene to a multimodal test case. Steps 5 and 6 use the same mask and depth to place the object in the LiDAR or the radar point cloud.

Why a control mode is needed

The image generator can shift colours and textures across the whole image, so a detector could flag edited scenes without noticing the obstacle. Control scenes, an idea from Fishyscapes (Blum et al., 2021), go through the same editing but only duplicate an object already in the scene. The main test compares obstacles with controls.

Obstacle mode

Obstacle mode: a generated wild boar on the road, outlined by a box.

Control mode

Control mode: a copy of one of the tanker trucks placed further ahead in the lane, outlined by a box.
Same scene, same editing, different content. An unfamiliar boar versus a copy of a tanker truck already in the scene (boxed).

04 · Evaluation and results

Detectors attached before fusion keep each sensor visible

Example: a tree trunk across the lane

Scene

Original: the road before the tree trunk is inserted.

Original

With obstacle: the same road with a tree trunk across the lane.

With obstacle

Camera

Original: camera branch response before insertion.

Originalz = −1.16

With obstacle: camera branch response, the most unusual patches lie on the trunk.

With obstaclez = +20.08

LiDAR

Original: LiDAR branch response before insertion.

Originalz = +0.20

With obstacle: LiDAR branch response, the most unusual points lie on the trunk.

With obstaclez = +12.89

Radar

Original: radar branch response before insertion.

Originalz = +0.43

With obstacle: radar branch response, the most unusual returns lie on the trunk.

With obstaclez = +71.72

Without the trunk, the most unusual patches and points are scattered. With it, they shift to the trunk. z: branch score in standard deviations from normal scenes. Radar is from the camera + radar setup, and its high z partly reflects the injected points themselves.

Three tests

All seven detectors ran with camera + LiDAR and with camera + radar on two datasets, the public Zenseact Open Dataset (ZOD) and an internal dataset. All images and values on this page come from ZOD.

  • Generated obstacles: 95 obstacle scenes (96 with radar) against 100 control scenes
  • Sensor failure: the camera, LiDAR or radar input replaced by zeros, 100 scenes each
  • Camera fog: synthetic fog on the camera image

Every result below is an AUROC: how reliably a detector’s score ranks one group of scenes above the other. 0.5 is chance, 1.0 is perfect. Values are for camera + LiDAR unless radar is named.

All seven detectors

Higher is better, except control vs. original, where close to 0.5 means the editing alone goes unnoticed.

AUROC of all seven detectors for camera + LiDAR and camera + radar, grouped by attachment point
Detector Camera + LiDAR Camera + radar
Obstacle vs. control Control vs. original LiDAR failure Obstacle vs. control Control vs. original Radar failure
Every detector catches a camera failure (1.000). An obstacle counts if at least 10 % of it lies in the predicted drivable area.

Sensor failure

Before fusion, LiDAR or radar has its own branch, whose score rises sharply when the sensor fails. After fusion, the camera dominates the features and partly masks the 3D contribution, so the failure is hard to detect.

Obstacles with radar

Before fusion, control vs. original is clearly higher with radar than with LiDAR (table above). The radar branch scores all returns, so it also reacts to injected or duplicated radar points, and generated radar points stay recognisable. Radar obstacle results are therefore less conclusive.

In camera fog, Dual-Bank PatchCore still separates obstacles from controls

AUROC for obstacles vs. controls with camera + LiDAR

Illustrative camera scene at synthetic fog intensity 0.5.
Only the camera image is degraded, with the Albumentations RandomFog augmentation. The LiDAR point clouds pass through unchanged. The curves are measured over all test scenes, not on this one image.

Camera fog

At fog level 0.2, the camera bank alone drops from 0.998 to 0.611, while the LiDAR bank stays at 0.949. The reliability-weighted maximum then relies more on LiDAR, so Dual-Bank PatchCore keeps 0.942. Detectors on fused features lose separation early, although LiDAR still supports the segmentation in fog.

Other scoring methods

Dual Mahalanobis and Dual Patch Autoencoder, attached at the same point, also catch every LiDAR failure and recover in dense fog. The advantage therefore comes from attaching before fusion, not from PatchCore alone. Only Dual-Bank PatchCore stays above 0.9 at every fog level, the other two drop to 0.578 and 0.691 in light fog.

Limits. Obstacles and sensor failures were synthetic, and scores were evaluated per scene, not per pixel. Tests with real multimodal anomaly data and more realistic radar points are the next steps.