Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Electrocardiogram lead selection for intelligent screening of patients with systolic heart failure

## Introduction

Heart failure (HF) is a prevalent cardiovascular condition and a considerable public health problem1,2. Half of the patients with HF have systolic cardiac contractile dysfunction, which is usually confirmed by ejection fraction (EF) measured with echocardiography3. Although the echocardiographic diagnosis of systolic HF is precise, this modality is relatively time-consuming and costly in comparison with electrocardiography4. By contrast, a 12-lead electrocardiogram (12-lead ECG) is a convenient and inexpensive tool that provides comprehensive information on cardiac electrical dynamics. Consequently, its use is highly desirable for the early screening of suspected systolic HF.

In recent years, artificial intelligence (AI) has been widely used in the medical field5,6. Numerous AI ECG-based feature detection approaches have been employed, such as the use of artificial neural networks4, image classification–based convolutional neural networks (CNNs)7, time-relative recurrent neural networks8, and the unsupervised method9. Along with the rapid development of AI, studies on using ECG signals to prescreen for specific diseases based on AI algorithms are evolving rapidly. Crucial research on systolic HF combine 12-lead ECG for classification was markedly progressed. However, a single ECG lead or combination of leads primarily drove accuracy of EF discrimination is unknown. In this study, we applied the continuous wavelet transform (CWT) to convert the 1D-ECG signals to 2D spectra for 2D-CNN classification. The contribution of individual ECG leads to the classification result was evaluated, and a comprehensive scoring method was designed to improve outcomes.

## Methods

### Dataset

This study was approved by the Research Ethics Committee for Human Subject Protection, National Taiwan University Hospital, Hsinchu Branch, Hsinchu, Taiwan (IRB number:108-073-E), and each person enrolled were all over 18 years old and gave written informed consent to participate. All authors confirm that all the experiments were performed in accordance with relevant guidelines and regulations. Two datasets were used in this study. One included 1090 systolic HF patients with an EF of < 50%. The other included 10,000 individuals with an EF of > 50% and without HF symptoms. The EF was measured by echocardiography performed by cardiologists, and 12-lead ECG data were acquired at clinics or during hospitalization. Both datasets were provided by National Taiwan University Hospital, Hsinchu and Biomedical Park Branch. The 12-lead ECG data of all participants were obtained within one week after echocardiography identified their left ventricular EF (LVEF) greater than 50% or not. Each 12-lead ECG recording was from a single participant, without duplication.

### Patient selection

The patient selection process is presented in Fig. 1. Among the 1090 patients with reduced EF, 12-lead ECG data with excessive noise were excluded from this research. ECG data with excessive noise was attributed to interferences from baseline wander, power line interference, electromyography noise, and R peak detection error. Examples of noise illustrations were shown in Fig. 2. Excessive noise in the ECG signal resulted in a splitting error. Splitting errors may generate an atypical waveform map, which could mislead our model for finding EF features. Thus, such ECG signals were excluded from our study. The remaining 12-lead ECG data for 900 patients with systolic HF was used as the patient training dataset. The corresponding 900 age-matched and EF-normal individuals were selected from the dataset with 10,000 individuals from health examination. Information for the patients with systolic HF and the individuals without HF are presented in Table 1. A total of 214 individuals were excluded due to having ECG data with signal splitting errors. A total of 186 testing data were randomly selected from the remaining 772 patients with systolic HF and 814 individuals without HF. The data of the systolic HF patients and the individuals without HF (total 1400) were randomly separated into two groups: 90% of data were used for training (n = 1260) and 10% of data were used for validation (n = 140). All patient’s original EF values were measured with echocardiograph. The systolic HF patient (EF < 50%) and individuals without systolic HF (EF > 50%) were divided in two classes, and compared to the AI prediction class.

### Electrocardiogram extraction

The flow chart for the whole experiment, including ECG extraction, CWT, and 2D-CNN classification, is depicted in Fig. 3. Because the 12-lead ECG data were recorded as a JPG image, the ECG signals had to be extracted from the image. The extraction procedure involved processing the JPG image through image binarization and signal extraction to obtain pure ECG signals. Then, the ECG image was cut vertically into four parts, followed by searching for black pixels on each of three vertical line to reconstruct the original ECG signal. The reconstructed ECG signal was then normalized and calibrated. Each ECG line was cut between two R peaks to obtain three small segments, and the middle segment was selected as the single-beat ECG compound. This procedure generated 12 single-lead ECG compounds for further processing. The details of the ECG extraction process are demonstrated in Fig. 4.

