0% found this document useful (0 votes)
4 views

CinC2020-039

This study presents two deep learning models for the automatic classification of 12-lead ECGs, addressing the inefficiencies of manual interpretation by medical practitioners. The models, which include a hybrid architecture of CNN and RNN as well as deep residual networks, were trained on a dataset of over 43,000 ECG recordings and demonstrated potential in classifying cardiac abnormalities. Despite achieving promising results, the models faced limitations in generalization across different databases and require further optimization.

Uploaded by

Muneeb Azad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

CinC2020-039

This study presents two deep learning models for the automatic classification of 12-lead ECGs, addressing the inefficiencies of manual interpretation by medical practitioners. The models, which include a hybrid architecture of CNN and RNN as well as deep residual networks, were trained on a dataset of over 43,000 ECG recordings and demonstrated potential in classifying cardiac abnormalities. Despite achieving promising results, the models faced limitations in generalization across different databases and require further optimization.

Uploaded by

Muneeb Azad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Automatic 12-lead ECG Classification Using Deep Neural Networks

Wenjie Cai, Shuaicong Hu, Jingying Yang, Jianjian Cao

University of Shanghai for Science and Technology, Shanghai, China

Abstract required for automated ECG interpretation.


Recently, deep learning has achieved great success in
ECG is the most commonly used diagnostic tool for computer vision, natural language processing and speech
identifying cardiovascular disease. However, manual recognition. With this cutting edge technique, researchers
interpretation of ECG is inefficient and requires medical have explored many methods for automatic ECG
practitioners with a lot of training. In this work we classification [3-9]. These methods mainly involve
proposed two deep learning models to classify ECG convolutional neural networks (CNN), recurrent neural
automatically. One model had a hybrid architecture of networks (RNN), or a combination of both. Hannun et al.
convolutional neural network and recurrent neural developed a deep residual neural network to classify
network. The other model contained deep residual neural single-lead ECG into 12 classes [3]. Their model got more
networks. The output layer of both models was activated accurate results than average cardiologists. Faust et al.
by a sigmoid function to get classification results. We proposed an LSTM model to detect atrial fibrillation and
manually located all the premature beats in each ECG achieved 98.51% accuracy [8]. Xiong et al. used 21-layer
recording and selected 10 s segments which contained at convolutional recurrent neural network to classify single
least one premature beat as training samples. Recordings lead ECGs in the 2017 PhysioNet/CinC Challenge and got
without premature beats were randomly split into 10 s F1 score of 0.82, which is among the best scores [9].
segments. The models were then trained on these ECG However, there are still few studies on the classification of
segments for 30 epochs with an optimizer of Adam. After 12-lead ECG. This may be due to the lack of appropriate
training, the model performance was evaluated on the database of 12-lead ECG. The PhysioNet/Computing in
hidden validation set and test set maintained by the Cardiology Challenge 2020 provides more than 43,000
challenge organizers. Our team, nebula, achieved a ECG recordings with diagnostic labels [10]. This study
challenge validation score of 0.526, and full test score of aims to develop an automated method for classifying
0.109, but was not ranked due to omissions in the cardiac abnormalities from 12-lead ECGs.
submission. The results show potential application value
in automatically classifying 12-lead ECG. 2. Methods

1. Introduction 2.1. Data preprocessing


Cardiovascular diseases (CVD) are the number one Data values of all recordings were divided by their
cause of death in the world, killing more than 17 million corresponding amplitude resolutions with the unit of mV.
lives each year [1]. Electrocardiogram (ECG), reflecting Then all samples were resampled to 500 Hz with fast
the electrical activity of the heart, is the preferred method Fourier transformation. Each lead of every recording was
for screening and diagnosing CVD. The standard ECG has subtracted by its mean value. There are some abnormal
12 leads and provides more diagnostic information than spikes [11] with the values greater than 20 mV in the
single lead ECG. Six of the leads are called “limb leads” recordings from the dataset of China Physiological Signal
which show information of electrical activity transmission Challenge in 2018 (CPSC2018). These spikes were
on the coronal plane. The other six leads are called “chest examined and replaced with normal values next to them.
leads” which show electrical transmission in the transverse
plane. The doctor makes a diagnostic conclusion by 2.2. Data relabeling
checking the ECG beat by beat and lead by lead. The ECG
interpretation process is time consuming and tedious, and Some labels were considered as the same diagnosis
it is prone to errors. Computerized interpretation of ECG according to scoring algorithm provided by the challenge
based on expert systems can reduce the workloads but it organizer. Complete right bundle branch block (CRBBB)
was reported to have a 5.8% higher error rate than average and right bundle branch block (RBBB) were merged as
cardiologists [2]. So more advanced algorithms are

Computing in Cardiology 2020; Vol 47 Page 1 ISSN: 2325-887X DOI: 10.22489/CinC.2020.039


Figure 1. The architecture of Model 1. The tensor dimensions of layer’s output are shown and t denotes the
samples of the input ECG.

