NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DomainFusion: Generalizing to Unseen Domains with Latent Diffusion Models

Yuyang Huang, Yabo Chen, Yuchen Liu, Xiaopeng Zhang, Wenrui Dai, Hongkai Xiong, Qi Tian

Abstract

Domain Generalization (DG) remains a critical challenge in deep learning, where models must perform accurately on data from domains not seen during training. While recent approaches leverage Latent Diffusion Models (LDMs) for large-scale data augmentation, they often suffer from extreme computational costs and underutilize the semantic knowledge inherent in pre-trained LDMs. We introduce DomainFusion, a framework that treats LDMs as both a data generator and a "knowledge teacher." DomainFusion employs Latent Distillation to extract domain-invariant features and an Online Lightweight Augmentation strategy to generate high-utility training samples on-the-fly. Our method achieves state-of-the-art results on five standard DG benchmarks while requiring 97% fewer generated images than previous diffusion-based methods.

Introduction: The Efficiency Gap in Domain Generalization

Deep learning models frequently struggle with "out-of-distribution" data—situations where the test data looks different from the training data, such as a model trained on photographs failing to recognize sketches. Domain Generalization (DG) aims to bridge this gap. Recent attempts have used LDMs to generate millions of synthetic images to cover diverse domains. However, these methods face two primary hurdles: the massive computational overhead of offline generation and the failure to exploit the LDM's internal latent space for feature learning.

Comparison of DomainFusion with previous offline augmentation methods like DSI and CDGA.

As shown in Figure 1, prior methods like DSI and CDGA rely on expensive offline augmentation. In contrast, DomainFusion extracts knowledge from the latent level and utilizes online lightweight augmentation to achieve superior generalization with significantly lower resource requirements.

Methodology

DomainFusion optimizes the DG training process through two core components: Latent Distillation and Online Lightweight Augmentation.

Latent Distillation (LD)

DomainFusion uses the LDM's denoising process as a supervisory signal. In a process termed Pseudo-Generation, the DG model's confidence in an image determines the level of "corruption" (contrast reduction) applied to it. This corrupted image is then passed to the LDM, which predicts the noise required to restore the image's semantic structure. The difference between the LDM's prediction and the actual noise serves as a Gradient Prior, forcing the DG model to focus on domain-invariant semantic features. The use of contrast reduction as a corruption proxy is key, as it strips away fine details while preserving global structure, forcing the model to rely on high-level semantic understanding.

Online Lightweight Augmentation

Instead of generating a static dataset, DomainFusion generates images dynamically during training. The framework uses a Smart Sampling strategy: for each image, it generates several candidates and evaluates them based on style and content. It selects candidates with the most distinct styles (maximizing KL divergence) but the most consistent content (maximizing cosine similarity and classification confidence). This ensures the model encounters diverse domain shifts without losing the target object's identity.

The DomainFusion framework, illustrating the interaction between the DG network and the LDM through Latent Distillation and Online Lightweight Augmentation.

Experimental Results

We evaluated DomainFusion on five major DG benchmarks: PACS, VLCS, OfficeHome, TerraIncognita, and DomainNet.

Performance and Efficiency

DomainFusion consistently outperformed existing diffusion-based and non-diffusion methods. Notably, on the DomainNet benchmark, DomainFusion achieved higher accuracy than the previous leading method (CDGA) while generating 97% fewer images (120,000 vs. 5 million).

Backbone Versatility

The framework is backbone-agnostic, showing significant improvements across different architectures. For instance, on the OfficeHome benchmark, it boosted the accuracy of a standard ResNet-50 from 73.7% to 83.4%.

Conclusion

DomainFusion redefines the role of Latent Diffusion Models in Domain Generalization. By moving beyond simple image generation and treating LDMs as semantic teachers through Latent Distillation, the framework achieves state-of-the-art performance with unprecedented efficiency. While the use of a U-Net during training introduces some computational overhead and creates a dependency on the quality of pre-trained LDMs, the drastic reduction in required synthetic data makes DomainFusion a highly practical solution for robust model training.

Summary updated

BibTeX
@inproceedings{huang2024domainfusion,
  author = {Yuyang Huang and Yabo Chen and Yuchen Liu and Xiaopeng Zhang and Wenrui Dai and Hongkai Xiong and Qi Tian},
  title = {{DomainFusion: Generalizing to Unseen Domains with Latent Diffusion Models}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72940-9\_27},
}
Figure