Deep neural networks detect regional wall motion abnormalities and preclinical cardiovascular disease from 12-lead ECGs

Background Identifying regional wall motion abnormalities (RWMAs) is critical for diagnosing and risk stratifying patients with cardiovascular disease, particularly ischemic heart disease. We hypothesized that a deep neural network could accurately identify patients with regional wall motion abnormalities from a readily available standard 12-lead electrocardiogram (ECG). Methods This observational, retrospective study included patients who were treated at Beth Israel Deaconess Medical Center and had an ECG and echocardiogram performed within 14 days of each other between 2008 and 2019. We trained a convolutional neural network to detect the presence of RWMAs, qualitative global right ventricular (RV) hypokinesis, and varying degrees of left ventricular dysfunction (left ventricular ejection fraction [LVEF] ≤50%, LVEF ≤40%, and LVEF ≤35%) identified by echocardiography, using ECG data alone. Patients were randomly split into development (80%) and test sets (20%). Model performance was assessed using area under the receiver operating characteristic curve (AUC). Cox proportional hazard models adjusted for age and sex were performed to estimate the risk of future acute coronary events. Results The development set consisted of 19,837 patients (mean age 66.7±16.4; 46.7% female) and the test set comprised of 4,953 patients (mean age 67.5±15.8 years; 46.5% female). On the test dataset, the model accurately identified the presence of RWMA, RV hypokinesis, LVEF ≤50%, LVEF ≤40%, and LVEF ≤35% with AUCs of 0.87 (95% CI 0.858–0.882), 0.888 (95% CI 0.878–0.899), 0.923 (95% CI 0.914–0.933), 0.93 (95% CI 0.921–0.939), and 0.876 (95% CI 0.858–0.896), respectively. Among patients with normal biventricular function at the time of the index ECG, those classified as having RMWA by the model were 3 times the risk (age- and sex-adjusted hazard ratio, 2.8; 95% CI 1.9–3.9) for future acute coronary events compared to those classified as negative. Conclusions We demonstrate that a deep neural network can help identify regional wall motion abnormalities and reduced LV function from a 12-lead ECG and could potentially be used as a screening tool for triaging patients who need either initial or repeat echocardiographic imaging.


Introduction
Ischemic heart disease (IHD) remains the leading cause of death and disability worldwide 1,2 .IHD causes a wide spectrum of symptoms, and some patients with undiagnosed coronary artery disease may present with atypical or without obvious cardiac symptoms, which may delay diagnosis and intervention.Once identified, interventions such as medications and revascularization can be initiated to improve patient outcomes 3 .Echocardiography is an important non-invasive diagnostic tool for identifying patients with IHD through its ability to identify global ventricular dysfunction and regional wall motion abnormalities (RWMAs) that correlate with prior myocardial infarction or areas with hibernating myocardium due to inadequate blood flow.However, echocardiography is expensive, time consuming, and requires expert interpretation.Assessment of RWMA can help in the diagnosis of acute and chronic myocardial infarction 4 , as well as differentiating between ischemic and non-ischemic cardiomyopathy.
Echocardiography is the most common diagnostic modality to determine RWMAs, however, it is unclear when initial or repeated imaging should be performed, as ischemic disease progresses at different rates.Furthermore, access to echocardiography is limited in many clinical settings due to lack of resources or expertise.The electrocardiogram (ECG), however, is a widely available and inexpensive diagnostic tool that is commonly used to evaluate patients with suspected acute coronary syndrome.Recent studies have demonstrated the ability of deep learning to detect left ventricular dysfunction, myocardial infarction, and many other cardiovascular diseases from the ECG [5][6][7][8] .
In this observational, retrospective study we developed and validated a novel deep learning model to identify the presence of RWMA, global right ventricular (RV) hypokinesis and reduced left ventricular ejection fraction (LVEF) based on analysis of ECG alone.We leveraged two openaccess databases of matched patient ECG and echocardiography reports collected from the intensive care unit and emergency room 9,10 .In patients where our model detected RWMA, we explored the model's ability to localize the abnormal regions of the myocardium.We also evaluated the model's ability to identify patients with normal biventricular function at the time of initial screening, but at increased risk of future wall motion abnormalities, reduced LVEF, and acute coronary events.

