---
title: 'FedEHR-Gen: Federated Synthetic EHR Generation'
url: https://www.emergentmind.com/topics/fedehr-gen
type: topic
---

# FedEHR-Gen: Federated Synthetic EHR Generation

Searching arXiv for the cited FedEHR-Gen and closely related federated EHR papers.
FedEHR-Gen is a federated framework for generating synthetic time-series electronic health records across multiple hospitals without pooling raw patient data. It is presented as the first federated framework for synthetic time-series EHR generation across distributed hospitals, and it is organized as a two-stage learning paradigm: a federated autoencoding stage that aligns local latent spaces, followed by a federated temporal conditional variational autoencoder trained in that aligned latent space [2605.27892]. The framework is motivated by a specific failure mode of direct federated generative modeling on EHR: high dimensionality, sparsity, temporal dependence, and severe cross-hospital heterogeneity make naïve parameter averaging unstable or divergent [2605.27892].

## 1. Conceptual scope and historical placement

FedEHR-Gen belongs to the line of work that treats federated learning as the natural collaboration mechanism for healthcare data, since hospitals keep data locally and exchange only model updates or model parameters rather than raw records. Earlier work on heterogeneous EHR federation showed that universal text-based patient representations can make cross-system predictive federated learning feasible, but remained purely discriminative rather than generative [2211.07300]. Similarly, federated BEHRT-style masked language modeling demonstrated that federated pretraining of diagnosis-sequence encoders can approach centralized performance, yet it still targeted representation learning and next-visit prediction rather than synthetic patient generation [2305.13052].

Within explicitly generative work, an early federated GAN study showed that binary tabular ICU diagnosis data could be synthesized across simulated silos with little degradation relative to centralized training, but it relied on similarly structured data and a sequential weight-handoff procedure rather than the latent-alignment and heterogeneity-aware design used by FedEHR-Gen [2109.02543]. Other adjacent approaches are complementary rather than equivalent. HealthGen addressed conditional generation of longitudinal ICU EHRs with explicit missingness modeling, but it was centralized rather than federated [2201.08186]. Federated Timeline Synthesis proposed a different federated generative route in which each institution trains its own autoregressive transformer and the server trains a Global Generator on synthetic trajectories sampled from local generators, again without using FedAvg-style aggregation [2506.23358]. This suggests that FedEHR-Gen should be understood as one member of a broader class of federated EHR generators, distinguished by latent-space alignment and distribution-aware temporal aggregation rather than by autoregressive distillation or tabular GAN training.

A common misconception is that all federated EHR work addresses generation once it uses tokenized or textual patient records. That is not the case. Several closely related frameworks for heterogeneous EHR federation, client selection, and privacy-preserving tabular prediction explicitly do not include a generative component [2404.13318], [2406.15962]. FedEHR-Gen is defined precisely by its aim to generate synthetic time-series EHR sequences rather than merely to learn predictive representations or discriminative risk models [2605.27892].

## 2. Problem formulation and design rationale

The motivating data regime is high-dimensional multi-hot time-series EHR. For hospital \(k\), the local dataset is written as
$$
\mathbf{X}^{(k)} \in \{0,1\}^{N_k \times T \times D},
$$
where each observation \(\mathbf{x}^{(k)}_{n,t} \in \{0,1\}^D\) is sparse and high-dimensional [2605.27892]. The paper argues that direct federated temporal generation in this raw space fails because hospitals differ in patient mix, workflow, coding practice, and measurement frequency, while the representation itself is extremely sparse and each timestamp is encoded as a large binary vector [2605.27892].

FedEHR-Gen therefore decomposes the problem into two coupled subproblems. First, it learns a compact latent representation of sparse EHR observations. Second, it models temporal dynamics in that latent space rather than in raw feature space. This decomposition is not merely computational. The paper further argues that latent coordinates learned independently at different hospitals are not semantically aligned, so ordinary averaging can corrupt the encoder even when local encoders are functionally similar up to latent-unit permutations [2605.27892].

