High accuracy distinction of shockable and non-shockable arrhythmias in abnormal classes through wavelet transform with pseudo differential like operators

Arrhythmia is an abnormal rhythm of the heart which leads to sudden death. Among these arrhythmias, some are shockable, and some are non-shockable arrhythmias with external defibrillation. The automated external defibrillator (AED) is used as the automated arrhythmia diagnosis system and requires an accurate and rapid decision to increase the survival rate. Therefore, a precise and quick decision by the AED has become essential in improving the survival rate. This paper presents an arrhythmia diagnosis system for the AED by engineering methods and generalized function theories. In the arrhythmia diagnosis system, the proposed wavelet transform with pseudo-differential like operators-based method effectively generates a distinguishable scalogram for the shockable and non-shockable arrhythmia in the abnormal class signals, which leads to the decision algorithm getting the best distinction. Then, a new quality parameter is introduced to get more details by quantizing the statistical features on the scalogram. Finally, design a simple AED shock and non-shock advice method by following this information to improve the precision and rapid decision. Here, an adequate topology (metric function) is adopted to the space of the scatter plot, where we can give different scales to select the best area of the scatter plot for the test sample. As a consequence, the proposed decision method gives the highest accuracy and rapid decision between shockable and non-shockable arrhythmias. The proposed arrhythmia diagnosis system increases the accuracy to 97.98%, with a gain of 11.75% compared to the conventional approach in the abnormal class signals. Therefore, the proposed method contributes an additional 11.75% possibility for increasing the survival rate. The proposed arrhythmia diagnosis system is general and could be applied to distinguish different arrhythmia-based applications. Also, each contribution could be used independently in various applications.

advice algorithm is the ultimate demand to use the scalogram information properly. For a viable solution to the above issues, we develop a simple decision method (design of the AED shock and non-shock advice algorithm) that guarantees high distinction with a low computational amount.
The main contributions of this paper are as follows: (i) Derivation of the scalogram. By making use of the Gabor wavelet transform with pseudo-differentiallike operators, developed in 17 , the time-frequency scalograms of the ECG corresponding to abnormal shockable (VT and VF) and abnormal non-shockable (PEA) arrhythmias are generated. The main novelty of the proposed method in 17 is that the application of pseudo-differential like operators with non-linear transformation function to the GWT does work efficiently and effectively, and generates distinguishable scalograms between shockable and non-shockable arrhythmias in the abnormal class signals, which satisfy visual comparison through scalo-graphic and scatter plot observation. (ii) Effective characterization of the scalogram in both time and frequency direction. In this context, we apply two quality parameters, normalized spectrum index (NSI) and normalized time index (NTI), in the scalogram. The NSI possesses the information in the frequency direction, which has been considered in Rahman et al. 17 . On the other hand, the NTI possesses the information in the time direction, which is a new addition to this paper. (iii) We employed the class separability technique to select essential features effective for discrimination. (iv) Design of the AED shock and non-shock advice algorithm. We develop a simple decision method to guarantee high accuracy and rapid decision between shockable and non-shockable arrhythmias. In this context, we adopt a new metric function, defined through adequately chosen topology for the space of scatter plots. The main novelty of the proposed decision method is that it effectively discriminates between shockable and non-shockable arrhythmias with low computational time, which help to increase the survival rate of the patients, and the application of the proposed metric function in the decision method achieves the highest accuracy than the application of the Euclidean metric function in the decision method. (v) We conducted a comparative performance analysis of our proposed methodology with other state-of-theart approaches. It is shown that the proposed arrhythmia diagnosis system performs better than others for the distinction between abnormal shockable (VT, VF) and abnormal non-shockable (PEA) arrhythmias in the abnormal class signals.