Study design and participants
Digitally stored 12-lead ECGs from patients aged 18 years or older that were captured within 14 days of the patient having two-dimensional echocardiographic imaging performed at Beth Israel Deaconess Medical Center (BIDMC) between Jan 1, 2008, and Dec 31, 2019, were identified.In the case of a patient having more than one echocardiogram performed during the study period, all were included for model development and only the first available exam was used for testing.If a patient had more than one ECG within 14 days of an echocardiogram during the study period, all were included for model development and the ECG performed closest to the time of echocardiography was used for testing.Patients without assessment of LV function reported in the echocardiography notes were excluded (Figure 1).Data used for the study was collected from three public databases, Medical Information Mart for Intensive Care (MIMIC)-IV-ECG, MIMIC-IV-Note, and MIMIC-IV-ECHO [9][10][11] .Clinical data linked to patients included in the study was matched using the publicly available database, MIMIC-IV 12 .

Ground truth
ECGs were labeled using echocardiography reports collected from the MIMIC-IV-Note dataset.RWMAs and their severity (hypokinesis, akinesis, or dyskinesis) were assigned to a location on the standard AHA 17-segment model 13 .All echocardiograms were read by a BIDMC cardiologist who was board certified in echocardiography.In the present study, we divided the left ventricle into seven regions in accordance with the coronary perfusion territories as: anterior, anterolateral, anteroseptal, apical, inferior, inferolateral, and inferoseptal 14 (Supplementary Figure 1).We annotated the seven regions accordingly and included a composite RWMA endpoint for each patient defined as having ≥1 abnormal wall segment.

Data partition
Patients were randomly split into development (80%) and test sets (20%).The development set was used to train and validate the model using fivefold cross-validation.The first four folds were used to assess model robustness and the fifth fold was used to select the highest performing model and optimal thresholds.The test set consisted of patients not included in the development set and was used to report the model performance.

Model development
We developed a multilabel convolutional neural network (CNN) to identify the presence of RWMAs, global RV hypokinesis, and reduced LVEF at various cut points from the 12-lead ECG.The model consisted of a feature-extraction component and classifier.For feature-extraction, we used a CNN encoder based on the resnet-101 architecture 16 with lead-specific convolutions.The lead-specific convolutions allowed the network to extract temporal features from each lead in parallel.A final convolutional layer was used to aggregate the lead-specific features, which were passed to a global average pooling layer for classification.The classifier was composed of two fully connected layers with dropout before each layer, and a sigmoid activation applied to each output.The model takes as input a 10-second 12-channel ECG waveform with a sampling frequency of 500 Hz and outputs a probability score for the presence of RWMA with a score for each region (anterior, anterolateral, anteroseptal, apical, inferior, inferolateral, and inferoseptal), ≥1 akinetic or dyskinetic wall, LVEF ≤50%, LVEF ≤40%, and LVEF ≤35%, and global RV hypokinesis.Detailed processes for model development and hyperparameter tuning are provided in the appendix.
For comparison, a reference model was derived using patient demographics and ECG findings extracted from cardiologist reports available in MIMIC-IV-Note.We trained a random forest classifier using as input the patient age, sex, and presence of 41 different ECG findings (Supplementary Table 1).Furthermore, we pretrained the deep learning model on patients from the MIMIC-IV-ECG dataset without an associated echocardiography report available in MIMIC-IV-Note (Figure 1).The model was pre-trained to detect the presence of 41 different ECG findings extracted from the ECG cardiologist overreads available in MIMIC-IV-Note.All findings were extracted from the reports using regular expressions.An overview of the ECG findings used for pre-training are provided in the appendix (Supplementary Table 1).No patients included in the study were used for pre-training (Figure 1).

