Abstract
Federated Learning (FL) is a decentralized approach where multiple clients collaboratively train a shared global model without sharing their raw data. Despite its effectiveness, conventional FL faces scalability challenges due to excessive computational and communication demands placed on a single central server as the number of participating devices grows. Hierarchical Federated Learning (HFL) addresses these issues by distributing model aggregation tasks across intermediate nodes (stations), thereby enhancing system scalability and robustness against single points of failure. However, HFL still suffers from a critical yet often overlooked limitation: domain shift, where data distributions vary significantly across different clients and stations, reducing model performance on unseen target domains. While Federated Domain Generalization (FedDG) methods have emerged to improve robustness to domain shifts, their integration into HFL frameworks remains largely unexplored. In this paper, we formally introduce Hierarchical Federated Domain Generalization (HFedDG), a novel scenario designed to investigate domain shift within hierarchical architectures. Specifically, we propose HFedATM, a hierarchical aggregation method that first aligns the convolutional filters of models from different stations through Filter-wise Optimal Transport Alignment and subsequently merges aligned models using a Shrinkage-aware Regularized Mean Aggregation. Our extensive experimental evaluations demonstrate that HFedATM significantly boosts the performance of existing FedDG baselines across multiple datasets and maintains computational and communication efficiency. Moreover, theoretical analyses indicate that HFedATM achieves tighter generalization error bounds compared to standard hierarchical averaging, resulting in faster convergence and stable training behavior.
Introduction
Federated Learning (FL) has revolutionized decentralized machine learning by enabling model training without direct access to raw user data. However, the traditional "hub-and-spoke" architecture, where a single central server manages thousands of clients, often leads to severe communication bottlenecks and scalability issues. Hierarchical Federated Learning (HFL) offers a solution by introducing intermediate "stations" to manage local clusters of clients.
While HFL improves scalability, it introduces a significant challenge: domain shift. In real-world scenarios, data distributions vary significantly across different geographical or organizational clusters. Simply averaging models from stations with diverse data (e.g., photos vs. sketches) often results in a global model that generalizes poorly to unseen domains. To address this, we introduce HFedATM (Hierarchical Federated Optimal Transport and Regularized Mean Aggregation), a framework designed to achieve robust domain generalization in hierarchical settings.
The HFedATM Framework
HFedATM addresses the "blurry model" problem by ensuring that model components are semantically and statistically aligned before aggregation.
Filter-wise Optimal Transport (FOT) Alignment
In standard FL, weight averaging assumes that filters at the same index in different models perform the same function. However, in practice, "Filter #1" in one model might detect vertical edges, while in another, it detects color blobs. HFedATM uses Optimal Transport to find the optimal permutation to align these filters semantically across stations. This process even supports models with different kernel sizes through bilinear interpolation, ensuring that the fundamental visual features learned by each station are preserved during merging.
Shrinkage-aware RegMean Aggregation
For linear layers, simple arithmetic averaging fails to capture the activation geometry of the features. HFedATM employs RegMean, where stations share Gram matrices that capture feature correlations. The server then solves a closed-form optimization problem to minimize merging error. A shrinkage parameter ($\alpha$) is added to ensure numerical stability, particularly when dealing with rank-deficient matrices.
Experimental Evaluation
The effectiveness of HFedATM was validated across four major benchmarks: PACS, Office-Home, TerraInc, and Amazon Reviews, using architectures ranging from ResNet-18 to transformer-based models like RoBERTa.
Key Results
HFedATM consistently improved the performance of standard FL baselines (FedAvg, FedProx) and existing FedDG methods (FedSR). On average, the method provided a 2% to 5% accuracy boost on unseen target domains. Importantly, this performance gain comes with minimal cost; the Sinkhorn algorithm used for alignment is highly efficient, keeping the total training latency overhead under 10%.
Theoretical and Privacy Considerations
Theoretical analysis (Theorem 1) confirms that HFedATM provides tighter generalization error bounds than standard hierarchical averaging by reducing divergence between station models.
From a privacy perspective, HFedATM remains strictly data-free. Only model weights and Gram matrices are exchanged. We provide a mathematical proof (Theorem 3) that because these Gram matrices are typically rank-deficient, they cannot be inverted to reconstruct original client data. The framework also maintains stability when integrated with Differential Privacy (DP) mechanisms, showing minimal performance degradation under strict privacy budgets.
Conclusion
HFedATM introduces a novel approach to Hierarchical Federated Domain Generalization by combining semantic filter alignment with correlation-aware aggregation. By addressing the structural and statistical challenges of HFL, it enables the training of highly generalizable models at scale. Future research will explore extending these techniques to heterogeneous model architectures, further increasing the flexibility of hierarchical federated systems.
Summary updated