Abstract 4371591: Automated End-to-End Framework for Extracting Raw ECG Waveforms and ST Segment Values from ECG Reports and Predicting ST Elevation by Machine Learning

P Prasanth Ganesan (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.) X 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.) S Sabyasachi Bandyopadhyay R Rayan Ansari (Stanford University, Chatsworth, California, United States) S Sulaiman Somani (Stanford Health Care, Stanford, California, United States) K Kelly Brennan (Stanford University, San Francisco, California, United States) A Alexander Karius (Johns Hopkins School of Medicine, Baltimore, Maryland, United States) T Tina Baykaner (Stanford University, Stanford, California, United States) A Alexander Perino (Stanford University, Stanford, California, United States) P Paul Wang (Stanford University, Stanford, California, United States) E Euan Ashley M Marco Perez (Stanford University, Stanford, CA, USA.) S Sanjiv Narayan (STANFORD MEDICINE, Stanford, California, United States) A Albert Rogers (Stanford University, Redwood City, California, United States)

Abstract

Background: Manual analysis of ECG reports can be time-consuming and difficult to perform. Machine learning (ML) models have shown higher success when trained on raw time-series rather than images. There is need for an end-to-end approach that starts from extraction of raw data from ECG reports and also predicts ECG features using ML. Hypothesis: A novel automated method that extracts and parses raw time-series ECG data and associated text/numeric data of ST-segment values from PDF ECG reports, may enable prediction of ST elevation by ML. Methods: We collected stress test ECG reports from N=7,622 patients. We split the dataset into 60% for training, 10% for validation and 30% for testing the ML model (fig A). We developed an automated extraction algorithm to extract ECG waveforms and ST elevation values for each stage (baseline, worst case exercise, etc.) of stress test from the PDF ECG reports (fig B). The algorithm uses metadata detection and spatial colocalization techniques to export the ECGs and ST values as JSON files. We then used the ECGs from JSON files to train a Convolutional Neural Network model to predict the max ST value. Performance of extraction algorithm was assessed by visual review of thirty cases comparing the extracted output in fig C to the original PDF. ML model’s performance was assessed using RMSE score and AUROC for predicting max ST value. Results: Review of thirty reports showed a complete accurate match between the original PDF and the extracted results. Figure C shows an example result, where the arrows pointing from a text object to the ECG time-series indicate the respective associations. Fig D shows a truncated output JSON file which was used for ML modeling. The maximum ST value was mostly seen in leads II and V3. ML showed an RMSE of 1.66 on the hold-out test set, and an AUROC of 0.897 (fig E). Conclusion: An automated end-to-end tool that converts PDF vector objects to voltage time series allows preprocessing of raw electrocardiograms for physiological studies and machine learning.

Article Details

Journal Circulation
Volume / Issue Vol. 152, Issue Suppl_3
Published November 04, 2025
ISSN 0009-7322
Publisher Lippincott Williams & Wilkins

Journal Info

Circulation

Lippincott Williams & Wilkins

ISSN: 0009-7322 Health Sciences

Authors (14)

P

Prasanth Ganesan

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.

X

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.

S

Sabyasachi Bandyopadhyay

R

Rayan Ansari

Stanford University, Chatsworth, California, United States

S

Sulaiman Somani

Stanford Health Care, Stanford, California, United States

K

Kelly Brennan

Stanford University, San Francisco, California, United States

A

Alexander Karius

Johns Hopkins School of Medicine, Baltimore, Maryland, United States

T

Tina Baykaner

Stanford University, Stanford, California, United States

A

Alexander Perino

Stanford University, Stanford, California, United States

P

Paul Wang

Stanford University, Stanford, California, United States

E

Euan Ashley

M

Marco Perez

Stanford University, Stanford, CA, USA.

S

Sanjiv Narayan

STANFORD MEDICINE, Stanford, California, United States

A

Albert Rogers

Stanford University, Redwood City, California, United States