DOI: 10.7717/peerj-cs.4139 ISSN: 2376-5992

A lightweight 1D-CNN for multi-class ECG arrhythmia classification on the MIT-BIH database

Youheng Li, Huakai Luo, Jingmin Wang, Jin Su

Cardiac arrhythmias are a major contributor to cardiovascular mortality, and reliable automatic analysis of electrocardiogram (ECG) signals is essential for large-scale screening and long-term monitoring. However, automated arrhythmia classification remains challenging due to severe class imbalance, potential data leakage during model evaluation, and the complexity of modern deep-learning architectures that limits their deployment on resource-constrained devices. In this work, we propose a lightweight deep-learning framework for five-class heartbeat classification (N, S, V, F, Q) using the preprocessed Massachusetts Institute of Technology-Beth Israel Hospital (MIT-BIH) Arrhythmia Database via Kaggle, which involves downsampling from 360 to 125 Hz, R-peak-centered segmentation, fixed-length 187-sample segments, and Association for the Advancement of Medical Instrumentation (AAMI) labeling. The proposed model employs a shallow three-block 1D convolutional neural network (1D-CNN) designed to efficiently capture morphological ECG features while maintaining a small computational footprint. We adopt a standard training setup with cross-entropy loss and validation-loss-based early stopping, and we implement within-fold normalization through a custom ECGScaler fitted only on training data to prevent preprocessing-induced leakage. However, as with many prior studies on this benchmark, our cross-validation follows sample-based stratification rather than patient-level separation due to the absence of patient identifiers in the preprocessed dataset. Therefore, the reported performance metrics should be interpreted as benchmark-specific and may not directly reflect inter-patient generalization. Experimental results demonstrate that the proposed approach achieves an overall accuracy of 0.9867 and a macro-F1-score of 0.9254, with good performance on minority classes, including F1-scores of 0.8537 for supraventricular beats and 0.8250 for fusion beats. Despite its simplicity, the model achieves performance comparable with many more complex state-of-the-art architectures while requiring significantly fewer parameters and computational resources. These results hint at possible application prospects of lightweight deep-learning models for arrhythmia detection in real-time wearable and remote cardiac monitoring scenarios.

More from our Archive