Model evaluation
The primary objective of the study was to evaluate the ability of a deep neural network to identify any RWMA, reduced LVEF, and global RV hypokinesis from a 12-lead ECG using the MIMIC-IV-ECG and MIMIC-IV-Note datasets.We additionally assessed performance of the model to localize RWMA classification to one or more of the seven regions of the left ventricular myocardium reflective of coronary perfusion territories.To measure potential bias from the model we performed subgroup analyses across patient age, sex, and self-reported race/ethnicity found in the MIMIC-IV dataset and cardiologist reported ECG findings.Diagnostic odds ratios (ORs) were computed for each subgroup.
Our secondary objective was to assess the prognostic value of the model to identify patients with normal biventricular function at the time of their index ECG-echocardiogram, but at increased risk of developing future RWMAs, reduced LVEF, RV hypokinesis, and a composite label for any of the endpoints during 5-year follow-up.Subsequent echocardiograms following the index ECG-echocardiogram were used for analysis of follow-up.We also evaluated the model's ability to identify patients with normal biventricular function and no history of ischemic heart disease diagnosed prior to or during their admission of screening, but at increased risk of acute coronary events during 5-year follow-up.Acute coronary events were defined as myocardial ischemia or its acute complications, or a coronary revascularization procedure such as percutaneous angioplasty/stent placement or coronary artery bypass graft surgery.Clinical outcomes and acute coronary events were identified by the presence of International Classification of Diseases (ICD)-10 and ICD-9 codes available in MIMIC-IV 12 (Supplementary Table 2).Cox proportional hazard models adjusted for age and sex were performed to estimate the risk of each endpoint.

Statistical analysis
The performance of the model was evaluated using the area under the receiver operating characteristic curve (AUC), sensitivity, specificity, positive and negative predictive values.To estimate 95% confidence intervals (CIs), we used non-parametric bootstrapping with 1,000 samples.Sensitivity and specificity were calculated at binary decision thresholds.The optimal decision threshold for each class was calibrated using the receiver operating curve and Youden index analysis on the final cross-validation fold.Delong's test was used to compare the AUC between the deep learning model and reference model on the test set.Continuous variables were compared using Student's t-test and categorical variables were compared with chi-Squared test.We considered two-sided p values <0.05 statistically significant.Kaplan-Meier analysis was used to compare the incidence of RWMA, global RV hypokinesis, reduced LVEF, and acute coronary event for true negatives versus false positives during follow-up.All models and statistics were computed using Python (v.3.8.12).Deep learning models were trained using the PyTorch (v1.7.0).Data analysis was performed using numpy (1.19.5), pandas (1.2.0), scipy (1.6.0), and scikit-learn (0.24.0).For data visualization and scientific plotting matplotlib (3.2.2) and seaborn (0.12.2) were used.Kaplan-Meier curves were computed using R (v 4.3.1)with the survival and survminer packages.3) with similar model performance regardless of ECG findings apart from paced rhythms or left bundle branch block where model performance was slightly reduced.

A
Among patients with normal biventricular function at the time of the index ECG, those classified as having a RWMA (false positive) by the model were 3 times the risk (age-and sex-adjusted hazard ratio, 3.2; 95% CI 2.2-4.6) of presenting with a future RWMA compared to those initially classified as negative (true negative) (Figure 2A).Similarly, the hazard ratios comparing false positives and true negatives for global RV hypokinesis and LVEF ≤40% were 6.2 (95% CI 3.6-10.8)and 4.1 (95% CI 2.7-6.4),respectively (Figure 2B-C).Patients classified as positive for at least one abnormality by the model were 3 times the risk (3.0 HR; 95% CI 2.3-4.0) of presenting a future composite event (RWMA, global RV hypokinesis, or LVEF ≤50%).Among patients with normal biventricular function and no history of ischemic heart disease, patients classified as positive for RWMA had a 2.8-fold increased hazard for acute coronary events (95% CI 1.9-3.9)(Figure 3).  .

