A New 12-Lead ECG Signals Fusion Method Using Evolutionary CNN Trees for Arrhythmia Detection

: The 12 leads of electrocardiogram (ECG) signals show the heart activities from different angles of coronal and axial planes; hence, the signals of these 12 leads have functional dependence on each other. This paper proposes a novel method for fusing the data of 12-lead ECG signals to diagnose heart problems. In the ﬁrst phase of the proposed method, the time-frequency transform is employed to fuse the functional data of leads and extract the frequency data of ECG signals in 12 leads. After that, their dependence is evaluated through the correlation analysis. In the second phase, a structural learning method is adopted to extract the structural data from these 12 leads. Moreover, deep convolutional neural network (CNN) models are coded in this phase through genetic programming. These trees are responsible for learning deep structural features from functional data extracted from 12 leads. These trees are upgraded through the execution of the genetic programming (GP) algorithm to extract the optimal features. These two phases are used together to fuse the leads of ECG signals to diagnose various heart problems. According to the test results on ChapmanECG, including the signals of 10,646 patients, the proposed method enjoys the mean accuracy of 97.60% in the diagnosis of various types of arrhythmias in the Chapman dataset. It also outperformed the state-of-the-art methods.


Introduction
Electrocardiogram (ECG) sensors measure the electrical activities of cardiac muscles in the supraventricular and ventricular areas. However, the functions of different muscles might sometimes adversely be affected by various factors, such as high levels of blood lipids, which causes arrhythmia in the electrical performance of the heart. For instance, emergence of cardiac problems in the walls of ventricles is a factor of arrhythmia. Another complication is the supraventricular problem in the upper walls of the ventricles called atria, which leads to arrhythmia in the electrical signal of the heart [1,2]. In particular, there are 11 types of arrhythmias in these two categories: sinus bradycardia, sinus rhythm, atrial fibrillation, sinus tachycardia, atrial flutter, sinus irregularity, supraventricular tachycardia, atrial tachycardia, atrioventricular node reentrant tachycardia, atrioventricular reentrant tachycardia, and sinus atrium to atrial wandering rhythm. According to the statistics, adults aged 35-90 years old experience nearly one-third of lethal factors, such as cardiac complications [3]. Thus, researchers have tried to introduce efficient methods for the early diagnosis and classification of irregularities in ECG signals by using smart computer systems. The 12-lead ECG signals show the heart activities from different angles of coronal and axial planes; hence, the signals of these 12 leads have functional dependence on each other. In addition, the simultaneous applications of these data between leads resulted in the emergence of latent medical variables, which cannot be measured only through single leads [4,5].
Fusion is a suitable approach for improving the performance of ECG-based detection algorithms and generally takes place at the hardware and software levels [6,7]. At the hardware level, fusion improves data measurement operations [8]. In ECG signals, heart information is obtained from multiple equal leads instead of one. Fusing the information obtained from these leads will provide a better assessment of heart function [9]. Generally, there are chest leads and limb leads, and each lead views the heart from a particular angle. At the software level, fusion improves the quality of the collected data. The goal is a better knowledge-extraction process from data. The first category of software fusions is feature-based fusion algorithms [10,11]. Algorithms, such as feature correlation, ranking, and frequency conversions, are used to fuse different classes. Inter-class algorithms fuse different features from different classes. In intra-class fusion, however, the features belonging to one class are fused to extract knowledge. As mentioned in [12], traditional fusion algorithms are for extracting suitable features from ECG signals (in both fiducial and non-fiducial groups) to fuse a specialized engineering process which requires knowledge about the signal. Therefore, hand craft feature generation eliminates the generalization feature and does not help in designing an efficient system. Deep-learning models, such as convolutional neural network (CNN) [5,13,14] and long short-term memory (LSTM) [15], have recently been used for software fusion. Deep-learning methods, such as CNN, present a hybrid view of raw data in multiple processing layers, which leads to automatic learning from the data. Given CNN's abilities, it has been used extensively in ECG detection and has led to superior operations. Although CNN-based feature generation methods are very accurate and have significantly improved biometric detection in ECG, the architectural parameters of CNN models (as explained), including the number and type of layers, are designed through trial and error. This solution is time-consuming and requires domain knowledge, and the complexity of the designed model is directly correlated to its designer's knowledge [14,[16][17][18]. In this paper, we propose a novel method for fusing the data of 12-lead ECG signals to diagnose heart problems.
This paper consists of the following sections. ECG data is described in detail in Section 2. The proposed method is described thoroughly in detail in Section 3, whereas the results are presented in Section 4 that also evaluates the parameters of the proposed method in comparison with other techniques. Finally, Section 5 presents the discussion and draws a conclusion.

ECG Data
The ECG dataset used in this article was collected by Chapman University and Shaoxing People's Hospital (Chapman ECG in short) [19]. This dataset comprises eight types of arrhythmia atrial flutter (AF) with 112 samples, Sinus bradycardia (SB) with 3889 samples, supraventricular tachycardia (SVT) with 587 samples, sinus tachycardia (ST) with 1568 samples, sinus rhythm (SR) with 1826 samples, atrial fibrillation (AFIB) with 1780 samples, and sinus irregularity (SI) with 399 samples. The signals for each person were recorded within several days and during different sessions by ECG sensors. In this dataset, the 12-lead ECG signals were recorded from 10,646 people with a frequency higher than 500 Hz. Each ECG signal in 12-lead is a 10-s strip. In addition, an initial pre-processing was applied to this dataset to smooth the ECG signals using the Butterworth filter and the non-local means technique. All samples of this dataset are classified into three sections, validation, train, and test, bearing the shares of 70%, 15%, and 15%, respectively. Figure 1 shows an ECG signal that has undergone the smoothing operation. Figure 1a shows the raw ECG signal with the domain of −500 mV to 400 mV. Figure 1b shows the 3D spectrogram of this raw signal. Figure 1c manifests the smoothed signal with a domain of −300 mV to 300 mV. Additionally, Figure 1d shows the spectrogram of the smooth signal, which revealed that the higher frequencies are decreased in it. The pre-processing will be quite effective in reducing the complexity of the model through the normalization of the numbers.
Mathematics 2022, 10, x FOR PEER REVIEW 3 of 14 of −300 mV to 300 mV. Additionally, Figure 1d shows the spectrogram of the smooth signal, which revealed that the higher frequencies are decreased in it. The pre-processing will be quite effective in reducing the complexity of the model through the normalization of the numbers.

The Proposed Method
This paper introduces an ECG signal detection system based on deep fusion. First, genetic programming-based evolutionary programming was used to solve problems with deep-learning fusion algorithms. In the proposed method, the CNN models used for fusion are coded as genetic programming (GP) programs [18]. These programs are binary trees whose nodes have embedded deep operators, such as convolution for fusion of ECG leads. During the evolutionary process, these trees evolve and the best variants for fusing ECG lead information are calculated at the software level. Finally, the best sample for fusing leads is extracted. To create an ECG-based detection system, this thesis conducts a full analysis of the ECG signal to maintain the system's generalization. To this end, the signal's frequency information is obtained via wavelet frequency conversion, and the similar information is calculated. Because CNN has a convolution filter, it is a model made for images; thus, in this paper, a method for converting the raw ECG signal to an image is presented. Then, signals are converted into images using a mixed conversion and given to CNN trees as frequency information. The proposed system's performance was evaluated on a dataset of 10,000 arrhythmia patients (Chapman) [19]. This dataset includes 11 different types of arrhythmias, which are measured with a 500 Hz frequency.

The Proposed Method
This paper introduces an ECG signal detection system based on deep fusion. First, genetic programming-based evolutionary programming was used to solve problems with deep-learning fusion algorithms. In the proposed method, the CNN models used for fusion are coded as genetic programming (GP) programs [18]. These programs are binary trees whose nodes have embedded deep operators, such as convolution for fusion of ECG leads. During the evolutionary process, these trees evolve and the best variants for fusing ECG lead information are calculated at the software level. Finally, the best sample for fusing leads is extracted. To create an ECG-based detection system, this thesis conducts a full analysis of the ECG signal to maintain the system's generalization. To this end, the signal's frequency information is obtained via wavelet frequency conversion, and the similar information is calculated. Because CNN has a convolution filter, it is a model made for images; thus, in this paper, a method for converting the raw ECG signal to an image is presented. Then, signals are converted into images using a mixed conversion and given to CNN trees as frequency information. The proposed system's performance was evaluated on a dataset of 10,000 arrhythmia patients (Chapman) [19]. This dataset includes 11 different types of arrhythmias, which are measured with a 500 Hz frequency.
Finally, the main contributions of this paper are as follows: • Employing the approach of trajectory image creation at ECG signals instead of raw signals to increment the integration of the proposed model; • Proposing a genetic programming-based model to learn deep features at ECG signals and employing several genes at GP to fusion these features.
The flowchart of the proposed method is shown in Figure 2. The innovation of the proposed method to diagnosis arrhythmia using the ECG signal of individuals is based on drawing a trajectory as a figure for each 12-ECG signal leads. Since the ECG signal is periodic, frequency analysis on it can give useful information about this signal. For this, frequency analysis was performed using the wavelet packet transform on each of the 12-ECG signal leads. Then, cross-correlation was calculated between leads 1 to 12 to describe relations between various leads. To extract the ECG signal trajectory, a repetitive pre-processing was calculated on 12 cross-correlation signals, and their spectrogram was extracted. Finally, a trajectory was drawn for these 12 signals, and the output of the trajectory was saved as a figure. These figures are used to produce features as input to the CNN tree. The CNN tree is then developed based on the GP paradigm. Finally, the main contributions of this paper are as follows: • Employing the approach of trajectory image creation at ECG signals instead of raw signals to increment the integration of the proposed model; • Proposing a genetic programming-based model to learn deep features at ECG signals and employing several genes at GP to fusion these features.
The flowchart of the proposed method is shown in Figure 2. The innovation of the proposed method to diagnosis arrhythmia using the ECG signal of individuals is based on drawing a trajectory as a figure for each 12-ECG signal leads. Since the ECG signal is periodic, frequency analysis on it can give useful information about this signal. For this, frequency analysis was performed using the wavelet packet transform on each of the 12-ECG signal leads. Then, cross-correlation was calculated between leads 1 to 12 to describe relations between various leads. To extract the ECG signal trajectory, a repetitive pre-processing was calculated on 12 cross-correlation signals, and their spectrogram was extracted. Finally, a trajectory was drawn for these 12 signals, and the output of the trajectory was saved as a figure. These figures are used to produce features as input to the CNN tree. The CNN tree is then developed based on the GP paradigm.  For this purpose, a set of the initial population is first randomly formed. Every sample of this population is a CNN tree (Section 3.4). The CNN hierarchical tree samples are used Mathematics 2022, 10, 1911 5 of 14 in each generation of the GP algorithm to extract features from dataset records. Samples from the CNN tree are used in each generation of the GP algorithm to extract features from dataset records. The SVM model is then taught to calculate the fit of each tree using the created features. Then, the SVM model classification error value is considered as the tree fit. The trees keep evolving until the end of generations by repeating this process. Eventually, the best sample in the population with the highest quality feature producer is selected under the name CNN tree.

Wavelet Decomposition of ECG Signal
Here, a wavelet packet analysis was performed to extract details and approximate the ECG signal. To decompose the ECG signal, a five-order wavelet of Daubechies type was used in the decomposition of ECG signal wavelet. Given the fewer details in the ECG signal, signal decomposition was performed only up to the first level of the tree. In this equation, cD j and dA j are respective details and approximation signals. Figure 3 shows the output of the frequency analysis of the ECG signal with the wavelet packet transform. For this purpose, a set of the initial population is first randomly formed. Every sample of this population is a CNN tree (Section 3.4). The CNN hierarchical tree samples are used in each generation of the GP algorithm to extract features from dataset records. Samples from the CNN tree are used in each generation of the GP algorithm to extract features from dataset records. The SVM model is then taught to calculate the fit of each tree using the created features. Then, the SVM model classification error value is considered as the tree fit. The trees keep evolving until the end of generations by repeating this process. Eventually, the best sample in the population with the highest quality feature producer is selected under the name CNN tree.

Wavelet Decomposition of ECG Signal
Here, a wavelet packet analysis was performed to extract details and approximate the ECG signal. To decompose the ECG signal, a five-order wavelet of Daubechies type was used in the decomposition of ECG signal wavelet. Given the fewer details in the ECG signal, signal decomposition was performed only up to the first level of the tree. In this equation, and are respective details and approximation signals. Figure 3 shows the output of the frequency analysis of the ECG signal with the wavelet packet transform.

Calculate Cross-Correlation between 12-Lead ECG
Cross-correlation is one of the useful tools to describe the relations between various leads of the ECG signal. Figure 4 shows the cross-correlation output between the approximation signal of the leads I and II of the ECG signals. As illustrated, there is a regular cross-correlation between these two leads due to the high similarity between signals of various leads of the ECG signal, as stated in the previous sections.

Calculate Cross-Correlation between 12-Lead ECG
Cross-correlation is one of the useful tools to describe the relations between various leads of the ECG signal. Figure 4 shows the cross-correlation output between the approximation signal of the leads I and II of the ECG signals. As illustrated, there is a regular cross-correlation between these two leads due to the high similarity between signals of various leads of the ECG signal, as stated in the previous sections.

ECG Trajectory Image Presentation
To prepare input data of the CNN tree, we calculated the ECG trajectory in this section. The output of the spectrogram display of an ECG signal is created as complex numbers. To draw the trajectory of this spectrogram, its real and imaginary sections should be illustrated as a two-dimensional function. Figure 5 shows the trajectory for cross-correlation between leads I to II of the ECG signal.

Feature Learning Using the Evolutionary CNN Tree
It was stated in the previous chapter that the gene, in the sample is a mapping function in the form of a CNN tree, which is used to extract the structural features from signal. The representation of the CNN tree encoded in the gene, as well as its functions and terminals, will be explained here. The representation of the CNN model in the form of GP trees is addressed in [20]. This article used a modified version of it per [20], which utilizes the morphological convolutional functions in this tree, and it is appropriate for QRS complex analysis in the ECG signal. Figure 6 shows an instance of the CNN Figure 4. Cross-correlation output between the approximation signal of the leads I and II of the ECG signals, (a) lead I and II signals, (b) cross correlation between lead I and II.

ECG Trajectory Image Presentation
To prepare input data of the CNN tree, we calculated the ECG trajectory in this section. The output of the spectrogram display of an ECG signal is created as complex numbers. To draw the trajectory of this spectrogram, its real and imaginary sections should be illustrated as a two-dimensional function. Figure 5 shows the trajectory for cross-correlation between leads I to II of the ECG signal.

Calculate Cross-Correlation between 12-Lead ECG
Cross-correlation is one of the useful tools to describe the relations between various leads of the ECG signal. Figure 4 shows the cross-correlation output between the approximation signal of the leads I and II of the ECG signals. As illustrated, there is a regular cross-correlation between these two leads due to the high similarity between signals of various leads of the ECG signal, as stated in the previous sections.
(a) (b) Figure 4. Cross-correlation output between the approximation signal of the leads I and II of the ECG signals, (a) lead I and II signals, (b) cross correlation between lead I and II.

ECG Trajectory Image Presentation
To prepare input data of the CNN tree, we calculated the ECG trajectory in this section. The output of the spectrogram display of an ECG signal is created as complex numbers. To draw the trajectory of this spectrogram, its real and imaginary sections should be illustrated as a two-dimensional function. Figure 5 shows the trajectory for cross-correlation between leads I to II of the ECG signal.

Feature Learning Using the Evolutionary CNN Tree
It was stated in the previous chapter that the gene, in the sample is a mapping function in the form of a CNN tree, which is used to extract the structural features from signal. The representation of the CNN tree encoded in the gene, as well as its functions and terminals, will be explained here. The representation of the CNN model in the form of GP trees is addressed in [20]. This article used a modified version of it per [20], which utilizes the morphological convolutional functions in this tree, and it is appropriate for QRS complex analysis in the ECG signal. Figure 6 shows an instance of the CNN

Feature Learning Using the Evolutionary CNN Tree
It was stated in the previous chapter that the f m n gene, in the p m sample is a mapping function in the form of a CNN tree, which is used to extract the structural features from x i signal. The representation of the CNN tree encoded in the f m n gene, as well as its functions and terminals, will be explained here. The representation of the CNN model in the form of GP trees is addressed in [20]. This article used a modified version of it per [20], which utilizes the morphological convolutional functions in this tree, and it is appropriate for QRS complex analysis in the ECG signal. Figure 6 shows an instance of the CNN tree. As displayed in this figure, the surface of this tree comprises a variety of layers. There is an input layer in the leaf nodes of this tree that receives the x i signal as the input. Afterward, there is a morphological convolutional layer, which is normally followed by a pooling layer. In this tree, a node can be a layer of the combination of morphological convolutional/pooling. Before the root layer, there is a concatenation layer. Finally, there is the root layer, which is the output layer. In this tree, the convolution layer carries out the operation of extracting the structural features using the morphological operators, which is fully explained in the next chapter. The pooling layer is used after the convolution layer to reduce the output dimensions of the convolution. Additionally, the concatenation layer connects two input layers together. The output layer is the same as the flatten layer in the CNN, which forms the feature diagram.
tree. As displayed in this figure, the surface of this tree comprises a variety of layers. There is an input layer in the leaf nodes of this tree that receives the signal as the input. Afterward, there is a morphological convolutional layer, which is normally followed by a pooling layer. In this tree, a node can be a layer of the combination of morphological convolutional/pooling. Before the root layer, there is a concatenation layer. Finally, there is the root layer, which is the output layer. In this tree, the convolution layer carries out the operation of extracting the structural features using the morphological operators, which is fully explained in the next chapter. The pooling layer is used after the convolution layer to reduce the output dimensions of the convolution. Additionally, the concatenation layer connects two input layers together. The output layer is the same as the flatten layer in the CNN, which forms the feature diagram. Figure 6. An instance of CNN tree: the green nodes are the input layers, the blue nodes are the morphological convolutional layers, the red nodes are the pooling layers, the black nodes are the concatenation layers, and the gray node is the output layer. Table 1 shows the set of functions used in the CNN tree. First, the functions used to change the numerical space of the features include convolution (Conv), square root (SQRT), addition (ADD), rectified linear unit (ReLU), subtraction (Sub), and absolute (Abs), among which Conv is the most important function. This function is responsible for applying the morphological operators to the input ECG signals. On account of their special geometrical characteristics, the morphological functions, such as dilation and erosion, are capable of perfectly analyzing the complexities of ECG signals, including QRS complex. The morphological operators, such as erosion and dilation, are beneficial for analyzing the shape-oriented signals due to their theoretical framework and lower computational complexity [21,22]. The morphological operators, i.e., erosion and dilation, are the restricted form of counter-harmonic mean morphology [23]. Figure 6. An instance of CNN tree: the green nodes are the input layers, the blue nodes are the morphological convolutional layers, the red nodes are the pooling layers, the black nodes are the concatenation layers, and the gray node is the output layer. Table 1 shows the set of functions used in the CNN tree. First, the functions used to change the numerical space of the features include convolution (Conv), square root (SQRT), addition (ADD), rectified linear unit (ReLU), subtraction (Sub), and absolute (Abs), among which Conv is the most important function. This function is responsible for applying the morphological operators to the input ECG signals. On account of their special geometrical characteristics, the morphological functions, such as dilation and erosion, are capable of perfectly analyzing the complexities of ECG signals, including QRS complex. The morphological operators, such as erosion and dilation, are beneficial for analyzing the shape-oriented signals due to their theoretical framework and lower computational complexity [21,22]. The morphological operators, i.e., erosion and dilation, are the restricted form of counter-harmonic mean morphology [23]. (2) and (3) is the counter-harmonic mean morphology filter that is expanded as follows.
The * equation indicates the convolution operations, and u(o) shows the kernel function. The convolution operations are formulated in the Conv function as follows using the counter-harmonic mean morphology filter.
Mathematics 2022, 10, 1911 8 of 14 The types of the operations of this function are determined with respect to the amount considered for q, (q = 0 linear, q < 0 pseudoerosion, q > 0 pseudodilation).
The Sub and Add functions carry out the weight addition and subtraction operations of two signals based on the weights of n 1 and n 2 . Two input ECG signals might have different measurements. Thus, the ECG signal will be cut using the aforementioned function to obtain two ECG signals of the same size. The Sqrt, ReLU, and Abs functions are used to change the amount of ECG signal and change the numerical space of the respective sample. In the new networks, the ReLU is preferred over the activating Sigmoid function for hidden layers for two reasons.

Description Method
Carrying out morphology convolution operations on S 1 matrix with Kernel filter k Conv (S 1 , k) Subtraction of matrices of S 1 and S 2 , bearing weights of n 1 and n 2 Sub (S 1 , S 2 , n 1 , n 2 ) Addition of matrices of S 1 and n 2 , bearing weights of n 1 and n 2 Add (S 1 , S 2 , n 1 , n 2 ) Return of max(0, x) for each x in S 1 matrix ReLU (S 1 ) Return of √ x for each x in S 1 matrix Sqrt (S 1 ) Return of |x| for each x in S 1 matrix Abs (S 1 ) Applying max-pooling to S 1 matrix using Kernel filter with a measurement of k 1 and k 2 MaxP (S 1 , k 1 , k 2 ) Connecting two S 1 and S 2 matrices together as a diagram Concat2 (S 1 , S 2 ) Connecting three S 1 to S 3 matrices together as a diagram Concat3 (S 1 , S 2 , S 3 ) Connecting four S 1 to S 4 matrices together as a diagram Concat4 (S 1 , S 2 , S 3 , S 4 ) First, it is simple and easy to use. Second, it does not cause a local minimum problem. In this function, in the case the input amount is less than zero, the output will be the same as the input, and in the case the input is less than or equal to zero, then the output will be zero. The ReLU function has a fixed derivative for all inputs greater than zero. This fixed derivative accelerates the network's learning. The Concat1, Concat2, Concat3, and Concat4 functions are used in the concatenation layer, which receives several ECG signals as input and displays them as a diagram in the output. The MaxP function performs a downsampling operation on the ECG input signal. This function can reduce the dimensions of the received ECG signal. Table 2 shows the list of the terminals and the range of the authorized amounts used for them in the nodes of the leaves of the CNN tree. x i The ECG input signal is displayed through the measurement of n × 1. The f ilter 3×3 , f ilter 5×5 , and f ilter 7×7 terminals show the convolution filter and the second input of Conv. Taking into account that the used morphological filter is a matrix in the shapes of a diamond, disk, line, rectangle, square n 1 and n 2 are added to the Sub and Add functions as inputs, and their amounts range between 0.000 to 1.000. k 1 and k 2 are the same size as the MaxP kernel functions. Their amounts will evolve randomly and during execution of the GP algorithm.

Results
All implementations and evaluations were performed on a PC with Microsoft Windows 10 OS, Intel i7-9750H processor, 64 GB of RAM, and Nvidia RTX 2060 GDDR6 SLI GPU with 6 GB memory. Besides that, the model's weight parameters were trained and adjusted by the Adam optimizer. For the experiments, all the networks trained 200 epochs, the initial learning rate was set to 1 × 10 −3 for the first half and then multiplied by 0.1 per quarter [25].

Results Analysis Method
A confusion matrix is first determined for test samples to analyze the results. Table 3 demonstrates how to form the confusion matrix for arrhythmia with "true" and "predicted" labels (c predictedlabel,truelabel ). The combination of eight "true" and "predicted" labels will yield an 8 * 8 confusion matrix. Table 3 reports the details regarding the layout of these sublabels of arrhythmia. Based on the resultant confusion matrix, four evaluation criteria (i.e., ACC Fold , ACC cl , SEN cl , and SPE cl ) are employed to evaluate classification models. The total accuracy (ACC Fold ) indicates the performance of the classification model for all subclasses in a specific fold. This criterion is calculated by dividing the number of correctly classified samples on all samples. It is easily obtained from the confusion matrix by adding the main diagonal to the total samples of the matrix in the following way. In addition to the criterion that evaluates all samples of the model in a general outlook, some criteria are considered to analyze the model performance in a class-oriented way. Particularly, these criteria analyze the model performance for the classification of samples in a class cl as opposed to the other classes. This criterion converts the classification from eight classes to a binary classification technique with two states in which the model operates correctly and two other states in which the model operates wrongly. The two correct states are called TP and TN, whereas the two wrong states are called FP and FN. In this case, "positive" indicates that a sample belongs to the current class (cl), whereas "negative" indicates that a sample belongs to the other classes. Equations (6)-(9) represent the formula-based definitions of these criteria. In these equations, cl ∈ {Class set}, and set = {A, F, PT, TA, DC, LC, MC, FC}. These definitions can be employed to formulate three evaluation criteria of the model in a class-oriented way.
ACC cl = TP cl + TN cl TP cl + TN cl + FP cl + FN cl (6) PREC cl = TP cl TP cl + FP cl (7) SEN cl = TP cl TP cl + FN cl (8) SPE cl = TN cl TN cl + FP cl (9) Table 4, it can be concluded that extracting functional data from ECG leads can be very useful and efficient in diagnosing arrythmias. The quality of the proposed method can be examined in the computational overload of its algorithm, where merely the correlation between the leads is used in the proposed method that includes a smaller data volume than the raw signal. In fact, their functional data were used simply as a number calculated through correlation and features of the structure extracted from the CNN tree. Figure 7a,b depict the confusion matrix and convergence diagram of the proposed fusion algorithm, respectively. Generally, the confusion matrix indicates that the proposed fusion algorithm had acceptable levels of dispersion for all classes and did not focus only on one class of arrythmia. (a) (b) Figure 7. The confusion matrix of the proposed fusion algorithm with all ECG 12 leads and its convergence rate curve, (a) confusion matrix, (b) convergence rate curve.
The Table 5 shows the execution duration of the proposed method during the training and testing phases. Table 5 demonstrates that the training section of the proposed method had an execution duration of 15 min and 10 s. This time has no effect on the process of executing the proposed method since the training phase is offline, which is crucial during the development of the system. However, the most important time is the duration of the testing. Accordingly, Table 5 shows that the execution duration of the proposed method is 31 s. It signifies that the proposed method can diagnose arrhythmia in a split second. It prevents the overfitting of the classification model. In this matrix, classification mistakes are observed among the classes of arrhythmia, which do not cause any medical problems. Figure 7b shows the convergence diagram of the fusion algorithm of the proposed method; the proposed method has a proper convergence for classifications of various arrhythmia samples in the Chapman dataset. Even the convergence rate is improved in comparison to Figure 7b, and it has rapidly obtained convergence.
The Table 5 shows the execution duration of the proposed method during the training and testing phases. Table 5 demonstrates that the training section of the proposed method had an execution duration of 15 min and 10 s. This time has no effect on the process of executing the proposed method since the training phase is offline, which is crucial during the development of the system. However, the most important time is the duration of the testing. Accordingly, Table 5 shows that the execution duration of the proposed method is 31 s. It signifies that the proposed method can diagnose arrhythmia in a split second.

Comparing the Proposed Fusion Algorithm with the Other Deep-Learning Methods
This subsection draws a comparison between the proposed fusion algorithm and the other state-of-the-art methods based on deep-learning models. First, Table 6 compares the proposed fusion algorithm with the methods in which the inputs are based on the single-lead ECG signals. The details include the number of patients, the number of ECG records, the quantities of classes and rhythms diagnosed, and the methods used. The performance results of the previous methods are reported with respect to certain criteria, such as accuracy and F1-score. Various deep-learning models, such as CNN, LSTM, and RNN, were used in these methods. Conventionally, a wide variety of these methods were evaluated on MIT-BIH Arrhythmia belonging to PhysioNet. For instance, a deep CNN model was used in [26] to classify 12 rhythms. Batch normalization and data augmentation steps were used in this model. The results of this study reported F1: 83% for 53,549 patients. In [27], a deep-learning model was used with the standard U-Net architecture to classify five different types of arrhythmias in MIT-BIH Arrhythmia. In this paper, the accuracy was reported as 97.32% for the classification of records collected from 47 patients. In [28], the same dataset was used with a CNN model for data normalization. The CNN model had five convolutional layers, three pooling layers, and one fully connected layer. According to the evaluation results, ACC was reported as 98.54% on 47 patients in MIT-BIH Arrhythmia. Recently, a hybrid CNN+LSTM model was introduced in [29] to classify ChapmanECG through single-lead ECG signals. In this method, a CNN model was adopted to generate deep spatial features from raw ECG signals. The CNN output was then given to the LSTM model to generate deep temporal features. According to the evaluation results, ACC was reported as 92.24% for 10,436 patients.
In this paper, a fusion algorithm was proposed to classify single-lead ECG signals. Its performance was then evaluated on the ChapmanECG dataset. According to Table 6, ACC was reported as 97.60% by the proposed fusion algorithm for the records of 10,646 patients. The proposed fusion algorithm used a large number of records for model development. The fusion algorithm yielded a further accuracy of 5.36% compared to the method proposed in [29] on ChapmanECG. Moreover, the same records were used in the training and test datasets in most of the previous studies, which reduced the universality of methods and attenuated their performance in response to unseen data. This problem was considered in the method proposed in this paper.