Cardiovascular disease (CVD) is a leading cause of mortality worldwide. Electrocardiograms (ECGs) are the most widely used non-invasive tool for cardiac assessment, yet large, well-annotated ECG corpora are scarce due to cost, privacy, and workflow constraints. Generating ECGs can be beneficial for the mechanistic understanding of cardiac electrical activity, enable the construction of large, heterogeneous, and unbiased datasets, and facilitate privacy-preserving data sharing. Generating realistic ECG signals from clinical context is important yet underexplored. Recent work has leveraged diffusion models for text-to-ECG generation, but two challenges remain: (i) existing methods often overlook the physiological simulator knowledge of cardiac activity; and (ii) they ignore broader, experience-based clinical knowledge grounded in real-world practice. To address these gaps, we propose SE-Diff, a novel physiological simulator and experience enhanced diffusion model for comprehensive ECG generation. SE-Diff integrates a lightweight ordinary differential equation (ODE)-based ECG simulator into the diffusion process via a beat decoder and simulator-consistent constraints, injecting mechanistic priors that promote physiologically plausible waveforms. In parallel, we design an LLM-powered experience retrieval-augmented strategy to inject clinical knowledge, providing more guidance for ECG generation. Extensive experiments on real-world ECG datasets demonstrate that SE-Diff improves both signal fidelity and text-ECG semantic alignment over baselines, proving its superiority for text-to-ECG generation. We further show that the simulator-based and experience-based knowledge also benefit downstream ECG classification.
Figures & tables
Figure 1: Overview Framework of SE-Diff. (a) Variational Autoencoder : encoder–decoder with a lightweight beat decoder for a single QRS-aligned cycle. (b) Conditional latent diffusion : U-Net denoiser with cross-attention to text, metadata, and retrieved report. (c) Simulator-informed diffusion : Euler and inter-lead constraints on the beat decoder output. (d) Experience retrieval–augmented Conditioning : tri-view EHR similarity with LLM distillation into a concise report. (e) Inference : reverse diffusion and decoding to a 10-second, 12-lead ECG.
Model
PR ↓
QRSd ↓
QT ↓
QTcF ↓
ST@J+60 ↓
P dur ↓
T dur ↓
MIMIC-IV-ECG (internal)
SSSD
7.70±8
32.00±1
25.11±11
23.25±11
0.16±0
5.30±3
23.71±9
WGAN
18.01±9
29.64±9
21.02±5
23.83±2
0.13±0
6.01±0
24.01±4
BeatDiff
10.34±5
18.23±6
14.23±6
9.43±5
0.17±0
7.00±1
30.02±3
DiffuSETS
14.81±6
11.71±7
8.20±3
9.71±4
0.04±0
5.60±1
8.71±7
SE-Diff
7.30±3
10.71±4
4.50±2
7.88±2
0.03±0
2.50±0
6.80±3
Table 2: Beat-level morphology & interval fidelity (MAE) on MIMIC-IV-ECG and PTB-XL datasets. All values are record-level medians; lower is better ( ↓ ).
Model
Male = 10% Female
SVT = 10% Sinus
F1 (%, ↑ )
Acc. (%, ↑ )
AUC (%, ↑ )
F1 (%, ↑ )
Acc. (%, ↑ )
AUC (%, ↑ )
SSSD
42±0
54±1
49±2
56±1
63±2
81±2
WGAN
42±0
54±1
49±2
57±2
63±2
82±2
BeatDiff
44±2
55±2
51±2
60±2
67±2
84±3
DiffuSETS
44±3
54±2
54±1
70±1
68±1
84±2
SE-Diff
58±1
58±1
58±2
72±2
71±0
85±2
Table 3: Downstream ECG classification under severe class imbalance.
Figure 2: Noise scheduling analysis showing the progression of noise and signal factors throughout the diffusion process.
Figure 3: Representative single-cycle ECG waveforms generated from our simulator. Panel A: sinus rhythm (Lead I). Panel B: ventricular pacing (Lead V1). Panel C: sinus rhythm with first-degree AV block (Lead II). Panel D: consider acute ST-elevation MI (Lead V3).
Figure 4: Case Study for ECG Generation.
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Prompt examples.
Model
MAE ↓
NRMSE ↓
MAEHR↓
rCLIP Score ↑
rFID Score ↑
SE-Diff
0.0923±0.0021
0.0714±0.0010
8.43±0.42
0.9470±0.0029
0.9509±0.0035
w/o Beat Loss
0.0951±0.0020
0.0743±0.0016
23.48±1.07
0.9393±0.0026
0.9140±0.0055
w/o Spec Loss
0.0942±0.0023
0.0797±0.0014
16.47±1.23
0.9257±0.0030
0.9073±0.0055
Appendix
Table 4: ECG generation performance on MIMIC-IV-ECG dataset.
Batch size
Time / batch (s)
Time / sample (s)
32
13.55
0.425
128
13.65
0.105
256
13.40
0.050
512
15.05
0.0295
1024
24.90
0.0245
2048
45.00
0.0220
Appendix
Table 5: Inference latency of the model for generating one 10-second, 12-lead ECG under different batch sizes. Times are averaged over 3 batches per configuration, with 1000 diffusion sampling steps.
Sampling Steps
NRMSE ↓
MAEHR↓
rCLIP Score ↑
1000
0.0714±0.0010
8.43±0.42
0.9470±0.0029
800
0.0877±0.0011
13.59±1.05
0.8671±0.0040
500
0.1097±0.0010
15.60±1.19
0.7888±0.0084
Appendix
Table 6: ECG generation performance under different sampling steps.
Sampler
NRMSE ↓
MAEHR↓
rCLIP Score ↑
SE-Diff (DDPM)
0.0714±0.0010
8.43±0.42
0.9470±0.0029
DDIM
0.1219±0.0010
9.05±0.44
0.7783±0.0072
Second Order
0.0877±0.0011
13.59±1.05
0.8671±0.0040
SDE
0.0693±0.0106
19.21±1.27
0.9213±0.0028
Appendix
Table 7: ECG generation performance under different samplers.
Sampler
NRMSE ↓
MAEHR↓
rCLIP Score ↑
SE-Diff (Linear)
0.0714±0.0010
8.43±0.42
0.9470±0.0029
Cosine
0.0728±0.0032
8.90±0.78
0.9446±0.0131
Appendix
Table 8: ECG generation performance under different noise schedules.
Config
Model
MAE ↓
MAEHR↓
rCLIP Score ↑
rFID Score ↑
A
DiffuSETS
0.1092±0.0022
13.29±1.13
0.9309±0.0036
0.9209±0.0038
A
SE-Diff
0.0923±0.0021
8.43±0.42
0.9470±0.0029
0.9509±0.0035
B
DiffuSETS
0.1092±0.0022
13.29±1.13
0.9347±0.0032
0.9197±0.0037
B
SE-Diff
0.0923±0.0021
8.43±0.42
0.9472±0.0032
0.9505±0.0035
C
DiffuSETS
0.1092±0.0022
13.29±1.13
0.9242±0.0039
0.9209±0.0038
C
SE-Diff
0.0923±0.0021
8.43±0.42
0.9393±0.0031
0.9509±0.0035
Appendix
Table 9: ECG generation performance comparison between SE-Diff and DiffuSETS under different calibration configurations.
λ1
λ2
λ3
k
LLM Score
1
1
1
3
94.9±2.3
1
1
1
2
94.4±2.1
1
1
1
4
94.8±2.9
2
1
1
3
94.7±2.6
1
2
1
3
93.6±1.5
1
1
2
3
93.5±3.3
Appendix
Table 10: Sensitivity of tri-view weights (λ1,λ2,λ3) and top- k on retrieval performance.
State Key Laboratory of General Artificial Intelligence, Peking University · School of Intelligence Science and Technology, Peking University, Beijing, China · Polytechnic Institute of Zhejiang University, Zhejiang University, Hangzhou, China +4