## 4 Results and Discussion
### Simulation Results
Figure 9: Accuracy and loss plots of CNN + GRU model training for the 3-class dataset, MIT-BIH + BIDMC (**top row**), and the 5-class dataset, MIT-BIH (**bottom row**). of the CNN + GRU model, which generalizes well to different data subsets, making it a reliable choice for both classification tasks. However, the slight decrease in performance for the five-class dataset may be attributed to the increased challenge of distinguishing between more classes, but the drop is minimal, highlighting the model's strong overall effectiveness. To assess the performance of the CNN + GRU algorithms, we compared their accuracies across five folds for both test sets and calculated the average values. The results are depicted in Figure 11. This figure contrasts the performance on the three-class (MIT-BIH + BIDMC) and five-class (MIT-BIH) datasets. While the three-class dataset achieved slightly higher accuracy, the CNN + GRU model exhibited almost double the loss value for the five-class dataset. These trends are expected given the  
Table 5 presents a comparison of various algorithms used for arrhythmia detection across different datasets and time periods, with metrics such as precision, recall, F1-score, and accuracy. From the dataset perspective, these results demonstrate the effectiveness of different algorithms on various ECG datasets, such as MIT-BIH, MIT-BIH AF, and BIDMC. The MIT-BIH dataset can be considered a benchmark for ECG classification, with algorithms typically addressing a four- or five-class classification problem. Notably, the recent results demonstrate a clear progression in performance, with hybrid and deep learning models like ResNet, CNN + GRU, and ResNet + BiLSTM achieving superior results across all metrics. For instance, the proposed model, using a three-channel CNN + GRU on both the MIT-BIH and MIT-BIH + BIDMC datasets, achieves remarkable precision, recall, F1-score, and accuracy values, indicating near-perfect classification ability. This surpasses earlier models such as CNN + Transformers and ResNet + BiLSTM, which, while achieving high accuracies, did not achieve as consistently high values across all metrics. Focusing on five-class classifications in the MIT-BIH dataset, earlier methods like using a CNN with genetic algorithms (CNN + GA) achieved a precision of 95.80% and an accuracy of 98.00% but had a notably lower F1-score of 89.70%, indicating weaker performance in balancing precision and recall. More recent algorithms, such as CBAM-ResNet, showed significant improvements, with a precision of 99.13%, an F1-score of 98.29%, and an accuracy of 99.23%. This highlights the advancements made in integrating attention mechanisms into models. The proposed three-channel CNN + GRU model outperforms all previous methods on the five-class MIT-BIH dataset, achieving a perfect balance with 99.76% across precision, recall, F1-score, and accuracy, showcasing its superior ability to classify arrhythmia types. For the three-class datasets (MIT-BIH + BIDMC), methods like CWT + CNN + LSTM performed well, with a precision and recall of 98.00% and an accuracy of 98.90%. The ResNet50 achieved notable results, with precision, recall, F1-score, and accuracy consistently at 99.20%. However, the proposed three-channel CNN + GRU model stands out as