CNN-T-NiN: A Hybrid Deep Learning Model for ECG Signal Classification and Rare Arrhythmia Detection

Accurate Electrocardiogram (ECG) signal classification is essential for automated arrhythmia detection, timely clinical intervention, and improved cardiovascular health outcomes. ECG arrhythmia classification remains challenging because of subtle morphological differences among heartbeat classes, temporal dependencies, and severe class imbalance, particularly for rare arrhythmias. Existing approaches may provide limited minority-class sensitivity or insufficient integration of morphological and temporal feature learning. To address these challenges, this study proposes CNN–T–NiN, a hybrid deep learning framework that integrates one-dimensional convolutional layers (CNN), Network-in-Network (NiN) blocks, and temporal attention (T). The ECG signal is processed through hierarchical NiN stages comprising one-dimensional convolutions, batch normalization, GELU activations, and pointwise convolutions to extract and refine local morphological features. A temporal-attention module is applied after the initial feature-extraction stage to model relationships among temporal positions and emphasize diagnostically informative regions of the heartbeat signal. The attended features are subsequently refined by deeper NiN blocks and aggregated for final heartbeat classification. On the predefined beat-level intra-dataset MIT-BIH evaluation, which does not employ strict patient-wise separation, CNN–T–NiN achieved 98.90% accuracy and 92.41% macro recall, with a macro F1-score of 84.46%, weighted F1-score of 96.73%, macro AUC of 98.95%, and specificity of 98.82%. Compared with the implemented models, these results indicate competitive performance rather than universal superiority. ResNet1D achieved stronger aggregate metrics but required 0.95 million parameters compared with 0.363 million for CNN–T–NiN, demonstrating a trade-off between model size and predictive performance. Weighted Random Sampling prioritizes minority-class sensitivity and improves macro recall, but this comes at the expense of precision and macro F1-score. On the patient-wise INCART evaluation, CNN–T–NiN achieved a balanced accuracy of 47.67% and macro AUC of 87.09%, while its macro precision of 32.26%, overall accuracy of 73.55%, and weighted F1-score of 80.01% remained lower than those of several simpler baselines.

Authors

Institutions

Publication Details

Journal
Applied Sciences
Published
2026-11-17
DOI
https://doi.org/10.3390/app162211397
Primary Topic
ECG Monitoring and Analysis
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

CNN-T-NiN: A Hybrid Deep Learning Model for ECG Signal Classification and Rare Arrhythmia Detection

Wajahat Ahmad, Ahmad Kamran Malik, Muhammad Nafees Qamar, Muhammad Wajid et al.
5 links
Applied Sciences
ECG Monitoring and Analysis
article

CNN-T-NiN: A Hybrid Deep Learning Model for ECG Signal Classification and Rare Arrhythmia Detection

Wajahat Ahmad, Ahmad Kamran Malik, Muhammad Nafees Qamar, Muhammad Wajid, Aleem Ahmed
article en

Abstract

Accurate Electrocardiogram (ECG) signal classification is essential for automated arrhythmia detection, timely clinical intervention, and improved cardiovascular health outcomes. ECG arrhythmia classification remains challenging because of subtle morphological differences among heartbeat classes, temporal dependencies, and severe class imbalance, particularly for rare arrhythmias. Existing approaches may provide limited minority-class sensitivity or insufficient integration of morphological and temporal feature learning. To address these challenges, this study proposes CNN–T–NiN, a hybrid deep learning framework that integrates one-dimensional convolutional layers (CNN), Network-in-Network (NiN) blocks, and temporal attention (T). The ECG signal is processed through hierarchical NiN stages comprising one-dimensional convolutions, batch normalization, GELU activations, and pointwise convolutions to extract and refine local morphological features. A temporal-attention module is applied after the initial feature-extraction stage to model relationships among temporal positions and emphasize diagnostically informative regions of the heartbeat signal. The attended features are subsequently refined by deeper NiN blocks and aggregated for final heartbeat classification. On the predefined beat-level intra-dataset MIT-BIH evaluation, which does not employ strict patient-wise separation, CNN–T–NiN achieved 98.90% accuracy and 92.41% macro recall, with a macro F1-score of 84.46%, weighted F1-score of 96.73%, macro AUC of 98.95%, and specificity of 98.82%. Compared with the implemented models, these results indicate competitive performance rather than universal superiority. ResNet1D achieved stronger aggregate metrics but required 0.95 million parameters compared with 0.363 million for CNN–T–NiN, demonstrating a trade-off between model size and predictive performance. Weighted Random Sampling prioritizes minority-class sensitivity and improves macro recall, but this comes at the expense of precision and macro F1-score. On the patient-wise INCART evaluation, CNN–T–NiN achieved a balanced accuracy of 47.67% and macro AUC of 87.09%, while its macro precision of 32.26%, overall accuracy of 73.55%, and weighted F1-score of 80.01% remained lower than those of several simpler baselines.

Applied SciencesVol. 16(22)
University of Electronic Science and Technology of China (CN), COMSATS University Islamabad (PK), Bryant University (US)
Good health and well-being
ECG Monitoring and Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon