Rhythm-Conditioned Transformer for Imputation and Reconstruction of Non-Concurrent ECG Signals

Sara Summerton1 and David C Wong2
1University of Manchester, 2University of Leeds


Abstract

Digitization of paper electrocardiograms (ECGs) can suffer from localized signal loss due to image artifacts such as shadows, creases, and camera framing. Recovering these missing signal segments from the remaining observed data is complicated by the temporal non-concurrency inherent to the standard 3x4 print layout; leads printed in different columns represent different 2.5-second windows of cardiac activity. We designed a rhythm-conditioned encoder-only transformer architecture to exploit both concurrent inter-lead relationships and non-concurrent cross-time dependencies via a three-stage attention hierarchy. The rhythm strip, recorded continuously across all 10 seconds, serves as a temporal anchor for aligning cardiac phases across columns. We evaluated this model against linear regression and standard transformer baselines on four tasks of increasing difficulty: short segment imputation, and reconstruction of one, multiple, and all precordial leads. Each task was assessed using Signal-to-Noise Ratio (SNR), Pearson Correlation Coefficient (PCC), and Mean Squared Error computed over occluded regions.

The rhythm-conditioned model achieves a mean SNR of 11.38 dB and PCC of 0.96 on short-segment imputation, and outperforms both baselines on all tasks. Ablation studies confirmed that the rhythm-anchored temporal alignment was the most critical architectural component.