Abstract 4370718: Transformer-based ECG beat foundation model reconstructs full 12-Lead morphology, vectorcardiogram and predicts peak heart rate in stress ECG
Abstract
Background: Regular monitoring of performance in ECG stress tests can enable early detection of subtle conduction/morphological changes and enable more accurate risk stratification. However, repeated stress ECGs are impossible in high-risk patients including those with severe stenosis, recent surgery or significant arrhythmia burden. An ECG foundational model capable of reconstructing 12-lead ECGs from a single lead typically available from wearables (e.g., apple watch: lead I) can create ambulatory stress ECG tests which obviate this problem. Hypothesis: We hypothesized that a self-supervised transformer model pretrained on reconstructing 11 masked leads using lead I can learn latent features for predicting peak heart rate (HR) across exercise stages and synthesize vectorcardiograms (VCG) for risk stratification in stress ECGs. Methods: We collected 7,625 stress test records from a single institution, from which 7,453 samples were included. This was divided into 4,447 training, 759 validation and 2,247 test ECGs which were used to develop a 6-layer transformer encoder architecture. A transposed-convolutional decoder with skip connection was used to reconstruct the masked leads while auxiliary linear layers regressed on VCG obtained using Dower transform and peak HR. A contrastive regularization loss was used to organize the latent space by reducing the distance between beats belonging to the same patient. The model was first trained solely on the reconstruction task (self-supervised pretraining) for 20 epochs, following which the decoder was frozen, and the encoder + auxiliary heads were supervised fine-tuned for 60 epochs to learn peak HR and VCG reconstructions. Training was performed with batch size = 32 and learning rate = 3x10 -3 during pretraining followed by 3x10 -4 during fine-tuning. Results: The model achieved A) a reconstruction mean squared error (MSE) of 0.16 mv2 on the masked leads, B) a R of 0.73 on peak HR regression, AUC = 0.82, AUPRC = 0.9 on high (> 120 bpm) peak HR classification, C) and Pearson R of 0.96, 0.95 and 0.98 on x, y, z axes of VCG in the held-out test dataset. (Fig 1) Conclusion: We are able to faithfully reconstruct 12-lead beat morphology from lead I which was valid across ST segments, QRS complexes and PR intervals. This self-supervised pretraining step was applicable in creating ambulatory, morphology aware stress ECG indices for a large hold-out test set.
Article Details
Authors (11)
Sabyasachi Bandyopadhyay
Xichong Liu
Department of Medicine (R.A.A., S.B., K.A.B., X.L., P.G., A.C.P., E.A.A., P.J.W., M.V.P., S.M.N., A.J.R.), Stanford University, CA.
Prash Ganesan
Stanford University, Palo Alto, California, United States
Sulaiman Somani
Stanford Health Care, Stanford, California, United States
Alexander Karius
Johns Hopkins School of Medicine, Baltimore, Maryland, United States
Tina Baykaner
Stanford University, Stanford, California, United States
Paul Wang
Stanford University, Stanford, California, United States
Euan Ashley
Marco Perez
Stanford University, Stanford, CA, USA.
Sanjiv Narayan
STANFORD MEDICINE, Stanford, California, United States
Albert Rogers
Stanford University, Redwood City, California, United States