TL;DR
This paper introduces SE-Diff, a novel diffusion model for generating realistic 12-lead ECG signals from clinical text descriptions. By integrating a physiological simulator and leveraging real-world clinical experience, SE-Diff produces ECGs that are more accurate, physiologically plausible, and semantically aligned with the input text, outperforming existing methods and even improving downstream ECG classification tasks.
What Problem Does This Paper Address?
Generating realistic electrocardiograms (ECGs) from clinical text is crucial for various applications, including augmenting scarce datasets, understanding cardiac electrical activity, and facilitating privacy-preserving data sharing. However, existing text-to-ECG generation methods often fall short in two key areas:
- Lack of Physiological Grounding: They primarily learn from data, neglecting the wealth of knowledge from established physiological simulators that can ensure generated waveforms are mechanically sound.
- Limited Clinical Context: They often rely on narrow patient metadata, overlooking the broader, experience-based clinical knowledge embedded in large electronic health record (EHR) corpora.
This gap leads to generated ECGs that may lack true physiological plausibility and may not fully capture the nuances of real-world clinical presentations.
Methods
SE-Diff tackles these challenges by combining several innovative techniques within a conditional latent-diffusion framework:
- Variational Autoencoder (VAE) with Beat Decoder: A VAE is used to learn a compressed latent representation of ECG signals. Crucially, a lightweight "Beat Decoder" is attached to this VAE to reconstruct a single, QRS-aligned cardiac cycle from the latent representation. This allows for fine-grained control and analysis at the beat level.
- Simulator-Informed Diffusion: The core innovation is the integration of a physiological ECG simulator (based on ordinary differential equations, ODEs) into the diffusion process. This is achieved through:
- Simulator-Consistent Constraints: The Beat Decoder's output is regularized using constraints derived from the simulator, ensuring that generated beats adhere to known physiological principles (e.g., Euler loss for per-lead consistency and inter-lead constraints for physiological relationships between leads). This injects "mechanistic priors."
- Experience Retrieval-Augmented Conditioning: To incorporate broader clinical knowledge, an LLM-powered retrieval system is employed. This system:
- Identifies clinically similar patients from EHR data.
- Retrieves their diagnoses, medications, and procedures.
- Distills this information into a concise, physiologically grounded narrative report.
- This report, along with original diagnoses and basic metadata, forms the comprehensive conditioning context for the diffusion model.
- Conditional Latent Diffusion: A U-Net denoiser operates in the VAE's latent space. It uses cross-attention mechanisms to incorporate the rich conditioning context (text, metadata, and retrieved report) to guide the denoising process and generate a latent representation that, when decoded, results in a physiologically plausible ECG.
Datasets
- MIMIC-IV-ECG: Used for training the VAE and the diffusion model. This dataset contains 800,035 de-identified 10-second, 12-lead ECGs sampled at 500 Hz.
- MIMIC-IV-CLINICAL: Used to obtain EHR data for the experience retrieval-augmented conditioning component.
The paper does not introduce new benchmarks but evaluates against existing methods on these real-world datasets.
Key Insights and Ideas
- Bridging the Gap Between Data and Physics: The most significant insight is the successful integration of a physiological simulator as a "mechanistic prior" within a deep generative model. This moves beyond purely data-driven generation towards physically informed synthesis, leading to more reliable and interpretable results.
- Leveraging "Experience" for Context: The use of LLM-driven retrieval from EHRs to augment text conditioning is a powerful way to inject real-world clinical experience, which is often implicit and hard to capture from structured metadata alone. This provides a richer context for generation.
- Beat-Level Control for Global Coherence: By focusing on a "Beat Decoder" and applying simulator constraints at the beat level, the model can enforce local physiological plausibility, which then contributes to the overall coherence and realism of the full 10-second ECG.
- Downstream Benefits: The paper demonstrates that the generated ECGs are not just visually appealing but also functionally useful, improving performance in downstream tasks like ECG classification, especially in challenging scenarios like class imbalance.
Key Results
- Improved Signal Fidelity: SE-Diff achieved lower MAE (0.0923 vs. 0.1092) and NRMSE (0.0714 vs. 0.0851) compared to the baseline DiffuSETS, indicating more accurate waveform reconstruction.
- Enhanced Physiology: The model significantly reduced the MAEHR (8.43 vs. 13.29) for heart rate estimation, suggesting better preservation of physiological dynamics.
- Superior Text-ECG Alignment: SE-Diff achieved a higher relative CLIP score (0.9470 vs. 0.9309) and rFID score (0.9509 vs. 0.9209), indicating better semantic alignment between the generated ECGs and the input text descriptions.
- Ablation Studies: Experiments showed that both the simulator-informed diffusion (Euler and inter-lead constraints) and the experience retrieval-augmented conditioning contribute significantly to SE-Diff's performance. Removing either component led to a noticeable drop in metrics.
- Downstream Classification: SE-Diff augmentation improved performance in imbalanced classification tasks (gender and rare-disease classification), narrowing the gap to the balanced upper bound.
Limitations and Future Work
- Limitations:
- The paper acknowledges that while the simulator provides mechanistic priors, it might not capture all complexities of cardiac electrical activity, especially in highly pathological or rare conditions.
- The LLM-generated reports are designed to be concise and clinically grounded, but the potential for LLM-induced biases or inaccuracies, though mitigated by the system's design, is an inherent consideration.
- Future Work: The authors suggest extending SE-Diff to more complex clinical applications such as:
- Arrhythmia risk stratification.
- Therapy response modeling.
- Long-term ambulatory ECG generation.
- Evaluating robustness across different institutions and for rare presentations.
Summary updated