The proposed methodology of the arrhythmia diagnosis system
The proposed discrimination procedure consists of several steps shown in Fig. 1. This figure describes the overall summary of the distinction process between shockable and non-shockable arrhythmias. In the proposed arrhythmia diagnosis system, the core idea is to derive exact information (scalogram) from the abnormal classes of ECG signals, which leads to the decision algorithm for accurate discrimination between shockable and non-shockable arrhythmias. Following the information, the new quality parameter is adopted to get more details by quantizing the statistical features. Also, a method is proposed in the decision stage to get high accuracy and rapid discrimination, increasing the chance of survival. First, the pre-processing of the ECG signals for segmenting and detrending is performed. The original ECG signals are separated into pieces of five-second signal segments. Then, the trend is removed from each of the segmented signals to obtain the signals f. Second, the wavelet transforms with pseudo-differential-like operators, and non-linear transformation is used to accurately generate wavelet coefficients H(L(a)Wf(a, b)) from f. These coefficients are represented as Figure 1. The whole scheme of shockable and non-shockable arrhythmia discrimination. ECG dataset. A combination of three accredited databases from physionet.org 37 , MIT-BIH arrhythmia database (MITDB), MIT-BIH malignant ventricular ectopy database (VFDB), and Creighton university ventricular tachyarrhythmia database (CUDB), is used to examine the proposed method for distinction of the shockable and non-shockable arrhythmia signals. These databases contain both shockable and non-shockable arrhythmia types. From these databases, 1079 ECG samples are collected. The samples are grouped into four classes: sinus rhythm (SR), pulseless electrical activity (PEA), ventricular fibrillation (VF), and ventricular tachycardia (VT). The pre-processing of the data set has been explained in 17 . Figures 2 and 3 show an example of the segmented non-shockable and shockable arrhythmias, respectively. In Fig. 2, the left is SR, and the right is PEA, respectively, both of non-shockable arrhythmias. On the other hand, in Fig. 3 the left is VF, and the right is VT, respectively, both shockable arrhythmias.
The wavelet transform with pseudo-differential like operators. In order to give a self-consistent style to the present paper and to avoid the confusion of the notions corresponding to the pseudo differential operators, we repeat the description given in 17 . The notions of the pseudo-differential like operators have been proposed by Rahman et al.,in 17 to apply it to the analysis of the ECG signals, and the general notions of the pseudo differential operators in the framework of the Fourier analysis are well-known and are found in 38 . More-   www.nature.com/scientificreports/ over, general applications of the pseudo differential operators to function spaces can be found, e.g., in 39 and 40 and references therein. The usual pseudo-differential operator is defined in the framework of the Fourier analysis. We extend the notion of the pseudo-differential operator to the wavelet analysis framework and call them the pseudo-differential-like operators. The notion of the pseudo differential operators to the GWT is defined as follows: Let L 2 ≡ L 2 (R → C) be the space of C-valued, complex number valued, square-integrable functions on the real line R . For some given σ > 0 and ω 0 ∈ R , take the mother wavelet function ψ(t) in L 2 as follows: Then, for f ∈ L 2 , define the Gabor wavelet transform (Wf)(a, b) as follows: where, the variable 1 a > 0 corresponds to the frequency of the function f, and b corresponds to the time. Next, we prepare two measurable functions L and H such that For f ∈ L 2 , we then define our wavelet transform with pseudo differential like operator L, and its non-linear transform by means of H, which are C-valued measurable functions with the variables a > 0 and b ∈ R , as follows: The algorithm 1 shows the process of generating the scalogram using the Gabor wavelet transform with pseudodifferential-like operators. From Figs. 4, 5, 6 and 7, through the source code by which these figures are derived, the vertical axis values can be interpreted as [Hz] by multiplying 1/π.
2σ 2 e iω 0 t , t ∈ R, with i ≡ √ −1.      17 ), In these figures the scalograms with L(a) = 1 and H(·) = |·| 2 , which is the conventional setting adopted by 9 , where the pseudo differential like operators are not applied. They show a good distinction between normal and abnormal signals. Still, there seem to be no differences in the scalo-graphic representation between abnormal signals, i.e., PEA, VF, and VT. In the scalograms, wavelet coefficient values for all scalograms are at the same level, which leads to failure to get the best distinction in the decision algorithm. (ii) Figures 6, 7 (which are given in 17 ), In these figures, the scalograms with L(a) = 1 a and H(·) = |·| 1 4 , which is the setting of pseudo-differential like operators and non-linear transformation. Through the pseudodifferential like operators, we can get much more fruitful information (fractional order of differentiation of the signal) on the original signals, and by applying the non-linear transformation functions to the transformed signals, we can make bigger the part of the transformed signals which has small amplitude. Through these, we can clearly distinguish the signals with small differences, i.e., PEA, VF, and VT. In particular, the difference between the maximum frequencies corresponding to PEA and VT is 7.2 (Hz) (randomly selected samples). The different values over time lead to getting the best discrimination in the decision stage.
We have demonstrated an intrinsic effect of L(a) with H(·) using qualitative evaluation in 17 . From the experimental results (cf. 17 ), for the subsequent considerations, we adopt the pseudo-differential like operators L(a) = 1 a with the non-linear transformation H(·) = |·|   Effective characterization of scalogram. Here, we present how to use the scalogram in the time and frequency plane to calculate statistical features effective for discrimination.
Characterization along with the frequency. For the scalogram analysis along with the frequency, we have adopted the quality parameter NSI in 17 and taken the center of gravity of energies over frequencies of the scalogram. Figures 8 and 9 show an example of NSI that was obtained as a "time series" signal from the scalogram   www.nature.com/scientificreports/ for SR, PEA, VF, and VT signals. The visualization shows that the NSI waveform tends to change periodically and regularly for an SR signal, while the changes are irregular for PEA, VF, and VT signals. In the example, we mainly concentrate on the discrimination of the shockable (VF and VT) and non-shockable (PEA) arrhythmia in the abnormal class through the NSI. Hence, the NSI value over time is the primary key here. Inspecting the maximum, we get different NSI values for PEA VF and VT signals. The definition of NSI is as follows: where E(a, b) and F(a) represent scalogram value and scalogram frequency, respectively. Note that E(a, b) in the scalogram is obtained by H(L(a) (Wf)(a, b)). The frequency F(a) is for the corresponding E(a, b). Algorithm 2 shows the characterization method of the scalogram over the frequency.
Characterization along with the time. We also adopt a new quality parameter NTI for additional analysis of the scalogram along the time direction. The NTI gives the center of gravity of energies over time of the scalogram. The NTI for SR, PEA, VF, and VT signals are shown in Figs. 10 and 11. Here, the NTI is obtained as a waveform over frequencies from the scalogram. We observe that the NTI spectrum is different for all classes of arrhythmia. The different NTI spectrum for each class lead to good discrimination in the decision algorithm. The definition of the NTI is given by where E(a, b) and T(b) represent scalogram value and scalogram time, respectively. Note that E(a, b) in the scalogram obtained by H(L(a) (Wf)(a, b)) and the time T(b) is for the corresponding E(a, b). The algorithm 3 shows the procedure to characterize the scalogram along the time direction.  Tables 1 and 2 show the features extracted from the scalogram through NSI and NTI. It is unclear here which features are effective for discriminating shockable and non-shockable arrhythmias. Therefore, it is necessary to find out the discriminatory abilities of features. In order to find out the effective features, we watch each of the generated features independently and test their discriminatory capabilities by using the class separability technique such as scatter matrices 41 . This procedure helps us to select the best feature from the set of features. Algorithm 4 shows a detailed process to find the effective feature. Suppose that we have an n-dimensional feature vector x = [x 1 , x 2 , . . . , x n ] assigned to c different classes (i = 1, 2, . . . , c) . The definition of within-class scatter matrix S w and between-class scatter matrix S b are given by, respectively:  where D i is the ith class, and P i is a priori probability for class D i . That is P i = n i /N , where n i is the number of samples in class D i , out of a total of N samples. The classwise mean µ i and the overall mean µ are defined by: respectively, where D is the set of all classes. The scatter matrices value in Fig. 12 provides insight into how the separation between the four different arrhythmias is using the individual features. In the figure, the feature "mean of NSI"has the highest scatter matrices value, indicating that this feature has the best discriminatory capabilities. Also, the "mean of NTI" and "variance of NSI" have the second-best discriminatory capability, whereas the rest of the features are less than a satisfactory level. The selected best three features are visualized by 3D scatter plot that displays the good separation corresponding to the abnormal groups and the group-wise distribution is very much scattered, where the proposed metric function fitted well on the scatter plot than the Euclidean metric function (see Fig. 13).  Fig. 13), through which we are able to get a high accuracy distinction between different groups of the arrhythmias. We give the corresponding mathematical description in a concise way and do not go further into the mathematics 42 (General topology) for the corresponding mathematics. In addition, algorithm 5 shows the detailed process for the discrimination of shockable and non-shockable arrhythmia.
Recall that our objective of the present research is to give a high-accuracy distinction procedure by using the information available from the scatter plot. For this purpose, we should choose an adequate topology for the given scatter plot. In the theory of statistics and corresponding mathematical software, there exist several provided methods of classification, e.g., the Mahalanobis distance and nearest neighbor evaluation. However, such provided methods would not always be optimal for each problem in consideration. For example, in the case when we are given a scatter plot on D dimensional Euclidean space, then the Mahalanobis distance is defined through the covariance matrix of the scatter plot of training data of a given group, e.g., the group of the ECG signals of SR, etc., which is a real symmetric non-negative definite D × D matrix by which we can define a multivariable Gaussian distribution. Hence, the classification through the Mahalanobis distance depends on the concept of an approximation using the Gaussian distributions. Also, the nearest neighbor evaluation is performed by the Euclidean distance, where we can choose more adequately for each problem in consideration. Suppose that we are given a non-negative function ρ(x, y) on the product space of D dimensional Euclidean space R D × R D , R ≡ (−∞, ∞) the real line, that satisfies the following: We note that here we do not ask ρ to be a function that satisfies the triangle inequality such that ρ(x, y) ≤ ρ(x, z) + ρ(z, y) for any x, y, z ∈ R D , and the ρ does not a metric function in general. For each x ∈ R D and r > 0 , let us define an open neighborhood of the point x ∈ R D as follows: if and only if x = y.   (10). Our distinction procedure adopted here is as follows: Suppose that we are given a scatter plot of training data (see Fig. 13), and test data (we do not know to which group of arrhythmias it belongs), denoted by x . Take the largest r > 0 by which O(x; r) include only one training data, say y , namely y is the nearest point to the test data x evaluated by ρ . Then we decide that the test data x is the same group as the one of y (see Fig. 14). For some special cases where the nearest points of x evaluated by ρ are not only one point, we may prepare an adequate algorithm by which we can avoid ambiguity. As an example, we can take ρ as follows: where j , j = 1, . . . , D and p j , j = 1, . . . , D are given positive numbers. More generally, we can take ρ as follows: where t w(x, y) is the transpose of the vector w(x, y) , and A is a real symmetric positive-definite D × D matrix: with real a ij = a ji , i, j = 1, . . . , D . In particular, by taking A as the diagonal matrix of which diagonal elements satisfy a ii = i , i = 1, . . . , D , then equation (13) is reduced to (12). Note that for the ρ satisfying the equation (13), the topology defined through (10), and (11) is equivalent to the one defined through the Euclidean metric d(x, y) = (x 1 − y 1 ) 2 + · · · + (x D − y D ) 2 , but we evaluate the distance between x and y by ρ(x, y) , not by d (x, y).
In short, by several ρ we can give the different scales to the space of the scatter plots. We should choose a ρ that is adequate to the present distinction problem. In the present paper we put D = 3 and through the experiment, we choose j , j = 1, 2, 3 and p j , j = 1, 2, 3 as follows: (10) O(x; r) ≡ {y ∈ R D : ρ(x, y) < r }.

