DynaECG-Net: Dynamic Margin Metric Learning for Arrhythmia Classification Using Single-Lead Electrocardiogram

Amnah Nasim1 and Taesik Go2
1Jeonbuk RICE Intelligence Innovation Research Center, Jeonbuk National University, 2Department of Biomedical Engineering, Jeonbuk National University


Abstract

Automated cardiovascular disease classification is crucial to enabling real-time and continuous monitoring using wearable electrocardiogram (ECG) devices. However, due to the limited number of pathological class samples and difficulty in separating some hard-to-discriminate ECG classes (such as normal sinus rhythm (N) and premature supraventricular contraction (S)) due to their morphological similarity, existing deep learning models frequently fail to ensure sufficient inter-class separation in the latent space, limiting their discriminative power. The proposed deep metric learning framework with dynamic margin triplet loss (DynaECG-Net) extracts feature embeddings that maximize latent space separability between N, S, and premature ventricular contraction (V) heartbeats. Disease-specific experiments conducted on MIT-BIH ECG Arrhythmia dataset for 3-class classification with 50% data used for training, yield overall: accuracy 98.97%, sensitivity (Sen) 97.76%, and, F1-score (F1) 96.82% and classwise: N (Sen=99.47%, F1=99.35%), S (Sen=95.23%, F1=93.36%) and V (Sen=99.44%, F1=98.19%) achieving better performance than the state-of-the-art in low inter-class separability and data-scarce conditions. Additionally, a t-SNE visualization demonstrated well-separated embedding clusters for each class.