# Machine Learning ECG Classification Using Wavelet Scattering of Feature Extraction

Authors: Heyam A. Marzog; Haider. J. Abd
Journal: Applied Computational Intelligence and Soft Computing
 (2022)

---

## Abstract

The heart’s electrical activity is registered by an electrocardiogram (ECG), which consists of a wealth of pathological data on heart diseases such as arrhythmia. However, with increasing complexity and nonlinearity, direct observation of ECG signals and analysis is very tough. The highest accuracy of classification performance for machine learning approaches are 99.7 for neural network with wavelet scattering features extraction and 99.92 for SVM also with wavelet scattering features extraction. Through wavelet cascades with a neural network, the wavelet scattering transform can yield a translation invariant and deflection depictions of ECG signals. We suggested a new wavelet scattering transform-based method for automatically classifying three types of ECG heart diseases as follows: arrhythmia (ARR), congestive heart failure (CHF), and normal sinus rhythm (NSR). The bandwidth of the scaling function is used to critically downsample the wavelet scattering transform in time. As a result, each of the scattering paths has 16-time windows. Beat classification performance is classified by utilizing the MIT-BIH arrhythmia dataset. The suggested method is able to conduct high accuracy arrhythmia classification, with a 99.7% and 99.92% accuracy rate of the neural network (NN) and support vector machine (SVM), respectively, and will aid physicians in ECG explanation.


---

## Body

## 1. Introduction

Globally, cardiovascular diseases (CVDs) are the biggest killer. In 2016, 17.9 million deaths occurred annually, accounting for 31% of all deaths worldwide [1]. CVDs are caused by a variety of factors, which include tobacco utilization, physical inactivity, poor eating habits, excess weight, and so on [2]. Arrhythmia, which describes the electrical dysfunction of the heart, is one type of CVD complication. The abnormal rate or rhythm of a heartbeat is made a reference to as an arrhythmia. The heart can beat too fast, too slow, or in an irregular rhythm during an arrhythmia [3]. The electrical activity of the heart is monitored by an electrocardiogram (ECG); any change in the morphological pattern over a recorded ECG waveform can diagnose cardiac arrhythmias. There are numerous options. It is critical to correctly classify ECG signals into those categories in a timely manner. Cardiologists visibly examine the ECG signal to make a definitive diagnosis depending on a great deal of knowledge and experience in their field. As a result of the existence of noise and minute morphometric parameter settings in ECG signals, this visual examination may result in interpretation [4]. Furthermore, interpreting ECG signals is time-expending and fatiguing for cardiologists, which may cause patients to miss out on the best treatment option. Numerous different computer-aided diagnosis (CAD) systems have lately been formulated to improve these downfalls. Physicians can use CAD systems as an adjuvant treatment tool in their interpretation of ECG signals to enhance diagnosis speed and accuracy. It is crucial in the treatment of cardiovascular diseases [5]. The majority of them concentrated on traditional machine learning methods. These methods require the extraction and classification of features. The features extracted from ECG signals, such as parametric and visual pattern features [6–8], as well as the classifiers designed for classification, have a direct impact on arrhythmia recognition accuracy. Despite the fact that some of these studies have achieved excellent classification results, users may have two main disadvantages: first, they necessitate the use of a very well-featured extractor, and the features must be manually improved before being fed into classifiers; second, they are prone to overfitting. Furthermore, only a few of these techniques supplied the ANSI/AAMI EC57: 1998 standard’s advised confusion matrix [9]. As a result, comparing their classification performance across different arrhythmia categories is difficult.The evaluation of morphological features of single or too few QRS complexes or beats is utilized in presented algorithms for automated ECG appreciation of cardiac arrhythmia. The analysis of QRS complexes is far more common in the research literature than the analysis of long-duration ECG signal fragments [10, 11]. The main diagnostic device is the ECG, which is a heart wearable activity signal composed of a P wave, a QRS complex, and a T wave. Arrhythmias are abnormal heart rhythms that happen as a consequence of an alteration in the normal sequence of electrical heart impulses [12].


## 2. Literature Search

