- The paper introduces a two-stage federated framework that leverages latent space alignment and distribution-aware aggregation to generate accurate synthetic EHR time-series data.
- It employs a matching aggregation using the Hungarian algorithm to realign encoder neuron semantics and a TCVAE for capturing temporal dynamics across non-IID hospital data.
- Experimental results on eICU and MIMIC-III show enhanced fidelity, improved downstream predictive performance, and scalability while preserving patient privacy.
FedEHR-Gen: Federated Synthetic Time-Series EHR Generation via Latent Space Alignment and Distribution-Aware Aggregation
Introduction and Motivation
The generation of high-fidelity synthetic Electronic Health Record (EHR) time-series (TS-EHR) data is essential for data augmentation and multi-hospital model training, given the stringent privacy constraints that prohibit direct sharing of raw patient records. Current centralized approaches such as MedGAN, TimeGAN, and diffusion models yield effective synthetic EHRs but require data pooling, which is infeasible under real-world privacy regulations. The direct application of federated learning (FL) to EHR generative modeling is fundamentally unstable due to the high dimensionality, structural sparsity, and severe cross-hospital heterogeneity that characterize clinical TS-EHR data.
This paper introduces FedEHR-Gen, a federated generative framework addressing these challenges through a two-stage process: (1) federated latent representation learning with semantic alignment across hospitals and (2) federated temporal generative modeling using a novel distribution-aware aggregation protocol. This approach is specifically architected to handle the non-IID nature and complex data distributions in multi-institutional EHR environments, enabling privacy-preserving synthetic data generation at scale.
Figure 1: Overview of the FedEHR-Gen framework. Stage 1 aligns latent encoders across hospitals; Stage 2 trains a federated temporal generative model on the aligned latent representations.
Methods
Stage 1: Federated Representation Learning with Matching Aggregation
FedEHR-Gen begins with a Federated Binary Autoencoder (FedBAE) deployed separately at each hospital. Each client encodes high-dimensional, sparse multi-hot TS-EHRs into a low-dimensional latent space via an autoencoder architecture. However, without explicit alignment, naive aggregation (e.g., FedAvg) of encoder parameters fails due to permutation invariance: latent unit semantics are not preserved across sites, so aggregated models are semantically incoherent.
To solve this, the server applies layer-wise matching aggregation (MA). Using the Hungarian algorithm, hospitals' encoders are aligned neuron-wise to a canonical reference ordering before averaging parameters. This realigns coordinate semantics, ensuring that every latent dimension corresponds to the same clinical concept across all clients.
Figure 2: Conceptual comparison of aggregation strategies for federated encoders. Matching aggregation achieves semantic alignment; naive averaging produces misaligned latent coordinates.
After aggregation, the aligned global encoder is broadcast to all clients. Each client updates its local decoder for hospital-specific reconstruction while freezing the shared encoder, maintaining both global latent alignment and local adaptive fidelity.
Stage 2: Federated Temporal Generative Modeling with Distribution-Aware Aggregation
On the globally aligned latent space, each hospital locally trains a Temporal Conditional Variational Autoencoder (TCVAE) to model temporal dynamics. The TCVAE employs recurrent neural architecture to capture longitudinal EHR evolution given local latent trajectories. However, cross-hospital distributional heterogeneity renders standard federated averaging (FedAvg) suboptimal for generative modeling.
FedEHR-Gen introduces distribution-aware aggregation (DA), which weights each client's contribution by the similarity of its temporal latent distributions to others (measured via averaged KL divergences across time). Hospitals exhibiting large distributional divergence are accordingly downweighted in aggregation, mitigating negative transfer and stabilizing convergence.
After global aggregation of the TCVAE, the model can generate synthetic latent sequences at each hospital, which are then mapped through the locally fine-tuned decoder for hospital-specific synthetic EHR sampling.
Experimental Evaluation
FedEHR-Gen is extensively evaluated on two public datasets (eICU and MIMIC-III) across multiple predictive tasks: short-term acute respiratory failure (ARF-4H) and in-hospital mortality (Mortality-48H).
Generation Fidelity
FedEHR-Gen demonstrates improved statistical and distributional alignment of synthetic and real data relative to both centralized and federated baselines. Feature-wise prevalence statistics are more closely preserved, especially for rare features, and UMAP visualizations reveal superior coverage and preservation of hospital-specific structure in the latent and data spaces.
Figure 3: Generation fidelity of averaged feature-wise prevalence for five eICU hospitals. FedEHR-Gen provides closer adherence to real data distribution than FedAvg.
Figure 4: UMAP visualization of synthetic vs. real data. FedEHR-Gen better recovers hospital-specific manifolds compared to FedAvg.
Downstream Utility
Synthetic data generated by FedEHR-Gen enable higher predictive performance on downstream classifiers, as quantified by AUPRC and AUROC, than data produced by baseline federated or centralized generators, particularly in hybrid settings (real + synthetic). The SHAP feature attribution analysis indicates that predictive models trained on FedEHR-Gen data recapitulate the feature importances observed in models trained on real data—driving trustworthiness in downstream applications.
Figure 5: Downstream predictive utility (AUPRC) for ARF-4H and Mortality-48H tasks on eICU. Hybrid strategies using FedEHR-Gen enhance performance over baselines.
Figure 6: Pearson correlation of SHAP values between models trained on synthetic data and centralized-real data, reflecting preservation of clinical feature importance.
Privacy and Scalability
Empirical membership inference risk (MIR) and nearest-neighbor adversarial accuracy (NNAA) metrics reveal that FedEHR-Gen reduces privacy leakage compared to naive FL baselines. In scalability analyses, FedEHR-Gen exhibits monotonic gains in downstream performance as the number of participating hospitals increases, outperforming all federated and hybrid baselines across varying federation scales.
Figure 7: Effect of number of hospitals on downstream task AUPRC, demonstrating scalability for ARF-4H.
Cross-Dataset and Ablation Analyses
When trained on eICU and applied to MIMIC-III, FedEHR-Gen-generated synthetic data generalize well, outperforming real-only baselines in target-domain task performance, demonstrating that it captures transferable cross-institutional EHR structure.
Figure 8: Cross-dataset generation utility. FedEHR-Gen synthetic data generated from eICU enhance ARF-4H and Mortality-48H AUPRC on MIMIC-III tasks compared to federated baselines.
Ablation studies confirm that both MA and DA components are essential: removing either significantly degrades generative fidelity and downstream predictive power.
Figure 9: Ablation of FedEHR-Gen components quantifies the contribution of matching aggregation and distribution-aware aggregation to downstream AUPRC.
Comparison with Federated Baselines
Directly federating state-of-the-art centralized EHR generative models (e.g., TimeGAN, EHR-M-GAN, TimeDiff, FlexGen-EHR) via FedAvg results in severe mode-dropping and poor generative quality in federated settings. FedEHR-Gen is shown to outperform all such baselines.
Figure 10: Directly federated centralized generative models (via FedAvg) are outperformed by FedEHR-Gen on downstream AUPRC metrics.
Implications and Future Work
FedEHR-Gen establishes a methodologically robust framework for large-scale, privacy-preserving synthetic longitudinal EHR generation, enabling the creation of high-fidelity, utility-preserving synthetic data in real-world non-IID federated settings. The approach resolves key challenges encountered in direct federated generative modeling by ensuring semantic consistency in representations and by accounting for latent distributional divergence during model aggregation.
Practically, FedEHR-Gen offers significant implications for multi-institutional collaborative research, federated model development, and safe clinical AI benchmarking without direct data exchange. It demonstrates that privacy-aware synthetic data generation is feasible and effective at scale, matching or approaching the fidelity and utility of centralized models while reducing privacy risk.
Theoretically, the results motivate further work on explicit regularization for privacy (e.g., differential privacy integration), communication efficiency optimization, and advanced aggregation mechanisms for even greater non-IID robustness. Extensions could include adaptive aggregation strategies incorporating per-hospital uncertainty estimation, and incorporation of adversarial robustness to malicious or corrupted clients.
Conclusion
FedEHR-Gen demonstrates that federated generative modeling for high-dimensional, heterogeneous TS-EHRs can be effective when carefully designed latent alignment and distribution-aware aggregation are incorporated. The framework yields synthetic data with fidelity and downstream utility comparable to centralized training, significantly outperforming federated baselines, while also achieving enhanced privacy and scalability. The architecture and principles established here provide a template for future federated generative model development in complex, privacy-sensitive domains.
Reference: ["FedEHR-Gen: Federated Synthetic Time-Series EHR Generation via Latent Space Alignment and Distribution-Aware Aggregation" (2605.27892)]