---
title: 'HFedATM: Hierarchical Federated Domain Generalization'
url: https://www.emergentmind.com/topics/hfedatm
type: topic
---

# HFedATM: Hierarchical Federated Domain Generalization

Searching arXiv for HFedATM and closely related papers to ground the article.
arXiv search: query="HFedATM Hierarchical Federated Domain Generalization via Optimal Transport and Regularized Mean Aggregation"
HFedATM, short for **Hierarchical Federated Domain Generalization via Optimal Transport and Regularized Mean Aggregation**, is a hierarchical, data-free aggregation method for domain generalization in hierarchical federated learning (HFL). It was introduced together with the formal problem setting of **Hierarchical Federated Domain Generalization (HFedDG)**, in which multiple stations aggregate client models locally and a server subsequently merges station models under domain shift, with the target being robust performance on an unseen domain. HFedATM operates specifically at the **station-to-server aggregation layer**: it aligns convolutional filters across station models through **Filter-wise Optimal Transport (FOT) Alignment**, then merges aligned models with **Shrinkage-aware Regularized Mean (RegMean) Aggregation** so that cross-station averaging is semantics-aware for convolutional layers and activation-geometry-aware for linear layers [2508.05135].

## 1. HFedDG setting and the problem HFedATM addresses

In standard federated learning, a single central server aggregates client updates. HFL introduces an intermediate layer of **stations**, yielding a three-tier structure
$$
\text{server} \rightarrow \text{stations} \rightarrow \text{clients}.
$$
This architecture is intended to improve scalability, bandwidth efficiency, and robustness. HFedATM is defined for this hierarchical regime rather than for conventional single-server federated learning [2508.05135].

The motivating difficulty is **domain shift**. In HFedDG, different clients and stations observe different source-domain distributions, while deployment is evaluated on an unseen target-domain distribution. The formalization uses \(E=\{1,\dots,N_E\}\) for stations, \(C_e=\{1,\dots,N_e\}\) for clients under station \(e\), and client datasets
$$
S_{e,i}=\{(x_{e,i}^{(j)},y_{e,i}^{(j)})\}_{j=1}^{n_{e,i}\sim P_{XY}^{e,i}},
$$
with an unseen target distribution \(P_{XY}^\star\) satisfying \(P_{XY}^\star \neq P_{XY}^{e,i}\) for all \((e,i)\). The objective is to learn a hypothesis \(h\) minimizing unseen-domain risk,
$$
D_{\mathrm{target}}(h)=\mathbb{E}_{(x,y)\sim P^\star_{XY}}[\ell(h(x),y)].
$$
Stations do not access raw client data; they aggregate only client models [2508.05135].

The paper’s generalization analysis identifies two residual error sources once local client-side learning has already attempted to produce domain-robust models: **intra-station** and **inter-station** distribution mismatch. These are summarized by station-level inner divergence \(\eta_e\), station-level breadth \(\omega_e\), server-level inner divergence \(\eta\), and server-level breadth \(\omega\). The hierarchical target-risk bound contains these terms explicitly, which is the principal theoretical motivation for a station-server merger that is more structure-aware than plain hierarchical averaging. In that sense, HFedATM is not a replacement for client-side FedDG training; it is a response to the claim that a substantial remaining performance gap arises from **how station models are merged at the server** [2508.05135].

## 2. Placement in the hierarchical training pipeline

HFedATM is a **station-to-server aggregation rule** compatible with multiple client-side methods, including **FedAvg**, **FedProx**, **FedSR**, and **FedIIR**. The full pipeline begins with server broadcast of the previous global model \(h^{(r-1)}\) to all stations. Within each station, over \(N\) station rounds, an active client subset \(\hat C_e\) is selected, each client trains locally for \(E\) epochs, and client parameters \(\theta_{e,i}\) are uploaded to the station [2508.05135].

