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

TTA-FedDG: Leveraging Test-Time Adaptation to Address Federated Domain Generalization

Haoyuan Liang, Xinyu Zhang, Shilei Cao, Guowen Li, Juepeng Zheng

Abstract

Federated Domain Generalization (FedDG) aims to develop global models that generalize to unseen client domains without accessing their private data. Traditional approaches focus on training-time robustness, which often fails under significant domain shifts. We present TTA-FedDG, a framework that introduces Test-Time Adaptation (TTA) to bridge this gap. By utilizing unlabeled data from new clients during inference, our proposed method, FedSPL, achieves state-of-the-art performance on benchmarks like PACS, Office-Home, and Digit-5.

Introduction

In Federated Learning (FL), the challenge of domain shift arises when a global model is deployed to "unseen" clients with data distributions differing from the training set. While existing FedDG methods attempt to build robust models during training, they often struggle with extreme shifts, such as transitioning from photographic to sketch-based data.

Comparison between Traditional FL and the proposed TTA-FedDG framework, highlighting the use of test data for adaptation.

TTA-FedDG redefines this problem by treating test data as a valuable resource for adaptation. Instead of relying on a static global model, we propose using the unlabeled data encountered during inference to adapt the model on the fly, effectively narrowing the domain gap that training-time methods cannot fully address.

Methodology: The FedSPL Framework

The core of our approach is FedSPL (Federated domain generalization based on select Strong Pseudo Label), which consists of two phases: a robust training phase and an adaptive testing phase.

1. Training Phase: Feature Mixing based on Feature Reordering (FMR)

To prepare the global model for adaptation, we enhance its initial robustness using FMR. Unlike standard methods that only match mean and variance, FMR employs a ranking-based approach to match all-order statistics. This creates diverse local models, providing a superior starting point for subsequent test-time adaptation.

2. Testing Phase: Model Based on Strong Pseudo-Labels (MBSL)

Upon reaching an unseen client, the model undergoes adaptation using a teacher-student architecture.

The FedSPL architecture, featuring FMR during training and the MBSL adaptation loop during testing with pseudo-label selection.

Key components include:

  • Confidence Separation Score (CSS): We identify "Strong" vs. "Weak" pseudo-labels by measuring the gap between the top two prediction probabilities, offering a more reliable metric than simple confidence.
  • Curriculum Learning: The student model is trained sequentially, using Cross-Entropy loss for Strong labels and consistency loss for Weak labels.
  • Contrastive Learning (CL): To maintain general feature knowledge, we use PCA to isolate and normalize principal features, focusing the model on structural elements like contours rather than style-specific noise.

Experimental Results

We evaluated FedSPL on three major benchmarks: PACS, Office-Home, and Digit-5, using a "leave-one-domain-out" protocol. FedSPL achieved state-of-the-art (SOTA) results across the board:

  • PACS: Achieved an average accuracy of 88.77%, significantly beating the previous SOTA (ATP at 85.04%).
  • Office-Home: Reached 67.03% average accuracy, outperforming other TTA methods like Tent (65.92%).
  • Digit-5: Showed a massive jump to 87.76% average accuracy, compared to 82.65% for the next best method.

Notably, the adaptation process is highly efficient, typically converging within 2 to 3 iterations, making it suitable for real-world deployment on edge devices.

Conclusion

TTA-FedDG demonstrates that test-time adaptation is a critical missing link in achieving robust Federated Domain Generalization. By combining all-order feature matching during training with a sophisticated pseudo-label selection mechanism during testing, FedSPL sets a new standard for performance across diverse and challenging domains. Future work will explore the framework's scalability to non-image data and even more extreme domain shifts.

Summary updated

BibTeX
@inproceedings{liang2025tta,
  author = {Haoyuan Liang and Xinyu Zhang and Shilei Cao and Guowen Li and Juepeng Zheng},
  title = {{TTA-FedDG: Leveraging Test-Time Adaptation to Address Federated Domain Generalization}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i18.34053},
}
Figure