Multi-Class Heart Disease Detection using ECG Images via Deep CNN Feature Extraction and Ensemble Stacking
PDF
PDF

How to Cite

Reddy, Nomula Nagarjuna, Lingadally Nipun, Md Uzair Baba, Nyalakanti Rishindra, and Thoutireddy Shilpa. 2025. “Multi-Class Heart Disease Detection Using ECG Images via Deep CNN Feature Extraction and Ensemble Stacking”. Journal of Innovative Image Processing 7 (3): 876-901. https://doi.org/10.36548/jiip.2025.3.016.

Keywords

  • Electrocardiogram (ECG) Classification
  • Deep Convolutional Neural Networks (CNNs)
  • Stacking Ensemble Learning
  • Transfer Learning
  • Cardiovascular Disease Diagnosis
  • Feature Fusion

Abstract

Cardiovascular diseases (CVDs) continue to be the number one cause of mortality across the globe, illustrating the need for trustworthy and automated diagnostic methods. Electrocardiogram (ECG) analysis is a traditional method to identify cardiac abnormalities but the existing methods based on single convolutional neural networks (CNNs) or traditional machine learning (ML) classifiers suffer from overfitting, generalizing across different datasets, and addressing class imbalance, which in turn presents a barrier to developing robust systems with clinical deployment intent. This research addresses these issues by using a hybrid ensemble framework for multi-class ECG image classification. Our hybrid ensemble framework follows the approach of using transfer learning from CNNs (VGG16, VGG19, ResNet50, and InceptionV3) for deep feature extraction, applying dimensionality reduction (via Principal Components Analysis) on the reduced features, and then classifying them using a stacking ensemble of Random Forest, XGBoost, LightGBM, Multilayer Perceptron (MLP), and Support Vector Machine (SVM), with Logistic Regression serving as the meta-learner. We augmented the classes by applying the Synthetic Minority Over-sampling Technique (SMOTE) to handle imbalanced datasets. Our trials on datasets from Pakistan, Mendeley, and Bangladesh verified the effectiveness of our model, as it scored 97.6% on accuracy, 97.59% on the F1 score, and 0.9992 on the macro-AUC score, continuously performing better than both traditional ML classifiers and individual CNNs. The findings indicate that CNN-derived features combined with different ML classifiers improve the robustness of the model, its scalability, and its ability to generalize across clinical datasets. They underscore the role of the proposed model in performing disease diagnosis in real-time from an ECG and act as part of the advanced clinical decision support.

References

Naz, Mahwish, Jamal Hussain Shah, Muhammad Attique Khan, Muhammad Sharif, Mudassar Raza, and Robertas Damaševičius. "From ECG signals to images: a transformation based approach for deep learning." PeerJ Computer Science 7 (2021): e386.

Ashtaiwi, AbdulAdhim, Tarek Khalifa, and Omar Alirr. "Enhancing heart disease diagnosis through ECG image vectorization-based classification." Heliyon 10, no. 18 (2024).

Fatema, Kaniz, Sidratul Montaha, Md Awlad Hossen Rony, Sami Azam, Md Zahid Hasan, and Mirjam Jonkman. "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 10, no. 11 (2022): 2835.

Mhamdi, Lotfi, Oussama Dammak, François Cottin, and Imed Ben Dhaou. "Artificial intelligence for cardiac diseases diagnosis and prediction using ECG images on embedded systems." Biomedicines 10, no. 8 (2022): 2013.

Aversano, Lerina, Mario Luca Bernardi, Marta Cimitile, Debora Montano, and Riccardo Pecori. "Early diagnosis of cardiac diseases using ecg images and cnn-2d." Procedia Computer Science 225 (2023): 2866-2875.

Saikumar, Kayam, D. Siva, Dhupati Srivalli, S. Shafiulla Basha, BP Santosh Kumar, and Abolfazl Mehbodniya. "Deep Learning Driven Heart Disease Prediction using ECG Signal Classification." Panamerican Mathematical Journal 35, no. 2s (2025): 42-56.

Sattar, Shoaib, Rafia Mumtaz, Mamoon Qadir, Sadaf Mumtaz, Muhammad Ajmal Khan, Timo De Waele, Eli De Poorter, Ingrid Moerman, and Adnan Shahid. "Cardiac arrhythmia classification using advanced deep learning techniques on digitized ECG datasets." Sensors 24, no. 8 (2024): 2484.

Narotamo, Hemaxi, Mariana Dias, Ricardo Santos, André V. Carreiro, Hugo Gamboa, and Margarida Silveira. "Deep learning for ECG classification: A comparative study of 1D and 2D representations and multimodal fusion approaches." Biomedical Signal Processing and Control 93 (2024): 106141.

Ayano, Yehualashet Megersa, Friedhelm Schwenker, Bisrat Derebssa Dufera, Taye Girma Debelee, and Yitagesu Getachew Ejegu. "Interpretable hybrid multichannel deep learning model for heart disease classification using 12-lead ECG signal." IEEE Access 12 (2024): 94055-94080.

Khan, Hira, Nadeem Javaid, Tariq Bashir, Mariam Akbar, Nabil Alrajeh, and Sheraz Aslam. "Heart disease prediction using novel ensemble and blending based cardiovascular disease detection networks: EnsCVDD-Net and BlCVDD-Net." IEEE Access 12 (2024): 109230-109254.

Nawaz, Syed Ali, Muhammad Arshad, Tanveer Aslam, Abdul Haseeb Wajid, Rizwan Ali Shah, and Mubashir H. Malik. "ECG based heart disease diagnosis using machine learning approaches." Journal of Computing & Biomedical Informatics (2024).

