Related Experiment Video
Updated: Jan 12, 2026

Patient-specific Modeling of the Heart: Estimation of Ventricular Fiber Orientations
Published on: January 8, 2013
Exploring latent diffusion models for ECG generation on the minute scale
Dominik D Kranz1, Jan F Krämer2, Oruç Kahriman3
1Section on Computational Neurology, Deparment of Neurology, Charité - Universitätsmedizin Berlin, Berlin, Germany; Berlin Institute of Health, Berlin, Germany; Department of Physics, Humboldt-Universität zu Berlin, Berlin, Germany.
Background And Objective:
Artificial Intelligence (AI) models for electrocardiogram (ECG) interpretation rely on large, diverse datasets, but existing clinical datasets are often skewed, overrepresenting normal rhythms and lacking rare pathologies. This limits model performance and generalizability. While generative AI has shown promise in other domains, its application to biosignals has so far been restricted to short segments, reducing clinical utility. Additionally, potentially promising tools like inpainting for artefact removal have not yet been explored in the biosignal domain. To overcome these limitations, we propose ECGEN, a latent diffusion model (LDM) designed to synthesize long-duration, realistic ECGs for data augmentation, rhythm-specific generation, and signal restoration.
Methods:
We developed ECGEN in three configurations: (1) ECGEN-Small, a 30-second conditional generator for sinus rhythm and atrial fibrillation (AFib); (2) ECGEN-Medium, a 90-second model for inpainting tasks; and (3) ECGEN-Large, an unconditional model for generating 320-second ECGs. Models were trained on real clinical ECGs from stroke patients using a vector quantized-variational autoencoder (VQ-VAE) for encoding and a denoising diffusion implicit model (DDIM) as the latent space backbone. We evaluated model outputs using heart rate (HR), heart rate variability (HRV), and morphological coherence.
Results:
ECGEN-Small achieved an AUC of 0.98 for the AFib vs. sinus rhythm classification. ECGEN-Medium successfully inpainted missing segments with plausible HR dynamics. ECGEN-Large generated long ECGs with consistent morphology but showed distributional shifts in HRV (e.g., inflated standard deviation of normal-to-normal intervals, SdNN), indicating incomplete modeling of global temporal dependencies. Network depth was found to significantly influence output quality and training stability.
Conclusions:
ECGEN demonstrates the feasibility of long-duration ECG generation using LDMs, offering applications in dataset augmentation and signal restoration. However, distributional mismatches and occasional artefacts highlight challenges in unsupervised biosignal synthesis. Future work should address long-range temporal modeling and refine realism through conditioning or adversarial training.
Related Concept Videos
ECG Interpretation of Rhythms
Components of the Electrocardiogram
The primary components of a normal ECG waveform in Normal sinus rhythm(NSR) include the P wave, PR interval, QRS complex, ST segment, T wave, and occasionally a U wave.
ECG waveforms are divided by vertical and horizontal lines at standard intervals.
The horizontal axis measures time and rate, and the vertical axis measures amplitude or voltage....
Electrocardiogram
Three major waveforms are present in a typical ECG recording: the P wave, the QRS complex, and...
Correlation between ECG and Cardiac Cycle
A cardiac action potential originates in the SA node and spreads throughout the atria and the AV node in approximately 0.03 seconds. This results in the P wave in an ECG and triggers atrial contraction. The action potential is then briefly slowed at the AV node, allowing the atria to contract and fill the ventricles with blood before...
Cardiac Action Potential
The cardiac action potential process involves a series of phases characterized by the movement of ions across the cardiac cell membranes, leading to the depolarization and repolarization of the cardiac myocytes.
Ionic Basis of Cardiac Action Potentials
Electrocardiogram Fundamentals
An electrocardiogram (ECG) is a diagnostic tool for identifying cardiac conditions such as arrhythmias, conduction abnormalities, and myocardial ischemia.
Definition
An electrocardiogram (ECG) visualizes the heart's electrical activity by tracing the electrical movement associated with each heartbeat on a graph or monitor. As the heart beats, an electrical wave passes through it, correlating with the cardiac cycle events.
Parts of an ECG
An ECG utilizes electrodes on the skin...
Physiological Pharmacokinetic Models: Blood Flow-Limited Versus Diffusion-Limited Models