This paper provides a study of various methods utilized in the literature for the discovery and classification of ECG beats. For many years, we performed a systematic search of articles. Pertinent articles were found by conducting a keyword search of articles cited in IEEE, Science Direct, and PubMed databases, among others. The review goes over the preprocessing phase, feature extraction, and ECG beat classification. The preprocessing step emphasizes the utilization of filters to eliminate noise current through ECG signal recording, as well as many other methods to eliminate noise from ECG signals. Various feature extraction and classification approaches for classifying ECG beats utilizing machine learning and deep learning approaches are well depicted. In 2017, Sultan-Qurraie proposed that cardiac arrhythmias be classified utilizing three various features extracted at various time frequencies. The frequency is divided into 9 windows, and the ECG segment and peaks are extracted. Classification is based on extracted features. For classification, the approach employs specific topic features [13]. In the same year, Garcia et al. suggested utilizing temporal features of VCG for feature extraction and the support vector (SV) with particle swarm optimization (PSO) for classification [14]. The random forest approach was utilized for a variety of problems, and it has been adapted for ECG classification in Mykoliuk (2018). The QRS complex is utilized in the approach to classifying ECGs. The Pan Tompkins and DWT strategies are utilized to extract features from ECG waves, and machine learning is used to classify them [15].Pyakillya (2019) describes deep learning. CNN was utilized for feature extraction, and the first layers of convolutional neurons (FCN) were utilized for ECG classification, whereas Ledezma (2019) classified ischemia using two different neural network classifiers. To create populations from healthy independent information, the approach employs the Tusscher–Panfilov model and the O’Hara-Rudy model. Accordingly, wavelet transform is utilized to classify ECG signals among each heartbeat at various heart cells. Machine learning approaches were utilized to classify the wave features of the ECG [16]. In 2019 also, Aykut employs the genetic algorithm for feature extraction and machine learning algorithms for classification. The deep neural network was used to classify ECGs and supervise cardiac conditions. The technique is used to extract ECG waveforms, and then, it trains them by using CNN. Alfaras (2019), the recommended brain-inspired machine learning technique, which is relied on echo state networks, can be utilized for ECG arrhythmia classification. The classifier employs ECG leads and appears to be working on online classification. It is utilized to track patients’ progress online. The technique employs combinations for various classes and performs a classification system depended on them [17, 18]. In 2020, Therib et al. [19] developed a heart disease classification scheme using a variety of techniques such as K nearest neighbor and support vector machine. They combined the neural network –high performance by the particle swarm optimization method with the ant colony technique. The analysis confirmed the usefulness of combining PSO enhancement and the ACO technique, which would be used to select features, that can be a difficult task in disease diagnosis. The results of the proposed optimum model are in comparison to those of other strategies. Md Rafiul Hassan et al. suggested a new multiclass classification technique for timeous cardiovascular autonomic neuropathy (CAN) diagnosis in (2022) [20]. By incorporating feature selection and multimodal feature fusion techniques, the new classification algorithm creates a multistage fusion model. To ensure hugely important features, the proposed method creates an achievement set of criteria feature selection methods. Deep learning feature fusion and selected original features were used to create a multimodal feature fusion method. The experimental findings from testing with a big CAN dataset show that the proposed method drastically enhanced CAN diagnosis accuracy as compared to conventional technology features [21].Various types of diseases can be found based on the heart rate. A person’s normal heart rate ranges between 50 and 100 beats/minute (BPM) [22]. If the recorded heartbeats are below the average limits, the situation is termed bradycardia (brady implies slow, and cardia means heart), and if they are greater than the normal range, the situation is termed tachycardia (tachy means fast, and cardia means heart). Rhythm is the second assessment, which is also known as beats. Rhythms generally classify the type of heartbeat; some might be natural, while others are risky, resulting in the person’s untimely death [20].Arrhythmias are classified according to their heart rate. The sinus node of the heart produces the rhythms. The rhythm produced is that of a healthy heart’s normal beats. If anyone in the irregularity is detected in these beat recordings, the situation is referred to as “Sinus Arrhythmias.” Arrhythmia is an irregular heartbeat, where A-irregular and rhythms were also heartbeats. Sinus arrhythmias are divided into two types as follows: sinus bradycardia and sinus tachycardia. The sinus node rhythms are generally slower than the NSR in sinus bradycardia [23]. The rhythms in sinus tachycardia are faster than the NSR. The various kinds of cardiac arrhythmias are as follows:(i)
Cardiac arrhythmia: in this category, anomalous heartbeats are produced from either the atrial or ventricular chambers. As a result, they have been classified as atrial arrhythmias and ventricular arrhythmias.(ii)
Atrial Arrhythmia: these irregular heartbeats occur in the atrial chamber but outside of the sinoatrial node-SA node. These are even further subdivided based on the type of beats.(iii)
Atrial Fibrillation: the atrial chamber of the heart creates 600 beats/minute in this type of irregularity. Normal heartbeats occur 60 to 80 times per minute. The following figure illustrates an ECG sample of atrial tachycardia.Table1presents some of the previous studies suggested for extracting features, classifying the heart signal, and comparing accuracy ratios among them. Different classes have been proposed for arrhythmia discrimination such as NN and SVM approaches because they have features such as reliability and high accuracy compared with other methods.Table 1
Different classifiers have been proposed for arrhythmia discrimination.
WorkFeature extractionClassifierAccuracy%Sultan-Qurraie S and Ghorbani Afkhami R(2017)Time-frequency, RR-interval, and higher-order statisticalDecision trees98.92Iryna Mykoliuk, Daniel Jancarczyk, Mikolaj Karpinski, and Viktor Kifer(2018)Pan-Tompkins algorithm and RR-intervalsRandom forest and neural network98.6Ledezma CA, Zhou X, Rodríguez B, Tan PJ, and Díaz-Zuccarini V(2019)Pseudo-ECGNeural network95S. K. Pandeya, R. R. Janghel, V. Vani(2020)Morphological, RR-intervals, wavelet transformer, and higher-order statisticalSVM, LSTM, KNN, and random forest94.4M. Alfaras, M. C. Soriano and S. Ortín(2019)R-R intervalsEcho state network95.7Md Rafiul Hassan a, Shamsul Huda B, and Mohammad Mehedi Hassan(2022)Deep learning neural network (DLNN)Multiclass CAN and deep learning neural network (DLNN)88.95Sudestna Nahak and Goutam Saha(2020)Pan-Tompkins algorithmSupport vector machine (SVM)93.33Axel Sepúlved, Francisco Castillo, Carlos Palma, and Maria Rodriguez-FernandezTime domain, frequency domain, and wavelet scatteringLinear discriminant analysis (LDA) and decision tree82.7