Gajendran, Mohan Kumar, Muhammad Zubair Khan, and Muazzam A. Khan Khattak. "Ecg classification using deep transfer learning." In 2021 4th international conference on information and computer technologies (ICICT), IEEE, (2021): 1-5.

Sinha, Nidhi, MA Ganesh Kumar, Amit M. Joshi, and Linga Reddy Cenkeramaddi. "DASMcC: Data Augmented SMOTE Multi-class Classifier for prediction of Cardiovascular Diseases using time series features." IEEE Access 11 (2023): 117643-117655.

Huang, Pang-Shuo, Yu-Heng Tseng, Chin-Feng Tsai, Jien-Jiun Chen, Shao-Chi Yang, Fu-Chun Chiu, Zheng-Wei Chen et al. "An artificial intelligence-enabled ECG algorithm for the prediction and localization of angiography-proven coronary artery disease." Biomedicines 10, no. 2 (2022): 394.

Karthik, S., M. Santhosh, Muthu Subash Kavitha, and A. Christopher Paul. "Automated Deep Learning Based Cardiovascular Disease Diagnosis Using ECG Signals." Computer Systems Science & Engineering 42, no. 1 (2022).

Mishra, Jyoti, and Mahendra Tiwari. "IoT-enabled ECG-based heart disease prediction using three-layer deep learning and meta-heuristic approach." Signal, Image and Video Processing 18, no. 1 (2024): 361-367.

Yoon, Taeyoung, and Daesung Kang. "Multi-modal stacking ensemble for the diagnosis of cardiovascular diseases." Journal of Personalized Medicine 13, no. 2 (2023): 373.

Mahmud, Tanjim, Anik Barua, Dilshad Islam, Mohammad Shahadat Hossain, Rishita Chakma, Koushick Barua, Mahabuba Monju, and Karl Andersson. "Ensemble deep learning approach for ecg-based cardiac disease detection: Signal and image analysis." In 2023 International Conference on Information and Communication Technology for Sustainable Development (ICICT4SD), IEEE, (2023): 70-74.

Alsekait, Deema Mohammed, Ahmed Younes Shdefat, Ayman Nabil, Asif Nawaz, Muhammad Rizwan Rashid Rana, Zohair Ahmed, Hanaa Fathi, and Diaa Salama AbdElminaam. "Heart-Net: A Multi-Modal Deep Learning Approach for Diagnosing Cardiovascular Diseases." Computers, Materials & Continua 80, no. 3 (2024).

Dhara, Sanjib Kumar, Nilankar Bhanja, and Prabodh Khampariya. "An adaptive heart disease diagnosis via ECG signal analysis with deep feature extraction and enhanced radial basis function." Computer Methods in Biomechanics and Biomedical Engineering: Imaging & Visualization 11, no. 7 (2024): 2245927.

Ma, Linjuan, and Fuquan Zhang. "A novel real-time detection and classification method for ECG signal images based on deep learning." Sensors 24, no. 16 (2024): 5087.

Akter, M., Islam, N., Ahad, A., Chowdhury, M. A., Apurba, F. F., & Khan, R. (2024). An embedded system for real-time atrial fibrillation diagnosis using a multimodal approach to ECG data. Eng, 5(4), 2728–2751. https://doi.org/10.3390/eng5040143

Alsayat, A., Mahmoud, A. A., Alanazi, S., Mostafa, A. M., Alshammari, N., Alrowaily, M. A., Shabana, H., & Ezz, M. (2025). Enhancing cardiac diagnostics: A deep learning ensemble approach for precise ECG image classification. Journal of Big Data, 12(1), 7. https://doi.org/10.1186/s40537-025-01070-4

Mohsin, K. (2022). National Heart Foundation 2023 ECG dataset[Data set]. Kaggle. https://www.kaggle.com/datasets/drkhaledmohsin/national-heart-foundation-2023-ecg-dataset

Khan, A. H., & Hussain, M. (2021). ECG images dataset of cardiac patients (Version 2)[Data set]. Mendeley Data. https://doi.org/10.17632/gwbz3fsgp8.2

Ray, A. (2024). ECG dataset for heart condition classification (Version 2)[Data set]. Mendeley Data. https://doi.org/10.17632/xw9sd3btcs.z

Mahajan, Palak, Shahadat Uddin, Farshid Hajati, and Mohammad Ali Moni. "Ensemble learning for disease prediction: A review." In Healthcare, vol. 11, no. 12, MDPI, (2023): 1808.

Salman, Hasan Ahmed, Ali Kalakech, and Amani Steiti. "Random forest algorithm overview." Babylonian Journal of Machine Learning 2024 (2024): 69-79.

Zhang, Ping, Yiqiao Jia, and Youlin Shang. "Research and application of XGBoost in imbalanced data." International Journal of Distributed Sensor Networks 18, no. 6 (2022): 15501329221106935.

Al Bataineh, Ali, Devinder Kaur, and Seyed Mohammad J. Jalali. "Multi-layer perceptron training optimization using nature inspired computing." IEEE Access 10 (2022): 36963-36977.

Roy, Atin, and Subrata Chakraborty. "Support vector machine in structural reliability analysis: A review." Reliability Engineering & System Safety 233 (2023): 109126.

Schober, Patrick, and Thomas R. Vetter. "Logistic regression in medical research." Anesthesia & Analgesia 132, no. 2 (2021): 365-366.

Zabor, Emily C., Chandana A. Reddy, Rahul D. Tendulkar, and Sujata Patil. "Logistic regression in clinical studies." International Journal of Radiation Oncology* Biology* Physics 112, no. 2 (2022): 271-277.