Efficient Deep Learning Models Integrated with a Smart Web Application for Classifying Heart Diseases Based on ECG Signals
Abstract
1. Introduction
- Proposing Swin-T, VGG-19, and ViT models to classify different types of heart patients based on ECG Images.
- Developing a smart web application integrated with the three models based on a dash framework for heart patients’ prediction.
- Achieving maximum classification accuracy of the three models based on fine-tuning for particular hyperparameters using a grid search technique with training on a high graphics processing unit (GPU).
- Applying different data augmentation techniques as a preprocessing step to improve the performance of the generalization phase for the models.
- Evaluating the performance of the three proposed models according to the testing dataset, using several evaluation measurements such as the normalized confusion matrix (NCM), TPR, and AUPR curves.
- Comparing the findings obtained from the models for heart patients’ classification against various state-of-the-art (SOTA) models.
2. Related Works
3. Methodology
3.1. The Proposed Swin-T Model
3.2. The Proposed VGG-19 Model
3.3. The Proposed ViT Model
3.4. The Proposed Smart Web Application
3.5. Dataset
4. Evaluation Metrics
5. Experimental Results
6. Discussion
7. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Ramesh, S.; Kosalram, K. The burden of non-communicable diseases: A scoping review focus on the context of India. J. Educ. Health Promot. 2023, 12, 41. [Google Scholar] [CrossRef] [Scilit]
- Kauferstein, S.; Kiehne, N.; Neumann, T.; Pitschner, H.-F.; Bratzke, H. Cardiac gene defects can cause sudden cardiac death in young people. Dtsch. Arztebl. Int. 2009, 106, 41. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Nechita, L.C.; Tupu, A.E.; Nechita, A.; Voipan, D.; Voipan, A.E.; Tutunaru, D.; Musat, C.L. The Impact of Quality of Life on Cardiac Arrhythmias: A Clinical, Demographic, and AI-Assisted Statistical Investigation. Diagnostics 2025, 15, 856. [Google Scholar] [CrossRef] [Scilit]
- Syahrul Ulum, A.M.; Mandala, S. Detection myocardial infarction with deep learning algorithms using MRI data. In Proceedings of the 3rd International Conference on Intelligent Cybernetics Technology & Applications (ICICyTA), Denpasar, Bali, Indonesia, 13–15 December 2023; IEEE: New York, NY, USA, 2023; pp. 6–11. [Google Scholar] [CrossRef] [Scilit]
- Desai, U.; Martis, R.J.; Janapati, R.; Rajesh, K.N.V.P.S. Coronary artery disease (CAD) heart beats classification using recurrence plots. In Proceedings of the 3rd International Conference on Artificial Intelligence and Signal Processing (AISP), Vijayawada, India, 18–20 March 2023; IEEE: New York, NY, USA, 2023; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
- Ayano, Y.M.; Schwenker, F.; Dufera, B.D.; Debelee, T.G.; Ejegu, Y.G. Interpretable hybrid multichannel deep learning model for heart disease classification using 12-lead ECG signal. IEEE Access 2024, 12, 94055–94080. [Google Scholar] [CrossRef] [Scilit]
- Vásquez-Iturralde, F.; Flores-Calero, M.J.; Grijalva, F.; Rosales-Acosta, A. Automatic classification of cardiac arrhythmias using deep learning techniques: A systematic review. IEEE Access 2024, 12, 118467–118492. [Google Scholar] [CrossRef] [Scilit]
- Aggarwal, L.; Goswami, P.; Batra, S.; Alam, S.; Kumar, A.; Srivastava, P. An intelligent healthcare system for diagnosis based on machine learning technique. In Proceedings of the 2nd IEEE Delhi Section Flagship Conference (DELCON), Rajpura, India, 24–26 February 2023; IEEE: New York, NY, USA, 2023; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
- Bansal, M.; Gandhi, B. IoT & big data in smart healthcare (ECG monitoring). In Proceedings of the International Conference on Machine Learning, Big Data, Cloud and Parallel Computing (COMITCon), Faridabad, India, 14–16 February 2019; IEEE: New York, NY, USA, 2019; pp. 390–396. [Google Scholar] [CrossRef] [Scilit]
- Vijaipriya, K.; Priya, C.; Sivanandan, S.; Krishnaswamy, R. ECG monitoring system using IoT for health care applications. In Proceedings of the Second International Conference on Augmented Intelligence and Sustainable Systems (ICAISS), Trichy, India, 23–25 August 2023; IEEE: New York, NY, USA, 2023; pp. 1611–1615. [Google Scholar] [CrossRef] [Scilit]
- Hodrob, R.; Obaid, M.; Abdulsalam Mansour, A.M.; Sawahreh, A.; Naghnagheah, M.; AbuShanab, S.S. An IoT based healthcare using ECG. In Proceedings of the 21st International Arab Conference on Information Technology (ACIT), Giza, Egypt, 28–30 November 2020; IEEE: New York, NY, USA, 2020; pp. 1–4. [Google Scholar] [CrossRef] [Scilit]
- Shaown, T.; Hasan, I.; Mim, M.M.R.; Hossain, M.S. IoT-based portable ECG monitoring system for smart healthcare. In Proceedings of the International Conference on Advances in Science, Engineering and Robotics Technology (ICASERT), Dhaka, Bangladesh, 3–5 May 2019; IEEE: New York, NY, USA, 2019; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
- Çelebi, M. Portable ECG monitoring device design based on Arduino. In Proceedings of the Medical Technologies Congress (TIPTEKNO), Antalya, Turkey, 19–20 November 2020; IEEE: New York, NY, USA, 2020; pp. 1–4. [Google Scholar] [CrossRef] [Scilit]
- Chulde-Fernández, B.; Enríquez-Ortega, D.; Guevara, C.; Navas, P.; Tirado-Espín, A.; Vizcaíno-Imacaña, P.; Villalba-Meneses, F.; Cadena-Morejon, C.; Almeida-Galarraga, D.; Acosta-Vargas, P. Classification of Heart Failure Using Machine Learning: A Comparative Study. Life 2025, 15, 496. [Google Scholar] [CrossRef] [Scilit]
- Baghdadi, N.A.; Abdelaliem, S.M.F.; Malki, A.; Gad, I.; Ewis, A.; Atlam, E. Advanced machine learning techniques for cardiovascular disease early detection and diagnosis. J. Big Data 2023, 10, 144. [Google Scholar] [CrossRef] [Scilit]
- Li, J.P.; Haq, A.U.; Din, S.U.; Khan, J.; Khan, A.; Saboor, A. Heart disease identification method using machine learning classification in e-healthcare. IEEE Access 2020, 8, 107562–107582. [Google Scholar] [CrossRef] [Scilit]
- Fan, C.; Su, Q.; Xiao, Z.; Su, H.; Hou, A.; Luan, B. ViT-FRD: A vision transformer model for cardiac MRI image segmentation based on feature recombination distillation. IEEE Access 2023, 11, 129763–129772. [Google Scholar] [CrossRef] [Scilit]
- Muthumeena, S.; Priya, L.; Vishnu Priya, M.R. Deep learning framework for cardio vascular disease prediction using ECG images. In Proceedings of the International Conference on Smart Systems for Electrical, Electronics, Communication and Computer Engineering (ICSSEECC), Coimbatore, India, 28–29 June 2024; IEEE: New York, NY, USA, 2024; pp. 244–249. [Google Scholar] [CrossRef] [Scilit]
- Yang, R.; Liu, K.; Liang, Y. A fusion-attention swin transformer for cardiac MRI images image segmentation. IET Image Process. 2024, 18, 105–115. [Google Scholar] [CrossRef] [Scilit]
- Khalid, M.; Pluempitiwiriyawej, C.; Abdulkadhem, A.A.; Afzal, I.; Truong, T. ECGConVT: A hybrid CNN and vision transformer model for enhanced 12-Lead ECG images classification. IEEE Access 2024, 12, 193043–193056. [Google Scholar] [CrossRef] [Scilit]
- Liu, S.-H.; Liu, H.-C.; Chen, W.; Tan, T.-H. Evaluating quality of photoplethymographic signal on wearable forehead pulse oximeter with supervised classification approaches. IEEE Access 2020, 8, 185121–185135. [Google Scholar] [CrossRef] [Scilit]
- Al Reshan, M.S.; Amin, S.; Zeb, M.A.; Sulaiman, A.; Alshahrani, H.; Shaikh, A. A Robust heart disease prediction system using hybrid deep neural networks. IEEE Access 2023, 11, 121574–121591. [Google Scholar] [CrossRef] [Scilit]
- ECG Images, National Heart Foundation of Bangladesh. Kaggle Repository. Available online: https://www.kaggle.com/datasets/drsaeedmohsen/ecg-images-national-heart-foundation-of-banglades (accessed on 14 May 2025).
- Yahya, A.S.; Edan, N.M. ECG signal classification using hybrid and non-hybrid learning technologies. Int. J. Percept. Cogn. Comput. 2025, 11, 114–121. [Google Scholar] [CrossRef] [Scilit]
- Hasan, M.N.; Hossain, M.A.; Rahman, M.A. An ensemble based lightweight deep learning model for the prediction of cardiovascular diseases from electrocardiogram images. Eng. Appl. Artif. Intell. 2025, 141, 109782. [Google Scholar] [CrossRef] [Scilit]
- Selvam, I.J.; Madhavan, M.; Kumarasamy, S.K. Detection and classification of electrocardiography using hybrid deep learning models. Hell. J. Cardiol. 2025, 81, 75–84. [Google Scholar] [CrossRef] [Scilit]
- Almazroi, A.A.; Aldhahri, E.A.; Bashir, S.; Ashfaq, S. A clinical decision support system for heart disease prediction using deep learning. IEEE Access 2023, 11, 61646–61659. [Google Scholar] [CrossRef] [Scilit]
- Chandrasekhar, N.; Narahari, S.C.; Kollem, S.; Peddakrishna, S.; Penchala, A.; Chapa, B.P. Heart abnormality classification using ECG and PCG recordings with novel PJM-DJRNN. Results Eng. 2025, 25, 104032. [Google Scholar] [CrossRef] [Scilit]
- Sumalatha, U.; Prakasha, K.K.; Prabhu, S.; Nayak, V.C. Deep learning applications in ECG analysis and disease detection: An investigation study of recent advances. IEEE Access 2024, 12, 126258–126284. [Google Scholar] [CrossRef] [Scilit]
- Lee, C.H.; Kim, S.H. ECG measurement system for vehicle implementation and heart disease classification using machine learning. IEEE Access 2023, 11, 17968–17982. [Google Scholar] [CrossRef] [Scilit]
- Kailan, S.L.; Madhloom Kurdi, W.H.; Najim, A.H.; Kadhim, M.N. Efficient ECG classification based on machine learning and feature selection algorithm for IoT-5G enabled health monitoring systems. Int. J. Intell. Eng. Syst. 2025, 18, 1187–1199. [Google Scholar] [CrossRef] [Scilit]
- Mohan, S.; Thirumalai, C.; Srivastava, G. Effective heart disease prediction using hybrid machine learning techniques. IEEE Access 2019, 7, 81542–81554. [Google Scholar] [CrossRef] [Scilit]
- Hambarde, S.; Paithane, A.; Lambhate, P.; Hambarde, A.S.; Kalyankar, P.A. Smart arrhythmia detection using single lead ECG signal and hybridized deep neural network model. Web Intell. 2025, 23, 155–171. [Google Scholar] [CrossRef] [Scilit]
- Ahmad, A. Heart failure detection using deep learning and gradient boosting classifier. El Cezeri J. Sci. Eng. 2025, 12, 1–8. [Google Scholar] [CrossRef] [Scilit]
- Pyakillya, B.; Kazachenko, N.; Mikhailovsky, N. Deep learning for ECG classification. J. Phys. Conf. Ser. 2017, 913, 012004. [Google Scholar] [CrossRef] [Scilit]
- Alimbayeva, Z.; Alimbayev, C.; Ozhikenov, K.; Bayanbay, N.; Ozhikenova, A. Wearable ECG device and machine learning for heart monitoring. Sensors 2024, 24, 4201. [Google Scholar] [CrossRef] [Scilit]
- Ma, L.; Zhang, F. A novel real-time detection and classification method for ECG signal images based on deep learning. Sensors 2024, 24, 5087. [Google Scholar] [CrossRef] [Scilit]
- Fatema, K.; Montaha, S.; Rony, M.A.H.; Azam, S.; Hasan, M.Z.; Jonkman, M. A robust framework combining image processing and deep learning hybrid model to classify cardiovascular diseases using a limited number of paper-based complex ECG images. Biomedicines 2022, 10, 2835. [Google Scholar] [CrossRef] [Scilit]
- Staffini, A.; Svensson, T.; Chung, U.-i.; Svensson, A.K. A disentangled VAE-BiLSTM model for heart rate anomaly detection. Bioengineering 2023, 10, 683. [Google Scholar] [CrossRef] [Scilit]
- Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2015, arXiv:1412.6980. [Google Scholar] [CrossRef] [Scilit]
- Papa, L.; Russo, P.; Amerini, I.; Zhou, L. A survey on efficient vision transformers: Algorithms, techniques, and performance benchmarking. IEEE Trans. Pattern Anal. Mach. Intell. 2024, 46, 7682–7700. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Pengfei, J.; Chunkai, Z.; Zhenyu, H. A new sampling approach for classification of imbalanced data sets with high density. In Proceedings of the International Conference on Big Data and Smart Computing (BIGCOMP), Bangkok, Thailand, 15–17 January 2014; IEEE: New York, NY, USA, 2014; pp. 217–222. [Google Scholar] [CrossRef] [Scilit]
- Hassan, A.M.A.; Mohsen, S. Compression of electrocardiogram signals using compressive sensing technique based on curvelet transform toward medical applications. Multimed. Tools Appl. 2025, 84, 11203–11219. [Google Scholar] [CrossRef] [Scilit]




