At the **last forward pass of the final local epoch**, clients additionally collect dense-layer activation statistics. For each linear layer \(l\), client \((e,i)\) forms
$$
G_{e,i}^{(l)} = X_{e,i}^{(l)\top} X_{e,i}^{(l)},
$$
where \(X_{e,i}^{(l)}\in\mathbb R^{d\times m}\) is the activation matrix for a mini-batch. The station averages client Grams,
$$
G_e^{(l)} = \frac{1}{|\mathcal S_e|}\sum_{i\in\mathcal S_e} G_{e,i}^{(l)},
$$
and applies diagonal shrinkage,
$$
\widehat G_e^{(l)} = \alpha G_e^{(l)} + (1-\alpha)\operatorname{diag}(G_e^{(l)}), \qquad 0\le \alpha \le 1,
$$
with default \(\alpha=0.75\). Each station then sends to the server both the station model \(h_e\) and the shrunk Gram matrices \(\widehat G_e^{(l)}\) [2508.05135].

The server chooses **station 1 as the reference**. It first performs FOT Alignment for every convolutional layer across stations. After alignment, **convolutional layers** are merged by weighted arithmetic mean, whereas **linear layers** are merged via RegMean in closed form. The merged model \(h_{\mathrm{ATM}}^{(r)}\) is then broadcast back to all stations [2508.05135].

This design is important because HFedATM leaves local optimization untouched and modifies only the hierarchical merging mechanism. The method is therefore best understood as a top-level model-merging rule for HFL rather than as a full end-to-end replacement for federated training.

## 3. Filter-wise Optimal Transport Alignment

The first core component addresses a structural weakness of naive parameter averaging in convolutional networks: **permutation symmetry of filters**. Filter index \(a\) in one station model need not correspond semantically to filter index \(a\) in another station model. Index-wise averaging can therefore blend unrelated features and degrade the merged representation. HFedATM handles this by solving a one-to-one filter matching problem before cross-station convolutional averaging [2508.05135].

