NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ImputeECG: Deep Learning Reconstruction of Complete 12-Lead Electrocardiograms from Incomplete Recordings for Cardiac Assessment

Xiaocheng Fang, Haoyu Wang, Jieyi Cai, Qinghao Zhao, Jun Li, Shanwei Zhang, Guangkun Nie, Yujie Xiao, Shun Huang, Jiarui Jin, Hongmin Liu, Guodong Wang, Shuohua Chen, Liming Lin, Shouling Wu, Hongyan Li, Shenda HongarXiv 2026

TL;DR

ImputeECG is a novel deep learning framework that reconstructs complete 10-second, 12-lead electrocardiograms (ECGs) from incomplete or partially digitized clinical recordings. By utilizing a mask-conditioned 1D Transformer autoencoder, the model leverages the physiological redundancy across leads to recover missing waveforms while perfectly preserving observed data, effectively restoring downstream AI diagnostic performance to near-ground-truth levels.

What Problem Does This Paper Address?

AI models for cardiovascular risk assessment typically require standard, complete digital waveforms: specifically, 12 synchronized leads recorded over 10 seconds. However, a massive portion of historical medical data remains locked away in paper printouts, scanned images, or PDFs.

When these paper records are digitized using image-processing algorithms, they are fundamentally limited by standard clinical printout formats. For instance, a common "4×3-lead" layout only displays 2.5 seconds of data for each lead, alongside a single 10-second rhythm strip. Consequently, large chunks of the underlying 10-second multi-lead signal are missing. Signal corruption, lead loss, and digitization failures compound this problem, creating a major barrier to utilizing historical archives for large-scale digital health research.

Methods

The authors introduce ImputeECG, a mask-guided deep learning architecture based on a 1D Vision Transformer (ViT) encoder-decoder.

Overview of the ImputeECG framework, including real-world incomplete scenarios, workflow, and evaluation strategy.

Key technical highlights include:

  • Mask-Conditioned Input: Instead of feeding just the incomplete ECG signal to the network, the model concatenates the zero-filled observed ECG ($X_{obs}$) with a binary missingness mask ($M$) along the lead dimension. This expands the input from 12 channels to 24 channels, explicitly teaching the model to distinguish between a true low-amplitude signal and missing data.
  • 1D Patch Embedding: The 24-channel input is divided into non-overlapping temporal patches (patch size $P=50$ samples, corresponding to 0.1 seconds at 500 Hz) before entering a 12-block Transformer encoder.
  • Targeted Reconstruction Loss: During training, the model optimizes an $L_1$ reconstruction loss computed only over the originally missing regions.
  • Exact Observation Retention: During inference, the final output is generated by keeping the originally observed segments exactly as they were and filling in the missing gaps with the model's predictions.

Datasets

The model was developed and validated across three distinct datasets:

  1. PTB-XL: A large public dataset containing 21,799 10-second clinical ECG recordings from 18,869 subjects. This served as the primary dataset for training, validation, and internal testing under simulated missingness layouts (4×3-lead 2.5s, 6×2-lead 5s, and random masks).
  2. CPSC2018: A public dataset of 6,877 recordings used as an independent external test set to evaluate waveform reconstruction and multi-label rhythm/conduction classification.
  3. Kailuan Cohort: A massive, real-world independent clinical cohort containing 43,633 records. These records were digitized from actual paper/image archives, providing a true out-of-distribution test bed for zero-shot downstream tasks (age and sex prediction).

Key Insights and Ideas

  • Exploiting Physiological Redundancy: The core intuition behind ImputeECG is that the 12 leads of an ECG are not independent; they capture different spatial projections of the exact same cardiac electrical activity. Combined with the repetitive nature of cardiac cycles over 10 seconds, a Transformer can learn to map these cross-lead and long-range temporal dependencies to infer missing segments.
  • Prioritizing Clinical Utility over Visual Plausibility: A common pitfall in signal generation is creating waveforms that look clean and plausible to the human eye but distort critical diagnostic features. The authors emphasize evaluating "diagnostic fidelity" by passing the imputed signals into fixed, pretrained downstream classifiers to see if the clinical information is truly preserved.

Key Results

ImputeECG significantly outperformed standard generative baselines like CycleGAN, Pix2Pix, and EKGAN across all evaluation metrics.

Waveform Reconstruction

On the PTB-XL test set, ImputeECG reduced the Mean Absolute Error (MAE) in missing regions by 41.7% to 51.0% and the Mean Squared Error (MSE) by 54.0% to 63.7% compared to the strongest baseline. It also demonstrated superior preservation of critical ECG landmarks (R-peak timing, QRS duration, and QT intervals).

Downstream Diagnostic Fidelity

  • PTB-XL Classification: In the highly challenging 4×3-lead setting, direct classification on un-imputed (masked) data yielded a poor AUROC of 70.43%. Imputing with ImputeECG restored the classification performance to 92.28% AUROC, nearly matching the complete ground-truth reference performance of 92.36%.
  • Real-World Zero-Shot Tasks (Kailuan Cohort): When evaluating real-world digitized images, applying ImputeECG prior to downstream analysis boosted zero-shot sex prediction AUROC from 82.58% to 85.82% and reduced age prediction MAE from 10.72 years to 9.87 years.

Limitations and Future Work

Despite its strong performance, the authors note several limitations:

  • Artifact Gaps: The training data relied on simulated missingness masks applied to clean digital signals. Real-world paper records often contain complex artifacts like grid lines, scanning distortions, trace overlaps, and baseline drift that complicate the initial digitization step.
  • Transient Abnormalities: If a rare or transient clinical event (such as a single premature ventricular contraction or a brief ischemic change) occurs entirely within a missing temporal window, the model cannot magically guess it from context and will instead reconstruct a standard, healthy morphology.
  • Lack of Uncertainty Quantification: The model provides a single deterministic reconstruction. Future work should incorporate uncertainty estimation to alert clinicians when the model is highly unconfident about a reconstructed region.

Summary updated

BibTeX
@misc{fang2026imputeecg,
  author = {Xiaocheng Fang and Haoyu Wang and Jieyi Cai and Qinghao Zhao and Jun Li and Shanwei Zhang and Guangkun Nie and Yujie Xiao and Shun Huang and Jiarui Jin and Hongmin Liu and Guodong Wang and Shuohua Chen and Liming Lin and Shouling Wu and Hongyan Li and Shenda Hong},
  title = {{ImputeECG: Deep Learning Reconstruction of Complete 12-Lead Electrocardiograms from Incomplete Recordings for Cardiac Assessment}},
  year = {2026},
  eprint = {2607.05009},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.05009},
}
Figure