Performance evaluation and discussion
Here, we explain the evaluation strategy, step by step performance result of our proposed method and compare it with shockable and non-shockable state-of-the-art methods.
Evaluation matrices. We use macro-and micro-average precision, recall, F1-score (F-measure), and accuracy as performance indices which are commonly used in multi-class classification measurement 43,44 . The F-measure is the harmonic mean of precision and recall. In order to obtain the macro-average F1 score, we compute F-measure (F i ) for each class and then take their average of F-measure over all classes as: where c is total number of classes and the precision (P i ) and recall (R i ) for class i are defined as follows: Here TP i , FP i , and FN i are true positive, false positive, and false negative in the ith class, respectively. The macro average precision (P macro ) and the macro average recall (R macro ) are the averages of individual precision and recall respectively: where micro average precision (P micro ) and micro average recall (R micro ) are computed by summing individual precision and recall as follows The accuracy is the ratio of correctly predicted observation to the total observation, that is: Evaluation process. We performed k-fold cross-validation 45 to stabilize the performance of the proposed method. The discrimination results of each iteration for the 1079 samples are in Tables 3, 4, 5 and 6). We have Z total = 1079 samples where (SR (Non-shockable) Z SR total = 491) , (PEA (Non-shockable) Z PEA total = 134) , (VF (Shockable) Z VF total = 299) and (VT (Shockable) Z VT total = 155) . Here, we have selected k = 4, so the total of (Z total = 1079) samples are randomly partitioned into four sub-samples of equal size. A single sub-sample, denoted by T , is used as the validation data for testing the model, and the remaining (Z total − T ) sub-samples are used as training data. Here, the T samples are also selected randomly for each type of ECG signal. The crossvalidation process is repeated four times, and the process is shown in Fig. 15.
Performance results. The performance results of the proposed method are evaluated for four class categories using a four-fold cross-validation approach (see "Evaluation process") based on the evaluation matrices (see "Evaluation matrices").
The confusion matrix plots with the performance results for shockable (VF, VT) and non-shockable (SR, PEA) arrhythmias are shown in Figs. 16, 17, 18, and 19 respectively. The confusion matrix is generated through the proposed metric function-based decision method with the scale factor, 1 = 6, 2 = 1, 3 = 1 , by using the combination of the "Mean of NSI", "Variance of NSI", and "Mean of NTI" features. In Figs. 16, 17, 18, and 19, the rows correspond to the predicted class, and the columns correspond to the actual class. The diagonal cells correspond to observations that are correctly classified. The off-diagonal cells correspond to incorrectly classified observations. Both the number of observations and the percentage of the total number of observations are shown in each cell. The values on the far right column (green and red color) and the row at the bottom (green and red color) of each figure show the percentages of correct and incorrect predictions, respectively. The cell in the bottom right of the plot shows the overall correct and incorrect accuracy.
For example, in Fig. 16, 270 data, composed of 33 of PEA, 123 of SR, 75 of VF, and 39 of VT, is tested. The first column shows that the 32 PEA data within the actual 33 PEA test data are correctly identified, and 1 PEA test data is miss judged as VT. Similarly, the second column shows that the actual 123 SR test data are correctly identified, and none of them are misjudged as others, i.e., PEA, VF, or VT. Similarly, the fourth column explains that, within the actual 39 number of VT, 36 are correctly identified, but 1 data is misjudged as VF, and 2 are misjudged as PEA. Therefore, 7.7% incorrect result given at the bottom of the fourth column indicated as the red color is calculated from (1 + 2)/(1 + 2 + 36) = 3/39.
. Accuracy = TP + TN TP + FP + FN + TN . On the other hand, the row concern, the first row of the same figure, shows that 32 PEA are exactly identified as PEA, but in addition, 2 of VT are miss judged as PEA, and the far-right component 94.1% of this row, indicated as the green color, is calculated from 32/(32 + 2) . Similarly, the fourth row shows that 36 VT data are identified correctly, but in addition, 1 of the PEA data is miss judged as VT. Therefore, 97.3% corrected (green color) and 2.7% (red color) incorrect results are calculated from 36/(36 + 1) and 1/(36 + 1) , which are shown in the far right of the fourth row. The cell in the bottom right of the plot of the same figure shows the overall 98.5% correct and 1.5% incorrect accuracy.       Tables 3, 4, 5 and 6. The group-wise precision, recall, and F1-score for all the test samples are illustrated in Fig. 20 where the blue, red, and green bar represents precision, recall, and F1-score, respectively. From the experimental results, we observe that the classification accuracy of the PEA, VF, and VT is relatively low. Because these (PEA, VF, and VT) signals belong to the abnormal class, and the distribution of the abnormal class signals is closed distance for the combination of the selected best three features and showing high interdependence in the univariate histogram for the Mean of NSI feature as shown in Fig. 13.
We have derived the detailed performance results of the proposed metric function-based decision method for the different scale factors and compared them with the Euclidean metric function and Mahalanobis metric function-based decision method. Figure 21 illustrates the summary of the performance of the proposed metric function-based decision method in terms of the different scale factors. It is observed from the figure that the highest accuracy 98.79% is obtained at 1 = 6, 7, 8, 2 = 1, 3 = 1 , and the performance is repeated for the different scale factors. For example, the accuracy 98.51% is obtained at 1 = 3, 4, 5, 12, 2 = 1, 3 = 1 , and the accuracy 98.79%, 98.60%, 98.42%, 98.05%, 97.96%, and 97.86% is obtained at 1 = 6, 7, 8, 2 = 1, 3 = 1 , at 1 =9, 10, 11, 2 = 1, 3 = 1 , at 1 =13 to 19, 2 = 1, 3 = 1 , at 1 = 25 to 33, 2 = 1, 3 = 1 , at 1 = 34 to 40, 2 = 1, 3 = 1 , and at 1 = 41 to 50, 2 = 1, 3 = 1 , respectively. The accuracy is at its peak for the different scale factors because the proposed metric function fitted well on the scatter plot by adopting different scale factors (see Fig. 13). Therefore, there is a high possibility of occurred correct classification of the test samples since open neighbors of the same groups of arrhythmias belong to the proposed metric function.
In addition, Table 7 shows the detailed performance (group-wise and different distinction schemes) comparison of the proposed metric function-based decision method and other distance-based decision methods. First, the proposed method is compared with the Euclidean metric function-based decision method regarding group-wise and different distinction schemes. As shown in the tables, 1.0 precision, 1.0 recall, 1.0 F1-score, and 100% accuracy are obtained by both methods for SR test data, while the precision, recall, F1-score, and accuracy improved for the PEA, VF, and VT test data by the proposed method. Also, the ratio of the successful discrimination between normal signals (SR) and abnormal signals (PEA, VF, and VT) is 100% for both methods, while accuracy improved for the shockable (VF, VT) versus non-shockable (PEA) arrhythmia cases by the proposed method. For example, 94.72% accuracy is achieved by the Euclidean metric function-based decision method. In contrast, the proposed metric function-based decision method increases the accuracy to 97.78%, with a 3.06% gain for the shockable (VF, VT) versus non-shockable (PEA) arrhythmia cases. In addition, the proposed method is compared with the Mahalanobis metric function-based decision method regarding different distinction schemes. The Mahalanobis metric function-based decision method achieves 86.03% accuracy for the shockable (VF, VT) and non-shockable (PEA) arrhythmias in abnormal class signals 11 . In contrast, the proposed metric function-based decision method increases the accuracy to 97.78% with an 11.75% gain.
The performance is improved by the proposed metric function-based decision method for shockable versus non-shockable cases because we can select the best area of the scatter plot by adopting different scales of the proposed metric function. On the other hand, the performance is low of the Euclidean metric function-based and the Mahalanobis metric function-based decision method for shockable versus non-shockable cases because the Euclidean metric function and the Mahalanobis metric function are not suitable for the separation of the different groups of arrhythmias due to the characteristics of our actual scatter plot (see Fig. 13).

