A CLIP-conditioned 1D U-Net that reconstructs 5 missing precordial ECG leads (V2–V6)
from 7 available leads (I, II, III, aVR, aVL, aVF, V1), enabling full 12-lead ECG synthesis
from reduced-lead recordings.
Clinical Motivation
Standard 12-lead ECGs require 10 body-surface electrodes. In wearables, ambulatory monitoring,
and emergency pre-hospital settings, only limb leads + V1 may be feasible to acquire.
This model reconstructs the missing precordial leads with clinical fidelity using a
visual-language prior from CLIP.
FiLM (Feature-wise Linear Modulation) at every scale
Parameters
13,703,507 (LeadGenerator only; CLIP is frozen)
Base channels
64
Sequence length
2500 samples (5 s @ 500 Hz)
Loss
Huber loss
Optimiser
AdamW + CosineAnnealingLR
Why CLIP conditioning?
Each ECG is rendered as a red-grid clinical image (standard paper layout) before being
passed through CLIP-ViT-L. The resulting 1024-d embedding captures morphological patterns
visually and is injected into the U-Net via FiLM — allowing the generator to produce
lead-consistent waveforms conditioned on the global ECG appearance.
Performance
Evaluated on a held-out 10% split of PTB-XL (500 Hz, 200 records).
Lead
RMSE ↓
DTW (normalised) ↓
V2
0.41751
0.10016
V3
0.52274
0.10500
V4
0.45217
0.09813
V5
0.35278
0.07953
V6
0.37252
0.09069
Mean
0.42355
0.09470
Evaluated on 200 held-out PTB-XL records (500 Hz). V5 achieves the best reconstruction
quality (RMSE 0.353), consistent with its anatomical proximity to V4 and V6 which are
both present in the training conditioning signal.
ecg-lead-generator/
├── model.safetensors # Model weights (safetensors format)
├── config.json # Model configuration
├── model.py # LeadGenerator architecture
└── README.md # This file
Limitations
Trained on 2,000 PTB-XL records — a larger training set is recommended for production use
Validated on 500 Hz recordings only
Not validated on all pathological ECG subtypes present in clinical practice
Not a medical device — intended for research and educational purposes only
Citation
If you use this model in your work, please cite PTB-XL:
bibtex
1@article{wagner2020ptb,
2 title={PTB-XL, a large publicly available electrocardiography dataset},
3 author={Wagner, Patrick and Strodthoff, Nils and Bousseljot, Ralf-Dieter and others},
4 journal={Scientific Data},
5 volume={7},
6 number={1},
7 pages={154},
8 year={2020},
9 publisher={Nature Publishing Group}
10}