## 3. Materials and Methods

In this part, we will describe our data preprocessing and strengthening techniques as well as briefly explain the database that we were utilizing for ECG classification.


### 3.1. Database Description

We utilized information from various PhysioNet databases in this work. These were obtained from the MIT-BIH arrhythmia database, the BIDMC congestive heart failure database, and the MIT-BIH normal sinus rhythm database. For each of the ARR, CHF, and NSR classes, approximately 8-minute data from 30 recordings are used. The following description is a detailed description of each of the databases mentioned above:(1)
Database of MIT-BIH arrhythmia: it is constituting the ARR data utilized in our work. It includes 47 ECG tracks sampled at 360 Hz for male and female groups ranging in age from 23 to 89 years [20], but in this case, we utilized 10-minute data from just 30 recordings(2)
Database of BIDMC congestive heart failure: it includes 30 ECG tracks sampled at 250 Hz for male and female groups ranging in age from 22 to 71 years. The CHF database utilized for this research consisted of 30 recordings of each matter.(3)
Database of MIT-BIH normal sinus rhythm: we utilized 30 recordings of NSR data in this search for groups of males and females which aged 20 to 50 with samples of 128 Hz. It should be indicated that they did not have any significant cardiac abnormalities.The ECG data utilized in the algorithm's verification and validation came from the PhysioNet library, specifically the MIT-BIH and BIDMC databases. PhysioBank is a huge and increasing archive of well-characterized digital recordings of biomedical signals for biomedical researchers to use. It is freely available online via the link PhysioBank ATM (physionet.org).


### 3.2. Preprocessing

The electrocardiogram (ECG) signals include many various kinds of noises that must be eliminated because it is not possible to obtain a correct reading of the ECG signal, which leads to a wrong diagnosis as baseline wander, powerline interference, electromyographic (EMG) noise, and electrode motion artifact noise. Baseline wander is a minimum frequency noise of about 0.5 to 0.6 Hz [24]. To reduce it, a discrete wavelet transformer (DWT) can be utilized. Powerline interference (50 or 60 Hz noise from major supply) can be reduced by utilizing a notch filter of 50 or 60 Hz cut-off frequency. EMG noise is a high-frequency noise of up to 100 Hz and thus may be reduced by an adaptive filter of a suitable cut-off frequency. Electrode motion artifacts can be restrained by lessening the motions made by using an adaptive filter supported with RLS and LMS algorithms. The 30 recordings are collected with sample groups in various frequencies 128 Hz, 250 Hz, and 360 Hz. Figure 1 describes preprocessing briefly.Figure 1
Block diagram of preprocessing of the ECG signal.


### 3.3. Feature Extraction

The feature extraction process is important to the achievement of arrhythmia heartbeat classification utilizing the ECG signal. Any information extracted from a heartbeat that is utilized to differentiate its category may be taken into account as a feature [1]. The extraction of features in the time and frequency domains may not be adequate to describe the detail and fluctuation which was revealed in the ECG signal during emotional situation changes; thus, we used wavelet transform-based analytical models to extract more advanced structures. The wavelet scattering algorithm divides each signal into a predefined set of scattering windows and uses wavelet transformations to extract features from them. After which, each scattered window is classified totally independent, and the initial segment is assessed depending on unified weighting (voting) of the classification of each scattered window. The wavelet scattering method involves a three-stage iterative signal transformation as follows: wavelet convolution, modulation, and filtering.This approach is related to a convolutional neural network (CNN), except that the convolution filters are not discovered but rather are predetermined wavelet functions [25]. The scattering coefficients are designed to also have a low variance within a category and a high variance between categories. Furthermore, they are unresponsive to input transcriptions on an invariance scale and get some useful characteristics such as multiscale contractions, linearization of hierarchical symmetries, and the generation of scattered data models.


