Detecting the Unexpected via Image Resynthesis

Krzysztof Lis, Krishna K. Nakka, Pascal Fua, Mathieu SalzmannICCV 2019

Abstract: Classical semantic segmentation methods, including the recent deep learning ones, assume that all classes observed at test time have been seen during training. In this paper, we tackle the more realistic scenario where unexpected objects of unknown classes can appear at test time. The main trends in this area either leverage the notion of prediction uncertainty to flag the regions with low confidence as unknown, or rely on autoencoders and highlight poorly-decoded regions. Having observed that, in both cases, the detected regions typically do not correspond to unexpected objects, in this paper, we introduce a drastically different strategy: It relies on the intuition that the network will produce spurious labels in regions depicting unexpected objects. Therefore, resynthesizing the image from the resulting semantic map will yield significant appearance differences with respect to the input image. In other words, we translate the problem of detecting unknown classes to one of identifying poorly-resynthesized image regions. We show that this outperforms both uncertainty- and autoencoder-based methods.

Introduction: The Closed-Set Problem

Most semantic segmentation models—the AI systems responsible for labeling every pixel in an image as "road," "car," or "tree"—operate under a "closed-set" assumption. They are designed to categorize pixels into a predefined set of classes encountered during training. However, in real-world applications like autonomous driving, vehicles inevitably encounter "unknown unknowns": a goose crossing the road, a lost sofa, or unusual construction equipment.

When faced with these unexpected objects, traditional models do not signal their confusion; instead, they confidently assign incorrect labels from their known vocabulary. Existing attempts to solve this usually rely on measuring prediction uncertainty or using autoencoders to find poorly reconstructed pixels. Unfortunately, these methods often produce false alarms by getting distracted by complex backgrounds or low-quality reconstructions across the entire image.

Methodology: Detect-by-Resynthesis

This paper proposes a novel "detect-by-resynthesis" approach. The core intuition is that if a segmentation network encounters an unknown object (like a goose) but labels it as a known class (like "road"), a generative model tasked with re-drawing the scene based on those labels will produce a patch of asphalt where the goose should be. This creates a visible discrepancy between the original input and the resynthesized image.

The authors implement this via a three-step pipeline:

  1. Semantic Segmentation: A standard network (e.g., PSPNet) generates a label map from the input image.
  2. Image Resynthesis: A generative adversarial network (GAN), specifically pix2pixHD, attempts to reconstruct the original image using only the predicted label map.
  3. Discrepancy Detection: A specialized "discrepancy network" compares the original image with the resynthesized one to identify meaningful differences.
The proposed pipeline: (a) Input image, (b) Predicted semantic labels, (c) Resynthesized image, and (d) Final detected differences.

To train the discrepancy network without requiring exhaustive examples of every possible unknown object, the authors simulate anomalies by randomly swapping labels of known objects during training. This teaches the network to ignore minor synthesis artifacts and focus on significant texture and shape mismatches.

Experimental Results

The resynthesis approach significantly outperforms traditional uncertainty and autoencoder methods across multiple datasets, including Cityscapes, Lost and Found, and a new Road Anomaly dataset. On the Lost and Found benchmark, the method achieved an AUROC (Area Under the ROC Curve) of 0.82, a substantial improvement over the 0.74 achieved by the best autoencoder baseline.

Qualitative comparison: The proposed method accurately isolates the unexpected object (the goose), whereas uncertainty-based and autoencoder methods are either overly noisy or fail to detect the object entirely.

Qualitatively, the method is far more precise. While uncertainty-based methods often flag distant trees or building edges as "uncertain," the resynthesis approach remains focused on the actual unexpected obstacles on the road. Furthermore, the method proves effective at detecting adversarial attacks. Because an attacked image's labels will not match its actual appearance, the resynthesis process exposes the manipulation by producing a wildly different image.

Conclusion and Future Work

By turning the failure of segmentation models into a visual signal, this research provides a robust way to detect the unexpected. While the system currently faces challenges with false positives—where unique but known objects might be flagged due to synthesis limitations—it represents a major step forward for autonomous safety. Future work will focus on reducing these distractions in complex driving scenarios and optimizing the computational efficiency of the GAN-based pipeline.

Summary updated

BibTeX
@inproceedings{lis2019detecting,
  author = {Krzysztof Lis and Krishna K. Nakka and Pascal Fua and Mathieu Salzmann},
  title = {{Detecting the Unexpected via Image Resynthesis}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  url = {https://openreview.net/forum?id=BCgZ-RiHjg5},
}
Figure