### Continuous wavelet transform

The 12-lead ECG signals were transformed by CWT to 2D spectra. Wavelet transform can be used to analyze time series in different frequencies that contain nonstationary power. In this research, Daubechies CWT (db8) was used to transform the ECG signals because it has a favorable balance between time and frequency localization. The CWT and Daubechies wavelet formulas are shown in Eqs. (1) and (2).

CWT equation:

$${\text{CWT}}_{{\text{x}}}^{\uppsi } \left( {\tau ,s} \right) = \frac{1}{\sqrt s }\int x \left( t \right)\uppsi ^{*} \left( {\frac{t - \tau }{s}} \right){\text{d}}t$$
(1)

Daubechies equation:

$${\text{H}}_{\emptyset } \left( {{\text{e}}^{{{\text{j}}\upomega }} } \right) = \sqrt 2 \left( {\frac{{1 + {\text{e}}^{{ - j\upomega }} }}{2}} \right)^{p} R\left( {{\text{e}}^{{{\text{j}}\upomega }} } \right)$$
(2)

In the CWT Eq. (1), τand s correspond to the translation and scale parameters, respectively. ψ(t) is the transforming function, which also represents the mother wavelet. Matlab CWT toolbox was employed in the CWTs. In the Daubechies Eq. (2), $$p$$ represents a vanishing moment10. The Matlab wavelet toolbox was used for the implementation of these two equations.

### CNN structure

The neural network programming was based on the Python and Keras application programming interfaces. The 2D-CNN structure was modified from the Visual Geometry Group (VGG) network5 for the 12-lead ECG CWT spectra classification. The 12-lead ECG CWT spectra were first resized to 200 × 200 × 3 pixels and then passed to the 2D-CNN as inputs. A 14-layer 2D-CNN was constructed with 6 convolution layers, 6 max-pooling layers, 1 flatten layer and 1 dense output layer with softmax function. The rectified linear unit, batch normalization, and dropout functions were used after each convolution layer was applied. Binary cross-entropy was defined as the loss function. An Adam optimizer was employed as the learning guide for 2D-CNN learning, and its learning rate was set as 10–4. For detailed 2D-CNN structure and hyperparameter information, please refer to Tables S1 and S2. In this research, the 12-lead ECG spectra were separately passed to 12 identical 2D-CNNs.

The comprehensive 12-lead ECG scoring method is based on the 2D-CNN output layers with a softmax formula, which is displayed in Eq. (3).

$${\text{S}}\left( {{\text{yi}}} \right) = \frac{{{\text{e}}^{{{\text{yi}}}} }}{{\sum\limits_{j} {e^{{y_{j} }} } }}\quad for\;i \, = \, 1, \ldots j$$
(3)

The logits vector from the 2D-CNN flatten layer proceeds through the softmax layer, the output class probability score of i(yi), and the class probability score summation [$$\sum\nolimits_{j} {e^{{y_{j} }} }$$ (for j from 0 to 1)]6. In our research, the 12-lead ECG CWT spectra were separately passed to 12 2D-CNNs, which generated 12 probability scores in the individual without HF class. The 12 probability scores were employed in our comprehensive 12-lead ECG scoring method.

### Statistical method

Descriptive continuous data were presented as mean ± standard deviation if normal distributed or otherwise as median/IQR. Ejection fraction measured by echocardiography were compared with comprehensive scoring and 12-lead 2D-CNN scoring predictions using accuracy, sensitivity, specificity, and f1 score formulas. These formulas can be used to evaluate the predictive capability of the 12-lead ECG, 2D-CNN model as well as the true positive (TP), true negative (TN), false positive (FP), and false negative (FN) rates11. These formulas are written as follows: accuracy = (TP + TN)/(TP + TN + FP + FN), sensitivity = TP/ (TP + FN), specificity = TP/(TP + FN), precision = TP/(TN + FP), recall = TP/(TP + FN) and f1 score = (2 × precision × recall)/(precision + recall).

The receiver operating characteristic curve (ROC) was used as an evaluation method in this study. The ROC curve is a common analysis method for evaluating deep learning models. Using ROC curves, the graphical display of true positives (as the y-axis) versus false positives (as the x-axis) can be observed and compared directly. The area under the ROC curve (AUC) represents the equivalent of the probability when randomly selecting a sample. The classifier ranks a randomly chosen positive sample higher than a randomly chosen negative sample. The AUC value ranges between 0 and 1, and if the AUC value is in the range of 0.5 < AUC < 1, it means the classifier has more effective predicting ability than random guesses12.

