Diffusion Features to Bridge Domain Gap for Semantic Segmentation

Yuxiang Ji, Boyong He, Chenyuan Qu, Zhuoyue Tan, Chuan Qin, Liaoni Wu · OpenReview

Abstract

Pre-trained diffusion models have demonstrated remarkable proficiency in synthesizing images across a wide range of scenarios with customizable prompts, indicating their effective capacity to capture universal features. Motivated by this, our study delves into the utilization of the implicit knowledge embedded within diffusion models to address challenges in cross-domain semantic segmentation. This paper investigates the approach that leverages the sampling and fusion techniques to harness the features of diffusion models efficiently. Contrary to the simplistic migration applications characterized by prior research, our finding reveals that the multi-step diffusion process inherent in the diffusion model manifests more robust semantic features. We propose DIffusion Feature Fusion (DIFF) as a backbone use for extracting and integrating effective semantic representations through the diffusion process. By leveraging the strength of text-to-image generation capability, we introduce a new training framework designed to implicitly learn posterior knowledge from it. Through rigorous evaluation in the contexts of domain generalization semantic segmentation, we establish that our methodology surpasses preceding approaches in mitigating discrepancies across distinct domains and attains the state-of-the-art (SOTA) benchmark. Within the synthetic-to-real (syn-to-real) context, our method significantly outperforms ResNet-based and transformer-based backbone methods, achieving an average improvement of $3.84\%$ mIoU across various datasets.

Introduction

Deep learning models for semantic segmentation are notoriously "brittle." When trained on synthetic data (e.g., GTA V), they often fail in real-world scenarios due to the Domain Gap—discrepancies in lighting, weather, or architecture. While standard backbones like ResNet or ViT capture visual patterns, they often struggle to disentangle "content" (e.g., identifying a car) from "style" (e.g., it is raining or dark). This research leverages the "world knowledge" of pre-trained text-to-image diffusion models, which have been trained on billions of diverse images, to provide a more universal semantic understanding that bridges these domain gaps.

Methodology

The proposed framework introduces two core innovations: the DIffusion Feature Fusion (DIFF) module and Implicit Posterior Knowledge Learning (IPKL).

DIFF Module

Unlike previous methods that might use a single denoising step, DIFF extracts features across the entire diffusion trajectory. It captures intermediate features and cross-attention maps from multiple layers and timesteps of a frozen Stable Diffusion U-Net. These multi-scale representations are then fused using a convolutional block to create a robust semantic signature that is less sensitive to domain shifts.

IPKL Training Framework

To handle the lack of text prompts during inference, the authors employ a dual-stream distillation strategy during training:

  • Conditional Branch: Uses ground-truth masks to generate text prompts (e.g., "a photo of a road, car, and sky"), guiding the model with "perfect" text-aligned features.
  • Unconditional Branch: Operates without text guidance, mimicking real-world deployment.
  • Consistency Loss: Forces the unconditional branch to match the conditional branch's output, effectively distilling text-guided knowledge into the image-only pipeline.
The overall framework of the proposed method, illustrating the DIFF module and the IPKL training strategy.

Experimental Results

The methodology was evaluated in a Domain Generalization (DG) setting, training on synthetic datasets (GTAV, Synthia) and testing on diverse real-world datasets including Cityscapes (CS), BDD-100K, Mapillary Vistas (MV), and adverse weather datasets like ACDC and Dark Zurich (DZ).

As shown in the quantitative results, the proposed method achieves state-of-the-art performance across all benchmarks. Notably, on the challenging Dark Zurich (night-time) dataset, it improved mIoU by 11.69% over previous leaders. Ablation studies further confirmed that the IPKL framework significantly boosts performance, increasing mIoU from 49.72% to 58.01% on the GTAV-to-Cityscapes task.

Comparison of the proposed method against state-of-the-art domain generalization methods across multiple datasets.

Conclusion

By tapping into the internal representations of diffusion models, DIFF provides a robust solution to the domain gap in semantic segmentation. While the computational cost of multi-timestep feature extraction is higher than traditional backbones, the gains in generalization—especially in adverse conditions—are significant. Future work will focus on optimizing the sampling process to reduce latency while maintaining high-quality semantic features.

Summary updated

BibTeX
@inproceedings{ji2025diffusion,
  author = {Yuxiang Ji and Boyong He and Chenyuan Qu and Zhuoyue Tan and Chuan Qin and Liaoni Wu},
  title = {{Diffusion Features to Bridge Domain Gap for Semantic Segmentation}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=i2ycvJ7c0W},
}
Figure