Multiscale Feature Enhancement and Bidirectional Temporal Dependency Networks for Arrhythmia Classification
Simple Summary
Abstract
1. Introduction
2. Materials and Methods
2.1. MFE-BiLSTM Model
2.2. ECG Dataset and Data Preprocessing
2.3. Multiscale Feature Enhancement
2.3.1. Hierarchical Feature Extraction
2.3.2. Multi-Head Self-Attention
2.4. Bidirectional Temporal Dependency
2.5. Experimental Configuration and Evaluation Indicators
3. Results
3.1. Test Experiment Results
3.2. The Generalization Verification Experiment Results
3.3. Comparison Experiment Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
| ECG | Electrocardiogram |
| CNNs | Convolutional Neural Networks |
| RNNs | Recurrent Neural Networks |
| LSTM | Long and Short-term Memory Network |
| BiLSTM | Bidirectional Long and Short-term Memory Network |
| AAMI | Association for the Advancement of Medical Instrumentation |
| MHSA | Multi-Head Self-Attention Mechanism |
| CPSC 2018 | the China Physiological Signal Challenge 2018 dataset |
| Db6 | Daubechies6 |
| N | Normal beat |
| ST | Sinus Tachycardia |
| SB | Sinus Bradycardia |
| PAC | Premature Atrial Contraction |
| AF | Atrial Fibrillation |
| PVC | Premature Ventricular Contraction |
| BN | Batch Normalization |
| ReLU | Rectified Linear Unit |
| TP | True Positive |
| FN | False Negative |
| FP | False Positive |
| TN | True Negative |
| ROC | Receiver Operating Characteristic |
| AUC | Area Under the Curve |
| FPR | False Positive Rate |
| TPR | True Positive Rate |
| PR | Precision-Recall |
| AUPR | Area Under the PR Curve |
| HRV | Heart Rate Variability |
References
- Liu, M.B.; He, X.Y.; Yang, X.H. Interpretation of report on cardiovascular health and diseases in China 2023. Chin. J. Cardiovasc. Med. 2024, 29, 305–324. [Google Scholar]
- Ye, C.; Vijaya Kumar, B.V.K.; Coimbra, M.T. Heartbeat classification using morphological and dynamic features of ECG signals. IEEE Trans. Biomed. Eng. 2012, 59, 2930–2941. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Tao, L.; Liu, B.; Liang, W. Automatic detection research of arrhythmia based on CNN-LSTM hybrid model. J. Shandong Univ. Eng. Sci. 2021, 51, 30–36. [Google Scholar]
- Zhang, N.N.; Ma, J.G.; Fan, Z.L.; Zhang, H.M.; Li, M. Review of automated ECG diagnosis based on machine learning. Chin. Med. Equip. J. 2022, 43, 92–97. [Google Scholar]
- Li, J. Research on Key Technologies of Arrhythmia Automatic Classification Based on Convolutional Neural Networks. Master’s Thesis, Jilin University, Changchun, China, 2019. [Google Scholar]
- Liu, X.; Wang, H.; Li, Z.; Qin, L. Deep learning in ECG diagnosis: A review. Knowl.-Based Syst. 2021, 227, 107187. [Google Scholar] [CrossRef] [Scilit]
- Kim, Y. Convolutional Neural Networks for Sentence Classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP 2014), Doha, Qatar, 25–29 October 2014. [Google Scholar]
- Huang, L.; Cai, D.J.; Ling, S.K.; OuYang, H.; Li, J. Review of deep learning for arrhythmia detection. Chin. Med. Equip. J. 2024, 45, 105–112. [Google Scholar]
- Rajpurkar, P.; Hannun, A.Y.; Haghpanahi, M.; Bourn, C.; Ng, A.Y. Cardiologist-level arrhythmia detection with convolutional neural networks. arXiv 2017, arXiv:1707.01836. [Google Scholar] [CrossRef] [Scilit]
- Wang, H.R.; Shi, H.T.; Chen, X.J.; Zhao, L.Q.; Huang, Y.X.; Liu, C.L. An improved convolutional neural network based approach for automated heartbeat classification. J. Med. Syst. 2020, 44, 35. [Google Scholar] [CrossRef] [Scilit]
- Singh, S.; Pandey, S.K.; Pawar, U.; Janghel, R.R. Classification of ECG arrhythmia using recurrent neural networks. Procedia Comput. Sci. 2018, 132, 1290–1297. [Google Scholar] [CrossRef] [Scilit]
- Zaremba, W.; Sutskever, I.; Vinyals, O. Recurrent Neural Network Regularization. arXiv 2015, arXiv:1409.2329. [Google Scholar] [CrossRef] [Scilit]
- Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [Scilit]
- Li, X.X. Research on ECG Arrhythmia Classification Method Based on Deep Learning. Master’s Thesis, Jiangxi Agricultural University, Nanchang, China, 2022. [Google Scholar]
- Luo, W.; Yang, X.; Chen, Y. Interpretable arrhythmia classification model based on attention mechanism. Comput. Technol. Dev. 2022, 32, 114–120. [Google Scholar]
- Moody, G.B.; Mark, R.G. The impact of the MIT-BIH Arrhythmia Database. IEEE Eng. Med. Biol. Mag. 2001, 20, 45–50. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Moody, G.B.; Mark, R.G. A new method for detecting atrial fibrillation using R-R intervals. Comput. Cardiol. 1983, 10, 227–230. [Google Scholar]
- Ribeiro, A.H.; Paixão, G.M.M.; Lima, E.M. CODE-15%: A Large Scale Annotated Dataset of 12-Lead ECGs, (version 1.0.0) [Data Set]; Zenodo: Geneva, Switzerland, 2021. [Google Scholar]
- Liu, F.F.; Liu, C.Y.; Zhao, L.N.; Zhang, X.Y.; Wu, X.L.; Xu, X.Y.; Liu, Y.L.; Ma, C.Y.; Wei, S.S.; He, Z.Q.; et al. An open access database for evaluating the algorithms of ECG rhythm and morphology abnormal detection. J. Med. Imaging Health Inform. 2018, 8, 1368–1373. [Google Scholar]
- Wang, J.R.; Deng, L.M.; Cheng, W.; Li, G.H. Study on ECG classification algorithm based on CNN-LSTM-SE. J. Test Meas. Technol. 2024, 38, 264–273. [Google Scholar]
- Zhang, L. Research on Arrhythmia Classification Algorithm Based on Deep Learning. Master’s Thesis, Shanxi University, Taiyuan, China, 2024. [Google Scholar]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L. Attention is all you need. In Proceedings of the 31st Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; Curran Associates, Inc.: Red Hook, NY, USA, 2017; pp. 5998–6008. [Google Scholar]
- Greff, K.; Srivastava, R.K.; Koutník, J.; Steunebrink, B.R.; Schmidhuber, J. LSTM: A search space odyssey. IEEE Trans. Neural Netw. Learn. Syst. 2017, 28, 2224–2232. [Google Scholar] [CrossRef] [Scilit]
- Deng, X.; Liu, Q.; Deng, Y.; Mahadevan, S. An improved method to construct basic probability assignment based on the confusion matrix for classification problem. Inf. Sci. 2016, 340–341, 250–261. [Google Scholar] [CrossRef] [Scilit]
- Yuan, C.C.; Liu, Z.J.; Wang, C.Q.; Yang, F. Electrocardiogram signal classification based on fusion method of residual network and self-attention mechanism. J. Biomed. Eng. 2023, 40, 474–475. [Google Scholar]
- Saito, T.; Rehmsmeier, M. The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. PLoS ONE 2015, 10, e0118432. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, J.; Yu, X.; Xin, B. Study on ECG classification algorithm based on improved U-Net network. J. Chongqing Univ. Technol. Nat. Sci. 2024, 38, 142–149. [Google Scholar]
- Ye, X.Y.; Wei, Z.Y.H.; Yan, H.; Zhou, Y.J.; Zhu, J.H.; Hong, H. ECG Signal classification based on fusion model of ResNet and Bi-LSTM network. Space Med. Med. Eng. 2021, 34, 244–251. [Google Scholar]
- Murugesan, B.; Ravichandran, V.; Ram, K.; Preejith, S.P.; Joseph, J.; Shankaranarayana, S.M.; Sivaprakasam, M. ECGNet: Deep network for arrhythmia classification. Comput. Cardiol. 2017, 44, 1–4. [Google Scholar]
- Huang, M.M.; Jiang, M.F.; Li, Y.; He, X.Y.; Wang, Z.F.; Wu, Y.Q.; Ke, W. Research on arrhythmia classification algorithm based on adaptive multi-feature fusion network. J. Biomed. Eng. 2025, 42, 49–56. [Google Scholar]
- Zhou, F.Y.; Sun, Y.H.; Wang, Y.W. Inter-patient ECG arrhythmia heartbeat classification network based on multiscale convolution and FCBA. Biomed. Signal Process. Control 2024, 90, 105789. [Google Scholar] [CrossRef] [Scilit]
- Jin, Y.R.; Li, Z.Y.; Wang, M.X.; Liu, J.L.; Tian, Y.Y.; Liu, Y.Q.; Wei, X.Y.; Zhao, L.Q.; Liu, C.L. Cardiologist-level interpretable knowledge-fused deep neural network for automatic arrhythmia diagnosis. Commun. Med. 2024, 4, 31. [Google Scholar] [CrossRef] [Scilit]