## Results

### Systolic HF prediction results

The 12-lead ECG data of the 900 HF patients and the 900 individuals without HF were transformed into CWT spectra. The baseline data of individuals with and without systolic HF are listed in Table 1. Furthermore, Table 2 presents the characteristics of the training, validation, and testing sets. In the testing dataset (n = 186), the mean LVEF was 32.6 ± 3.4%, and 73 (39.2%) patients had myocardial infarction, 82 (44.1%) had hypertension, and 69 (37.1) had diabetes. Those values were similar to those in the training dataset (LVEF = 32.3 ± 4.6, p = 0.25; myocardial infarction 36.7%, p = 0.16; hypertension 48.5%, p = 0.09, and diabetes 37.0%, p = 0.11). Figure 5 illustrates the original ECG data from the JPG image and the CWT spectra. The CWT spectra can concentrate the unobvious ECG linear features into 2D image, which can enhance specific features of HF for machine learning classification. Also, the tenfold cross validation had been applied to our model, and demonstrated that the V6 had the highest average accuracy of 89.07% (Table S3).

### Systolic HF prediction results for individual leads

A total of 1400 ECG training data and 186 ECG testing data were used in this study. The accuracy, sensitivity, specificity, and f1 score of the test dataset are revealed in Table 3. The ECG results for individual ECG leads were favorable for the classification of patients with systolic HF. Each lead had accuracy ranging from 0.71 to 0.93. In particular, lead V6 exhibited the highest accuracy (0.93), specificity (0.97), and f1 score (0.94). The full results are presented in Table 3A.

## Discussion

A pre-screening systolic HF was established in this study. However, prospective testing of this method is still needed. The novel and comprehensive 12-lead ECG scoring method can achieve higher classification performance than individual leads. The individual leads had an average accuracy, sensitivity, and specificity of 0.75 and an f1 score of 0.83. However, the accuracy (0.94), specificity (0.97), sensitivity (0.89), and f1 score (0.94) all improved when the comprehensive 12-lead ECG scoring method was used.

In the individual lead results, V6 had higher accuracy than the other 11 leads. The screening results revealed that V6 was the representative lead of the 12-leads for pre-screening patients for systolic HF. This might be because V6 is the lead physically closest to the left ventricle. In comprehensive scoring, the four methods all had high classification capability. Among them, V5 and V6 had better classification capability than the other comprehensive scoring methods. In the ROC curve, the comprehensive scoring method exhibited significantly improved AUC compared with the AUC of the 12 individual leads. Therefore, V6 single lead and the comprehensive scoring method can be highly effective for screening patients for systolic HF.

In previous EF prediction research, many studies used ECG features and physiological parameters to predict EF13. However, by restricting the ECG features in the method, researchers may have ignored other important features. A previous study applied AI for predicting EF using the entire 12-lead ECG signal as a matrix and feeding into 2D-CNN for EF prediction14. But the crucial ECG leads were not identified.

In many ECG AI studies, researchers used 1D-CNN to classify ECG signals, such as for atrial fibrillation classification4,15. We compare 1D and 2D-CNNs in this study by establishing three simple 1D-CNN models and applied the 1D-CNN structure of the two papers on our dataset16,17 (Tables S4S7). According to the above comparison, our 2D-CNN shows the highest accuracy in predicting systolic heart failure compared to the other three 1D-CNN models. Although such a result may be limited by the amount of training data, it still reveals that the 2D-CNN model may perform better than the 1D-CNN models when classifying using a single ECG compound.

Another study applied ECG CWT in a 2D-CNN for atrial arrhythmia detection but also focused on only one lead feature18. These studies have revealed that ECG CWT is a powerful tool for identifying abnormal ECG features. In our research, all ECG leads were used to expand all ECG features to the 2D-CNN to enhance the systolic HF classification capability. A key lead, useful for pre-screening patients for systolic HF, was identified by separately training the 12-leads in identical 2D-CNN models. The key lead cannot be identified without training the 12-leads concurrently.