The two stages are thus conceptually distinct. Stage 1 solves a representation-alignment problem; Stage 2 solves a heterogeneity-aware temporal generation problem. The architecture does not directly federate a temporal generator over raw EHR features, and it replaces naïve parameter averaging with two specialized aggregation mechanisms: layer-wise matching for encoders and distribution-aware weighting for temporal generators [2605.27892].

## 3. Stage 1: federated binary autoencoder and latent-space alignment

Each hospital trains a local binary autoencoder with encoder \(f_{\phi^{(k)}}\) and decoder \(g_{\theta^{(k)}}\):
$$
\mathbf{z}^{(k)}_{n,t} = f_{\phi^{(k)}}\!\left(\mathbf{x}^{(k)}_{n,t}\right)\in\mathbb{R}^{d},
$$
$$
\hat{\mathbf{x}}^{(k)}_{n,t} = g_{\theta^{(k)}}\!\left(\mathbf{z}^{(k)}_{n,t}\right)\in(0,1)^D.
$$
Because the inputs are binary multi-hot vectors, local training minimizes binary cross-entropy reconstruction loss:
$$
\mathcal{L}^{(k)}_{\mathrm{BAE}}(\phi^{(k)},\theta^{(k)}) =
\frac{1}{N_k T}\sum_{n=1}^{N_k}\sum_{t=1}^{T}
\mathrm{BCE}\!\left(\mathbf{x}^{(k)}_{n,t},\hat{\mathbf{x}}^{(k)}_{n,t}\right).
$$
The paper does not introduce extra regularizers for the BAE beyond this reconstruction term [2605.27892].

The central technical issue is permutation invariance of hidden units. If two hospitals learn equivalent encoders up to different neuron orderings, then standard FedAvg produces an average that is generally not a coherent encoder [2605.27892]. FedEHR-Gen addresses this with layer-wise matching aggregation. For encoder layer \(\ell\), hospital \(k\) has weight matrix \(\mathbf{W}^{(k)}_{\ell}\), and the server solves a bipartite matching problem against a reference neuron ordering using a neuron similarity cost and the Hungarian algorithm:
$$
\min_{\{\pi^{(k)}_{i,j}\}}
\sum_i\sum_j \pi^{(k)}_{i,j}\,
c\!\left(\mathbf{w}^{(k)}_{\ell,i}, \tilde{\mathbf{w}}_{\ell,j}\right),
\quad
\sum_j\pi^{(k)}_{i,j}=1,\;
\sum_i\pi^{(k)}_{i,j}=1.
$$
After alignment, the global layer is formed by permutation-aware averaging:
$$
\bar{\mathbf{W}}_{\ell} =
\sum_{k=1}^{K} \alpha_k\, \mathbf{W}^{(k)}_{\ell}\mathbf{\Pi}^{(k)}_{\ell},
\qquad
\alpha_k = \frac{N_k}{\sum_{k'}N_{k'}}.
$$
The resulting aligned global encoder \(f_{\phi^\star}\) defines a shared latent tensor
$$
\mathbf{H}^{(k)} = f_{\phi^\star}\!\left(\mathbf{X}^{(k)}\right)
\in \mathbb{R}^{N_k \times T \times d}.
$$
After broadcast, each hospital replaces its local encoder with the aligned global encoder, applies the corresponding latent permutation to the decoder interface, freezes the encoder, and fine-tunes the local decoder [2605.27892].

This stage is the part of FedEHR-Gen that most directly addresses semantic incompatibility across hospitals. A plausible implication is that it functions as a latent interoperability layer for sparse time-series EHR, analogous in role—but not in mechanism—to the cross-site representation unification pursued by text-linearization frameworks for heterogeneous EHR prediction [2211.07300].

## 4. Stage 2: federated temporal conditional VAE with distribution-aware aggregation