### 3.4. Classification

In this part, we will introduce our algorithms for the classification of ECG, but before that, we have depicted the wavelet scattering transform that we utilized to extract to derive the classifier model from ECG signals.


#### 3.4.1. Wavelet Scattering Transform

A wavelet scattering transform creates signal depictions that are translation invariant, stable, and informative. It is resistant to deformations and retains category discrimination ability, making it especially useful for classification. We relate to it because of its excellent work achievement in classification. We could well adhere to the annotation in [1]. Let f(t) represent the signal under consideration. The low-pass filter and wavelet function are intended to create filters that encompass the entire frequency range of the signal. ϕ(t) denote the low-pass filter that generates local produce translation invariant explanations of (f) at a specific scale T. The group of wavelet indices with an octave frequency resolution Qk is denoted by Λk. By stretching the wavelet ѱ, multiscale high-pass filter banks (ѱj) can be created. The convolution S0 f(t) = f ⋆ϕ(t) produces a local produce translation invariant feature of (f) and though causes a lack of high-frequency information. A wavelet elastic modulus transform can retrieve these missing high frequencies.(1)W1f=S0ft,f∗Ψj1tj1∈Λ1.Averaging the wavelet operand coefficients withϕj yields the first-order scattering coefficients.(2)S1ft=f∗Ψj1∗ϕJtj1∈Λ1.To retrieve the information missed due to averaging, we can retrieve complement high-frequency coefficient values by consideringS1ft as the low-frequency component of f∗Ψj1 as shown in the following equation:(3)W2f∗Ψj1=S1ft,f∗Ψj1∗Ψj2tj1∈Λ2.In the second order of scattering coefficients(4)S2ft=f∗Ψj1∗Ψj2∗ϕJtj1∈Λi,i=1,2,….Iterating the preceding method yields wavelet integrand convolutions.(5)Umft=f∗Ψj1∗⋯∗Ψjmj1∈Λi,i=1,2,…,m.Scattering coefficients at m-th order(6)Smft=f∗Ψj1∗⋯∗Ψjm∗ϕJtj1∈Λi,i=1,2,…,m.The final matrix of scattering is(7)Smft=Smft0≤m≤l.The scattering decomposition could indeed detect slight changes in the amplitude and duration of ECG signals, which are difficult to quantify and though represent the heart's situation. As a result, we employ the network of wavelet scattering to generate reliable depictions of ECG heartbeats, which decrease variations within one arrhythmia class whilst ensuring adequate discriminability between them. It has already been demonstrated that the energy of scattering parameters minimizes slightly as the layer level rises, for the first two layers containing nearly 99 percent of the energy [1, 26]. As a result, we utilized a two-request scattering network to retrieve ECG signal features. This also significantly reduces the complexity of the algorithm.(1) I-Classifier. In this paper, it is briefly explained how to use classifier approaches that combine features to predict the category for ECG signals. Choosing the most convenient classifier must be based on specific criteria such as the classifier’s use in previous works to compare with them and its ability to handle high dimension and large size training data efficiently. As the selected classifier is of the supervised category, classification entails two stages: learning the data and thereafter testing it. All ECG segments of the very same heartbeat type are saved in a single feature vector, and the process is repeated for one of the other kinds of ECG segments. All of these heartbeats are mapped using feature extraction methods from our research methods.


#### 3.4.2. Neural Network (NN)

A well-established physiologically concept, NNs, is a favorable machine learning technique to identify nonlinear ECG signals for biometric recognition. NN employs a variety of methods, including supervised learning, unsupervised learning, and reinforcement learning [27]. The network model is supported by some input nodes that receive input data or features, a hidden layer made up of nodes with activation functions that accomplish some procedure on the input data, and an output node that provides the predicted class of test data. The weights of the network were determined using the training dataset. Furthermore, during the training stage, the network was investigated on the validation dataset to accomplish slightly earlier shutdown for overloading reduction objectives. The last network was investigated on a test dataset using the last stored weights that produces great results on the validation dataset. The network’s weights were saved every time it achieved a good outcome on the validation dataset [28]. The NN model used in this paper has one input layer, twenty hidden layers, and one/three output layers for binary/multiclass classification. The network is tested with various internal process activation functions, and it is discovered that the sigmoid function provides the highest precision. Reference [29] is shown in Figure 2.Figure 2
Neural network system [30].


