Improving Anomaly Segmentation with Multi-Granularity Cross-Domain Alignment

Ji Zhang, Xiao Wu, Zhi-Qi Cheng, Qi He, Wei Li · DOI

Introduction

In the field of autonomous driving, semantic segmentation serves as a foundational component for environmental perception. While modern deep learning models excel at identifying predefined categories such as roads, vehicles, and pedestrians, they often fail when encountering "anomalies"—unexpected objects like fallen debris, stray animals, or construction equipment that were not present in the training set. This inability to handle out-of-distribution (OOD) objects poses a significant safety risk.

To address this, researchers have turned to synthetic data to train models to recognize anomalies. However, this approach introduces a substantial domain gap: models trained on clean, synthetic street scenes struggle to generalize to the messy and diverse conditions of real-world "wild" roads. This paper introduces the Multi-Granularity Cross-Domain Alignment (MGCDA) framework, a novel training strategy designed to bridge this gap by aligning features at both the scene and object levels.

The Challenge of Out-of-Distribution Detection

Existing anomaly segmentation methods typically rely on training with synthetic anomalies—pasting random objects from external datasets (like COCO) onto standard street scenes (like Cityscapes). Despite the utility of this approach, two primary hurdles remain:

  1. Global Domain Disparity: The overall visual characteristics of synthetic datasets often differ significantly from real-world sensor data.
  2. Local Feature Inconsistency: Anomalous objects are inherently diverse. A model might learn to identify a specific synthetic anomaly but fail to recognize a real-world obstacle because the underlying feature representations are not domain-agnostic.

MGCDA tackles these issues by treating anomaly segmentation as a cross-domain alignment problem, ensuring that the model learns robust features that persist across different data sources.

Multi-Granularity Cross-Domain Alignment (MGCDA)

The MGCDA framework is designed as a modular "booster" that can be integrated into various existing segmentation backbones. It operates through two primary mechanisms during the training phase:

1. Multi-source Domain Adversarial Training (MDAT)

At the scene (global) level, MDAT employs a discriminator to identify which synthetic dataset a particular feature map originated from. By training the encoder and decoder to "fool" this discriminator, the framework forces the model to extract features that are invariant to the specific source domain. To maintain training stability and prevent the model from becoming overly biased toward a single synthetic source, the authors implement Dynamic Label Smoothing. This technique adaptively adjusts target labels as the model’s feature distributions shift, ensuring a more balanced and stable adversarial learning process.

2. Cross-domain Anomaly-aware Contrastive Learning (CACL)

At the pixel (local) level, CACL refines the model's ability to distinguish between standard road classes and anomalies. While standard contrastive learning pulls similar features together and pushes dissimilar ones apart, CACL introduces an "anomaly-aware" component. It specifically targets "hard samples"—pixels that the model currently misclassifies or finds ambiguous. By focusing on these difficult boundaries, the model learns a more precise representation of what constitutes an anomaly versus a standard road element, regardless of the domain.

One of the most significant advantages of the MGCDA framework is that these components are only active during training. The final model utilizes parameter-free inference, meaning it achieves superior detection accuracy without any increase in computational overhead or latency during real-time deployment.

Experimental Evaluation

The framework was trained using two synthetic sources: VoidClass (utilizing the "void" category from Cityscapes) and AnomalyMix (superimposing COCO objects onto street scenes). To test its real-world efficacy, the researchers evaluated the model on two rigorous benchmarks:

  • Fishyscapes (FS): Featuring the "Static" track (Pascal VOC objects) and the "LostAndFound" track (real roadway obstacles).
  • RoadAnomaly: A dataset consisting of 60 real-world images from the internet depicting highly unusual obstacles, such as animals and construction machinery.

Results and Impact

MGCDA demonstrated state-of-the-art (SOTA) performance across all major benchmarks, significantly outperforming previous methods like PEBAL.

  • Accuracy Gains: On the Fishyscapes LostAndFound benchmark, the model achieved 60.96% Average Precision (AP), representing a 16.79% improvement over the baseline. On RoadAnomaly, it reached 50.35% AP, a 5% lead over previous SOTA methods.
  • Safety Metrics: The framework significantly reduced the FPR95 (False Positive Rate at 95% True Positive Rate). In a safety-critical context like autonomous driving, a lower FPR95 means fewer "false alarms" that would lead to unnecessary and potentially dangerous emergency braking.

Conclusion

The MGCDA framework proves that multi-granularity alignment is essential for robust anomaly segmentation. By combining scene-level adversarial training with pixel-level contrastive learning, the model successfully bridges the gap between synthetic training environments and the unpredictable real world. While the domain gap remains a persistent challenge in computer vision, the modular and efficient nature of MGCDA provides a scalable path forward for safer autonomous navigation. Future research may explore incorporating unlabeled real-world data into this alignment loop to further enhance the model's resilience to the "open world."

Summary updated

BibTeX
@inproceedings{zhang2023improving,
  author = {Ji Zhang and Xiao Wu and Zhi-Qi Cheng and Qi He and Wei Li},
  title = {{Improving Anomaly Segmentation with Multi-Granularity Cross-Domain Alignment}},
  booktitle = {ACM Multimedia},
  year = {2023},
  url = {https://openreview.net/forum?id=bd6_D6SlJo0},
}
Figure