Everything to the Synthetic: Diffusion-driven Test-time Adaptation via Synthetic-Domain Alignment

Jiayi Guo, Junhao Zhao, Chunjiang Ge, Chaoqun Du, Zanlin Ni, Shiji Song, Humphrey Shi, Gao Huang

Abstract

Test-time adaptation (TTA) aims to improve the performance of source-domain pre-trained models on previously unseen, shifted target domains. Traditional TTA methods primarily adapt model weights based on target data streams, making model performance sensitive to the amount and order of target data. The recently proposed diffusion-driven TTA methods mitigate this by adapting model inputs instead of weights, where an unconditional diffusion model, trained on the source domain, transforms target-domain data into a synthetic domain that is expected to approximate the source domain. However, in this paper, we reveal that although the synthetic data in diffusion-driven TTA seems indistinguishable from the source data, it is unaligned with, or even markedly different from the latter for deep networks. To address this issue, we propose a Synthetic-Domain Alignment (SDA) framework. Our key insight is to fine-tune the source model with synthetic data to ensure better alignment. Specifically, we first employ a conditional diffusion model to generate labeled samples, creating a synthetic dataset. Subsequently, we use the aforementioned unconditional diffusion model to add noise to and denoise each sample before fine-tuning. This Mix of Diffusion (MoD) process mitigates the potential domain misalignment between the conditional and unconditional models. Extensive experiments across classifiers, segmenters, and multimodal large language models (MLLMs, e.g., LLaVA) demonstrate that SDA achieves superior domain alignment and consistently outperforms existing diffusion-driven TTA methods.

Introduction

Machine learning models often struggle when encountering "out-of-distribution" data—images affected by noise, blur, or varying lighting conditions not present during training. Test-time adaptation (TTA) is designed to address these shifts dynamically during inference.

Traditional TTA approaches typically update the model's weights using the incoming target data stream. However, this process is often unstable; for instance, if a batch contains a single class, the model may overfit and lose its generalizability. To solve this, researchers introduced diffusion-driven TTA, which keeps model weights fixed and uses a diffusion model to project corrupted target images back toward the source domain.

The Challenge: The Synthetic Gap

Despite the visual quality of diffusion-generated images, this paper identifies a critical "synthetic gap." While a reconstructed image may look identical to a real one to a human observer, deep neural networks perceive a significant domain misalignment between real source data and synthetic data. This misalignment limits the effectiveness of the "cleaned" images when processed by the original source model.

Comparison of TTA approaches: (a) Traditional TTA, (b) Diffusion-driven TTA, and (c) the proposed SDA framework.

Synthetic-Domain Alignment (SDA)

The core philosophy of SDA is to move both the model and the data into a shared synthetic domain, rather than forcing target data back to the original source domain. The framework operates in three distinct phases:

  1. Source-Domain Pretraining: The model is initially trained on standard real-world data.
  2. Source-to-Synthetic Model Adaptation: Since original source data is often unavailable during TTA, the authors introduce a Mix-of-Diffusion (MoD) technique. A conditional diffusion model generates a labeled synthetic dataset, which is then processed by an unconditional diffusion model (adding noise and denoising). This ensures the synthetic training data matches the distribution of the projected target data. The source model is then fine-tuned on this data.
  3. Target-to-Synthetic Data Adaptation: At test time, corrupted target images are projected into the synthetic domain using the same unconditional diffusion process. Because the model was fine-tuned on this specific synthetic distribution, the domain misalignment is eliminated.
Summary of adaptation directions for different TTA frameworks.

Experimental Evaluation

SDA was evaluated across several benchmarks, including ImageNet-C, CIFAR-10-C, and ImageNet-W, using architectures like ResNet-50, Swin Transformer, and ConvNeXt.

  • Performance Gains: On ImageNet-C, SDA improved average accuracy by 2.5% to 2.9% over the primary diffusion-driven baseline (DDA).
  • Scalability: When applied to the multimodal LLaVA 1.5-7b model, SDA achieved a 2.4% accuracy improvement on corrupted images.
  • Robustness: In data stream sensitivity tests (UniTTA), SDA maintained a high accuracy of 31.6%, whereas traditional TTA methods often failed completely under extreme class imbalances.

Conclusion

SDA addresses the hidden domain gap in diffusion-driven TTA by aligning both the model and the data in a shared synthetic space. By shifting the heavy lifting of model adaptation to an offline phase, SDA provides a more stable and robust solution for real-world domain shifts. Future work will focus on reducing the computational overhead of diffusion processes at test time to enable real-time applications.

Summary updated

BibTeX
@inproceedings{guo2025everything,
  author = {Jiayi Guo and Junhao Zhao and Chunjiang Ge and Chaoqun Du and Zanlin Ni and Shiji Song and Humphrey Shi and Gao Huang},
  title = {{Everything to the Synthetic: Diffusion-driven Test-time Adaptation via Synthetic-Domain Alignment}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.02840},
}
Figure