#### 3.4.3. Support Vector Machine (SVM)

It is a learning algorithm with a number of advantageous properties. It identifies trends in information and is attributed to data analysis. For classification, it employs a linear discriminate function [31]. Nonlinear classification, on the other hand, is possible if a nonlinear kernel is used. SVM works well in real time, is robust, and is simple to recognize. It seems to have a comprehensive solution when especially in comparison to other classifiers. A classification task usually necessitates knowledge of the data to be classified [32].We have reorganized the multisignal scattering transform into a material to produce a matrix suitable for the SVM classifier. The framework produced a matrix with the dimensions 416-by-16-by-113 for the provided signal length and quality attributes. There were 416 scattering paths, with 16 representing a scattering time window. We can exhibit the procedures of our system briefly as shown in Figure3.Figure 3
The general system of classification.


## 3.1. Database Description

We utilized information from various PhysioNet databases in this work. These were obtained from the MIT-BIH arrhythmia database, the BIDMC congestive heart failure database, and the MIT-BIH normal sinus rhythm database. For each of the ARR, CHF, and NSR classes, approximately 8-minute data from 30 recordings are used. The following description is a detailed description of each of the databases mentioned above:(1)
Database of MIT-BIH arrhythmia: it is constituting the ARR data utilized in our work. It includes 47 ECG tracks sampled at 360 Hz for male and female groups ranging in age from 23 to 89 years [20], but in this case, we utilized 10-minute data from just 30 recordings(2)
Database of BIDMC congestive heart failure: it includes 30 ECG tracks sampled at 250 Hz for male and female groups ranging in age from 22 to 71 years. The CHF database utilized for this research consisted of 30 recordings of each matter.(3)
Database of MIT-BIH normal sinus rhythm: we utilized 30 recordings of NSR data in this search for groups of males and females which aged 20 to 50 with samples of 128 Hz. It should be indicated that they did not have any significant cardiac abnormalities.The ECG data utilized in the algorithm's verification and validation came from the PhysioNet library, specifically the MIT-BIH and BIDMC databases. PhysioBank is a huge and increasing archive of well-characterized digital recordings of biomedical signals for biomedical researchers to use. It is freely available online via the link PhysioBank ATM (physionet.org).


## 3.2. Preprocessing

The electrocardiogram (ECG) signals include many various kinds of noises that must be eliminated because it is not possible to obtain a correct reading of the ECG signal, which leads to a wrong diagnosis as baseline wander, powerline interference, electromyographic (EMG) noise, and electrode motion artifact noise. Baseline wander is a minimum frequency noise of about 0.5 to 0.6 Hz [24]. To reduce it, a discrete wavelet transformer (DWT) can be utilized. Powerline interference (50 or 60 Hz noise from major supply) can be reduced by utilizing a notch filter of 50 or 60 Hz cut-off frequency. EMG noise is a high-frequency noise of up to 100 Hz and thus may be reduced by an adaptive filter of a suitable cut-off frequency. Electrode motion artifacts can be restrained by lessening the motions made by using an adaptive filter supported with RLS and LMS algorithms. The 30 recordings are collected with sample groups in various frequencies 128 Hz, 250 Hz, and 360 Hz. Figure 1 describes preprocessing briefly.Figure 1
Block diagram of preprocessing of the ECG signal.


## 3.3. Feature Extraction

The feature extraction process is important to the achievement of arrhythmia heartbeat classification utilizing the ECG signal. Any information extracted from a heartbeat that is utilized to differentiate its category may be taken into account as a feature [1]. The extraction of features in the time and frequency domains may not be adequate to describe the detail and fluctuation which was revealed in the ECG signal during emotional situation changes; thus, we used wavelet transform-based analytical models to extract more advanced structures. The wavelet scattering algorithm divides each signal into a predefined set of scattering windows and uses wavelet transformations to extract features from them. After which, each scattered window is classified totally independent, and the initial segment is assessed depending on unified weighting (voting) of the classification of each scattered window. The wavelet scattering method involves a three-stage iterative signal transformation as follows: wavelet convolution, modulation, and filtering.This approach is related to a convolutional neural network (CNN), except that the convolution filters are not discovered but rather are predetermined wavelet functions [25]. The scattering coefficients are designed to also have a low variance within a category and a high variance between categories. Furthermore, they are unresponsive to input transcriptions on an invariance scale and get some useful characteristics such as multiscale contractions, linearization of hierarchical symmetries, and the generation of scattered data models.


## 3.4. Classification

In this part, we will introduce our algorithms for the classification of ECG, but before that, we have depicted the wavelet scattering transform that we utilized to extract to derive the classifier model from ECG signals.