The temporal generator operates on aligned latent trajectories rather than raw EHR vectors. A recurrent hidden state summarizes temporal history:
$$
\mathbf{s}_t = \mathrm{RNN}\!\left(\mathbf{s}_{t-1}, \mathbf{h}_{t-1}, \mathbf{c}\right),
$$
where \(\mathbf{c}\) denotes conditioning variables; the appendix specifies a two-layer LSTM backbone [2605.27892]. Conditioned on \(\mathbf{s}_t\) and \(\mathbf{c}\), the model defines a prior, posterior, and likelihood:
$$
p_{\psi_p}\!\left(z_t \mid s_t, c\right),\quad
q_{\psi_e}\!\left(z_t \mid h_t, s_t, c\right),\quad
p_{\psi_d}\!\left(h_t \mid z_t, s_t, c\right).
$$

At hospital \(k\), local training minimizes a sequential ELBO:
$$
\mathcal{L}^{(k)}_{\mathrm{TCVAE}}
=
\frac{1}{N_k}\sum_{n=1}^{N_k}\sum_{t=1}^{T}
\Bigl[
-\mathbb{E}_{q_{\psi_e}} \log p_{\psi_d}
+
\lambda\,\mathrm{KL}\!\left(q_{\psi_e}\,\|\,p_{\psi_p}\right)
\Bigr],
$$
with the full conditional arguments given in the paper for \(\mathbf{h}^{(k)}_{n,t}\), \(\mathbf{s}^{(k)}_{n,t}\), and \(\mathbf{c}^{(k)}_n\) [2605.27892].

The second specialized aggregation mechanism is distribution-aware aggregation. FedEHR-Gen defines a hospital-specific temporal latent distribution
$$
q^{(k)}_t(\mathbf{z}) =
\frac{1}{N_k}\sum_{n=1}^{N_k}
q_{\psi_e}\!\left(\mathbf{z}\mid \mathbf{h}^{(k)}_{n,\le t}, \mathbf{s}^{(k)}_{n,t}, \mathbf{c}^{(k)}_n\right),
$$
and then computes pairwise divergences
$$
d_{k,j} =
\frac{1}{T}\sum_{t=1}^{T}
\mathrm{KL}\!\left(q^{(k)}_t(\mathbf{z}) \,\|\, q^{(j)}_t(\mathbf{z})\right).
$$
The average divergence \(\bar d_k\) is used to define aggregation weights
$$
\tilde{\alpha}_k =
\frac{\alpha_k \exp(-\tau \bar d_k)}
{\sum_{j=1}^{K}\alpha_j \exp(-\tau \bar d_j)},
$$
and model components are aggregated as
$$
\psi_\bullet^r = \sum_{k=1}^{K}\tilde{\alpha}_k\,\psi_\bullet^{(k)},
\qquad \bullet \in \{e,p,d\}.
$$
This explicitly downweights outlier hospitals whose temporal latent distributions are far from the rest [2605.27892].

After convergence, the global TCVAE recursively samples latent trajectories and each hospital decodes them with its local decoder:
$$
\tilde{\mathbf{x}}^{(k)}_{1:T} =
g_{\theta^{(k)}}\!\left(\tilde{\mathbf{h}}_{1:T}\right).
$$
The temporal generator is therefore global, whereas decoding is local. This division preserves shared temporal structure while allowing hospital-specific observation characteristics to remain local [2605.27892].

## 5. Empirical evaluation and reported findings

Experiments use eICU as the primary multi-hospital benchmark and MIMIC-III mainly for cross-dataset generalization, with preprocessing by FIDDLE into high-dimensional multi-hot binary time-series [2605.27892]. Two tasks are defined: Mortality-48H and ARF-4H. The reported dataset statistics are substantial: for eICU, Mortality-48H has \(N=77{,}066, T=146, D=2{,}382\), and ARF-4H has \(N=138{,}840, T=717, D=5{,}854\); for MIMIC-III, Mortality-48H has \(N=8{,}577, T=96, D=7{,}307\), and ARF-4H has \(N=15{,}873, T=98, D=4{,}045\) [2605.27892]. For eICU, the top 20 hospitals by sample size are used as federated clients, with within-hospital 70/15/15 train/validation/test splits and a pooled global test set [2605.27892].