| Dataset | MIT-BIH Arrhythmia Dataset | MIT-BIH Atrial Fibrillation Dataset | CODE Dataset | CPSC 2018 |
|---|---|---|---|---|
| Source | Boston’s Beth Israel Hospital | Boston’s Beth Israel Hospital | Telehealth Network of Minas Gerais | Southeast University and 11 hospitals |
| Number of records | 48 | 25 (records 00735 and 03665 are not available without data files) | 18 | 6877 |
| Record duration | 30 min | 10 h | 7–10 s | 6–60 s |
| Sample frequency/Hz | 360 | 250 | 400 | 500 |
| Number of leads | 2 | 2 | 12 | 12 |
| Types of Arrhythmias | One-Hot Encoding |
|---|---|
| N (normal beat) | 1, 0, 0, 0, 0, 0 |
| ST (sinus tachycardia) | 0, 1, 0, 0, 0, 0 |
| SB (sinus bradycardia) | 0, 0, 1, 0, 0, 0 |
| PAC (premature atrial contraction) | 0, 0, 0, 1, 0, 0 |
| AF (atrial fibrillation) | 0, 0, 0, 0, 1, 0 |
| PVC (premature ventricular contraction) | 0, 0, 0, 0, 0, 1 |
| MIT-BIH Arrhythmia Dataset | MIT-BIH Atrial Fibrillation Dataset | CODE Dataset | Total | |
|---|---|---|---|---|
| N | 74,700 | 0 | 134,657 | 209,357 |
| ST | 0 | 0 | 7584 | 7584 |
| SB | 0 | 0 | 5605 | 5605 |
| PAC | 2532 | 0 | 0 | 2532 |
| AF | 0 | 40,899 | 6831 | 47,730 |
| PVC | 7106 | 0 | 0 | 7106 |
| Total | 84,338 | 40,899 | 154,677 | 279,914 |
| Types of Arrhythmias | Training Set | Validation Set | Test Set |
|---|---|---|---|
| N | 167,408 | 21,075 | 20,874 |
| ST | 6048 | 792 | 744 |
| SB | 4535 | 513 | 557 |
| PAC | 2039 | 240 | 253 |
| AF | 38,209 | 4677 | 4844 |
| PVC | 5692 | 694 | 720 |
| Total | 223,931 | 27,991 | 27,992 |
| Dataset | ECG Record Number | |
|---|---|---|
| MIT-BIH arrhythmia dataset | Training set | 101 106 108 109 112 114 115 116 118 119 122 124 201 203 205 207 208 209 215 220 223 230 |
| Test set | 100 103 105 111 113 117 121 123 200 202 210 212 213 214 219 221 222 228 231 232 233 234 | |
| MIT-BIH atrial fibrillation dataset | Training set | 04015 04048 04746 04936 05121 06426 06995 07859 07910 08219 08405 08455 |
| Test set | 04043 04126 04908 05091 05261 06453 07162 07879 08215 08378 08434 | |
| CODE dataset | Training set | 0 2 4 6 8 10 12 14 16 |
| Test set | 1 3 5 7 9 11 13 15 17 | |
| Types of Arrhythmias | Training Set | Test Set | Total |
|---|---|---|---|
| N | 108,419 | 100,938 | 209,357 |
| ST | 3950 | 3634 | 7584 |
| SB | 2925 | 2680 | 5605 |
| PAC | 800 | 1732 | 2532 |
| AF | 31,014 | 16,716 | 47,730 |
| PVC | 3899 | 3207 | 7106 |
| Total | 151,007 | 128,907 | 279,914 |
| Layer/Operation | Output Size | Explanation |
|---|---|---|
| Input | (B, 1, L) | Input signal, B is the batch size, L is the original sequence length (divisible by 64, such as 4096) |
| Convolutional layer 1 (k = 60, s = 2) | (B, 32, L/2) | Convolution kernel 60, step 2, padding 29, output length L/2 |
| Convolutional layer 2 (k = 20, s = 2) | (B, 32, L/4) | Convolution kernel 20, step 2, padding 9, output length L/4 |
| Residual block group 1 | (B, 32, L/8) | Two residual blocks (hold channel 32), length L/8 after max pooling (s = 2) |
| Residual block group 2 | (B, 64, L/16) | Channels 32–64 with maximum pooled length of L/16 |
| Residual block group 3 | (B, 128, L/32) | Channels 64–128 with maximum pooled length of L/32 |
| Residual block group 4 | (B, 256, L/64) | Channels 128–256 with maximum pooled length of L/64 |
| Multi-head self-attention | (B, 256, L/64) | Input reshapes to (B, L/64, 256), output restores original shape |
| BiLSTM | (B, 512, L/64) | Bidirectional output concatenation, feature dimension 512 |
| Flatten | (B, 512 × (L/64)) | If L = 4096, it is 512 × 64 = 32,768 after flattening. |
| Fully connected layer | (B, 128) | Downscaling to 128, applying ReLU and Dropout |
| Classification layer | (B, 6) | Output 6 classification results |
| Types of Arrhythmia | Precision | Recall | F1 | AUC |
|---|---|---|---|---|
| N | 0.9943 | 0.9907 | 0.9925 | 0.9988 |
| ST | 0.8973 | 0.9529 | 0.9243 | 0.9993 |
| SB | 0.8365 | 0.8831 | 0.8591 | 0.9972 |
| PAC | 0.9718 | 0.9526 | 0.9621 | 0.9999 |
| AF | 0.9917 | 0.9860 | 0.9888 | 0.9993 |
| PVC | 0.9916 | 0.9916 | 0.9916 | 0.9995 |
| Overall accuracy | 0.9855 | |||
| Overall F1-score | 0.9531 | |||
| Macro-AUC | 0.9990 | |||
| Micro-AUC | 0.9997 | |||
| Types of Arrhythmias | Precision | Recall | F1 | AUC |
|---|---|---|---|---|
| N | 0.9699 | 0.9349 | 0.9521 | 0.9702 |
| ST | 0.8992 | 0.9353 | 0.9169 | 0.9972 |
| SB | 0.7840 | 0.8287 | 0.8057 | 0.9928 |
| PAC | 0.7614 | 0.8523 | 0.8762 | 0.9616 |
| AF | 0.9023 | 0.9142 | 0.9082 | 0.9931 |
| PVC | 0.9136 | 0.7746 | 0.8383 | 0.9848 |
| Overall accuracy | 0.8985 | |||
| Overall F1-scores | 0.8829 | |||
| Macro-AUC | 0.9833 | |||
| Micro-AUC | 0.9853 | |||
| Types of Arrhythmias | Precision | Recall | F1 | Number of Records |
|---|---|---|---|---|
| N | 0.9625 | 0.9247 | 0.9432 | 918 |
| PAC | 0.8768 | 0.8067 | 0.8403 | 574 |
| AF | 0.7879 | 0.9510 | 0.8618 | 1098 |
| PVC | 0.9375 | 0.8356 | 0.8836 | 653 |
| Overall accuracy | 0.8912 | |||
| Overall F1-score | 0.8822 | |||
| Model | Accuracy | F1 | Macro-AUC | Micro-AUC |
|---|---|---|---|---|
| CNN | 0.9059 | 0.9087 | 0.9689 | 0.9945 |
| CNN-BiLSTM | 0.9569 | 0.9235 | 0.9865 | 0.9956 |
| CNN-MHSA | 0.9673 | 0.9212 | 0.9861 | 0.9978 |
| MFE-BiLSTM | 0.9855 | 0.9531 | 0.9990 | 0.9998 |
| Model Settings | Precision | F1 | Model Parameter Quantity/M |
|---|---|---|---|
| Single-scale convolution kernel: 3 | 0.9841 | 0.9503 | 5.1 |
| Single-scale convolution kernel: 5 | 0.9843 | 0.9523 | 5.4 |
| Single-scale convolution kernel: 9 | 0.9848 | 0.9529 | 5.8 |
| Complete multi-scale module | 0.9855 | 0.9531 | 5.3 |
| Literature | Wang et al. [27] | Ye et al. [28] | Murugesan B et al. [29] | Huang et al. [30] | Zhou et al. [31] | Jin et al. [32] | This Article | |
|---|---|---|---|---|---|---|---|---|
| Model | Unet-LSTM-Attention | ResNet-BiLSTM | CNN-LSTM | multi-feature fusion CNN | CNN-FCBA (frequency convolutional block attention) | CNN-BiLSTM-Attention | MFE-BiLSTM | |
| Training set | CPSC 2018 | The 2017 PhysioNet/CinC Challenge, Clinical ECG data of the First Affiliated Hospital of Zhejiang University School of Medicine | MIT-BIH arrhythmia dataset | MIT-BIH arrhythmia dataset | MIT-BIH arrhythmia dataset | The large-scale Chinese ECG dataset jointly constructed by Shanghai First People’s Hospital | MIT-BIH arrhythmia dataset, MIT-BIH atrial fibrillation dataset, CODE dataset | |
| Test set | CPSC 2018 | The 2017 PhysioNet/CinC Challenge, Clinical ECG data of the First Affiliated Hospital of Zhejiang University School of Medicine | MIT-BIH arrhythmia dataset | MIT-BIH arrhythmia dataset | MIT-BIH arrhythmia dataset | The large-scale Chinese ECG dataset jointly constructed by Shanghai First People’s Hospital | MIT-BIH arrhythmia dataset, MIT-BIH atrial fibrillation dataset, CODE dataset, CPSC 2018 | |
| Scale of data | 6877 pieces of data ranging from 6 to 60 s | 8528 pieces of data ranging from 9 to 21 s, 92,245 pieces of 30 s data | 48 pieces of 30 min data | 48 pieces of 30 min data | 48 pieces of 30 min data | 51,261 pieces of data ranging from 10 to 45 s | 48 pieces of 30 min data, 23 pieces of 10 h data, 18 pieces of data ranging from 7 to 10 s, 6877 pieces of data ranging from 6 to 60 s | |
| Parameter quantity/M | 5.2 | 4.7 | 3.9 | 3.5 | 4.2 | 6.3 | 5.3 | |
| N | F1 | 0.7280 | 0.9861 | 0.9900 | 0.9850 | 0.9784 | 0.9774 | 0.9925 |
| ST | - | - | - | - | - | 0.9069 | 0.9243 | |
| SB | - | - | - | - | - | 0.8977 | 0.8591 | |
| PAC | 0.8070 | 0.8199 | 0.8400 | 0.7910 | 0.6715 | 0.6946 | 0.9621 | |
| AF | 0.9200 | 0.9449 | - | - | - | 0.9077 | 0.9888 | |
| PVC | 0.8780 | 0.8439 | 0.9700 | 0.9340 | 0.9280 | 0.7184 | 0.9916 | |
| Overall accuracy | - | - | 0.9800 | 0.7520 | 0.6120 | 0.9550 | 0.9855 | |
| Overall F1-score | 0.8250 | 0.8852 | 0.9333 | 0.9033 | 0.8593 | 0.8504 | 0.9531 | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Yang, L.; Wang, C.; Chu, W.; Chen, H.; Wu, C.; Chen, Y.; Wan, X. Multiscale Feature Enhancement and Bidirectional Temporal Dependency Networks for Arrhythmia Classification. Biology 2026, 15, 149. https://doi.org/10.3390/biology15020149
Yang L, Wang C, Chu W, Chen H, Wu C, Chen Y, Wan X. Multiscale Feature Enhancement and Bidirectional Temporal Dependency Networks for Arrhythmia Classification. Biology. 2026; 15(2):149. https://doi.org/10.3390/biology15020149
Chicago/Turabian StyleYang, Liuwang, Chen Wang, Wenjing Chu, Hongliang Chen, Chuquan Wu, Yunfan Chen, and Xiangkui Wan. 2026. "Multiscale Feature Enhancement and Bidirectional Temporal Dependency Networks for Arrhythmia Classification" Biology 15, no. 2: 149. https://doi.org/10.3390/biology15020149
APA StyleYang, L., Wang, C., Chu, W., Chen, H., Wu, C., Chen, Y., & Wan, X. (2026). Multiscale Feature Enhancement and Bidirectional Temporal Dependency Networks for Arrhythmia Classification. Biology, 15(2), 149. https://doi.org/10.3390/biology15020149

