Attention-enhanced bidirectional LSTM for multivariate ECG arrhythmia classification: a deep learning approach with clinical validation

https://doi.org/10.55529/jaimlnn.52.107.117

Authors

  • Nadira Tashtemirova Scientific Secretariat, Research Institute, Research Institute for the Development of Artificial Intelligence, Tashkent, Uzbekistan.

Keywords:

ECG Classification, Bidirectional LSTM, Multi-Head Self-Attention, Arrhythmia Detection, Deep Learning Clinical AI

Abstract

Cardiovascular diseases (CVDs) are the top cause of death in the world, responsible for some 32% of all deaths. Despite the fact that electrocardiogram (ECG) is still the most commonly used non-invasive diagnostic tool for cardiac arrhythmia detection, automated classification of complex multivariate ECG signals remains a persistent challenge due to wave non-stationarity, inter-patient variability and severe class imbalance. We introduce a novel deep learning framework, called ATT-BiLSTM, for real-time ECG arrhythmia classification, combining bidirectional long short-term memory (BiLSTM) networks with a multi-head self-attention mechanism. The architecture consists of two BiLSTM encoder layers with residual connections, followed by a scaled dot-product attention module with eight heads, dynamically applied to P-wave, QRS complex and T-wave morphology features. The model was tested on the MIT-BIH Arrhythmia Database and the PTB-XL large-scale ECG database, achieving 96.4% classification accuracy, macro-averaged F1 score of 95.8% and AUC-ROC of 0.982. Comparative experiments with CNN-LSTM hybrid networks, Temporal Convolutional Networks (TCN), vanilla Transformer encoder, and standard BiLSTM further demonstrate the superiority of ATT-BiLSTM. Ablation studies confirm that multi-head self-attention contributes the greatest performance gain (+1.4% accuracy), with all improvements statistically significant (p < 0.01) via paired Wilcoxon signed-rank tests. This work advances scalable, AI-driven cardiovascular care by delivering clinical-grade diagnostic accuracy with real-time inference for automated cardiac monitoring.

References

Sen GuptaS.Towards non-invasive blood glucose measurement using machine learning: An all-purpose PPG system designBiomedical Signal Processing and Control20216810270610.1016/j.bspc.2021.102706

LiangJ.DengX.ZhangY.Hybrid CNN-BiLSTM with attention mechanism for imbalanced ECG heartbeat classificationBiomedical Signal Processing and Control20216810.1016/j.bspc.2021.102706

GnanasekeraM.A range-based algorithm for autonomous navigation of an aerial drone to approach and follow a herd of cattleSensors20212121721810.3390/s21217218

GuglinM. E.ThataiD.Common errors in computer electrocardiogram interpretationInternational Journal of Cardiology2006106223223710.1016/j.ijcard.2005.02.007

ZhangX.ZhouT.LinY.Transformer-based deep neural network for ECG classification using multi-lead signalsPattern Recognition Letters20221521810.1016/j.patrec.2021.11.019

HannunA. Y.Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural networkNature Medicine2019251656910.1038/s41591-018-0268-3

YildirimO.A novel wavelet sequence based on deep bidirectional LSTM network model for ECG signal classificationComputers in Biology and Medicine20189618920210.1016/j.compbiomed.2018.03.016

MousaviS.AfghahF.Inter- and intra-patient ECG heartbeat classification for arrhythmia detection: A sequence to sequence deep learning approachProc. IEEE ICASSPBrighton, UK201910.31224/osf.io/uedzx

SinghP.SharmaA.Attention-based convolutional denoising autoencoder for two-lead ECG denoising and arrhythmia classificationIEEE Transactions on Instrumentation and Measurement20227111010.1109/TIM.2022.3197757

LiZ.ZhangH.Automatic detection for multi-labeled cardiac arrhythmia based on frame blocking preprocessing and residual networksFrontiers in Cardiovascular Medicine2021810.3389/fcvm.2021.616585

PetmezasG.Automated atrial fibrillation detection using a hybrid CNN-LSTM network on imbalanced ECG datasetsBiomedical Signal Processing and Control20216310.1016/j.bspc.2020.102194

PanJ.TompkinsW. J.A real-time QRS detection algorithmIEEE Transactions on Biomedical Engineering198532323023610.1109/TBME.1985.325532

KiranyazS.1D convolutional neural networks and applications: A surveyMechanical Systems and Signal Processing202115110.1016/j.ymssp.2020.107398

WangH.LiJ.WuQ.Residual BiLSTM networks with self-attention for automated cardiac arrhythmia recognitionExpert Systems with Applications202219711674010.1016/j.eswa.2022.116740

JiangM.HADLN: Hybrid attention-based deep learning network for automated arrhythmia classificationFrontiers in Physiology20211268302510.3389/fphys.2021.683025

NatarajanA.A wide and deep transformer neural network for 12-lead ECG classificationProceedings of Computing in CardiologyRimini, Italy20204710.22489/CinC.2020.107

StrodthoffN.Deep learning for ECG analysis: Benchmarks and insights from PTB-XLIEEE Journal of Biomedical and Health Informatics20212551519152810.1109/JBHI.2020.3022989

ChenL.ZhouP.WuM.Multi-head self-attention networks for robust ECG signal classificationArtificial Intelligence in Medicine202313410.1016/j.artmed.2022.102421

MoodyG. B.MarkR. G.The impact of the MIT-BIH arrhythmia databaseIEEE Engineering in Medicine and Biology Magazine2001203455010.1109/51.932724

Automatic classification of heartbeats using ECG morphology and heartbeat interval featuresIEEE Transactions on Biomedical Engineering20045171196120610.1109/TBME.2004.827359

WagnerP.PTB-XL, a large publicly available electrocardiography datasetScientific Data20207111510.1038/s41597-020-0495-6

RibeiroA. H.Automatic diagnosis of the 12-lead ECG using a deep neural networkNature Communications202011110.1038/s41467-020-15432-4

ZhangZ.Interpretable deep learning for automatic diagnosis of 12-lead electrocardiogramiScience20212410.1016/j.isci.2021.102373

LiuF.An open access database for evaluating the algorithms of electrocardiogram rhythm and morphology abnormality detectionJournal of Medical Imaging and Health Informatics2018871368137310.1166/jmihi.2018.2442

Published

2025-10-19

How to Cite

Tashtemirova, N. (2025). Attention-enhanced bidirectional LSTM for multivariate ECG arrhythmia classification: a deep learning approach with clinical validation. Journal of Artificial Intelligence, Machine Learning and Neural Network, 5(2), 107–117. https://doi.org/10.55529/jaimlnn.52.107.117