| Stage | Hyperparameters | Selected Values |
|---|---|---|
| Architecture | Kernel size of convolution_1 | 3 × 3 |
| Number of filters for convolution_1 | 64 | |
| The stride of the convolution operation | 1 | |
| Max-Pooling size for Max-Pooling_1 | 2 × 2 | |
| The stride of the max-pooling operation | 2 | |
| Number of neurons for the first FC layer | 4096 | |
| Number of neurons for the second FC layer | 4096 | |
| Dropout rate of neurons | 0.1 | |
| Training | Batch Size | 32 |
| Optimizer | Adam | |
| Number of Epochs | 20 | |
| Learning Rate | 0.0001 |
| Model | Training Error | Testing Error |
|---|---|---|
| Swin Transformer | 0.0002 | 0.0707 |
| VGG-19 | 0.3493 | 0.4138 |
| ViT | 0.0003 | 0.0015 |
| Metrics | Swin Transformer | VGG-19 | ViT |
|---|---|---|---|
| Precision (%) | 99 | 94 | 100 |
| Recall (%) | 99 | 94 | 100 |
| F1-score (%) | 99 | 94 | 100 |
| Model | Macro-Average Specificity% | Macro-Average Sensitivity% |
|---|---|---|
| Swin Transformer | 99.58 | 99.16 |
| VGG-19 | 97.08 | 94.17 |
| ViT | 100 | 100 |
| Class | Precision | TPR | F1-Score |
|---|---|---|---|
| Arrhythmia Patient | 1.00 | 0.97 | 0.99 |
| Myocardic Patient | 1.00 | 1.00 | 1.00 |
| Normal Patient | 0.98 | 1.00 | 0.99 |
| Accuracy | - | - | 0.99 |
| Macro average | 0.99 | 0.99 | 0.99 |
| Weighted average | 0.99 | 0.99 | 0.99 |
| Class | Precision | TPR | F1-Score |
|---|---|---|---|
| Arrhythmia Patient | 0.92 | 0.90 | 0.91 |
| Myocardic Patient | 0.98 | 1.00 | 0.99 |
| Normal Patient | 0.93 | 0.93 | 0.93 |
| Accuracy | - | - | 0.94 |
| Macro average | 0.94 | 0.94 | 0.94 |
| Weighted average | 0.94 | 0.94 | 0.94 |
| Class | Precision | TPR | F1-Score |
|---|---|---|---|
| Arrhythmia Patient | 1.00 | 1.00 | 1.00 |
| Myocardic Patient | 1.00 | 1.00 | 1.00 |
| Normal Patient | 1.00 | 1.00 | 1.00 |
| Accuracy | - | - | 1.00 |
| Macro average | 1.00 | 1.00 | 1.00 |
| Weighted average | 1.00 | 1.00 | 1.00 |
| Reference | Technique | Testing Accuracy (%) |
|---|---|---|
| [24] | Hybrid LSTM-CNN with Adam activation | 98.75 |
| [25] | Lightweight CNN with ensemble (GNB, DT, XGB, RF) | 99.29 |
| [26] | Hybrid CNN-VAE | 98.51 |
| [27] | Dense neural networks | 83 |
| [22] | Hybrid Deep Neural Network (CNN, LSTM, Dense) | 98.86 |
| [28] | PJM-DJRNN (ECG + PCG signals) | 97.33 |
| [30] | Two-stage machine learning | 0.7898 |
| [31] | PSO-based feature selection + SVM | 98 |
| [32] | HRFLM (Random Forest + Linear Model) | 88.7 |
| [33] | CWO-optimized deep learning | 96.1 |
| [34] | CNN + XGBoost | 99.9 |
| [35] | 1D CNN + Fully connected layers | 86 |
| [36] | CNN-based anomaly detection | 92.6 |
| The proposed work | Swin-T VGG-19 ViT | 99.17 94.17 100 |
| Reference | Methodology | Key Results and Contributions | Dataset | Strengths | Limitations |
|---|---|---|---|---|---|
| [23] | Random Forest, LSTM-CNN hybrid for Heartbeat classification from ECGs | Hybrid LSTM-CNN outperforms traditional machine learning methods in accuracy and stability; kernel size and activation impact performance. | Adult ECG data | Outperformed ML models | Kernel size and activation function sensitivity |
| [24] | Lightweight CNN, Weighted Ensemble (GNB, DT, XGB, RF) models for predicting cardiovascular abnormalities, highlighting CVD prediction | The optimized ensemble model provided high scalability and, with weighted classifiers, achieved the highest accuracy in CVD detection. | Real ECG datasets | Outperformed traditional models | Limited to specific datasets |
| [25] | Hybrid CNN with Variational Autoencoder (VAE) for CVD classification | Hybrid CNN-VAE outperforms traditional models for CVD early detection through automatic feature extraction. | PTB-XL ECG dataset | Superior to traditional DL | Limited dataset application |
| [26] | Dense Neural Networks for early heart disease detection using Keras | Deep learning model showed improved accuracy, sensitivity, and specificity for heart disease diagnosis, outperforming individual and ensemble methods. | Multiple heart disease datasets | No detailed performance comparison with other models | Limited evaluation metrics and low performance in generalization |
| [27] | Hybrid Deep Neural Network (HDNN): CNN, LSTM, Dense layers for early heart disease prediction | The HDNN model has a superior performance compared to traditional ML and deep learning methods. | Cleveland and HD datasets | Strong performance across datasets | Lack of clarity on generalizability |
| [22] | Polynomial Jacobian Matrix (PJM), Deep Jordan Recurrent Neural Network (DJRNN) for heart disease classification using ECG + PCG | Novel methods with ECG and PCG signals outperformed other techniques in classification and noise robustness, with high recall and accuracy, and robust noise removal and feature selection. | Diverse ECG datasets | Robust against noise | Limited to certain datasets |
| [28] | Review of deep learning models in ECG-based cardiovascular health monitoring, such as CNNs, RNNs, and Hybrid models | Focus on improvements in accuracy, real-time processing, privacy issues, and integration with clinical applications. | General ECG | Addressed real-time monitoring, privacy | Data limitations, EHR integration challenges |
| [29] | Two-stage ML structure with optimized feature selection for single-lead ECG measurement in vehicles for heart health monitoring and real-time ECG classification | Real-time heart condition classification with fast prediction times for daily vehicle monitoring, with a stable signal acquisition under noise, showing potential. | Real-time vehicle ECG measurements | Potential for daily health monitoring in vehicles | Signal stability under noisy conditions |
| [30] | PSO-based feature selection, and ML SVM classifiers for IoT and ECG classification for IoT health systems | PSO-SVM model improved classification accuracy with reduced dataset dimensionality for real-time, resource-constrained ECG monitoring. | 5G-enabled IoT health monitoring systems-based ECG | Outperformed existing methods | Limited real-world deployment |
| [31] | Hybrid RF with a Linear Model to predict heart disease | The HRFLM combined Random Forest and Linear methods for early heart disease detection. | Raw healthcare data | Early detection potential | Low accuracy compared to others |
| [32] | Arrhythmia detection using Cephalous Wolf Optimization (CWO), Deep Neural Networks | High detection performance with precision and recall on ECG signals, optimized for signal analysis. | MIT-BIH arrhythmia signals dataset | Strong performance with feature extraction | Needs more training data for robust generalization |
| [33] | Implementing a CNN and XGBoost for heart failure detection | CNN-XGBoost model outperforms CNN-only models in detecting heart failure from ECG data. | 2 s ECG segments | Outperformed CNN-only models | Potential for clinical applications |
| [34] | 1D Convolution with fully connected layers for ECG classification | Effective for unstructured ECG data, but future improvements are needed in preprocessing and balancing, unbalanced data without feature engineering. | Unstructured ECG data | No feature engineering needed | Accuracy is limited and needs enhanced preprocessing |
| [35] | Wearable ECG monitoring for early CVD prediction using CNN, real-time signal filtration, and anomaly detection | A wearable system with CNNs effectively detects ECG abnormalities but requires refinement for broader clinical use. | Real-time ECG data | High potential for wearable tech | Needs more refinement for disease differentiation |
| The proposed work | Integrating a framework of efficient three DL models: Swin-T, VGG-19, and ViT to classify ECG images between Arrhythmia, Normal, and Myocardic patients with a smart web application | Achieved high accuracy 99.17% for Swin-T, 94.17% for ViT, and 100% for ViT, applying prediction with a smart web application. | A total of 600 images: 200 Arrhythmia, 200 Myocardic, 200 Normal images | Efficient models: areas under the AUROC and AUPR are 100% for the Swin-T and ViT. Also, the testing accuracy, Precision, Recall, and F1-score are 100% for ViT | Limited to 600 ECG samples |
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
Mohsen, S.; Ibrahim, A.F.; Hassan, O.F.; Alnaim, N.; Albehaijan, N.; Abdel-Aziz, M. Efficient Deep Learning Models Integrated with a Smart Web Application for Classifying Heart Diseases Based on ECG Signals. Computers 2026, 15, 191. https://doi.org/10.3390/computers15030191
Mohsen S, Ibrahim AF, Hassan OF, Alnaim N, Albehaijan N, Abdel-Aziz M. Efficient Deep Learning Models Integrated with a Smart Web Application for Classifying Heart Diseases Based on ECG Signals. Computers. 2026; 15(3):191. https://doi.org/10.3390/computers15030191
Chicago/Turabian StyleMohsen, Saeed, Ahmed F. Ibrahim, Osama F. Hassan, Norah Alnaim, Noorah Albehaijan, and M. Abdel-Aziz. 2026. "Efficient Deep Learning Models Integrated with a Smart Web Application for Classifying Heart Diseases Based on ECG Signals" Computers 15, no. 3: 191. https://doi.org/10.3390/computers15030191
APA StyleMohsen, S., Ibrahim, A. F., Hassan, O. F., Alnaim, N., Albehaijan, N., & Abdel-Aziz, M. (2026). Efficient Deep Learning Models Integrated with a Smart Web Application for Classifying Heart Diseases Based on ECG Signals. Computers, 15(3), 191. https://doi.org/10.3390/computers15030191