### 3.4.1. Wavelet Scattering Transform

A wavelet scattering transform creates signal depictions that are translation invariant, stable, and informative. It is resistant to deformations and retains category discrimination ability, making it especially useful for classification. We relate to it because of its excellent work achievement in classification. We could well adhere to the annotation in [1]. Let f(t) represent the signal under consideration. The low-pass filter and wavelet function are intended to create filters that encompass the entire frequency range of the signal. ϕ(t) denote the low-pass filter that generates local produce translation invariant explanations of (f) at a specific scale T. The group of wavelet indices with an octave frequency resolution Qk is denoted by Λk. By stretching the wavelet ѱ, multiscale high-pass filter banks (ѱj) can be created. The convolution S0 f(t) = f ⋆ϕ(t) produces a local produce translation invariant feature of (f) and though causes a lack of high-frequency information. A wavelet elastic modulus transform can retrieve these missing high frequencies.(1)W1f=S0ft,f∗Ψj1tj1∈Λ1.Averaging the wavelet operand coefficients withϕj yields the first-order scattering coefficients.(2)S1ft=f∗Ψj1∗ϕJtj1∈Λ1.To retrieve the information missed due to averaging, we can retrieve complement high-frequency coefficient values by consideringS1ft as the low-frequency component of f∗Ψj1 as shown in the following equation:(3)W2f∗Ψj1=S1ft,f∗Ψj1∗Ψj2tj1∈Λ2.In the second order of scattering coefficients(4)S2ft=f∗Ψj1∗Ψj2∗ϕJtj1∈Λi,i=1,2,….Iterating the preceding method yields wavelet integrand convolutions.(5)Umft=f∗Ψj1∗⋯∗Ψjmj1∈Λi,i=1,2,…,m.Scattering coefficients at m-th order(6)Smft=f∗Ψj1∗⋯∗Ψjm∗ϕJtj1∈Λi,i=1,2,…,m.The final matrix of scattering is(7)Smft=Smft0≤m≤l.The scattering decomposition could indeed detect slight changes in the amplitude and duration of ECG signals, which are difficult to quantify and though represent the heart's situation. As a result, we employ the network of wavelet scattering to generate reliable depictions of ECG heartbeats, which decrease variations within one arrhythmia class whilst ensuring adequate discriminability between them. It has already been demonstrated that the energy of scattering parameters minimizes slightly as the layer level rises, for the first two layers containing nearly 99 percent of the energy [1, 26]. As a result, we utilized a two-request scattering network to retrieve ECG signal features. This also significantly reduces the complexity of the algorithm.(1) I-Classifier. In this paper, it is briefly explained how to use classifier approaches that combine features to predict the category for ECG signals. Choosing the most convenient classifier must be based on specific criteria such as the classifier’s use in previous works to compare with them and its ability to handle high dimension and large size training data efficiently. As the selected classifier is of the supervised category, classification entails two stages: learning the data and thereafter testing it. All ECG segments of the very same heartbeat type are saved in a single feature vector, and the process is repeated for one of the other kinds of ECG segments. All of these heartbeats are mapped using feature extraction methods from our research methods.


### 3.4.2. Neural Network (NN)

A well-established physiologically concept, NNs, is a favorable machine learning technique to identify nonlinear ECG signals for biometric recognition. NN employs a variety of methods, including supervised learning, unsupervised learning, and reinforcement learning [27]. The network model is supported by some input nodes that receive input data or features, a hidden layer made up of nodes with activation functions that accomplish some procedure on the input data, and an output node that provides the predicted class of test data. The weights of the network were determined using the training dataset. Furthermore, during the training stage, the network was investigated on the validation dataset to accomplish slightly earlier shutdown for overloading reduction objectives. The last network was investigated on a test dataset using the last stored weights that produces great results on the validation dataset. The network’s weights were saved every time it achieved a good outcome on the validation dataset [28]. The NN model used in this paper has one input layer, twenty hidden layers, and one/three output layers for binary/multiclass classification. The network is tested with various internal process activation functions, and it is discovered that the sigmoid function provides the highest precision. Reference [29] is shown in Figure 2.Figure 2
Neural network system [30].


### 3.4.3. Support Vector Machine (SVM)

It is a learning algorithm with a number of advantageous properties. It identifies trends in information and is attributed to data analysis. For classification, it employs a linear discriminate function [31]. Nonlinear classification, on the other hand, is possible if a nonlinear kernel is used. SVM works well in real time, is robust, and is simple to recognize. It seems to have a comprehensive solution when especially in comparison to other classifiers. A classification task usually necessitates knowledge of the data to be classified [32].We have reorganized the multisignal scattering transform into a material to produce a matrix suitable for the SVM classifier. The framework produced a matrix with the dimensions 416-by-16-by-113 for the provided signal length and quality attributes. There were 416 scattering paths, with 16 representing a scattering time window. We can exhibit the procedures of our system briefly as shown in Figure3.Figure 3
The general system of classification.