For station \(e\) and convolutional layer \(l\), the filter bank is written as
$$
W_e^{(l)} \in \mathbb R^{k\times c_{\text{in}}\times n\times n}.
$$
Each filter is flattened and \(\ell_2\)-normalized,
$$
\widetilde w_e^{(l)}[a] =
\frac{\mathrm{vec}(W_e^{(l)}[a])}
{\|\mathrm{vec}(W_e^{(l)}[a])\|_2},
\qquad a=1,\dots,k.
$$
For stations \(e\) and \(e'\), the squared Euclidean cost matrix is
$$
D_{e,e'}^{(l)}(a,b)=
\left\|
\widetilde w_e^{(l)}[a]-\widetilde w_{e'}^{(l)}[b]
\right\|_2^2.
$$
Using station \(1\) as reference, HFedATM solves
$$
\Pi_{1,e}^{(l)}=
\arg\min_{\Pi\in\mathcal U}\langle \Pi,D_{1,e}^{(l)}\rangle,
$$
over the Birkhoff polytope
$$
\mathcal U=\{\Pi \mid \Pi\mathbf 1=\mathbf 1,\ \Pi^\top\mathbf 1=\mathbf 1,\ \Pi\ge 0\}.
$$
The paper states that this discrete OT assignment problem is solved approximately by **entropic Sinkhorn** [2508.05135].

The resulting transport plan acts as an alignment permutation:
$$
W_e^{(l)} \leftarrow \Pi_{1,e}^{(l)} W_e^{(l)}.
$$
If filter sizes differ, they are resized to the reference size \(n_1\),
$$
W_e^{(l)}[a] \leftarrow \operatorname{resize}(W_e^{(l)}[a], n_1).
$$
FOT is therefore applied **before any cross-station convolutional averaging**, and its purpose is to create a common semantic channel order across station models [2508.05135].

The paper also proves a permutation-invariance lemma for the OT cost,
$$
D_{\mathrm{OT}}(PW_1,PW_2)=D_{\mathrm{OT}}(W_1,W_2),
$$
for any permutation matrix \(P\). This is used to support the interpretation of filter reindexing as semantic alignment rather than an arbitrary transformation. The method is explicitly **data-free** at this stage: no raw inputs or activation tensors are required for filter alignment, and computational cost depends mainly on the number of kernels \(k\), not on dataset size [2508.05135].

## 4. Shrinkage-aware Regularized Mean Aggregation

The second core component addresses linear layers. Even after convolutional filters have been aligned, direct coordinate-wise averaging of dense-layer weights remains problematic because those weights are coupled to the feature covariance geometry induced by each station’s data. HFedATM therefore uses a RegMean merger driven by **activation Gram matrices** rather than by naive tensor averaging [2508.05135].

For a dense layer \(l\), each client records activations \(X_{e,i}^{(l)}\in\mathbb R^{d\times m}\) and computes
$$
G_{e,i}^{(l)} = X_{e,i}^{(l)\top} X_{e,i}^{(l)}.
$$
The paper allows two optional privacy mechanisms before transmission to the station: clients may clip \(\|G_{e,i}^{(l)}\|_2 \le C\), and they may add Gaussian noise for differential privacy. Station-level averaging and shrinkage then yield
$$
G_e^{(l)} = \frac{1}{|\mathcal S_e|}\sum_{i\in \mathcal S_e} G_{e,i}^{(l)},
$$
and
$$
\widehat G_e^{(l)} = \alpha G_e^{(l)} + (1-\alpha)\operatorname{diag}(G_e^{(l)}),
\qquad \alpha=0.75 \text{ by default}.
$$
The shrinkage step is described as stabilizing the covariance estimate and reducing sensitivity to noise and sampling variability [2508.05135].

Given aligned station linear weights \(\widetilde W_e^{(l)}\), the server seeks a merged weight \(W\) minimizing
$$
W_{\mathrm{ATM}}^{(l)}=
\arg\min_W
\sum_{e=1}^{N_E}
\left\|
W^\top X_e^{(l)}-\widetilde W_e^{(l)\top}X_e^{(l)}
\right\|_F^2.
$$
Replacing \(X_e^{(l)\top}X_e^{(l)}\) by \(\widehat G_e^{(l)}\) gives the reported closed-form aggregation rule
$$
W_{\mathrm{ATM}}^{(l)}=
\left(\sum_{e=1}^{N_E}\widehat G_e^{(l)}\right)^{-1}
\left(\sum_{e=1}^{N_E}\widehat G_e^{(l)}\,\widetilde W_e^{(l)}\right).
$$
This is the defining RegMean step in HFedATM [2508.05135].

The contrast between convolutional and linear aggregation is explicit. After FOT, convolutional filters are merged by weighted arithmetic mean,
$$
\overline W^{(l)}[a]=
\frac{\sum_{e=1}^{N_E}\gamma_e W_e^{(l)}[a]}
{\sum_{e=1}^{N_E}\gamma_e},
$$
typically with \(\gamma_e=|\mathcal S_e|\), while dense layers are merged via the RegMean solution above. The final global model therefore combines **FOT-aligned convolutional averaging** with **Gram-weighted linear-layer merging** [2508.05135].

## 5. Theoretical analysis and target-risk contraction

The theoretical treatment extends domain-generalization analysis to the hierarchical setting. The appendix defines the \(\mathcal H\)-divergence as
$$
d_{\mathcal H}(P_X,Q_X)=
2\sup_{h\in \mathcal H}
\left|
\Pr_{P_X}[h(x)=1]-\Pr_{Q_X}[h(x)=1]
\right|,
$$
and assumes bounded or Lipschitz loss together with a Hölder continuity condition,
$$
|\ell(u,y)-\ell(v,y)| \le L\|u-v\|,
$$
and
$$
|\ell(f(u),y)-\ell(f(v),y)| \le L_\gamma \|u-v\|^\gamma,
\qquad \gamma\in(0,1].
$$
A lemma then yields
$$
\bigl|\mathbb E_P[f]-\mathbb E_Q[f]\bigr|
\le \tfrac12 L^\gamma d_{\mathcal H}(P,Q)^\gamma.
$$
These ingredients support the hierarchical target-risk analysis for HFedATM [2508.05135].

The central bound states that if client-level training already achieves
$$
D_{e,i}(h^{(R)}) \le \varepsilon_{\mathrm{local}}
\qquad \forall (e,i),
$$
then the HFedATM output satisfies
$$
\begin{aligned}
D_{\mathrm{target}}\bigl(h_{\mathrm{ATM}}^{(R)}\bigr)\le\;&
\varepsilon_{\mathrm{local}}
+\frac{1}{2}(1-\beta)^R
\left(
\omega^{(0)}+\sum_{e=1}^{N_E}\rho_e^\star \omega_e^{(0)}
\right) \\
&+(1-\beta)^R
\left(
\eta^{(0)}+\sum_{e=1}^{N_E}\rho_e^\star \eta_e^{(0)}
\right) \\
&+\lambda_{\mathcal H}(P_X^\star,P_X^\dagger).
\end{aligned}
$$
The interpretation given in the paper is that HFedATM geometrically contracts divergence and breadth terms over rounds and therefore achieves a tighter bound than plain hierarchical averaging [2508.05135].

That contraction is decomposed into two mechanisms. FOT reduces breadth terms through
$$
\omega^{(r)}=(1-\beta_{\mathrm{FOT}})\omega^{(r-1)},
\qquad
\omega_e^{(r)}=(1-\beta_{\mathrm{FOT}})\omega_e^{(r-1)},
$$
while RegMean reduces divergence terms through
$$
\eta^{(r)}=(1-\alpha)\eta^{(r-1)},
\qquad
\eta_e^{(r)}=(1-\alpha)\eta_e^{(r-1)}.
$$
Combining them with
$$
\beta := 1-(1-\beta_{\mathrm{FOT}})(1-\alpha)
$$
gives
$$
\omega^{(r)}\le (1-\beta)\omega^{(r-1)},
\qquad
\eta^{(r)}\le (1-\beta)\eta^{(r-1)}.
$$
The theoretical message is therefore conditional: HFedATM is most beneficial when client-side training has already made local risks small enough that **hierarchical aggregation itself** becomes the dominant source of remaining generalization error [2508.05135].

## 6. Empirical evaluation and comparative behavior

HFedATM is evaluated on four benchmark families: **PACS**, **Office-Home**, **TerraInc**, and **Amazon Reviews**. The simulated HFL topology uses **10 stations**, **100 clients total**, and **10 clients per station**, with all clients participating each round. Heterogeneity is controlled by \(\lambda\in\{1.0,0.1,0.0\}\), where \(\lambda=1.0\) is relatively IID and \(\lambda=0.0\) is maximally heterogeneous. The main backbones are **LeNet-5** for vision and **RoBERTa-base** for NLP, with additional robustness studies on **ResNet-18**, **VGG-11**, and **DeBERTa-base**. Appendix hyperparameters include local epochs \(E=10\), station rounds per server round \(N=5\), batch size \(32\), total global rounds \(200\), SGD with learning rate \(0.01\) for vision, AdamW with learning rate \(3\times 10^{-5}\) for NLP, cosine scheduler, Sinkhorn regularizer \(\lambda_{\mathrm{OT}}=0.05\), shrinkage \(\alpha=0.75\), and Sinkhorn iterations \(n_{\mathrm{iter}}=25\). Experiments use NVIDIA RTX 3090 GPUs and three random seeds \(\{0,1,2\}\) [2508.05135].

Across all four benchmark families, attaching HFedATM to existing baselines improves unseen-domain accuracy. Representative examples reported in Table 1 include **PACS** with \(\lambda=1.0\), where **FedSR + Avg** gives \(84.1, 80.9, 83.6, 73.4\) and **FedSR + HFedATM** gives \(87.7, 84.4, 86.6, 76.7\); and **Office-Home** with \(\lambda=1.0\), where **FedIIR + Avg** gives \(69.4,57.3,49.7,74.8\) and **FedIIR + HFedATM** gives \(73.5,60.7,53.5,78.7\). For **Amazon Reviews**, the paper states that gains are particularly large and consistent, with **FedIIR + Avg** around \(72\%\) and **FedIIR + HFedATM** around \(81\%-82\%\) [2508.05135].

The paper emphasizes that HFedATM performs best when paired with stronger local DG methods such as **FedSR** and **FedIIR**. This is presented as empirical support for the theory: when initial station models are already reasonably domain-generalizable, station-server aggregation quality becomes especially consequential. The architecture-robustness study reports improvements for all tested backbones; for example, **FedIIR + Avg vs +HFedATM** changes from \(89.7 \to 93.0\) on ResNet-18 PACS, \(78.9 \to 82.2\) on Office-Home, \(53.1 \to 56.9\) on TerraInc, and \(77.9 \to 81.9\) on DeBERTa Amazon Reviews [2508.05135].

Ablation results show that removing either major component lowers accuracy: **w/o FOT** degrades results, **w/o RegMean** also degrades results, and the full method is best. The intended interpretation is that the two mechanisms are complementary: FOT corrects semantic filter mismatch, whereas RegMean corrects feature-correlation mismatch in linear layers [2508.05135].

The overhead is reported as modest. Per-round latency increases by about **\(8\%\)** on PACS, **\(4\%-5\%\)** on Office-Home and TerraInc, and **\(3\%\)** on Amazon Reviews. The paper attributes this to efficient Sinkhorn OT and Gram computation in one final forward pass. Under Gaussian noise added to Gram matrices for \((\varepsilon,\delta)\)-DP, performance remains stable for moderate budgets \((\varepsilon \ge 1)\), usually with **less than \(2\%\)** accuracy drop, and even at \(\varepsilon=0.1\) the degradation is described as graceful [2508.05135].

## 7. Privacy stance, limitations, and relevance beyond the benchmark suite

HFedATM is described as **data-free** because no raw examples are transmitted. That description is exact for FOT, which depends only on weights, but the full method also uses **Gram matrices of activations** for RegMean. The paper argues that these statistics remain relatively privacy-preserving because clients may clip and noise them for DP, and because Gram matrices are many-to-one and not uniquely invertible. The appendix notes that for \(G=X^\top X\), \(X\) cannot be uniquely recovered; if \(\tilde X=XQ\) for orthogonal \(Q\), then \(\tilde X^\top \tilde X = Q^\top G Q\), and repeated eigenvalues or rank deficiency permit infinitely many compatible activations [2508.05135].

The principal limitations are also explicit. HFedATM assumes **homogeneous model architectures** across clients and stations. Its benefits depend on the quality of local client-side training: if client models are highly heterogeneous and not yet domain-generalizable, the gains shrink. Gram sharing introduces some privacy surface even if it is weaker than raw-data sharing. The FOT design aligns all stations to **station 1**; the paper does not deeply investigate multi-reference or barycentric alternatives. These constraints delimit the method’s scope and distinguish it from a fully architecture-agnostic or strictly weights-only merger [2508.05135].

The paper positions HFedATM for large-scale HFL systems with many devices and intermediate edge aggregators, especially in settings with multiple source domains, unseen target domains, and restrictions on raw-data sharing. The intended application categories include **healthcare**, **surveillance**, **mobile systems**, and other multi-tier federated deployments [2508.05135].

A common source of ambiguity is the acronym “HF” itself. In HFedATM, “HF” denotes the **hierarchical federated** setting, not heart failure. Even so, a plausible implication is that the method is germane to privacy-sensitive heart-failure sensing pipelines. A Chinese heart-failure speech study releases **high-level features / Full data by request**, explicitly to preserve patient privacy, and identifies **individual difference** as a major cause of inaccuracy, which suggests a natural motivation for federated or personalized aggregation mechanisms rather than centralized raw-audio pooling [2508.14908]. A further plausible implication is that multimodal wearable heart-failure risk models built from short ECG and sampled long-term HRV could serve as local models inside an HFL stack, since such models already target device heterogeneity, sparse sensing, and privacy-sensitive health data, although that work itself does **not** study federated learning [2403.15408].

Within federated learning research, HFedATM’s distinctive contribution is therefore twofold. It formalizes **HFedDG** as a hierarchical analogue of federated domain generalization, and it proposes a station-server merger that is explicitly designed for the two structural failures of naive hierarchical averaging: permutation mismatch in convolutional filters and incompatible second-order activation structure in dense layers.

Source: https://www.emergentmind.com/topics/hfedatm