Discussion
In summary, we developed and validated a novel deep learning model to identify and localize regional motion abnormalities from a 12-lead ECG alone.The added value of this study is twofold: First, we show that deep neural networks can accurately detect abnormal wall motion in individual wall segments (AUC: 0.85 to 0.91), global RV hypokinesis (AUC: 0.88), LVEF ≤50% (AUC: 0.89) LVEF ≤40% (AUC: 0.92), and LVEF ≤35% (AUC: 0.93).Second, we showed that our model may be able to detect subtle patterns in the ECG able to identify patients with normal biventricular function at the time of initial screening, but at increased risk of future ischemic heart disease (Figure 3).Early identification of high-risk patients may enable healthcare providers to intervene proactively, preventing the occurrence of detrimental events such as suffering a heart attack.
This study is the first to accurately identify and localize regional wall motion abnormalities from the 12-lead ECG.While recent studies have demonstrated the potential of deep learning-enabled ECGs to detect severely reduced LVEF, a large proportion of these studies were developed and validated using closed or proprietary datasets [5][6][7][8]  Our study adds to this previous work for the detection of reduced LVEF by introducing a model that explicitly identifies the presence of RWMAs, which may help differentiate if the reduced LVEF may be from a focal abnormality compared to a global disease, and which has important implications for further diagnosis and intervention.We are unable to compare the performance of our model to prior studies because the models and data are unavailable.
Our choice of dividing the left ventricle into seven myocardial regions reflective of the coronary perfusion territories may provide value in identifying patients with single-vessel versus multivessel coronary artery disease.These seven regions are also in accordance with ASE segmentation guidelines 14 and may complement RWMA assessment during echocardiography, especially when views are suboptimal.Additionally, our model could be used to detect which patients require repeat electrocardiography.For patients with suspected acute coronary syndrome, this model may help monitor both the onset of new RWMAs or changes in LVEF that require further evaluation or intervention.
In addition to effectively identifying patients with RWMA or reduced LVEF, our secondary objective demonstrates that our deep learning model may also identify patients with seemingly normal biventricular function who are at increased risk of future RWMA.Notably, these patients predicted as positive by model (false positive) had a threefold increased risk of developing a new RWMA over the next 5 years.We repeated this analysis for global RV hypokinesis and LVEF ≤40%, which revealed a sixfold and fourfold increased risk for each, respectively.In patients with normal biventricular function and no history of ischemic heart disease, the false positives of the model had a near threefold increased risk of acute coronary events.These findings suggest that the model may detect subtle or structural patterns in the ECG predictive of future ischemic events.
Ischemic heart disease prevalence and outcomes are known to be highly variable across patient age, sex, and race/ethnicity 17 .Moreover, studies have demonstrated the need to assess potential bias of analyzing ECGs across diverse demographics 18 .To understand how our model performs across different patient profiles we performed subgroup analyses accordingly.We observed consistent performance across sex and race/ethnicity.Although the model was accurate in patients of all ages, we found performance was best in younger patients.Notably, the model was less accurate in patients with paced rhythms or left bundle branch block (Supplementary Figure 3).However, given the difficulty in identifying subtle ECG abnormalities in patients with paced ECGs and left bundle branch block, despite its reduced accuracy in these patients, the model still provided useful and actionable data.
This study has several limitations.First, this is a retrospective, single-center study that requires further external and prospective validation before translation to the clinical arena.Second, due to sample sizing, the RWMA endpoint defined in our study did not differentiate between the severity of wall motion, and hypokinesia, akinesia, and dyskinesia were treated similarly as "wall motion abnormalities".Discriminating between patients with hypokinetic, akinetic, and dyskinetic wall motion abnormalities could have additional clinical utility.Third, the echocardiographic findings were dependent on the final read of the interpreting cardiologist, which is known to be subject to interobserver variability.Systematic reinterpretation was not performed due to the impracticality of reinterpreting the large number of studies included.
In conclusion, deep neural networks models can accurately screen for regional wall motion abnormalities and identify patients at increased risk of future ischemic heart disease using a low cost and ubiquitous 12-lead ECG.Based on the observed performance from this study, this model may support and inform clinical decision making for patients with ischemic heart disease who could benefit from medical intervention.
Supplementary Figure 1.Left ventricular wall segme labeling convention for each of the seven ASE regions 14 .

