Introduction
Standard Federated Learning (FL) enables collaborative model training across decentralized clients without sharing raw data. However, conventional FL often assumes that data is labeled and drawn from the same distribution. In many real-world scenarios, such as sensor data from wearables or images from diverse geographical locations, data is unlabeled and subject to significant "domain shift."
This paper introduces Federated Unsupervised Domain Generalization (FUDG). The goal is to train a model on multiple unlabeled decentralized source domains such that it generalizes effectively to a completely unseen target domain at test time. The primary challenge lies in distinguishing domain-invariant features from domain-specific "noise" without the guidance of labels.
The FedGaLA Framework
To address FUDG, the authors propose FedGaLA (Federated Global and Local Alignment of gradients). The method leverages gradient geometry to filter out features that do not generalize across domains.
FedGaLA operates at two distinct levels:
- Local Gradient Alignment (Client Side): During local training via Self-Supervised Learning (e.g., SimCLR), clients evaluate the cosine similarity between each batch gradient and a "reference gradient" derived from the global model's trajectory. Gradients that fall below a threshold $\tau$ are discarded, preventing the model from over-optimizing on local, non-generalizable shortcuts.
- Global Gradient Alignment (Server Side): During aggregation, the server applies a soft-weighting mechanism. Updates from clients that align more closely with the collective global direction receive higher weights, ensuring the global model reflects a cross-domain consensus.
Theoretical Foundation
A key contribution of this work is the theoretical link established between gradient alignment and domain similarity. The authors demonstrate that gradient covariance serves as a reliable proxy for the shift between domains.
As shown in the figure above, there is a clear correlation: as the mutual information between domains decreases (indicating a larger domain shift), the covariance of their gradients also tends to decrease. This provides a formal justification for using gradient alignment as a mechanism for domain generalization.
Experimental Results
FedGaLA was evaluated on four major benchmarks: PACS, OfficeHome, TerraInc, and DomainNet, using a "leave-one-domain-out" protocol.
- Performance: FedGaLA consistently outperformed state-of-the-art baselines like FedSimCLR and FedMoCo. On the PACS dataset, it achieved an average accuracy of 60.0%, surpassing the best baseline by 1.4%.
- Ablation Studies: Experiments confirmed that both local and global alignment are critical. Removing either component led to a significant drop in generalization performance on unseen domains.
- Regularization Effect: Interestingly, FedGaLA often outperformed centralized unsupervised domain generalization methods, suggesting that the decentralized nature of FL, when combined with gradient alignment, acts as a powerful regularizer against single-domain overfitting.
Limitations and Future Directions
While effective, FedGaLA introduces some trade-offs. The local alignment threshold $\tau$ is a sensitive hyperparameter that requires careful tuning. Additionally, calculating cosine similarities for every batch gradient increases the local computational burden. Future work may explore extending these dual-level alignment principles to supervised settings or optimizing the computational efficiency of the alignment process.
Summary updated