Several ECG features have been used to assess the LV function, and the presence of prolonged QRS duration is a strong marker for diminished LV systolic function19. Our study also supported these findings. Under our algorithm, the widening of QRS and lower QRS amplitude imply the high probability of poor LVEF. As shown in supplemental Fig. 1, we also found other specific features that suggested poor contractility, including p wave amplitude, T amplitude and ST interval, which were also the possible indicators for poor LV contractility20,21,22. Our AI-assisted algorithm could combine those features and assess the possibility of LVEF of < 50% with good accuracy. On the other hand, our algorithm aimed to screen patients with reduced LVEF (LVEF < 50%) by using only 12-lead ECG, which is low-cost and easily-feasible. In many rural areas and developing countries, the difficult access to cardiologic care and imaging could cause under-diagnosis and treatment for heart failure. Our algorithm by converting 12-lead ECG to 2D images rather than raw data provides a portable, inexpensive test for ventricular systolic dysfunction. The early diagnosis of left ventricular dysfunction could permit early institution of effective therapies, such as beta-blockers, angiotensin receptor antagonists and implantable devices. Along with the smartphone-enable electrodes, the single-lead ECG could be acquired by using mobile applications. Our algorithm could also be incorporated into those applications to assess the ventricular function.

### Study limitation

The limitations of this research are deficiencies for patients with systolic HF and noise in all ECG data. For future studies to further improve screening accuracy, it is imperative to collect training data from hospitals to enhance the dataset continually. The new data can be used to improve our model’s performance. Furthermore, ECG signals should be kept clear and noise-free to prevent ECG slicing issue. Also, in this study, the prevalence of disease in our study cohort does not reflect prevalence in the general population. Thus, further research is needed to assess the utility of the given cutoffs in a general, ostensibly healthy population. At last, our dataset excluded patients with heart failure symptoms but with normal left ventricular systolic function. Therefore, heart failure patients with preserved LVEF may not be identified by using our algorithm.

## Conclusion

In this research, we revealed that ECG CWT spectra can expand all ECG features for 2D-CNN classification. With the comprehensive 12-lead ECG scoring method, systolic HF screening obtained an accuracy of over 0.94 in Lead V5 and V6 and an AUC of 0.98 in Lead I and V6. In addition, we found that the V6 lead is vital for detecting systolic HF. Overall, this study provided an effective and accurate screening method for predicting cardiac contractile dysfunction using 12-lead ECG images.

## References

1. 1.

Garg, R., Packer, M., Pitt, B. & Yusuf, S. Heart failure in the 1990s: evolution of a major public health problem in cardiovascular medicine. J. Am. Coll. Cardiol. 22, 3A-5A. https://doi.org/10.1016/0735-1097(93)90454-9 (1993).

2. 2.

Stewart, S. et al. The current cost of heart failure to the National Health Service in the UK. Eur. J. Heart Fail. 4, 361–371. https://doi.org/10.1016/s1388-9842(01)00198-2 (2002).

3. 3.

Cikes, M. & Solomon, S. D. Beyond ejection fraction: an integrative approach for assessment of cardiac structure and function in heart failure. Eur. Heart J. 37, 1642–1650. https://doi.org/10.1093/eurheartj/ehv510 (2016).

4. 4.

Attia, Z. I. et al. Screening for cardiac contractile dysfunction using an artificial intelligence–enabled electrocardiogram. Nat. Med. 25, 70–74. https://doi.org/10.1038/s41591-018-0240-2 (2019).

5. 5.

Simonyan, K. & Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv preprint https://arxiv.org/abs/1409.1556 (2014).

6. 6.

Bishop, C. M. Pattern Recognition and Machine Learning (Information Science and Statistics) (Springer, Berlin, 2006).

7. 7.

Sengupta, P. P., Kulkarni, H. & Narula, J. Prediction of abnormal myocardial relaxation from signal processed surface ECG. J. Am. Coll. Cardiol. 71, 1650–1660. https://doi.org/10.1016/j.jacc.2018.02.024 (2018).

8. 8.

Zhu, F., Ye, F., Fu, Y., Liu, Q. & Shen, B. Electrocardiogram generation with a bidirectional LSTM-CNN generative adversarial network. Sci. Rep. 9, 6734. https://doi.org/10.1038/s41598-019-42516-z (2019).

9. 9.

Rodriguez-Sotelo, J. L., Peluffo-Ordonez, D., Cuesta-Frau, D. & Castellanos-Dominguez, G. Unsupervised feature relevance analysis applied to improve ECG heartbeat clustering. Comput. Methods Programs Biomed. 108, 250–261. https://doi.org/10.1016/j.cmpb.2012.04.007 (2012).