Figure 2 .
Figure 2. Subgroup analysis of the deep learning model by patient age, sex, and race/ethnicity using diagnostic odds ratio (OR) with 95% confidence intervals (CIs).The vertical dashed lines represent the OR of the model across all patients in the test set.

Figure 3 .
Figure 3. Cumulative incidence of cardiovascular outcomes in patients with initially normal biventricular function at the time of the index ECG-echo stratified by model classification during a 5-year follow-up period.(A) Cumulative incidence curves for RWMA stratified by classification of RWMA (B) Cumulative incidence curves for global RV hypokinesis stratified by classification of global RV hypokinesis.(C) Cumulative incidence curves for LVEF ≤40% stratified by classification of LVEF ≤40% (D) Cumulative incidence curves for a composite endpoint (any RWMA, LVEF ≤50%, or global RV hypokinesis) stratified by any abnormal classification (E) Cumulative incidence curves for acute coronary events in patients with normal biventricular function and no history of ischemic heart disease prior to or during the index admission stratified by classification of RWMA.

Table 1 .
total of 109,060 ECGs associated with 39,144 echocardiograms from 24,790 patients were included in the study.The development set consisted of 19,837 patients (mean age 66.7±16.4years;46.7%female) and the test set consisted of 4,953 patients (mean age 67.5±15.8years;46.5% female).Median time between ECG and echocardiography of the training set and test sets were 1.8 days (IQR 0.7-4.7 days) and 0.77 days (IQR 0.2-1.8days).A RWMA was observed in 3856 (19.4%) and 1049 (21.2%) of patients in development and test sets and global RV hypokinesis in 1360 (6.9%) and 355 (7.2%), respectively (Table 1).Sample sizes for segment level wall motion abnormalities are provided in Supplementary Table 3 and baseline ECG findings in Supplementary Table 1.Patient baseline characteristics at the time of the index ECG-echocardiogram.Values are n (%) or mean SD.Student t-test and chi-squared test were used (BMI=body mass index, LVEF=left ventricular ejection fraction, RWMA=regional wall motion abnormality, RV=right ventricular) The deep learning model significantly outperformed the reference model to detect RWMA (P<0.001).The deep learning model identified abnormal wall motion in individual wall segments with an AUC ranging from 0.853 to 0.913, sensitivity from 69.3 to 83.4%, and specificity from 76.7 to 83.8% (Table2).The sensitivity of the model to identify RWMA was correlated with the number of abnormal wall segments (Supplementary Figure2).

Table 2 .
Model performance of the deep learning model on the test set (RWMA=regional wall motion abnormality, LVEF=left ventricular ejection fraction, RV=right ventricular, AUC=area under the receiver-operator curve, PPV=positive predictive value, NPV=negative predictive value, 95% CIs computed using bootstrapping with 1,000 samples)We evaluated model performance across subgroups of patient age, sex, and race/ethnicity (Table3).The model showed consistent performance for both sexes.Performance was robust across all age groups for the detection of reduced LVEF and RV hypokinesis, however, model performance to identify RMWAs was comparatively lower in older patients compared to younger patients.

Table 1 .
ECG findings from the entire cohort.Values are provided as n (%).Chi-squared test was used.

Table 3 .
Number of wall motion findings by left ventricular region across the entire cohort.