Automatic classification of electrocardiogram signals based on transfer learning and continuous wavelet transform
Introduction
An arrhythmia usually refers to an abnormal heartbeat frequency or irregular heartbeat rhythm (Acharya et al., 2017). In most cases, an arrhythmia itself does not seriously threaten human health (Munger et al., 2013). However, arrhythmias may lead to more serious heart diseases, such as persistent ventricular tachycardia and paroxysmal supraventricular tachycardia (de Chazal et al., 2004). If not diagnosed and treated in a timely manner, arrhythmia can also lead to conditions such as dizziness, syncope, chest tightness, and sudden death (Xu et al., 2018). According to the American College of Cardiology, the number of deaths caused by cardiovascular disease (CVD) accounts for one third of the total number of deaths globally. In 2015, more than 400 million people globally were diagnosed with a CVD, with more than 17.7 million CVD deaths. CVD caused by cardiac arrhythmias have become the major factor driving the increase of global mortality (Roth et al., 2017). Therefore, cardiac arrhythmias must be diagnosed and patients must be treated in a timely manner (de Luna et al., 1989).
In hospitals, professional doctors usually use an electrocardiogram (ECG) to diagnose conditions such as heart arrhythmias. An ECG is a series of signals used to monitor and record the electrical activity of the patient's heart. Due to its non-invasive nature and technical sophistication, it is widely used as a medical tool for diagnosis (Ghista et al., 2016). It contains a large number of basic physiological signals that can be used to analyze cardiac function. Each heart beat cycle contains a series of amplitudes that deviate from the baseline ECG signal or waveform. The main signal components include the P-wave, QRS-wave, and T-wave. (Acharya et al., 2017h). Doctors can use the ECG to assess whether the patient has severe congenital heart disease or other structural abnormalities of the heart. Nevertheless, this process is generally time consuming and labor-intensive.
Therefore, researchers have also developed alternative methods that are able to automatically classify ECG signals (Luo et al., 2017; Sannino and De Pietro, 2018; Ye et al., 2012). Some of these methods use the morphological features of ECG signals for classification, including the ECG shape and RR interval features. Jagdeep et al. (Jr et al., 2021) conducted experiments mainly using the RR interval feature between heart beats alongside other statistical features. Their method classified the entered heartbeat into a normal heartbeat, premature ventricular contraction (PVC), premature atrial contraction (PAC), and other heartbeats, achieving an accuracy of 98.51%. Prasad et al. (Prasad et al., 2013) used a high-order spectrum (HOS) to distinguish the electrical signals. Additionally, other researchers have employed methods including regression trees, k-nearest-neighbor, and neural networks for classification.
In the machine learning community, algorithms such as support vector machine (SVM), linear discriminants l (LDS) (Xu et al., 2018), random forest (Breiman, 2001), and decision tree (Quinlan, 1986) have also achieved sound results in the field of ECG classification. Ozal Yildirim et al. (Yildirim et al., 2019) used a convolutional autoencoder (CAE) to compress and encode ECG signals. After obtaining the low dimensional data of each ECG signal, the long-short term memory (LSTM) network was used to build a classification model to classify the ECG signal. Jianli Yang et al. (Yang et al., 2018) implemented an ECG classification method by combining stacked sparse autoencoders (SSAEs) and softmax regression (SF) models. SSAEs were used to extract the high-level features in ECG signals as assessment features and SF was used to train component classifiers. Finally, the classification of six ECG signals was performed. Al Rahhal et al. (Al Rahhal et al., 2016) obtained effective assessment features from the original ECG by using stacked denoising autoencoders (SDAEs). The SF layer was superimposed on the resulting hidden representation layer to obtain a new type of deep neural network (DNN) and determine the value of each weight in the DNN.
The wavelet transform method can decompose the signal from different viewpoints and then reassemble the decomposed parts back to the original signal without losing the most important information during the conversion process, making wavelet transform highly suitable for ECG feature extraction. Wang et al. (Wang et al., 2021) automatically classified ECGs by continuous wavelet transform (CWT) and a convolutional neural network (CNN). The final accuracy, precision, and recall were 98.74%, 70.75%, and 67.47%, respectively.
CNNs are widely used to perform the task of feature extraction and classification in deep learning research. In the network constructed by a CNN, multiple convolutional layers and pooling layers are connected according to the design requirements to extract the potential features of the input (Cai et al., 2021). CNN has already been successfully used in facial recognition (Ben Fredj et al., 2021) and image processing (Yu et al., 2020). As CNN structures have a strong representation learning ability, they have also become popular methods in ECG recognition. Omar et al. (Cheikhrouhou et al., 2021) designed an ECG method based on a 1D CNN. This method can be used to accurately detect the ECG signal of the wearer of Internet of Things wearable devices and complete the classification of arrhythmias. Xu Gang et al. (Xu et al., 2020) developed a method that can classify five different arrhythmias by combining a 1D CNN and a gated circulating unit network. Yildirim et al. (Yıldırım et al., 2018) proposed a new method based on classification of ECG signal segments with long durations. By using a 1D CNN, an overall accuracy of 91.33% was achieved.
Although these methods have demonstrated good performance in known ECG databases, their performance in practical applications is not ideal. When using separate data sets for verification, the classification effect of these methods on ECG signals is less efficient. The primary reason is that 1D ECG signals usually consists of various frequency components, including noise. After manual filtering of known interfering signals, there are often many other hidden interfering signals that have not been processed in practical applications. This situation severely limits the generalization ability of the method. The second reason is that deep learning uses a large amount of training data to determine the potential patterns hidden within. However, an unavoidable problem is that the training data is often insufficient in some fields. This is because obtaining and collecting data is expensive and intricate.
To solve these problems and challenges, this study develops a CNN-based ECG automatic classification method based on transfer learning and CWT. First, CWT is used to convert the 1D ECG signal into a 2D ECG spectrum in the time-frequency domain. This effectively reduces the difficulty of extracting effective features from the CNN. Simultaneously, it can also effectively avoid the aliasing effect caused by the aliasing of various 1D signal components. To solve the problem of using a low ECG data volume with high-performance deep learning feature requirements, 2D domain transfer learning is used. The designed CNN model is trained on the ImageNet dataset, and its weighting parameters are maintained. The model is then fine-tuned in the MIT-BIH arrhythmia database (Moody and Mark, 2001). The model provides a good fit for a small volume of data. This is because the volume of training data in the image classification and target recognition domains are larger than for ECG signals which use a relatively small volume of data. Furthermore, these domains contain sufficient data to train the CNN model. This enables CNN to provide a good generalization ability. Typically, arrhythmia not only affects the shape of the ECG signal, but also changes the peak position of the R wave. Therefore, eight morphological features were also designed for the peak position of the R wave in the ECG signal, which are used as the main judgment features of the classification model, together with the features extracted by CNN. Through testing with the MIT-BIH arrhythmia database, the devised method obtains 99.13% accuracy, 96.55% precision and 96.21% recall. The results show that the new classification model performs very well in ECG classification. To prove that the developed CNN can be used in the field of biological acoustic monitoring. We used the NIPS4Bplus ecological audio dataset (Morfi et al., 2019) to conduct bird activity monitoring experiments. Convert the two types of audio files with and without songbird sounds in the experimental dataset into a Mel spectrum, and input these Mel spectra into a fine-tuned CNN for discrimination and classification, according to the experimental steps for ECG spectrum classification. The accuracy rate of the final bird activity monitoring model is 91.67% and the recall rate is 91.71%. The results show that our new classification model not only performs very well in ECG signal classification, but also achieves satisfactory results in bird activity monitoring.
The main contributions of this study can be summarized as follows:
- (a)
A new method is adopted to manage with the problem of ECG classification. CWT is used to transform the problem of 1D ECG signal classification into a 2D perspective. This reduces the difficulties in extracting effective features from a deep learning network and avoids the aliasing effect caused by the aliasing of different 1D signal components.
- (b)
Eight new morphological features related to the peak position of the R wave of the ECG signal are designed.
- (c)
A new CNN feature extractor is designed, and the problem of using a low ECG data volume with high-performance deep learning feature requirements is solved by transfer learning.
- (d)
Compared with other methods in the same field, the structure of the model is simpler, and the principle is less complex, obtaining stronger results.
- (e)
The developed CNN can be used in the field of bird activity detection. A comparative experiment was conducted using the same data set and the latest methods for bird activity detection in the same domain. It was proved that the performance of the CNN developed this time was improved by 11.67% and 11.57% in classification accuracy and recall rate, respectively, compared with the latest research programmes in the same field.
The rest of the paper is organized as follows. Section 2 introduces the ECG database used in this experiment. Section 3 introduces the design of the CNN ECG automatic classification method and model structure based on transfer learning and CWT. Section 4 provides the experimental results of the model and the comparison and discussion with other methods in the same field. Finally, the conclusions and future research directions are given in Section 5.
Section snippets
Data
This study used the ECG data in the MIT-BIH arrhythmia database to test the developed model. The MIT-BIH arrhythmia database is the most widely used and well-known ECG database globally. The database included 48 double lead records obtained from 47 subjects. Each record was digitized at a rate of 360 samples per second at an 11-bit resolution in the range of 10 mV. The two leads were modified limb (ML) II and either ML V1, V2, V4, or V5. Two or more cardiologists independently annotated each
Methodology
In this section, the proposed CNN-based ECG automatic classification method based on transfer learning and CWT is presented in detail. This section consists of three parts: signal preprocessing, signal feature extraction, and ECG signal classification. The overall process is shown in Fig. 1.
Results and discussion
In this section, the reliability of the designed CNN feature extractor is verified, the classification performance of the model is calculated and analyzed, and the results are compared and discussed with other research methods in the same field. Finally, the classification results of the designed ECG classification model using different 2D image feature acquisition schemes are compared. The application experiment of the designed CNN in the field of ecological information is also added. This
Conclusion
This study designed an automatic and CNN-based classification method for ECGs, using transfer learning and CWT. To solve the problem of mixing different frequency signals, such as noise, into available signals, CWT was used to convert 1D ECG signals into the frequency domain. Thus, the 1D signal classification was transferred into 2D issues. Then, transfer learning was applied to prioritize the training of the developed CNN model on the ImageNet dataset, allowing the model to gain the ability
Declaration of Competing Interest
None.
Acknowledgement
This research was supported by the Fundamental Research Funds for the Universities in Heilongjiang Province (2018-KYYWF-1681), the University Nursing Program for Young Scholars with Creative Talents in Heilongjiang Province (UNPYSCT-2017086), and National Natural Science Foundation of China (61671190, 61571168).
References (46)
- et al.
Automated characterization and classification of coronary artery disease and myocardial infarction by decomposition of ECG signals: a comparative study
Inf. Sci.
(2017) - et al.
Heartbeat classification using projected and dynamic features of ECG signal
Biomed. Sign. Process. Control
(2017) - et al.
Ambulatory sudden cardiac death: mechanisms of production of fatal arrhythmia on the basis of data from 157 cases
Am. Heart J.
(1989) - et al.
Global, regional, and national burden of cardiovascular diseases for 10 causes, 1990 to 2015
J. Am. Coll. Cardiol.
(2017) - et al.
A deep learning approach for ECG-based heartbeat classification for arrhythmia detection
Futur. Gener. Comput. Syst.
(2018) - et al.
Arrhythmia detection using deep convolutional neural network with long duration ECG signals[J]
Comput. Biol. Med.
(2018) - et al.
A new approach for arrhythmia classification using deep coded features and LSTM networks
Comput. Methods Prog. Biomed.
(2019) - et al.
Heartbeat classification using disease-specific feature selection
Comput. Biol. Med.
(2014) - et al.
Acoustic detection of regionally rare bird species through deep convolutional neural networks[J]
Ecol. Inform.
(2021) - et al.
A deep convolutional neural network model to classify heartbeats [J]
Comput. Biol. Med.
(2017)
ECG heartbeat classification using multimodal fusion[J]
IEEE Access
Deep learning approach for active classification of electrocardiogram signals
Inf. Sci.
Low resource species agnostic bird activity detection
Face recognition in unconstrained environment with CNN[J]
Vis. Comput.
Bioacoustic classification of avian calls from raw sound waveforms with an open-source deep learning architecture[J]
Sci. Rep.
Random forests
Mach. Learn.
Real-time arrhythmia classification algorithm using time-domain ECG feature based on FFNN and CNN[J]
Math. Probl. Eng.
One-dimensional CNN approach for ECG arrhythmia analysis in fog-cloud environments
IEEE Access
Automatic classification of heartbeats using ECG morphology and heartbeat interval features
IEEE Trans. Biomed. Eng.
Inter-patient ECG heartbeat classification with temporal VCG optimized by PSO
Sci. Rep.
ECG waveform and heart rate variability signal analysis to detect cardiac arrhythmias
Cardiol. Sci. Technol.
Deep residual learning for image recognition[C]
Using Convolutional Neural Networks for Image Recognition
Cited by (9)
A novel method for non-invasive detection of aflatoxin contaminated dried figs with deep transfer learning approach
2022, Ecological InformaticsCitation Excerpt :Pre-trained models have been used to solve many tasks in many areas. For example, it has been used to classify brain magnetic resonance images (Kaur and Gandhi, 2020) and detect different cancer types (Ayana et al., 2021; Sun et al., 2022) in the medical field. In addition, it has been used for solving some problems in the ecology field (Lu et al., 2021; Vabø et al., 2021), detecting plant diseases (Tiwari et al., 2021) and classifying food products (Xiang et al., 2019) in agriculture and food fields. (
Fault diagnosis of railway point machines based on wavelet transform and artificial immune algorithm
2023, Transportation Safety and EnvironmentA 5 Class Classification of ECG Using SRCNN and CNN Using MIT-BIH Arrhythmia Dataset
2023, Proceedings - 1st International Conference on Intelligent Technologies for Sustainable Electric and Communications Systems, iTech SECOM 2023