## 3.4.1. Wavelet Scattering Transform

A wavelet scattering transform creates signal depictions that are translation invariant, stable, and informative. It is resistant to deformations and retains category discrimination ability, making it especially useful for classification. We relate to it because of its excellent work achievement in classification. We could well adhere to the annotation in [1]. Let f(t) represent the signal under consideration. The low-pass filter and wavelet function are intended to create filters that encompass the entire frequency range of the signal. ϕ(t) denote the low-pass filter that generates local produce translation invariant explanations of (f) at a specific scale T. The group of wavelet indices with an octave frequency resolution Qk is denoted by Λk. By stretching the wavelet ѱ, multiscale high-pass filter banks (ѱj) can be created. The convolution S0 f(t) = f ⋆ϕ(t) produces a local produce translation invariant feature of (f) and though causes a lack of high-frequency information. A wavelet elastic modulus transform can retrieve these missing high frequencies.(1)W1f=S0ft,f∗Ψj1tj1∈Λ1.Averaging the wavelet operand coefficients withϕj yields the first-order scattering coefficients.(2)S1ft=f∗Ψj1∗ϕJtj1∈Λ1.To retrieve the information missed due to averaging, we can retrieve complement high-frequency coefficient values by consideringS1ft as the low-frequency component of f∗Ψj1 as shown in the following equation:(3)W2f∗Ψj1=S1ft,f∗Ψj1∗Ψj2tj1∈Λ2.In the second order of scattering coefficients(4)S2ft=f∗Ψj1∗Ψj2∗ϕJtj1∈Λi,i=1,2,….Iterating the preceding method yields wavelet integrand convolutions.(5)Umft=f∗Ψj1∗⋯∗Ψjmj1∈Λi,i=1,2,…,m.Scattering coefficients at m-th order(6)Smft=f∗Ψj1∗⋯∗Ψjm∗ϕJtj1∈Λi,i=1,2,…,m.The final matrix of scattering is(7)Smft=Smft0≤m≤l.The scattering decomposition could indeed detect slight changes in the amplitude and duration of ECG signals, which are difficult to quantify and though represent the heart's situation. As a result, we employ the network of wavelet scattering to generate reliable depictions of ECG heartbeats, which decrease variations within one arrhythmia class whilst ensuring adequate discriminability between them. It has already been demonstrated that the energy of scattering parameters minimizes slightly as the layer level rises, for the first two layers containing nearly 99 percent of the energy [1, 26]. As a result, we utilized a two-request scattering network to retrieve ECG signal features. This also significantly reduces the complexity of the algorithm.(1) I-Classifier. In this paper, it is briefly explained how to use classifier approaches that combine features to predict the category for ECG signals. Choosing the most convenient classifier must be based on specific criteria such as the classifier’s use in previous works to compare with them and its ability to handle high dimension and large size training data efficiently. As the selected classifier is of the supervised category, classification entails two stages: learning the data and thereafter testing it. All ECG segments of the very same heartbeat type are saved in a single feature vector, and the process is repeated for one of the other kinds of ECG segments. All of these heartbeats are mapped using feature extraction methods from our research methods.


## 3.4.2. Neural Network (NN)

A well-established physiologically concept, NNs, is a favorable machine learning technique to identify nonlinear ECG signals for biometric recognition. NN employs a variety of methods, including supervised learning, unsupervised learning, and reinforcement learning [27]. The network model is supported by some input nodes that receive input data or features, a hidden layer made up of nodes with activation functions that accomplish some procedure on the input data, and an output node that provides the predicted class of test data. The weights of the network were determined using the training dataset. Furthermore, during the training stage, the network was investigated on the validation dataset to accomplish slightly earlier shutdown for overloading reduction objectives. The last network was investigated on a test dataset using the last stored weights that produces great results on the validation dataset. The network’s weights were saved every time it achieved a good outcome on the validation dataset [28]. The NN model used in this paper has one input layer, twenty hidden layers, and one/three output layers for binary/multiclass classification. The network is tested with various internal process activation functions, and it is discovered that the sigmoid function provides the highest precision. Reference [29] is shown in Figure 2.Figure 2
Neural network system [30].


## 3.4.3. Support Vector Machine (SVM)

