Accurate classification of electrocardiogram (ECG) signals is essential for early arrhythmia detection. This study compares the performance of unidirectional and bidirectional recurrent neural networks (RNN), specifically gated recurrent unit (GRU)-based architectures, for classifying ECG beats as normal or arrhythmic. ECG data were sourced from the MIT-BIH Arrhythmia Database using the WFDB toolkit. Each beat was segmented into a 128-sample window centered on the R-peak and labeled into two classes. To address severe class imbalance (6,279 normal vs. 43 arrhythmic beats), data augmentation techniques—jittering and scaling—were applied, resulting in a balanced dataset. Both models were trained under identical conditions, with evaluation based on accuracy, precision, recall, F1-score, and other statistical metrics. The unidirectional RNN achieved poor recall (9.0%) despite high precision, yielding an overall accuracy of 54.0%. In contrast, the bidirectional RNN significantly outperformed, achieving 98.17% accuracy, 98.39% precision, 97.92% recall, and a 98.16% F1-score. The results demonstrate that bidirectional temporal modeling provides substantial improvements in ECG classification, especially for detecting minority class arrhythmias. This study highlights the importance of both data augmentation and model architecture in developing effective deep learning solutions for real-time ECG analysis and clinical diagnostics.
Copyrights © 2026