Federated Learning with Domain Generalization

Liling Zhang, Xinyu Lei, Yichun Shi, Hongyu Huang, Chao ChenarXiv 2021

Abstract

Federated Learning (FL) faces significant challenges when deployed to "unseen" domains with varying data distributions. This paper introduces FedADG (Federated Adversarial Domain Generalization), a framework designed to improve model robustness against domain shift while preserving strict privacy. By employing an adaptive adversarial learning approach, FedADG aligns client features to a dynamically learned reference distribution rather than a fixed one, facilitating better generalization to novel environments without the need for sharing sensitive raw data or frequency spectra.

Introduction

While standard Federated Learning (FL) excels at training models on decentralized data, it frequently encounters performance degradation due to "Domain Shift"—the variation in data distributions across different clients. For instance, medical imaging data from different hospitals may vary due to equipment or lighting, forming distinct domains. While a model might perform well on the clients it was trained with, it often fails when deployed to a new, "unseen" client.

Existing Domain Generalization (DG) methods typically require a central server to access all data simultaneously, violating the core privacy principles of FL. Previous attempts to bridge FL and DG have often relied on sharing sensitive information, such as image frequency components. FedADG addresses these limitations by achieving high generalization performance through model parameter synchronization alone.

Methodology

The core of FedADG is the Federated Adversarial Learning (FedALN) architecture. Unlike standard FL which focuses solely on classification, FedADG implements an Adversarial Learning Network on each client to align features across domains.

The FedADG architecture featuring Federated Adversarial Learning (FedALN) with local distribution generators and discriminators.

Key Components:

  • Adaptive Reference Distribution: Rather than forcing features to match a rigid, pre-defined distribution (like a standard Gaussian), FedADG learns a reference distribution that adaptively represents the center of all source domains. This reduces data distortion during alignment.
  • Class-Wise Alignment: To maintain discriminative power, alignment is performed independently for each class using one-hot label vectors. This ensures that while features become domain-invariant, they remain distinct between categories (e.g., distinguishing a "cat" from a "dog").
  • Random Projection (RP) Layer: A layer prepended to the discriminator stabilizes training and reduces computational load by lowering feature dimensionality.
  • Adversarial Loss: The framework utilizes a least-squares adversarial loss to ensure convergence, combined with a standard cross-entropy classification loss employing label smoothing to prevent overfitting.

Key Insights and Ideas

A primary innovation of FedADG is the shift from fixed to adaptive alignment. The authors demonstrate that forcing features into a rigid distribution can actually discard useful semantic information. By allowing the reference distribution to evolve as the "center" of all client distributions, the model preserves more discriminative features.

t-SNE visualization comparing (a) a fixed reference distribution versus (b) the proposed adaptive reference distribution, demonstrating improved feature discriminability.

As shown in the t-SNE visualizations above, the adaptive approach (b) results in much tighter, more distinct clusters compared to the fixed approach (a), which leaves the features "less discriminative." This class-wise granularity ensures that the universal features learned are highly effective for classification in novel domains.

Experimental Results

FedADG was evaluated on three standard benchmarks—VLCS, PACS, and Office-Home—using a "leave-one-domain-out" strategy. The results consistently show that FedADG outperforms both standard FL and existing FL-DG methods:

  • VLCS Dataset: Using an AlexNet backbone, FedADG achieved an average accuracy of 75.09%, a massive leap from the 54.79% achieved by standard FedAvg.
  • PACS Dataset: With a ResNet18 backbone, FedADG reached 82.25% accuracy, significantly outperforming the previous state-of-the-art federated method, FedDG (71.89%).
  • Competitive Performance: Remarkably, FedADG’s performance is comparable to top-tier centralized DG methods, despite the constraints of decentralized training and privacy protection.

Conclusion and Future Work

FedADG provides a robust solution for deploying FL models in the real world where data distributions are unpredictable. By aligning features to an adaptive reference distribution, it achieves superior generalization without compromising user privacy.

However, the authors note that adversarial training increases local computational requirements and communication overhead due to the synchronization of ALN parameters. Future research will focus on "Open-Set" scenarios—where unseen domains may contain entirely new classes—and optimizing the balance between training time and domain alignment efficiency.

Summary updated

BibTeX
@misc{zhang2021federated,
  author = {Liling Zhang and Xinyu Lei and Yichun Shi and Hongyu Huang and Chao Chen},
  title = {{Federated Learning with Domain Generalization}},
  year = {2021},
  eprint = {2111.10487},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.10487},
}
Figure