It is a learning algorithm with a number of advantageous properties. It identifies trends in information and is attributed to data analysis. For classification, it employs a linear discriminate function [31]. Nonlinear classification, on the other hand, is possible if a nonlinear kernel is used. SVM works well in real time, is robust, and is simple to recognize. It seems to have a comprehensive solution when especially in comparison to other classifiers. A classification task usually necessitates knowledge of the data to be classified [32].We have reorganized the multisignal scattering transform into a material to produce a matrix suitable for the SVM classifier. The framework produced a matrix with the dimensions 416-by-16-by-113 for the provided signal length and quality attributes. There were 416 scattering paths, with 16 representing a scattering time window. We can exhibit the procedures of our system briefly as shown in Figure3.Figure 3
The general system of classification.


## 4. The Results

The exploratory data were obtained from the PhysioNet 2016 heart database. Heart data were obtained from both healthy people and patients with heart disease, and these data are in different recordings; the duration of heartbeat recording varies. The three classes which represent arrhythmia (ARR), congestive heart failure (CHF), and normal sinus rhythm (NSR) during 90 recordings are utilized for classification. Matlab2019b has been used to evaluate the proposed algorithms for classification and disease prediction. Randomly, the data were divided into 70% for training and 30% for testing while the machine learning algorithms were working.For each scenario, the classification using scattering features demonstrated high precision. This result was confirmed by wavelet scattering’s representing time and frequency domain data at various scales with each scattered window, which can be supplied to a classifier that can learn and create the output classification using big selected features. Furthermore, the high precision of scattered window classification may be inherited by the received signal segment classification based on the simple majority of the unique standards of each scattered window. This method produces better performance of the classifier.Scattering coefficients in specific time windows comprise too much delegate information for various classes than scattering coefficients in the other time windows. The decrease in the dimensionality of the time windows eradicates feature redundant information, which not only enhances classification performance but also decreases computation complexity. Our findings in this study demonstrate that the scattering coefficients of the time window comprise enough data to classify arrhythmias. In this case, the output of the feature matrix is 416-by-16-by-113. The bandwidth of the scaling function is used to seriously downsample the wavelet scattering transform in time. This results in 16-time windows for each of the 416 scattering paths.A confusion matrix is a common method of representing any classifier’s classification efficiency. In a confusion matrix, the rows indicate the current class labels, while the columns depict the predicted target class. In such a matrix, each diagonal cell means the number of samples correctly classified for various class labels, as depicted by the corresponding row/column label. Each and every cell that is not on a diagonal denotes an incorrectly classified class as Figure4.Figure 4
Confusion matrix of classification with NN.In the figure above, the diagonal cells represent the number and percentage of correctly classified made by the trained network. 463 samples, for example, are correctly classified as benign. This accounts for 22.3 percent of all samples. Likewise, 377 of the 377 cases are classified correctly as cancerous. This accounts for 18.2 percent of all samples. In addition, 1228 samples were classified correctly at a rate of 59.2 percent. Two malignant biopsies are wrongfully classified as normal, accounting for 0.1 percent of all samples in the data. Likewise, four benign biopsies are misclassified as injured, accounting for 0.2 percent of all data. Overall, 99.7 percent of the accuracy is due to training, while 0.3 percent is incorrect. In Figure5 appears the number of errors, which takes the name and value of the property to define bins number used in the plot of the histogram. The feedforward network has been utilized to resolve any problem to define bins number. While Figure 6 explains the highest accuracy performance by training epochs, the error decreases as more epochs of training are completed, but it may begin to increase on the validation data as the network begins to overfit the training data. The training is stopped after 117 consecutive increases in validation error configuration, and the best possible performance is obtained from the epoch with the smallest validation error.Figure 5
Error histogram.Figure 6
The best performance of the network is at 123 epochs.Figure7 explains the confusion matrix with wavelet scattering of feature extraction and SVM whose given accuracy is 99.92%, which is very good, but the actual performance is better because each time window is classified individually here. Each signal is classified into 16 different categories. To obtain a single class prediction for each scattering representation, use a simple majority.Figure 7
Confusion matrix of classification with SVM.


## 5. Conclusion

The major aim of this work was to improve a machine learning work to classify three various classes automatically namely arrhythmia (ARR), congestive heart failure (CHF), and normal sinus rhythm (NSR) of ECG signals. The experiments have been performed on 90 recordings of ECG signals taken from a commonly available database.The extraction of features from an ECG signal using wavelet scattering was shown to enhance the performance of machine learning algorithms in classifying heartbeats when tried to compare to time and frequency domain features. The wavelet scattering method enables the ECG signal to be evaluated at various time scales and in both the time and frequency domains at the same time. This improves the specificity and separability of the signals. The highest accuracy of classification performance for machine learning approaches is 99.7 for a neural network with wavelet scattering feature extraction and 99.92 for SVM also with wavelet scattering feature extraction.



---

*Source: 9884076-2022-09-19.xml*