Discussion
The objective of this experiment is to certify the effectiveness of our proposed method in an absolute sense and to compare relatively the performance with the existing state-of-the-art shockable and non-shockable arrhythmia discrimination methods. Table 8 shows the performance results where several factors have been considered to compare the proposed method with other methods. For example, we have compared the proposed method with other distance-based decision methods (e.g., Euclidean distance, Mahalanobis distance), and baseline methods where the same strategy was used for the information extraction from the signals. We further compared the proposed method with other existing state-of-the-art methods, which exactly followed the same databases, the same distinction scheme, and included the same arrhythmia types.
First, we compare the proposed method with the existing state-of-the-art method that exactly followed the same strategy for the information extraction from the signals. For example, Rahman et al. 17 represented a method to derive the scalogram in the time-frequency domain. In this paper, the authors presented various experimental scalograms of the electrocardiograms using wavelet transform with various pseudo-differential-like operators and non-linear transformation functions. Then, the scalogram is analyzed only in the frequency direction, and calculated statistical features from the scalogram. Finally, the histogram is used in the decision stage to distinguish shockable and non-shockable arrhythmia. The authors achieved 100% accuracy for normal (SR) versus abnormal (PEA, VF, and VT) signals, while 91.58% accuracy was achieved for the shockable (VF, and VT) versus non-shockable (PEA) of the abnormal class signals. On the other hand, the proposed work followed the same strategy for the derivation of the scalogram from the signals and analyzed the scalogram along the frequency direction. In addition, the scalogram is analyzed along the time direction which is a new addition to our research. Also, in this proposed work we have designed a simple distance-based decision method with a scale factor where the highest accuracy is achieved. However, the proposed work achieved 100% accuracy for normal (SR) versus abnormal (PEA, VF, and VT) signals, while 97.78% accuracy was achieved for the shockable (VF, and VT) versus non-shockable (PEA) of the abnormal class signals at scale factor 1 = 6, 2 = 1, 3 = 1.  Table 8 it is clear that the proposed metric function-based decision method performed better than the other distance-based decision methods. For example, in 24,25 , they used the Euclidean metric function-based decision method to distinguish arrhythmias. There it is mentioned that 91.75% and 91.67% accuracy have been obtained, while the proposed metric function-based decision method increases the accuracy to 97.78% with 6.03% and 6.11% gain. In addition, Okai et al. 11 showed the detailed performance results of shockable versus non-shockable arrhythmia recognition algorithms by analyzing different spectrum feature parameters. They applied the Gabor wavelet transform to extract the information from the ECG signal, and used the Mahalanobis distance in their decision stage. Note that, the classification through the Mahalanobis distance depends on the concept of an approximation by means of the Gaussian distributions. The Mahalanobis metric function-based decision method achieves 100% accuracy for the distinction between normal (SR) and abnormal (PEA, VF, and VT) cases, and 86.03%  www.nature.com/scientificreports/ accuracy for the shockable (VF, VT) and non-shockable (PEA) arrhythmias in abnormal class signals, while the proposed metric function-based decision method achieves 100% accuracy for the distinction between normal (SR) and abnormal (PEA, VF, and VT) cases and increases the accuracy to 97.78% with 11.75% gain for the shockable (VF, VT) and non-shockable (PEA) arrhythmias in abnormal class signals.
We also further compare our proposed method with other existing state-of-the-art methods those exactly followed the same types of distinction scheme and included PEA arrhythmia. Sharma et al. 10 employed five-level decomposition of the signal, extracted fuzzy entropy (FE), renyi entropy (RE) features, and then fed features into various machine-learning based classifiers for the shockable and non-shockable classification. They achieved 97.8% accuracy for the Shockable (VF, VT) versus non-shockable (NSR, PEA, others), while the proposed method achieves 97.78%. The accuracy is slightly high for the existing method since the evaluation was performed on around five hundred samples where non-shockable samples (e.g., NSR samples) numbers are relatively higher than the shockable samples. In addition, we observe from Table 8 the methods as 12,[30][31][32][33][34][35] , and 36 achieved the high-performance results for shockable versus non-shockable arrhythmia distinction, but PEA arrhythmia is not individually considered there. As has been explained in the introduction the discrimination of PEA arrhythmia is particularly important in the abnormal classes regarding the actual application of AED. From the tables, we see that our proposed method obtains an accuracy comparable to or greater than the above methods with respect to the delicate distinction between shockable and non-shockable cases.

