Style transfer with diffusion models for synthetic-to-real domain adaptation

Estelle Chigot, Dennis G. Wilson, Meriem Ghrib, Thomas OberlinCVIU 2025

Abstract

Bridging the domain gap between synthetic training data and real-world environments is a critical challenge for semantic segmentation. This paper presents CACTI and CACTIF, diffusion-based style transfer methods that leverage class-aware normalization and selective attention filtering. By preserving semantic structure while transferring realistic textures, these methods significantly enhance model performance in adverse conditions like fog and night, even in few-shot scenarios.

Introduction

Deep learning models for semantic segmentation require vast amounts of labeled data. While synthetic data from game engines like GTA5 offers an abundant source of ground-truth labels, models trained exclusively on such data often struggle when deployed in the real world. This "sim-to-real" domain gap arises from differences in lighting, texture, and weather conditions.

Traditional domain adaptation techniques often face three major hurdles:

  1. Global Style Transfer Artifacts: Methods that apply uniform transformations across an entire image often cause "color bleeding," where characteristics of one semantic class (e.g., the blue of the sky) leak into another (e.g., the gray of the road).
  2. Structural Inconsistency: Powerful generative models can be "too creative," altering the underlying geometry of a scene and rendering original synthetic labels inaccurate.
  3. Data Requirements: Many state-of-the-art methods require large target datasets, undermining the benefit of using synthetic data.

Methodology

The authors propose a pipeline based on Stable Diffusion and Denoising Diffusion Probabilistic Model (DDPM) inversion to transform synthetic images into realistic counterparts while strictly maintaining semantic integrity.

DDPM Inversion and Class-wise AdaIN

The first stage involves DDPM Inversion, which maps the synthetic "content" image and a real "style" image into a latent noise space. To ensure semantically appropriate style transfer, the authors introduce CACTI (Class-wise Adaptive Instance Normalization and Cross-Attention). Unlike standard AdaIN, which aligns global feature statistics, CACTI calculates mean and variance statistics independently for each semantic class. For instance, only "road" pixels from the style image are used to normalize "road" pixels in the content image, preventing unrealistic color shifts.

Overview of the DDPM Inversion and Class-wise AdaIN components.

CACTIF: Selective Attention Filtering

To further refine the process, the authors developed CACTIF, which adds a Filtered Cross-Attention mechanism. Standard cross-attention can sometimes produce noisy correspondences, leading to structural hallucinations. CACTIF evaluates the cosine similarity between feature vectors of the synthetic content and the real style. If the correspondence is weak, the system selectively retains the original content features. This ensures that the model "knows when to stop" and sticks to the original structure when a suitable style match cannot be found.

The CACTIF architecture featuring filtered cross-attention and class-wise AdaIN.

Experimental Evaluation

The method was tested using GTA5 as the source domain and two challenging target datasets: Cityscapes (urban driving in good weather) and ACDC (adverse conditions including fog, night, rain, and snow). Notably, the authors focused on a few-shot setting, assuming access to only a single representative style image for each target condition.

Results and Discussion

The researchers evaluated the approach using both image quality metrics and downstream segmentation performance (mIoU):

  • Image Quality: CACTI achieved a Fréchet Inception Distance (FID) of 54.56, outperforming standard cross-image attention (65.31) and AdaIN diffusion (73.26).
  • Segmentation Accuracy: On the ACDC Fog dataset using the HRDA architecture, CACTI reached 58.24% mIoU, a 5.01% improvement over the baseline.
  • Generalization: Training on CACTIF-generated images improved Segformer performance on Cityscapes by over 4% compared to training on raw synthetic data.

The core insight is that style is class-dependent; a "rainy" effect manifests differently on asphalt than on vegetation. By making the diffusion process class-aware and structurally conservative, the authors effectively bridge the gap for extreme domains like fog and night.

Conclusion

While CACTI and CACTIF represent a significant step forward, challenges remain. Nighttime scenarios continue to be difficult, with the best models reaching only 26.07% mIoU, likely due to the extreme visual disparity between synthetic daytime and real nighttime scenes. Future work may explore integrating explicit structural guidance via ControlNet or utilizing textual prompts to further refine the diffusion process. Despite these hurdles, the proposed semantically-aware diffusion approach provides a robust framework for few-shot domain adaptation in complex real-world environments.

Summary updated

BibTeX
@article{chigot2025style,
  author = {Estelle Chigot and Dennis G. Wilson and Meriem Ghrib and Thomas Oberlin},
  title = {{Style transfer with diffusion models for synthetic-to-real domain adaptation}},
  journal = {Comput. Vis. Image Underst.},
  year = {2025},
}
Figure