Federated Unsupervised Domain Generalization using Global and Local Alignment of Gradients
Farhad Pourpanah, Mahdiyar Molahasani, Milad Soltany, Michael Greenspan, Ali Etemad
TL;DR
This work introduces federated unsupervised domain generalization, a setting where data privacy prohibits sharing raw data across clients. It proposes FedGaLA, a two-level gradient-alignment framework that performs local gradient alignment via self-supervised learning and global gradient alignment during aggregation to improve generalization to unseen domains. The authors establish a theoretical connection between domain shift and gradient covariance and demonstrate empirical gains across PACS, Office-Home, DomainNet, and TerraInc, along with thorough ablations and sensitivity analyses. The approach preserves privacy and is supported by public code, highlighting practical relevance for privacy-preserving distributed learning with domain shifts.
Abstract
We address the problem of federated domain generalization in an unsupervised setting for the first time. We first theoretically establish a connection between domain shift and alignment of gradients in unsupervised federated learning and show that aligning the gradients at both client and server levels can facilitate the generalization of the model to new (target) domains. Building on this insight, we propose a novel method named FedGaLA, which performs gradient alignment at the client level to encourage clients to learn domain-invariant features, as well as global gradient alignment at the server to obtain a more generalized aggregated model. To empirically evaluate our method, we perform various experiments on four commonly used multi-domain datasets, PACS, OfficeHome, DomainNet, and TerraInc. The results demonstrate the effectiveness of our method which outperforms comparable baselines. Ablation and sensitivity studies demonstrate the impact of different components and parameters in our approach. The source code is available at: https://github.com/MahdiyarMM/FedGaLA.
