# Lightweight Ensemble Network for Detecting Heart Disease Using ECG Signals
## 4 Results and Discussion
The higher the value on the left, the better the ROC curve. The ROC curve can be used to calculate the \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Data Index** & **Class** & **Sensitivity** & **Specificity** & **Precision** & **F1 Score** \\ \hline
1 & NSR & 0.81 & 0.71 & 0.87 & 0.84 \\
2 & AFIB & 0.94 & 0.98 & 0.93 & 0.94 \\
3 & PVC & 0.92 & 0.97 & 0.91 & 0.92 \\
4 & LBBB & 1 & 0.99 & 0.96 & 0.98 \\ Average & - & 0.92 & 0.91 & 0.92 & 0.92 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Algorithm performance evaluation results. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Option** & **Value** & **Option** & **Value** \\ \hline Batch size & 30 & Time elapsed & 23 m 30 s \\ Data rotation & 5 & Epoch & 40 \\ Data shift & 3 & Iteration & 120 \\ Validation frequency & 50 & Learning rate & 0.01 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Computational or time-complexity evaluation table of proposed algorithms. change in the TPR while changing the FPR from 0 to 1. When the threshold is specified as 1, the FPR is 0, and conversely, when the threshold is 0, the FPR becomes 1. The TPR based on the change in the FPR value becomes the ROC curve. The area under the ROC curve (AUC) for each class indicated the performance of the classifier, with a larger area corresponding to a better performance. The AUCs for all the data are presented in Table 4.  
The PVC, LBBB, and AFIB data had AUCs close to 1, indicating that the signals were classified accurately. The NSR data had an AUC value of 0.982, which was smaller than those of the other classes, but still indicates a high-performance classifier (defined as having an AUC value of \(\geq\)0.8). Therefore, the NSR data were also classified accurately. Figure 12 shows the results of K-fold cross validation. \begin{table}
\begin{tabular}{c c} \hline \hline
**Class** & **AUC** \\ \hline NSR & 0.982 \\ AFIB & 0.997 \\ PVC & 0.996 \\ LBBB & 0.999 \\ Average & 0.994 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: AUCs of the algorithm. Figure 11: Arrhythmia detection results. A larger AUC corresponds to better performance. AUC denotes the area under the graph, and the four graphs represent the AUC that is proportional to the accuracy of each class. The most important goal of deep-learning algorithms is \"how accurately data can be classified\". In general, deep-learning algorithms are used to predict unknown data with limited data held by the system. The accuracy increases with an increasing number of data. There is no problem if the data are sufficient, but when the system learns with limited data, it is important to use the data it holds as efficiently as possible. Cross validation reveals how efficiently the system can use data. Therefore, this method was used to verify the performance of the proposed algorithm. The performance of the MobileNetV2-BiLSTM algorithm was analyzed using K-fold cross validation. The dataset was divided into 12 groups, and one of the groups was extracted and used as the test set. The remaining 11 groups were used as training sets. The test was repeated 12 times. The accuracy increased with the K value. The accuracy of the algorithm was maximized when the K value was 10, and it decreased as K increased further. The minimum accuracy was 79.7%, the maximum accuracy was 93.3%, and the average accuracy was 86.21%. ECG signals contain noise. For example, noise caused by factors such as patient movement, impedance between the skin and electrodes, and movement of cables reduces the accuracy of the algorithm and should be minimized. In this study, a MATLAB-based Butterworth filter was designed. The filter band was set as 5 Hz for high-pass and 250 Hz for low-pass, and the band-stop filter was designed for 60 Hz. Figure 13 shows the experimental evaluation results for the performance of the MATLAB-based filter. The raw signal with noise is shown in blue, and the result of applying the filter is shown in red. Comparing the two signals revealed that the noise of the baseline was reduced.