Evaluation spans three axes. Fidelity is measured by \(R^2\) between real and synthetic feature trajectories and by MMD, supplemented by feature-prevalence plots and UMAP visualizations. Downstream utility is assessed by AUPRC and AUROC for models trained on real, synthetic, or hybrid data, and by SHAP-value correlation with centralized-real models. Privacy risk is evaluated empirically using membership inference risk and nearest-neighbor adversarial accuracy [2605.27892].

The central empirical finding is that FedEHR-Gen consistently improves over a standard federated baseline and approaches centralized performance. On five eICU hospitals for ARF-4H, centralized training reports \(R^2 = 0.768 \pm 0.038\) and MMD \(=0.842 \pm 0.020\), FedAvg gives \(R^2 = 0.672 \pm 0.041\) and MMD \(=0.892 \pm 0.021\), while FedEHR-Gen reaches \(R^2 = 0.721 \pm 0.040\) and MMD \(=0.863 \pm 0.024\) [2605.27892]. For Mortality-48H, centralized training gives \(R^2 = 0.712 \pm 0.029\) and MMD \(=0.886 \pm 0.028\), FedAvg yields \(R^2 = 0.651 \pm 0.043\) and MMD \(=0.921 \pm 0.039\), and FedEHR-Gen reaches \(R^2 = 0.701 \pm 0.031\) and MMD \(=0.848 \pm 0.030\) [2605.27892].

Downstream results show that synthetic-only training is worse than real-only training, but hybrid training consistently improves over both, and the best federated hybrid variant is the one using FedEHR-Gen-generated data. Relative to a FedAvg-based hybrid baseline, AUPRC improves from about 0.15 to 0.17 on ARF-4H and from about 0.34 to 0.41 on Mortality-48H; SHAP-value correlation with centralized-real models is around 0.85 for ARF-4H and around 0.86 for Mortality-48H [2605.27892]. Empirical privacy risk is also lower than under FedAvg: on ARF-4H, MIR/NNAA change from 0.262/0.011 for FedAvg to 0.236/0.008 for FedEHR-Gen, and on Mortality-48H from 0.317/0.013 to 0.251/0.009 [2605.27892].

Ablations indicate that both components matter: removing matching aggregation causes a clear performance drop, and removing distribution-aware aggregation also hurts performance, though less severely. The full model achieves the best AUPRC and AUROC and converges faster than FedAvg and the ablated variants [2605.27892].

## 6. Relation to adjacent methods, limitations, and outlook

FedEHR-Gen addresses synthetic time-series generation directly, but it does not solve every federated EHR problem. It does not provide formal privacy guarantees; privacy is assessed empirically rather than through differential privacy or secure aggregation [2605.27892]. This limitation is consistent with other healthcare FL work in which data locality is the main privacy mechanism and stronger defenses remain future work [2406.15962]. The framework also requires multiple communication rounds, assumes all hospitals participate in every round, and introduces server-side Hungarian matching overhead in Stage 1 [2605.27892].

Another limitation is representational scope. FedEHR-Gen is built for sparse binary time-series EHR after FIDDLE preprocessing, not for free-text notes or fully multimodal structured-unstructured fusion. By contrast, multimodal generative foundation models such as GDP show how structured EHR time series and clinical text can be combined in a single generative architecture, but they are not federated [2508.16054]. A plausible implication is that FedEHR-Gen and GDP occupy complementary positions: the former contributes heterogeneity-aware federated generation for structured time-series, whereas the latter suggests how future federated extensions might incorporate richer modalities.

Finally, FedEHR-Gen should not be conflated with generalized heterogeneous-EHR federation more broadly. Text-linearization frameworks and client-selection methods show that schema heterogeneity can be mitigated for predictive FL without costly standardization [2211.07300], [2404.13318], while federated self-supervised encoders such as BEHRT-style MLM provide a route to cross-site representation learning [2305.13052]. FedEHR-Gen advances a different frontier: stable synthetic time-series EHR generation under severe cross-hospital heterogeneity. Its future directions, as stated by the authors, include improved communication efficiency, stronger privacy mechanisms such as differential privacy, robustness to adversarial clients, and movement from a single global distribution-aware aggregate toward hospital-specific or personalized aggregation [2605.27892].

Source: https://www.emergentmind.com/topics/fedehr-gen