10. 10.

Chun-Lin, L. A Tutorial of the Wavelet Transform (NTUEE, Taiwan, 2010).

11. 11.

Ebrahimzadeh, E., Pooyan, M. & Bijar, A. A novel approach to predict sudden cardiac death (SCD) using nonlinear and time-frequency analyses from HRV signals. PLoS ONE 9, e81896. https://doi.org/10.1371/journal.pone.0081896 (2014).

12. 12.

Fawcett, T. An introduction to ROC analysis. Pattern Recognit. Lett. 27, 861–874. https://doi.org/10.1016/j.patrec.2005.10.010 (2006).

13. 13.

O’Neal, W. T. et al. Electrocardiographic predictors of heart failure with reduced versus preserved ejection fraction: the multi-ethnic study of atherosclerosis. J. Am. Heart Assoc. 6, e006023. https://doi.org/10.1161/JAHA.117.006023 (2017).

14. 14.

Attia, Z. I. et al. Screening for cardiac contractile dysfunction using an artificial intelligence-enabled electrocardiogram. Nat. Med. 25, 70. https://doi.org/10.1038/s41591-018-0240-2 (2019).

15. 15.

Attia, Z. I. et al. Age and sex estimation using artificial intelligence from standard 12-lead ECGs. Circ. Arrhythm. Electrophysiol. 12, e007284. https://doi.org/10.1161/CIRCEP.119.007284 (2019).

16. 16.

Kiranyaz, S., Ince, T. & Gabbouj, M. Real-time patient-specific ECG classification by 1-D convolutional neural networks. IEEE T Bio-Med. Eng. 63, 664–675. https://doi.org/10.1109/Tbme.2015.2468589 (2016).

17. 17.

Hsieh, C. H., Li, Y. S., Hwang, B. J. & Hsiao, C. H. Detection of atrial fibrillation using 1D convolutional neural network. Sens. Basel 20, 2136. https://doi.org/10.3390/s20072136 (2020).

18. 18.

He, R. et al. Automatic detection of atrial fibrillation based on continuous wavelet transform and 2D convolutional neural networks. Front. Physiol. 9, 1206. https://doi.org/10.3389/fphys.2018.01206 (2018).

19. 19.

Khan, N. K. et al. Prevalence of ECG abnormalities in an international survey of patients with suspected or confirmed heart failure at death or discharge. Eur. J. Heart Fail. 9, 491–501. https://doi.org/10.1016/j.ejheart.2006.11.003 (2007).

20. 20.

O'Neal, W. T. , et al. Electrocardiographic predictors of heart failure with reduced versus preserved ejection fraction: the multi-ethnic study of atherosclerosis. J. Am. Heart Assoc. 6, e006023. https://doi.org/10.1161/JAHA.6117.006023 (2017).

21. 21.

Silva, R. M., Kazzaz, N. M., Torres, R. M. & Moreira Mda, C. P-wave dispersion and left atrial volume index as predictors in heart failure. Arq. Bras. Cardiol. 100, 67–74. https://doi.org/10.1590/s0066-1782x2012005000115 (2013).

22. 22.

Rautaharju, P. M., Kooperberg, C., Larson, J. C. & LaCroix, A. Electrocardiographic predictors of incident congestive heart failure and all-cause mortality in postmenopausal women: the Women’s Health Initiative. Circulation 113, 481–489. https://doi.org/10.1161/CIRCULATIONAHA.1105.537415 (2006).

## Funding

This study was supported by the Science and Technology Unit, Ministry of Health and Welfare, Executive Yuan, Taiwan (109-2628-B-002-033).

## Author information

Authors

### Contributions

T.-T.L., S.-F.L. and L.-Y.L. conceived the presented idea. T.-T.L. and L.-T.Y. collected data and measured the ejection fraction scores. Y.-A.C., J.-Y.S. and S.-Y.W. performed the experiments, derived the models and analyzed the data. T.-T.L. and Y.-A.C. wrote the manuscript. T.-T.L. and S.-F.L. revised the final manuscript for submission.

### Corresponding authors

Correspondence to Ting-Tse Lin or Shien-Fong Lin.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Chiou, YA., Syu, JY., Wu, SY. et al. Electrocardiogram lead selection for intelligent screening of patients with systolic heart failure. Sci Rep 11, 1948 (2021). https://doi.org/10.1038/s41598-021-81374-6

• Accepted:

• Published: