Classifying Electrocardiograph Waveforms Using Trained Deep Learning Neural Network Based On Wavelet Representation
Classifying Electrocardiograph Waveforms Using Trained Deep Learning Neural Network Based On Wavelet Representation
Corresponding Author:
Noor Yahya Jawad
Department of Computer Techniques Engineering, Al-Safwa University College
Karbala, Iraq
Email: [email protected]
1. INTRODUCTION
The top five causes of mortality worldwide, including the majority of deaths, are cardiovascular
disorders. The accompanying health issues, notably heart-related issues, have developed by increasing the
sedentary lifestyles among vast populations [1]. The electrocardiogram is the main instrument used by medical
professionals to examine and analyze a patient's heart condition. Only a few of the distinctive components that
may be utilized to determine the heart activity of a healthy person are the depolarization of the atria (P-wave),
time taken from atrial depolarization to ventricular depolarization (PR interval), depolarization of the ventricles
(QRS complex), time taken for ventricular depolarization and repolarization to take place (QT interval), and
repolarization of ventricles (T-wave) [2]. Any cardiac ailment may be diagnosed and identified by looking at
different patterns and anomalies in these waves. Since deep learning approaches have advanced over the past
ten years, it is becoming common to diagnose various heart disorders utilizing computer-based methods [3].
We can reach a 100% outcome if we can keep getting better at it and tweak the datasets and technique layers.
In order to do that, we will try K-fold validation and other comparable approaches in the future together with
a federated learning strategy. The cardiac ailment known as arrhythmia (ARR) affects the pace at which the
heart beats [4]. Inappropriate electrical impulse production, which controls the heartbeat, is one of the primary
causes. The result is that the heart either beats extremely slowly, very fast or altogether randomly as a result of
these erroneous electrical impulses. As a result, if the proper medical care is not given, it may result in a heart
attack, heart failure, or sudden cardiac arrest. A healthy person's heart's regular electrical activity is represented
by the normal sinus rhythm (NSR). It is proof that the sinus node properly generates and transmits the electrical
pulse [5]. When a person has chronic congestive heart failure (CHF), their heart's capacity to pump blood is
significantly impaired. Heart artery narrowing and high blood pressure are the key contributors to the heart's
ineffective pumping ability, which over time causes the heart to become very weak [6]. Three distinct cardiac
states are represented by the electrocardiograph (ECG) signal. It is crucial to identify and categorize any
anomalies in the ECG signal. Therefore, it will be useful for doctors and other health experts to find specific
ECG anomalies so they can take the necessary medical action. Neural networks with numerous layers of
neurons are used in deep learning techniques [7]. Deep learning has multiple layers functioning as processing
units to achieve feature extraction. Each layer that extracts a particular feature takes its input from the output
of the layer before it [8]. Deep learning approaches have surpassed previously used techniques in a number of
pattern recognition competitions, which has inspired the scientific community to apply these cutting-edge
methods to the analysis of biological images [9]. A deep bidirectional network with a unique wavelet-based
layer was presented for the categorization of electrocardiogram signals [10]. The ECG signals were separated
into frequency sub-bands at different scales using a wavelet-based layer. For the input of networks, these
sub-bands functioned as sequences. By using the MIT-BIH arrhythmia database, five different cardiac kinds
were discovered. A 144-layer convolutional neural network (CNN) has been created with the aim of
recognizing different heart rhythms from electrocardiograms recorded using single-lead wearable monitors. In
this study, a sizable dataset of 70,325 ECG recordings from 190 individuals was employed. Using the CNN
model, a set of ECG data is converted into a set of rhythm classes. When the CNN model's performance with
six different cardiologists was evaluated, the proposed model outperformed the performance of the typical
cardiologist in terms of sensitivity and accuracy. The primary advantage of deep neural networks (DNNs) is
the automated extraction and identification of complex and minute details in images, which eliminates the
need for conventional feature extraction as in conventional machine learning (ML) methods. To extract
complicated ECG properties and learn from a variety of available inputs, however, a sizable amount of
data must be provided. Only then can rising levels of accuracy and human-level output be achieved. The
modified GoogLeNet is employed in this study to classify ECG data. Using a transfer learning approach and
adjustments to some of the output layers, the ECG classifications were performed and the efficacy of CNN
designs was tested. Several sections are presented in this research as: In section 2 shows the literature review,
and section 3 represents the methods used in this paper. Section 4 is the results and discussion of the ECG.
Section 5 presents the conclusions.
2. LITERATURE REVIEW
In this section, we represent some of the previous studies: Moskalenko et al. [11] In 2019 The method
they suggested generates a list of the onsets and offsets of the P and T waves as well as the QRS complexes
and accepts as input any ECG data with any sampling rate. Our segmentation method is better than others since
it can be used for a wide range of sampling rates and ECG monitor types and is rapid, only needs a few
parameters, and has excellent generalizability. The recommended method performs better in terms of quality
than current state-of-the-art segmentation methods. F1 measures are particularly effective in detecting the start
and end of P and T waves as well as QRS-complexes, with 97.8%, 99.5%, and 99.9% accuracy, respectively.
Murat et al. [12] in 2020 The examination of deep learning methods was then expanded upon using a five-class
ECG dataset with 100,022 beats. Results from using this dataset to test the built models are shown. Therefore,
this paper gives details on deep learning techniques utilized for classifying arrhythmias as well as
recommendations for future research in this field. Naz et al. [13] in 2021 in this paper, a brand-new deep
learning method for Veterans Affairs (VA) identification is proposed. The ECG impulses are then converted
into hitherto unheard-of pictures. These photos are later normalized and used to train the deep learning models
AlexNet, visual geometry group-16 (VGG-16) which is a type of CNN, and Inception-v3. To train a model and
retrieve the deep information from several output layers, transfer learning is used. Then, using a heuristic
entropy calculation technique, the best features are chosen after the features are concatenated and fused. For
the final feature classification, supervised learning classifiers are used. The accuracy of the results, which were
assessed using the MIT-BIH dataset, was 97.6% (using Cubic support vector machine as a final stage
classifier). Jawad et al. [14] in 2022 the wavelet transform is used in this study to extract features. The
electrocardiogram (ECG) signal is classified using an optimal neural network with eight classes using
information from two ECG signals (ST-T and MIT-BIH database). The artificial neural network's training
method uses the wavelet transform coefficients, which are then tuned using the invasive weed optimization
(IWO) algorithm. The proposed approach offers over 70% sensitivity, over 94% specificity, over 65% positive
predictive, over 93% negative predictive, and over 80% classification accuracy. The classifier performs better
when the buried layer's number of neurons is increased. By comparing our work with the above studies we
used the continuous wavelet transform (CWT) for feature extraction and the modified GoogLeNet is used for
ECG data classification, the accuracy exceeded all the above studies and reach 100%.
Classifying electrocardiograph waveforms using trained deep learning neural … (Noor Yahya Jawad)
410 ISSN: 2252-8938
3. METHOD
The suggested approach, which is different from the ECG domain, uses transfer learning from several
classes and is an ECG multiple classification technique. Specifically, architectures that have already been
trained on data related to image classification and object identification (1,000 classes, such as a chair, mouse,
and table lamp) are used in place of training the CNNs from scratch using ECG data. Large datasets are readily
available in these fields, allowing for effective feature map extraction and training that captures intricate
characteristics and patterns in the images [15]. Only after converting 1-dimensional ECG signal samples into
a 2-dimensional image of the ECG signal, known as a scalogram, using continuous wavelet transform, can
such learned and accessible feature maps be transmitted for ECG classification applications. The GoogLeNet
structure was chosen for this work because it can successfully extract features from a relatively small collection
of ECG signal scalograms.
Classifying electrocardiograph waveforms using trained deep learning neural … (Noor Yahya Jawad)
412 ISSN: 2252-8938
64 pictures, one photo for each channel in the layer. The activation is represented in an 8 by 8 grid as shown
in Figure 5. Features can be examined by noting whether regions of a photo's convolutional layers are active
and contrasting them with the corresponding regions of the original pictures.
The activations may be assessed and identified by the elements by comparing areas of activation with
the original image GoogLeNet Learns. Convolutional layer regions on an image from the ARR, CHF, and NSR
classes are active as shown in Figure 6, Figure 7, and Figure 8. The regions can be compared with their
counterparts in the original picture. Convolutional layers are made of several channels, which are 2-D arrays.
The output activations can be examined in the first convolutional layer after running the image through the
network. The output of a channel in the convolutional layer is represented by each tile in the grid of activations.
White pixels denote strongly positive activations, whilst black pixels denote considerable negative activations.
A channel that is mostly grayscale responds to the incoming image less forcefully. The place of a pixel during
channel activation coincides with that pixel's place during the original image. When a channel has a white pixel
there, it means that the channel is very active there. The channel activations are resized to the size of the original
image to display the activations. Where Figure 6(a) is the activation layer representation of ARR and
Figure 6(b) is the classification result for one case of ARR. Where Figure 7(a) is the scalograms for the
activation layer representation of CHF and Figure 7(b) is the scalograms classification result for one case of
CHF. Where Figure 8(a) is the Scalograms for the activation layer representation of NSR and Figure 8(b) is
the scalograms classification result for one case of NSR.
(a) (b)
Figure 6. Scalograms of; (a) ARR activation of GoogLeNet and (b) classified image for ARR heart rhythms
Classifying electrocardiograph waveforms using trained deep learning neural … (Noor Yahya Jawad)
414 ISSN: 2252-8938
class is 100% as shown at the bottom of the confusion matrix in Figure 9. The recall values are shown at the
right of the confusion chart.
(a) (b)
Figure 7. Scalograms of; (a) CHF activation of GoogLeNet and (b) classified image for CHF heart rhythms
(a) (b)
Figure 8. Scalograms of; (a) NSR activation of GoogLeNet and (b) classified image for NSR heart rhythms
5. CONCLUSION
This study shows the use of continuous wavelet analysis and transfer learning for classifying three
categories of ECG signals by benefitting the pretrained GoogLe neural network. Wavelet representations are
used for creating the scalograms of ECG signals. Therefore, the scalograms are created for each RGB image.
These scalograms of images are used for fine tuning the deep GoogLeNet. Activations were also shown for
various network layers. The obtained results are strongly affected by the period of ECG signals, samples per
signal, and the wavelet transformation parameters. This paper illustrates using a modified GoogLeNet model
for enhancing the classification of the ECG signals. GoogLeNet neural network is a pretrained network for
subsets of the Images database. The scalograms also underwent data reduction to fit with the GoogeNet network
architecture. High accuracy was obtained for190 individual cases of ECG data which was equal to the accuracy
of the human level. In comparison to the 80% accuracy achieved by the optimized neural network, the
GoogLeNet architecture achieves 100% accuracy for the multi-class ECG signal classification challenge
utilizing a small dataset of scalogram images.
REFERENCES
[1] B. M. Li et al., “Influence of armband form factors on wearable ECG monitoring performance,” IEEE Sensors Journal, vol. 21, no.
9, pp. 11046–11060, May 2021, doi: 10.1109/JSEN.2021.3059997.
[2] X. Mufali, “Exploration of multi modal datasets towards sleep quality analysis,” School of Industrial and Information Engineering,
2022.
[3] A. Javeed, S. U. Khan, L. Ali, S. Ali, Y. Imrana, and A. Rahman, “Machine learning-based automated diagnostic systems developed
for heart failure prediction using different types of data modalities: A systematic review and future directions,” Computational and
Mathematical Methods in Medicine, vol. 2022, pp. 1–30, Feb. 2022, doi: 10.1155/2022/9288452.
[4] H. Li et al., “Classification of electrocardiogram signals with waveform morphological analysis and support vector machines,”
Medical and Biological Engineering and Computing, vol. 60, no. 1, pp. 109–119, Oct. 2022, doi: 10.1007/s11517-021-02461-4.
[5] S. Nurmaini et al., “Beat-to-beat electrocardiogram waveform classification based on a stacked convolutional and bidirectional long
short-term memory,” IEEE Access, vol. 9, pp. 92600–92613, 2021, doi: 10.1109/ACCESS.2021.3092631.
[6] B. C. V. Campbell et al., “Ischaemic stroke,” Nature Reviews Disease Primers, vol. 5, no. 1, Oct. 2019, doi: 10.1038/s41572-019-
0118-8.
[7] X. Lin et al., “All-optical machine learning using diffractive deep neural networks,” Science, vol. 361, no. 6406, pp. 1004–1008,
Sep. 2018, doi: 10.1126/science.aat8084.
[8] S. Kumar and M. Singh, “Big data analytics for healthcare industry: Impact, applications, and tools,” Big Data Mining and Analytics,
vol. 2, no. 1, pp. 48–57, Mar. 2019, doi: 10.26599/BDMA.2018.9020031.
[9] M. Duran-Frigola, A. Fernández-Torras, M. Bertoni, and P. Aloy, “Formatting biological big data for modern machine learning in
drug discovery,” Wiley Interdisciplinary Reviews: Computational Molecular Science, vol. 9, no. 6, Dec. 2019, doi:
10.1002/wcms.1408.
[10] S. Nurmaini et al., “Electrocardiogram signal classification for automated delineation using bidirectional long short-term memory,”
Informatics in Medicine Unlocked, vol. 22, p. 100507, 2021, doi: 10.1016/j.imu.2020.100507.
[11] V. Moskalenko, N. Zolotykh, and G. Osipov, “Deep learning for ECG segmentation,” in Studies in Computational Intelligence, vol.
856, Springer International Publishing, 2020, pp. 246–254.
[12] F. Murat, O. Yildirim, M. Talo, U. B. Baloglu, Y. Demir, and U. R. Acharya, “Application of deep learning techniques for heartbeats
detection using ECG signals-analysis and review,” Computers in Biology and Medicine, vol. 120, p. 103726, May 2020, doi:
10.1016/j.compbiomed.2020.103726.
[13] M. Naz, J. H. Shah, M. A. Khan, M. Sharif, M. Raza, and R. Damaševičius, “From ECG signals to images: a transformation based
approach for deep learning,” PeerJ Computer Science, vol. 7, pp. 1–18, Feb. 2021, doi: 10.7717/PEERJ-CS.386.
[14] A. T. Jawad, D. S. Abdul-Zahra, H. M. Gheni, and A. N. Abdullah, “Electrocardiograph signal recognition using wavelet transform
based on optimized neural network,” International Journal of Electrical and Computer Engineering, vol. 12, no. 5, pp. 4944–4950,
Oct. 2022, doi: 10.11591/ijece.v12i5.pp4944-4950.
[15] S. M. Anwar, M. Majid, A. Qayyum, M. Awais, M. Alnowami, and M. K. Khan, “Medical image analysis using convolutional
neural networks: a review,” Journal of Medical Systems, vol. 42, no. 11, Oct. 2018, doi: 10.1007/s10916-018-1088-1.
[16] W. gang Li, L. Xie, Y. tao Zhao, Z. xiang Li, and W. bo Wang, “Prediction model for mechanical properties of hot-rolled strips by
deep learning,” Journal of Iron and Steel Research International, vol. 27, no. 9, pp. 1045–1053, Jul. 2020, doi: 10.1007/s42243-
020-00450-9.
[17] X. Wei, L. Zhou, Z. Chen, L. Zhang, and Y. Zhou, “Automatic seizure detection using three-dimensional CNN based on multi-
channel EEG,” BMC Medical Informatics and Decision Making, vol. 18, no. S5, Dec. 2018, doi: 10.1186/s12911-018-0693-8.
[18] G. Sannino and G. De Pietro, “A deep learning approach for ECG-based heartbeat classification for arrhythmia detection,” Future
Generation Computer Systems, vol. 86, pp. 446–455, Sep. 2018, doi: 10.1016/j.future.2018.03.057.
[19] F. R. Mashrur, M. S. Islam, D. K. Saha, S. M. R. Islam, and M. A. Moni, “SCNN: Scalogram-based convolutional neural network
to detect obstructive sleep apnea using single-lead electrocardiogram signals,” Computers in Biology and Medicine, vol. 134, p.
104532, Jul. 2021, doi: 10.1016/j.compbiomed.2021.104532.
[20] S. Dalal and V. P. Vishwakarma, “Classification of ECG signals using multi-cumulants based evolutionary hybrid classifier,”
Scientific Reports, vol. 11, no. 1, Jul. 2021, doi: 10.1038/s41598-021-94363-6.
[21] X. Wu, D. Sahoo, and S. C. H. Hoi, “Recent advances in deep learning for object detection,” Neurocomputing, vol. 396, pp. 39–64,
Jul. 2020, doi: 10.1016/j.neucom.2020.01.085.
[22] L. Meng, K. Ge, Y. Song, D. Yang, and Z. Lin, “Wearable electrocardiogram signal monitoring and analysis based on convolutional
neural network,” IEEE Transactions on Instrumentation and Measurement, vol. 70, pp. 1–11, 2021, doi:
10.1109/TIM.2021.3072144.
[23] I. H. Yemenoglu, A. F. M. Shahen Shah, and H. Ilhan, “Deep convolutional neural networks-based sign language recognition
system,” in 2021 IEEE 12th Annual Information Technology, Electronics and Mobile Communication Conference, IEMCON 2021,
Oct. 2021, pp. 573–576, doi: 10.1109/IEMCON53756.2021.9623068.
[24] A. D. Jagtap, K. Kawaguchi, and G. E. Karniadakis, “Adaptive activation functions accelerate convergence in deep and physics-
informed neural networks,” Journal of Computational Physics, vol. 404, p. 109136, Mar. 2020, doi: 10.1016/j.jcp.2019.109136.
[25] E. Yosrita, R. Nur Aziza, R. Farah Ningrum, and G. Muhammad, “Denoising of EEG signal based on word imagination using ICA
for artifact and noise removal on unspoken speech,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 22,
no. 1, p. 83, Apr. 2021, doi: 10.11591/ijeecs.v22.i1.pp83-88.
Classifying electrocardiograph waveforms using trained deep learning neural … (Noor Yahya Jawad)
416 ISSN: 2252-8938
BIOGRAPHIES OF AUTHORS
Noor Yahya Jawad was born in Karbala, Iraq, on June 11, 1990. he received a
BSc in Electrical and Electronic Engineering from Karbala University. He completed and
received a master's degree in Communications Engineering from the University of
Technology Baghdad, Iraq. Now, affiliation is a Lecturer in the Department of Computer
Techniques Engineering, Al-Safwa University College, Karbala, Iraq. His research interests
include image/signal processing, communications, fiber optics, and artificial intelligence. He
can be contacted at email: [email protected].
Ahmed Mohammed Merza was born in Babylon, Iraq. He received the B.S and
M.S degrees from University of Babylon, College of Engineering, Electrical Engineering,
Iraq, in 2013 and 2016 respectively. Now he is a Ph.D. student in research stage at Islamic
Azad University, Isfahan, Iran in electrical engineering. He currently a Lecturer at the
Department of Biomedical engineering, college of engineering, University of Warith Al-
Anbiyaa, Karbala, Iraq. His research interest including wireless sensor network, wireless
communication, soft switching interleaved DC/DC converters. He can be contacted at email:
[email protected].
Hussein Tami Sim was born in Babylon, Iraq, on Jule 5, 1986. he received a
BSc in General Physics from Babylon University. He completed and received a master's
degree in Nuclear Physics from the University of Babylon, Iraq. Now currently a Ph.D.
student (Medical Physics) at Erciyes University, Turkey. Now, affiliation is a Lecturer
in the Department of Dentistry and Department of Prosthetic Dental Technology, Hilla
University College, Babylon, Iraq. His research interests include the using of laser (Low
Level Laser Therapy (LLLT)) in the treatment of oral problems (ulcers, cleft lip, gum disease,
sensitivity of fillings). In addition to theoretical physics. He can be contacted at email:
[email protected].