Figure 2. The architecture of Model 2. The tensor


dimensions of layer’s output are shown and t denotes the Figure 3. The architecture of Res-SENet. The letter s means
samples of the input ECG. strides.

to the sample classifier which provided by the challenge


RBBB. Premature atrial contraction (PAC) and organizer. Briefly, all the ECG recordings were band-pass
supraventricular premature beats (SVPB) were merged as filtered between 0.5-15 Hz to remove baseline wandering
PAC. Ventricular ectopics (VEB) belongs to unscored and some noise. Then ECG peaks were detected based on
label, but it has the same medical meaning with Premature Pan-Tomkins algorithm [12]. The statistical features about
ventricular contractions (PVC) and ventricular premature the peak values and peak intervals including mean, median,
beats (VPB). So these three labels were merged together as standard deviation, variance, skewness, kurtosis were
PVC. For each unscored label, if the total number of ECG calculated. We extracted features from lead I, II, III and got
samples with this label was less than 300, we removed this 12 features from each lead. Counting age and gender, each
label from all recordings. recording generated a total of 38 characteristics.

2.3. Premature beats locating 2.5. Deep learning models architecture


For PAC or PVC, the premature beat may only occur Two models were proposed in this study. The first
once in a very long recording. So we manually located all model consists of five CNN layers, three max pooling
the premature beats and used segments that contained at layers, two stacked bidirectional GRU layers and two fully
least one premature beat for training. connected layers (Fig. 1). Sigmoid was used as the
activation function in the last layer and Rectified Linear
2.4. Feature extraction Unit (ReLU) was used elsewhere. The second model had
two parallel residual neural networks and each used the
The feature extraction process was carried out according residual neural network (ResNet) block as a basic block

Page 2
(Fig. 2). Each parallel Residual neural network contains 1 Table 1. Performance of proposed models on our own
CNN layer and 6 ResNet blocks, and the last 4 blocks used test set.
Squeeze-and-Excitation networks (SENet) to pay more
attention to meaningful feature channels (Fig. 3). The Methods Challenge Score
outputs of ResNet blocks were compressed by using a
Model 1 0.534
global average pooling layer and a global max pooling
Model 2 0.558
layer simultaneously. The last layer used a fully connected
Ensemble 0.560
layer with sigmoid as activation function. For both models,
XGBoost 0.546
their input dimensions were not fixed at a certain number,
so both models accepted ECG data with variable lengths.
Table 2. Performance of proposed models on the
2.6. Model training official validation set.

The challenge data were randomly shuffled and 80% of Methods Challenge Score
the data were put into the training set and the remaining Ensemble 0.526
were used as our own test set. Our models were trained XGBoost 0.517
with the training set using 5-fold cross validation strategy.
Although our models accepted data with various length,
data with fixed length can take the most advantage of Table 3. Performance of the ensemble model on the
parallel processing power of GPU and reduce a lot of official test set.
training time. Thus, we used 10 s segments for training in
this study. If a recording was labelled as PAC or PVC, the Test set Challenge Score
segments that contained at least one premature beat were Database 1 0.736
used. For other recordings, the segments were randomly Database 2 0.086
chosen. These segments were further processed for data Database 3 0.052
augmentation on the fly. Data augmentation techniques All 0.109
included adding random Gaussian noise, combining a
random sinusoidal signal [13] and shifting random baseline. on our own test set. As shown in Table 1, the best method
The models were trained using Adam algorithm with the was the ensemble model which combined the decisions of
learning rate set between 1e-3 and 1e-4. Total epochs were model 1 and model 2. It had a challenge score of 0.560.
set at 30. XGBoost classifier had a challenge score of 0.546 which
was lower than that of model 2 and ensemble model.
2.7. XGBoost classifier The models’ performance was further evaluated on the
hidden validation set. As shown in Table 2, the ensemble
Extreme gradient boosting (XGBoost) is an optimized model got a challenge score of 0.526 and XGBoost
decision trees based gradient boosting framework [14]. We classifier had a challenge score of 0.517.
trained 24 XGBoost classifiers to predict all the scored Finally, the ensemble model was evaluated on the
labels with normal features and deep features. Specifically, official full test set. As shown in Table 3, the model
deep features included the output of the second last layer received challenge scores of 0.736, 0.086 and 0.052 from
of the first model and the output of the last layer of the three test databases respectively. And our team got the final
second model. challenge score of 0.109.

2.8. Model inference 4. Discussion and Conclusions

The ECG recordings were pre-processed as described at The results shown in Section 3 indicate that the model
section 2.1. Then the data were fed into the deep learning with deeper layers is more effective in classifying ECG
models. The average values of two models’ outputs were abnormality than the model with shallower layers. Model
used to make a classification with threshold set at 0.5. If 1 is simple and contains 5 CNN layers with a small
XGBoost classifiers were used, normal features and deep receptive field. It can’t extract and identify complex
features were fed into 24 separate XGBoost classifiers to features. However, this simple model runs fast and can be
make predictions for 24 scored labels. used as a baseline model. Model 2 has two parallel deep
residual neural networks and each has 37 CNN layers. One
major difference between the two parallel deep residual
3. Results
neural networks lies in different convolution kernels and
different filters. So they have variant receptive fields.
After models training, we evaluated their performance

