UGainS: Uncertainty Guided Anomaly Instance Segmentation

Alexey Nekrasov, Alexander Hermans, Lars Kuhnert, Bastian Leibe

Introduction

In the field of autonomous driving, identifying out-of-distribution (OoD) objects—anomalies that do not belong to predefined training classes—is a critical safety requirement. Traditional anomaly segmentation methods typically produce per-pixel uncertainty heatmaps. While these maps indicate the presence of something unusual, they lack the structural information necessary for high-level decision-making. For a vehicle to safely navigate around an obstacle, it must perceive the anomaly as a discrete object with defined boundaries, rather than a collection of "weird" pixels.

This paper introduces UGainS (Uncertainty Guided Anomaly Instance Segmentation), a framework designed to bridge the gap between pixel-level anomaly detection and instance-level understanding. By leveraging the zero-shot generalization capabilities of the Segment Anything Model (SAM), UGainS converts fuzzy uncertainty maps into precise, actionable instance masks.

Methodology

The UGainS framework employs a two-branch architecture to process input frames, combining semantic segmentation with specialized instance discovery.

1. OoD Semantic Prediction Branch

The first branch focuses on identifying regions of uncertainty. It utilizes a modified Mask2Former architecture incorporating the "Reject by All" (RbA) approach. This branch predicts masks for known semantic classes (e.g., road, car, sidewalk) while generating a per-pixel uncertainty map for regions that do not align with any known category. This map serves as the foundation for identifying potential anomalies.

2. OoD Instance Prediction Branch

The core innovation of UGainS lies in how it processes the uncertainty map to identify individual objects:

  • Point Sampling: To identify potential object centers, the system applies Farthest Point Sampling (FPS) within regions of high uncertainty.
  • SAM Prompting: These sampled points serve as visual prompts for the Segment Anything Model (SAM). SAM, a foundation model trained on a vast dataset of diverse images, possesses a strong "object prior." It can delineate the boundaries of an object even if it has never encountered that specific object type during training.
  • Refinement and Ensembling: Once SAM generates instance masks, the system calculates an anomaly score for each mask by averaging the underlying pixel-level uncertainty. These instance-level scores are then ensembled back into the pixel-level map, effectively "cleaning" the noise and sharpening the boundaries of the anomaly detection.

Evaluation and Metrics

The authors argue that standard pixel-level Average Precision (pAP) is an insufficient metric for safety-critical applications. pAP is often biased toward large objects close to the sensor, whereas small, distant objects are equally dangerous at high speeds. To address this, the paper emphasizes instance-level Average Precision (iAP), which treats every anomalous object as a single unit regardless of its size in pixels.

The model was evaluated on several key benchmarks:

  • Fishyscapes Lost and Found (FS L&F): A benchmark specifically designed for road anomalies.
  • RoadAnomaly: A dataset featuring diverse and unexpected objects on roads.
  • Qualitative Benchmarks: Testing on CODA and SegmentMeIfYouCan demonstrated the model's robustness in complex, real-world edge cases.

Results

UGainS achieved new state-of-the-art (SOTA) performance across multiple metrics:

  • Fishyscapes L&F: The model reached a pAP of 80.08%, a significant improvement over the previous RbA-based SOTA of 70.81%.
  • RoadAnomaly: The pAP increased to 88.98% from a baseline of 85.42%.
  • Instance Segmentation: On FS L&F, UGainS achieved an iAP of 29.75%. While numerically lower than pixel-level scores, this represents a substantial leap over traditional connected-component grouping methods, which typically score around 17%, highlighting the difficulty and importance of the instance-level task.

Discussion and Limitations

While UGainS represents a significant step forward, several challenges remain. The computational overhead of the Segment Anything Model is substantial, making real-time execution on embedded vehicle hardware a significant engineering challenge. Furthermore, the system is inherently dependent on the quality of the initial uncertainty map; if the semantic branch fails to detect any uncertainty for a specific object, SAM will never be prompted to segment it.

Future research will focus on optimizing point-proposal strategies and exploring more efficient, lightweight versions of SAM to facilitate deployment in production autonomous systems. Additionally, the authors highlight the need for more comprehensive datasets with exhaustive instance-level annotations for anomalies to further refine benchmarking in this critical safety domain.

Summary updated

BibTeX
@inproceedings{nekrasov2023ugains,
  author = {Alexey Nekrasov and Alexander Hermans and Lars Kuhnert and Bastian Leibe},
  title = {{UGainS: Uncertainty Guided Anomaly Instance Segmentation}},
  booktitle = {DAGM},
  year = {2023},
  doi = {10.1007/978-3-031-54605-1\_4},
}
Figure