A unified deep generative framework for longitudinal clinical mosaic alignment, dense omics imputation, and dynamic disease trajectory forecasting.
Architecture & Math • Clinical Benchmarks • CDSS Workspace • Quick Start • Paper Attribution • Advisory Acknowledgments
Routine clinical records are characterized by longitudinal mosaic missingness: inexpensive blood tests and vital signs are obtained frequently at repeated patient visits, whereas deep molecular profiles (NMR metabolomics, Olink/SomaScan proteomics) are gathered only intermittently or at baseline.
Existing single-cell multi-omics frameworks (e.g., MIDAS, scVAEIT, StabMap) treat biological observations as isolated, static cross-sections. However, human disease progression is a continuous physiological trajectory governed by personalized homeostatic baselines.
PULSE (Patient Unified Longitudinal Signal Engine) reformulates longitudinal patient care as a coupled dynamical system:
- Cross-Modal Grounding: Models routine blood markers and high-dimensional omics as different views of a shared continuous latent physiological process.
-
Personalized Baselines: Anchors inference to an individual's temporal trajectory, recognizing that rates of change (
$\Delta$ ) relative to baseline set-points carry far more diagnostic significance than population-average absolute thresholds. - Generative Synthesis: Imputes thousands of unmeasured plasma metabolites and proteins from simple routine lab panels, enabling calibrated 10-year and 30-day disease risk forecasting at a fraction of standard assay costs.
| Pillar | Mechanism | Clinical Impact |
|---|---|---|
| Longitudinal Memory | Propagated Past-State Prior ( |
Constrains high-dimensional imputation to biologically plausible trajectories, avoiding population mean regression. |
| Soft Semantic Alignment | Information-Theoretic Symmetrical Jeffrey Divergence ($J(q_a, q_b)$) | Preserves posterior variance and biological heterogeneity across modalities without mode collapse. |
| Active Masking Protocol | Single-Modality Uniform Withholding ( |
Prevents trivial intra-visit identity shortcuts, compelling decoders to rely on cross-modal and historical dynamics. |
| Adversarial Regularization | Gradient Reversal Layer (GRL) Missingness Discriminator ( |
Eliminates missingness artifacts, ensuring synthesized biomarker trajectories mimic genuine human physiology. |
| Interactive CDSS | Tauri v2 Standalone Desktop App + Next.js Workspace | Categorizes biomarkers into physiological panels (Lipid, Metabolic, Neuro, Renal) with calibrated prognostic risk radar. |
Longitudinal Clinical Encounter Architecture:
Encounter t-1 Encounter t (Current) Encounter t+1
┌─────────────┐ ┌───────────────────────────┐ ┌─────────────┐
│ Past State │ ──GRU/Trans──> │ Past-State Encoder (Z_P) │ ──┐ │ Future State│
│ h_{t-1} │ └───────────────────────────┘ │ │ h_{t+1} │
└─────────────┘ ┌───────────────────────────┐ ├──> Jeffrey ──>└─────────────┘
│ Modality A Encoders (Z_A)│ ──┤ Alignment ▲
[Routine Labs] ────────────────>└───────────────────────────┘ │ + Equal-Weight │
┌───────────────────────────┐ │ Visit Fusion ─────┘
[Missing Omics] (Synthesized)<──│ Generative Decoders │<──┴──> [ z_{visit} ]
└───────────────────────────┘
Let patient
At encounter
Modality availability is formalized by a ternary indicator
-
$s_{i,t}^{(m)} = 0$ (Observed): Available in clinic; routed to the corresponding modality encoder. -
$s_{i,t}^{(m)} = 1$ (Actively Masked): Measured in reality, but intentionally withheld from encoders during training to force cross-modal and historical synthesis; supervised via ground-truth targets. -
$s_{i,t}^{(m)} = 2$ (Naturally Missing): Absent in clinical practice; decoded by the network, but generates zero reconstruction loss gradient.
For each observed modality $m \in \mathcal{O}{i,t}$, a modality-specific variational encoder $q{\phi_m}$ maps high-dimensional clinical inputs into a shared
Simultaneously, the patient's summarized history up to encounter
Clinical Rationale: Human biomarkers fluctuate within tight personal homeostatic ranges. Incorporating
$Z_P$ provides an individualized reference point, turning ill-posed cross-sectional imputation into continuous trajectory completion.
Standard multi-view VAEs frequently suffer from geometric collapse when enforcing deterministic Euclidean point-matching (e.g., MSE on
For two diagonal multivariate Gaussian posteriors
The Jeffrey divergence
Let $\mathcal{B}{i,t} = {q{\phi_m} : m \in \mathcal{O}{i,t}} \cup {q{\phi_P}}$ denote all active latent branches at encounter
Available modality states and historical context are aggregated into a single unified visit coordinate
- The denominator
$+1$ accounts specifically for$\mu_{P, i,t}$ . Current measurements and prior history are balanced symmetrically. - If no modalities are observed at encounter
$t$ ($|\mathcal{O}{i,t}| = 0$), the visit coordinate transitions seamlessly to pure historical carry-forward: $z{i,t} = \mu_{P, i,t}$.
From visit coordinate
-
Recurrent Engine (
temporal_model="recurrent"):
Uses a Gated Recurrent Unit (GRU) cell for parameter-efficient sequence modeling:$$h_{i,t+1} = \text{GRUCell}(z_{i,t}, h_{i,t})$$ Optimized for outpatient encounters with 2–5 visits. -
Causal Transformer Engine (
temporal_model="transformer"):
Employs multi-head causal self-attention with temporal sinusoidal position encodings:$$h_{i,t+1} = \text{TransformerEncoder}\left(\text{CausalMask}\left([z_{i,1}, \dots, z_{i,t}]\right)\right)_{t}$$ Optimized for dense, high-frequency encounters (e.g., 48-hour continuous ICU step series).
To ensure encoders learn cross-modal temporal dependencies rather than memorizing intra-visit shortcuts:
- At encounters with $|\mathcal{O}{i,t}| \ge 2$ observed modalities, active masking triggers with probability $p{\text{mask}} = 0.6$.
- Exactly one observed modality
$m^*$ is uniformly chosen at random and relabeled to$s = 1$ . - Modality $m^$ is masked from the encoder inputs, requiring the remaining modalities and past-state prior $Z_P$ to synthesize $\hat{x}_{i,t}^{(m^)}$.
- Supervised reconstruction loss is applied against the ground-truth values of
$x_{i,t}^{(m^*)}$ .
To eliminate subtle reconstruction artifacts introduced by missingness patterns, each modality is equipped with a binary discriminator
During backpropagation, gradients are inverted by
The final scalar loss minimized during end-to-end training is:
where:
- Reconstruction Loss: $$\mathcal{L}{\text{rec}} = \sum{i,t} \sum_{m} \mathbb{I}[s_{i,t}^{(m)} \in {0, 1}] \cdot \text{MSE}\left(\hat{x}{i,t}^{(m)}, x{i,t}^{(m)}\right)$$
- Gaussian Prior Regularization: $$\mathcal{L}{\text{KL}} = \sum{b \in \mathcal{B}{i,t}} D{\text{KL}}(q_b \parallel \mathcal{N}(0, I))$$
-
KL Warmup Schedule
$\alpha(e)$ : Linearly scaled from$0 \to 1$ across the first 50 epochs ($e \in [1, 50]$ ) to prevent posterior collapse.
Reconstructing follow-up NMR metabolomic profiles (251 biomarkers) using only routine blood markers (61 routine lab tests) at follow-up, conditioned on baseline medical history (
Metabolomics Imputation Correlation (Pearson r across 251 metabolites):
PULSE (Ours) [██████████████████████████████████████] 0.781 ± 0.012
scVAEIT [████████████████████████████ ] 0.654 ± 0.015
MIDAS [████████████████████████ ] 0.638 ± 0.016
StabMap [████████████████████ ] 0.589 ± 0.018
| Model / Framework | Architecture Type | Context Employed | Pearson's |
MAE ( |
MSE ( |
|---|---|---|---|---|---|
| PULSE (Ours) | Longitudinal Variational | Baseline History ( |
0.781 ± 0.012 | 0.312 ± 0.008 | 0.201 ± 0.009 |
| scVAEIT | Static Masked VAE | Current Labs ( |
0.654 ± 0.015 | 0.405 ± 0.010 | 0.324 ± 0.012 |
| MIDAS | Static Product-of-Experts | Current Labs ( |
0.638 ± 0.016 | 0.418 ± 0.011 | 0.341 ± 0.013 |
| StabMap | Static MNN Manifold | Current Labs ( |
0.589 ± 0.018 | 0.462 ± 0.013 | 0.410 ± 0.015 |
Dynamic Change Concordance: On predicting longitudinal within-person change (
$\Delta = \text{Follow-up} - \text{Baseline}$ ), PULSE achieves$r = 0.850$ , confirming that it captures individual temporal drift rather than mean reversion.
Synthesizing 2,923 plasma protein abundances from 61 blood markers and prior ICD trajectories (
| Disease Outcome (10-Year Incident Risk) | Measured Proteomics AUROC | PULSE Synthesized Proteomics AUROC | Delta ( |
|---|---|---|---|
| Dementia / Alzheimer's | 0.835 | 0.831 | -0.004 |
| Heart Failure | 0.801 | 0.798 | -0.003 |
| Myocardial Infarction | 0.789 | 0.784 | -0.005 |
| Chronic Obstructive Pulmonary Disease (COPD) | 0.775 | 0.772 | -0.003 |
| Ischemic Stroke | 0.749 | 0.745 | -0.004 |
| Type 2 Diabetes Mellitus | 0.731 | 0.728 | -0.003 |
Clinical Significance: PULSE-synthesized proteomics models achieve disease forecasting accuracy statistically indistinguishable from models trained on genuine, high-cost laboratory proteomics.
30-day post-discharge readmission prediction from the first 48 hours of ICU admission, aggregated into twelve 4-hour temporal steps combining structured labs and unstructured nursing notes:
| Cohort | Metric | Lab Transformer Only | Clinical Notes (Llama 3) | Late Fusion Baseline | PULSE (Ours) |
|---|---|---|---|---|---|
| MIMIC-III (US) | AUROC | 0.639 | 0.647 | 0.663 | 0.713 (0.691–0.732) |
| ( |
AUPRC | 0.110 | 0.127 | 0.130 | 0.193 (0.167–0.224) |
| Wenzhou ICU (China) | AUROC | 0.647 | 0.691 | 0.706 | 0.735 (0.683–0.789) |
| ( |
AUPRC | 0.116 | 0.273 | 0.317 | 0.388 (0.298–0.480) |
This repository includes a production-grade Clinical Decision Support System (CDSS) application implementing the PULSE inference engine.
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ PULSE Clinical Decision Support System (CDSS) │
├─────────────────┬──────────────────────────────────────────────────────────────────────┤
│ Panels │ Longitudinal Trajectory Workspace │
│ ├─ Lipid │ LDL-C: [142 mg/dL ──> 128 mg/dL ──> 112 mg/dL (Controlled)] │
│ ├─ Metabolic │ HbA1c: [ 6.8% ──> 6.5% ──> 6.1% (Improving)] │
│ ├─ Neuro │ NfL: [14.2 pg/mL──> 16.8 pg/mL──> 18.2 pg/mL (Monitoring)] │
│ └─ Renal │ eGFR: [88 mL/min ──> 84 mL/min──> 81 mL/min (Mild Risk)] │
├─────────────────┼──────────────────────────────────────────────────────────────────────┤
│ Risk Forecast │ 10-Year ASCVD: 14.2% • 30-Day ICU Readmission: 4.8% • CKD: 8.1% │
│ Inference Mode │ [Run PULSE Synthesis] ──> Synthesizes 25+ Omics Biomarkers │
└─────────────────┴──────────────────────────────────────────────────────────────────────┘
- Logical Biomarker Panels:
- Lipid Panel: Total Cholesterol, LDL-C, HDL-C, Triglycerides.
- Metabolic Panel: Fasting Plasma Glucose, Glycated Hemoglobin (HbA1c), Fasting Insulin.
- Neurological & Inflammatory Panel: Neurofilament Light Chain (NfL), High-Sensitivity C-Reactive Protein (hs-CRP).
- Renal & Hepatic Panel: Serum Creatinine, Estimated Glomerular Filtration Rate (eGFR), Blood Urea Nitrogen (BUN), ALT.
- Clinical Encounter Recording:
- Structured modal for logging physical vitals, routine laboratory panels, and clinician progress notes.
- Quick presets for Outpatient Cardiovascular Assessment and ICU Sepsis / Acute Kidney Injury.
- FHIR & CSV Interoperability:
- One-click longitudinal observation export compliant with HL7 FHIR standard bundles.
- Standalone Multi-Platform Desktop Deployment:
- Built on Tauri v2 and Next.js with asynchronous background backend management:
- Linux: Universal
.AppImage,.deb,.rpmbundles. - Windows:
.exeand.msistandalone installers with headless WSL bridge. - macOS: Universal Apple Silicon / Intel
.dmginstaller.
- Linux: Universal
- Dual-Mode Launcher: Switch between native desktop workstation and browser mode (
http://localhost:8000).
- Built on Tauri v2 and Next.js with asynchronous background backend management:
# Clone the repository
git clone https://github.com/p19racha/LongitudinalGeneration.git
cd LongitudinalGeneration
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
pip install -e .import torch
from pulse.model import PulseModel
from pulse.data.dataset import LongitudinalDataset, collate_visits, create_synthetic_data
device = "cuda" if torch.cuda.is_available() else "cpu"
# 1. Define input modality dimensions
modality_dims = {
"routine_labs": 61,
"metabolomics": 251,
}
# 2. Instantiate PULSE model
model = PulseModel(
modality_dims=modality_dims,
latent_dim=16,
hidden_dim=64,
temporal_model="recurrent", # or "transformer"
kl_weight=1e-3,
align_weight=1.0,
active_mask_prob=0.6,
).to(device)
# 3. Generate sample longitudinal data
synthetic_data, masks = create_synthetic_data(num_patients=16, max_visits=3, modality_dims=modality_dims)
dataset = LongitudinalDataset(synthetic_data, masks)
batch = collate_visits([dataset[i] for i in range(16)])
# 4. Perform forward pass and evaluate loss
output = model(batch["visits_data"], batch["missing_masks"], return_loss=True)
print(f"Total Loss: {output['loss']:.4f}")
print(f"Reconstruction Loss: {output['losses']['loss_recon']:.4f}")
print(f"Jeffrey Alignment Loss: {output['losses']['loss_align']:.4f}")Download the standalone installer for your operating system from the Latest Releases:
- Linux: Run
./PULSE-CDSS_1.0.1_amd64.AppImage - Windows: Execute
PULSE-CDSS_1.0.1_x64-setup.exe - macOS: Install
PULSE-CDSS_1.0.1_universal.dmg
# Terminal 1: Launch FastAPI backend
source .venv/bin/activate
uvicorn server.main:app --host 0.0.0.0 --port 8000
# Terminal 2: Launch Next.js frontend
cd frontend
npm install
npm run dev
# Navigate to http://localhost:3000This research, algorithm design, and foundational mathematical implementation were created and published by:
- Lead Author & Originator: Wei Wu (@ww20hust)
Department of Big Data and Biomedical AI, College of Future Technology, Peking University & Peking-Tsinghua Center for Life Sciences, Beijing, China
Artificial Intelligence Cross Disciplinary Research Institute, Faculty of Medicine, Macau University of Science and Technology, Macau, China
Guangzhou National Laboratory, Guangzhou, China- Email:
ww20ya@163.com - GitHub: https://github.com/ww20hust
- Email:
- Co-First Authors (equal contribution):
Wei Wu, Gen Li, Kai Wang, Hui Xu, Haodi Xiao, Changxi Hu, Sian Liu, Cheng Tang - Corresponding Author:
Prof. Kang Zhang (kang.zhang@gmail.com), Macau University of Science and Technology, Wenzhou Medical University, and Guangzhou National Laboratory - Consortium:
On behalf of the International Consortium of Digital Twins in Healthcare and Medicine - Primary Publication:
"Longitudinal alignments and syntheses of multimodal clinical data for personalized medicine with the PULSE framework", Nature Computational Science (2026). DOI: 10.1038/s43588-026-01026-5
The full peer-reviewed paper is included in this repository:Longitudinal alignments and syntheses of multimodal clinical data for personalized medicine with the PULSE framework.pdf
Special recognition and formal gratitude are expressed to:
Advisory Citation: For her dedicated domain advisory and medico-technical guidance in interpreting the clinical nuances of the research paper. Her assistance in translating the multi-scale physiological feedback loops, defining meaningful clinical biomarker groupings (Lipid, Metabolic, Neuro, and Renal panels), and clarifying real-world EHR mosaic workflows was pivotal in shaping the clinical requirements and usability of the PULSE Clinical Decision Support System.
@article{wu2026pulse,
title = {Longitudinal alignments and syntheses of multimodal clinical data for personalized medicine with the PULSE framework},
author = {Wu, Wei and Li, Gen and Wang, Kai and Xu, Hui and Xiao, Haodi and Hu, Changxi and Liu, Sian and Tang, Cheng and Liu, Fei and Zou, Zixing and Li, Bingzhou and Li, Jinghang and Zhang, Charlotte L. and Wong, Hang and Chong, Ieng and Lu, Wenyang and Sun, Zhuo and Yin, Yun and Loupy, Alexandre and Oermann, Eric and Al Dajani, Saleem A. and Zhu, Hao and Gootenberg, Jonathan and Abudayyeh, Omar O. and Gladyshev, Vadim N. and Rasko, John E. J. and Zhang, Kang},
journal = {Nature Computational Science},
year = {2026},
doi = {10.1038/s43588-026-01026-5},
url = {https://doi.org/10.1038/s43588-026-01026-5}
}This project is licensed under the MIT License.