TL;DR
DPMFormer introduces a novel framework for Domain Generalized Semantic Segmentation (DGSS) by dynamically adapting Vision-Language Model (VLM) text prompts to match the visual style of the input image. By resolving the semantic misalignment between static text prompts and shifting visual domains, it achieves state-of-the-art segmentation performance on unseen real-world environments.
What Problem Does This Paper Address?
Domain Generalized Semantic Segmentation (DGSS) is the task of training a model on a single source domain (often synthetic data like video games) so that it can accurately segment images across diverse, unseen real-world target domains (e.g., different cities, weather conditions, or times of day).
Recently, researchers have leveraged the rich, pre-trained knowledge of Vision-Language Models (VLMs) like CLIP to improve generalization. However, existing methods typically rely on fixed context prompts (such as a hardcoded template like "a photo of a [class]" or a single learnable text embedding optimized only on the source domain).
The authors point out a major flaw here: semantic misalignment. If a model is trained on sunny, daytime synthetic images, a fixed prompt fails to capture the reality of a rainy night scene in the real world. The visual context changes drastically, but the text prompt remains rigid, leading to degraded performance on target domains.
Methods
To solve this, the authors propose the Domain-aware Prompt-driven Masked Transformer (DPMFormer), built on top of the popular Mask2Former architecture. It introduces three core components:
- Texture Perturbation: During training, the source images are augmented using content-preserving photometric transformations (strong color jitter, Gaussian blur, and noise) to simulate diverse, novel domain styles.
- Domain-aware Context Prompt Learning: Instead of using static prompts, an auxiliary network extracts global domain-specific properties from a frozen CLIP visual backbone. These properties are dynamically added to the text embeddings, generating prompts tailored to the input image's specific environment (e.g., adjusting the text feature of a "car" to account for night-time reflections).
- Domain-aware Contrastive Loss ($\mathcal{L}_{contra}$): This loss function trains the auxiliary network by ensuring that prompts generated from similar domains are pulled closer together in the embedding space, while prompts from different domains are pushed apart.
- Domain-robust Consistency Learning ($\mathcal{L}_{cons}$): To ensure stability against severe domain shifts, a consistency loss enforces that both class and mask predictions remain identical between the original image and its texture-perturbed counterpart. Crucially, this is applied at every single layer of the transformer decoder to prevent early-stage errors from propagating.
Datasets
The framework was validated using standard DGSS benchmarks:
- Synthetic Source Datasets: GTAV and SYNTHIA.
- Real-World Target Datasets: Cityscapes, BDD100K (which includes day, dawn, and night scenes), and Mapillary Vistas.
- Real-to-Real Evaluation: Cityscapes was also used as a source domain to evaluate generalization to BDD100K and Mapillary.
Key Insights and Ideas
- Dynamic Text is Better Than Static Vision: Traditional domain generalization focuses almost entirely on making visual features robust. DPMFormer flips the script by showing that adapting the linguistic side of a VLM to match the visual domain shift is highly effective.
- Contrastive Prompt Space: Applying contrastive learning directly to the generated text prompts ensures the model captures broad domain-level styles (like weather or lighting) rather than overfitting to instance-specific object details.
- Layer-wise Decoder Defense: Implementing consistency regularization across all layers of the transformer decoder prevents domain-induced noise from compounding as features move deeper through the network.
Key Results
DPMFormer established a new state-of-the-art (SOTA) across multiple benchmarks:
- Synthetic-to-Real (GTAV Source): Using a CLIP ViT-B backbone, DPMFormer achieved an average mIoU of 58.14% across Cityscapes, BDD100K, and Mapillary, outperforming the previous best method (TQDM) by 3.17%.
- Robustness to Extreme Environments: On the highly diverse BDD100K dataset, DPMFormer significantly boosted performance, particularly in challenging dawn and night settings where fixed-prompt models fail.
The model even demonstrated remarkable robustness when evaluated on completely out-of-distribution artistic styles (such as Pop Art and Cubism) generated via ChatGPT, proving that its prompt adaptation generalizes far beyond standard driving conditions.
Limitations and Future Work
The primary limitation acknowledged by the authors is the reliance on global representations for prompt generation. In complex scenes, local textures can vary wildly from the global average (for example, a road illuminated by bright headlights contrasted against a pitch-black night sky).
The authors suggest that future work should explore exploiting local texture patterns for more granular, detailed prompt generation. Additionally, exploring open-set domain adaptation to handle unshared label spaces between source and target datasets remains a promising direction.
Summary updated