Page 3
Another difference lies in the first two ResNet blocks of [4] Wang G, Zhang C, Liu Y, et al. A global and updatable
both branches. One branch uses 1 dimensional CNN layers, ECG beat classification system based on recurrent
whereas another branch uses 2 dimensional CNN layers. neural networks and active learning. Information
The 2 dimensional CNN layer is designed to make sure that Sciences, 2019; 501:523-542.
[5] Yildirim Ö. A novel wavelet sequence based on deep
the same kernel walks through each lead and extract bidirectional LSTM network model for ECG signal
features common to different leads. The ResNet like classification. Computers in Biology and Medicine,
structure has shortcuts that jump over different layers, 2018; 96:189-202.
which can avoid the problem of vanishing gradients during [6] Sannino G, De Pietro G. A deep learning approach for
training and make full use of the features extracted by ECG-based heartbeat classification for arrhythmia
different convolutional layers. Furthermore, SENet, which detection. Future Generation Computer Systems, 2018;
won the first place in ILSVRC 2017 classification 86:446-455.
challenge [15], recalibrates channel-wise feature [7] Al Rahhal MM, Bazi Y, Al Zuair M, et al.
importance and makes the model more effective. So model Convolutional neural networks for electrocardiogram
classification. Journal of Medical & Biological
2 got much better performance than model 1. Engineering, 2018; 38:1014-1025.
Although XGBoost classifiers had made use of age, sex, [8] Faust O, Shenfield A, Kareem M, et al. Automated
peak related features and deep features, their performance detection of atrial fibrillation using long short-term
was not as good as model 2. One possible reason is that memory network with RR interval signals, Computers
these features are not good enough to make a classifier with in Biology and Medicine, 2018; 102:327-335.
high quality. Further features about frequency, HRV and [9] Xiong Z, Nash MP, Cheng E, et al. ECG signal
morphology may be required. The other reason is that we classification for the detection of cardiac arrhythmias
used the default parameters to train XGBoost classifiers, using a convolutional recurrent neural network,
and these default parameters were not optimal, which Physiological Measurement, 2018; 39(9):094006.
[10] Perez Alday EA, Gu A, Shah A, et al. Classification of
might lead to overfitting. 12-lead ECGs: the PhysioNet/Computing in
There are several limitations in our study. Firstly, an Cardiology Challenge. Physiological Measurement,
ablation study has not been carried out. Our proposed 2020 (Under Review).
models are not optimal and could be further tuned. [11] Cai W, Hu D. QRS complex detection using novel deep
Secondly, we trained our models on 10 s segments and learning Neural Networks. IEEE Access, 2020;
evaluated them on various long samples. It may attenuate 8:97082-97089.
the overall performance. Thirdly, the generalization of our [12] Pan J, Tompkins WJ. A real-time QRS detection
models needs to be improved since they had a big algorithm. IEEE Transactions on Biomedical
difference in performance on different databases of the Engineering, 1985; 32(3):230-236.
[13] Tan JH, Hagiwara Y, Pang W, et al. Application of
official test set. stacked convolutional and long short-term memory
In conclusion, the presented deep learning models network for accurate identification of CAD ECG
showed potential application value in automatically signals, Computers in Biology and Medicine, 2018;
classifying 12-lead ECG. 94:19-26.
[14] Chen T, Guestrin C. XGBoost: A scalable tree boosting
Acknowledgments system. Proceedings of the 22nd ACM SIGKDD
International Conference on Knowledge Discovery and
Data Mining, 2016; San Francisco, California, USA.
This work was supported by University of Shanghai for [15] Hu J, Shen L, Albanie S, et al. Squeeze-and-excitation
Science and Technology under Science and Technology networks, IEEE Transactions on Pattern Analysis and
Development Project. Machine Intelligence, 2020;42(8):2011-2023.

References
[1] Virani SS, Alonso A, Benjamin EJ, et al. Heart Disease Address for correspondence:
and Stroke Statistics-2020 Update: A report from the
American Heart Association. Circulation, Wenjie Cai
2020;141(9):e1-e458. School of Medical Instrument and Food Engineering,
[2] Rautaharju PM. Eyewitness to history: Landmarks in University of Shanghai for Science and Technology,
the development of computerized electrocardiography. 516 Jungong Road, Yangpu Distric, Shanghai, China
Journal of Electrocardiology, 2016; 49(1):1-6. [email protected]
[3] Hannun AY, Rajpurkar P, Haghpanahi M, et al.
Cardiologist-level arrhythmia detection and
classification in ambulatory electrocardiograms using a
deep neural network. Nature Medicine, 2019; 25(1):65-
69.

Page 4

You might also like