Conclusion
Two important aspects related to the design of an arrhythmia diagnosis system of the AED have attracted the attention of this paper: how accurately does AED diagnose the shockable and non-shockable arrhythmias in the abnormal classes?; and how quickly can make a decision?; The most challenging scenario for the AED is the discrimination between non-shockable PEA and shockable VF, VT arrhythmias in the abnormal classes signals, as both signals show an unorganized electrical activity and may have similar visual characteristics. The rapid decision of AED for the application of defibrillation to arrhythmia patients increases the survival rate. From these points of view, we enhanced the arrhythmia diagnosis system in the AED. Numerical experimental results on datasets show the efficiency of the proposed methods for shockable and non-shockable arrhythmias distinction in the abnormal classes.
In this paper, we have considered four types of arrhythmias (e.g., SR, PEA, VF, and VT) to evaluate our proposed arrhythmias diagnosis system. Classifying all types of arrhythmias is essential so the clinician can prevent and treat the life-threatening ones. Therefore, all types of arrhythmias will be considered in our future work to validate our arrhythmias diagnosis system. Besides, our arrhythmias diagnosis system's current stage remains at the software algorithms level. Therefore, the final aim of our work is to design a hardware platform that can be integrated with the AED to prevent sudden cardiac death caused by fatal arrhythmia. In this case, it is possible to translate the proposed algorithms (e.g., derivation of the scalogram, analysis of the scalogram, design of the AED shock non-shock advice algorithm) into a single hardware framework.
In addition, our future research subjects include the extraction of more effective feature parameters such as entropy-based features (e.g. Shannon entropy, Renyi entropy), Poincare plot, and so on for improving distinction accuracy. Furthermore, we will adopt SVMs (Support Vector Machines) with some kernel functions as a classifier, and evaluate their performance. Table 7. Performance comparison of the proposed metric function-based decision method with others metric function-based decision methods. † Normal (SR) vs Abnormal (PEA, VF and VT) and Shockable (VF, VT) vs non-shockable (PEA) *The accuracy has been calculated according to their predicted result (see part A of section III in 11 ).

Method
Group Precision Recall F1-score