Abstract
The rise of deep neural networks has led to several breakthroughs for semantic segmentation. In spite of this, a model trained on a source domain often fails to work properly in new challenging domains, a problem directly concerned with the generalization capability of the model. In this paper, we present a novel memory-guided domain generalization method for semantic segmentation based on a meta-learning framework. Specifically, our method abstracts the conceptual knowledge of semantic classes into categorical memory which is constant beyond the domains. Upon the meta-learning concept, we repeatedly train memory-guided networks and simulate virtual tests to 1) learn how to memorize domain-agnostic and distinct information of classes and 2) offer an externally settled memory as a class-guidance to reduce the ambiguity of representation in the test data of arbitrary unseen domains. To this end, we also propose memory divergence and feature cohesion losses, which encourage learning memory reading and update processes for category-aware domain generalization. Extensive experiments for semantic segmentation demonstrate the superior generalization capability of our method over state-of-the-art works on various benchmarks.
The Challenge of Domain Shift
Deep learning models for semantic segmentation—the task of labeling every pixel in an image—are notoriously "brittle." A model trained on sunny, clean streets in Germany (Cityscapes) often fails significantly when deployed in a rainy night in New York or a dusty road in India. This performance drop is known as domain shift.
While Unsupervised Domain Adaptation (UDA) helps by tuning a model to a specific target environment using unlabeled data, it is often impractical to collect data for every possible city or weather condition. This research focuses on Domain Generalization (DG): training a model so robustly on source data that it can generalize to any arbitrary, unseen domain without further training. The core challenge is teaching the model to distinguish between transient "style" (lighting, weather) and invariant "content" (object shapes and categories).
Memory-Guided Meta-Learning
The proposed approach, "Pin the Memory," introduces two primary innovations: a Categorical Memory module and a Meta-Learning framework designed to simulate the challenges of unseen environments during training.
Categorical Memory
Drawing inspiration from human semantic memory, which abstracts the concept of a "car" away from any specific instance, the network maintains an external "memory bank." This bank stores representative feature vectors (prototypes) for every class (e.g., road, car, tree). During inference, the model "reads" from this memory to resolve ambiguities in the input image. This memory acts as an anchor; even if a pixel's features are distorted by heavy rain or shadows, the model can compare them to the "clean" prototypes in memory to make an accurate prediction.
Meta-Learning and Virtual Domain Shifts
To prepare for the unknown, the authors utilize a meta-learning strategy. Training data is split into "meta-train" and "meta-test" sets to create a "virtual domain shift." The model is forced to update its memory on the meta-train set and then prove it can still segment the meta-test set accurately. This "stress-testing" teaches the model how to extract domain-invariant features and ignore stylistic noise.
To support this, two novel losses are introduced:
- Feature Cohesion Loss ($L_{coh}$): Ensures that features of the same class cluster tightly around their corresponding memory prototype.
- Memory Divergence Loss ($L_{div}$): Pushes prototypes of different classes (e.g., "bus" vs. "truck") far apart in the embedding space to prevent category confusion.
Experimental Results
The researchers evaluated the method using a rigorous "Synthetic-to-Real" setup, training on synthetic datasets (GTAV and Synthia) and testing on diverse real-world datasets including Cityscapes (Germany), BDD100K (US), Mapillary Vistas (Global), and IDD (India).
Quantitative Performance
"Pin the Memory" significantly outperformed existing state-of-the-art DG methods across all benchmarks:
- Cityscapes: Achieved 44.51% mIoU, an 11.1% improvement over the baseline.
- BDD100K: Achieved 38.07% mIoU (a 9.0% gain).
- Mapillary: Achieved 42.70% mIoU (a 10.5% gain).
Remarkably, this DG method—which never sees target data during training—performed on par with some UDA methods that require access to target domain images.
Qualitative Robustness
Visual results demonstrate that the model is significantly better at identifying "minor" objects like poles, traffic signs, and pedestrians under challenging conditions such as snow, night, and heavy reflections, where competing models often fail.
Conclusion and Future Work
By mimicking human semantic memory and employing a meta-learning framework, this research provides a robust solution for domain generalization in semantic segmentation. While the model excels at common classes, it still faces challenges with the "long tail" of rare classes (e.g., bicycles or riders) due to inherent data imbalance. Future work may explore "open-set segmentation" to handle classes not encountered during training and further optimize the computational overhead of the memory module.
Summary updated