Heart Attack Prediction Using an Enhanced Convolutional AlexNet Model for ECG Image Classification

Authors

Omoniyi Joseph Asabia

Department of Computer Science, School of Computing, Babcock University, Ilishan-Remo, Ogun State (Nigeria)

Abayomi Oluwaseun Japinye

Department of Banking Examination, Central Bank of Nigeria, Lagos (Nigeria)

Olusegun J. Omotosho

Department of Computer Science, School of Computing, Babcock University, Ilishan-Remo, Ogun State (Nigeria)

Chigozirim U. Ajaegbu

Department of Computer Science, School of Computing, Babcock University, Ilishan-Remo, Ogun State (Nigeria)

Raymond Osi Alenoghena

Department of Economics, Caleb University Imota, Lagos (Nigeria)

Nwamaka Grace Ajaegbu

Department of Social Sciences, Yaba College of Technology, Lags (Nigeria)

Article Information

DOI: 10.51244/IJRSI.2026.1310000056

Subject Category: Computer Science

Volume/Issue: 13/10 | Page No: 777-783

Publication Timeline

Submitted: 2026-10-16

Accepted: 2026-10-21

Published: 2026-10-31

Abstract

Cardiovascular disease (CVD) is still the greatest cause of death around the world, myocardial infarction (MI) making up a large number of the deaths related to CVD. Currently, diagnosis depends on manual analysis of electrocardiogram (ECG) traces, a time-consuming process prone to human error and variation between observers. The present study introduces an improved AlexNet-based convolutional neural network (CNN) which enables automated multi-class classification of ECG images into four categories: Normal Heartbeat (NH), Myocardial Infarction (MI), Previous Myocardial Infarction (PMI), and Abnormal Heartbeat (HB). The dataset consisted of 929 ECG images taken from a public Mendeley repository. We used a thorough preprocessing pipeline involving denoising, digitisation, augmentation, segmentation into thirteen ECG leads, contour-based signal extraction, Min–Max normalisation, and Principal Component Analysis (PCA), which reduced the 3,060 contour features to 400 principal components while retaining about 99% of the total variance. To modify the AlexNet architecture, we replaced the three-channel RGB input with a single-channel grayscale input; this required changing the convolutional kernel sizes and redesigning the output layer to include four Softmax neurons and a 0.5 dropout rate. The model was trained using the Adam optimiser with a learning rate of 0.001 and with a train–test split of 80:20. The results obtained were 99.44% accuracy, a macro-averaged F1-score of 99.2%, and an AUC-ROC of 96.06%, thereby exceeding the performance of a lightweight CNN, a SMOTE-enhanced CNN, and a Particle Swarm Optimisation-based neural network (PSO-NN). The fact that modified CNN architectures are able to accurately detect heart attacks from ECG data shows that they have the potential to be incorporated into clinical decision support systems in order to allow efficient and clinically relevant automated cardiac screening.

Keywords

Cardiovascular Disease Prediction; Heart Attack Detection; Deep Learning; Enhanced Alexnet; Convolutional Neural Network; ECG Image Classification; Myocardial Infarction

Downloads

References

1. Alenoghena, R. O., Ajaegbu, N. G., Imohi, G. D., Omachonu, F., Oguntade, F. A., & Adewale, S. A. (2026). Stock Market Development, Financial Deepening, and Industrial Growth in Nigeria. International Journal of Research and Innovation in Social Science, 10(3), 4581-4596. [Google Scholar] [Crossref]

2. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., & Houlsby, N. (2021). An image is worth 16×16 words: Transformers for image recognition at scale. International Conference on Learning Representations (ICLR). [Google Scholar] [Crossref]

3. Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27(8), 861–874. https://doi.org/10.1016/j.patrec.2005.10.010 [Google Scholar] [Crossref]

4. Goldberger, A. L., Amaral, L. A. N., Glass, L., Hausdorff, J. M., Ivanov, P. C., Mark, R. G., Mietus, J. E., Moody, G. B., Peng, C.-K., & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation, 101(23), e215–e220. [Google Scholar] [Crossref]

5. Hasan, M., Yasmin, F., Hassan, M. M., Yu, X., Yeasmin, S., Joshi, H., & Islam, S. M. S. (2025). Effectiveness of machine learning models in diagnosis of heart disease: A comparative study. Scientific Reports, 15, 24568. [Google Scholar] [Crossref]

6. Hassan, M., Ahmed, S., Ali, R., & Khan, M. (2025). Enhanced AlexNet architectures for medical image classification: A comprehensive review. Journal of Medical Artificial Intelligence, 8(2), 101–120. [Google Scholar] [Crossref]

7. He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 770–778. https://doi.org/10.1109/CVPR.2016.90 [Google Scholar] [Crossref]

8. Huang, G., Liu, Z., Van Der Maaten, L., & Weinberger, K. Q. (2017). Densely connected convolutional networks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 4700–4708. https://doi.org/10.1109/CVPR.2017.243 [Google Scholar] [Crossref]

9. Jolliffe, I. T., & Cadima, J. (2016). Principal component analysis: A review and recent developments. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 374(2065), 20150202. https://doi.org/10.1098/rsta.2015.0202 [Google Scholar] [Crossref]

10. 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 [Google Scholar] [Crossref]

11. Kingma, D. P., & Ba, J. (2015). Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR). [Google Scholar] [Crossref]

12. Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. Advances in Neural Information Processing Systems, 25, 1097–1105. [Google Scholar] [Crossref]

13. LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. https://doi.org/10.1038/nature14539 [Google Scholar] [Crossref]

14. Litjens, G., Kooi, T., Bejnordi, B. E., Setio, A. A. A., Ciompi, F., Ghafoorian, M., van der Laak, J. A. W. M., van Ginneken, B., & Sánchez, C. I. (2017). A survey on deep learning in medical image analysis. Medical Image Analysis, 42, 60–88. [Google Scholar] [Crossref]

15. Oluwadamilare, J. O., Alenoghena, R. O., Ajaegbu, N. G., Oguntade, F. A., Osunlana,, K. I., & Ajisafe, H. B. (2026). Project Charter Development and Its Influence on Software Project Success. International Journal of Humanities Social Science and Management (IJHSSM), 6(2), 403-409. [Google Scholar] [Crossref]

16. Omoniyi, O. A. J., Jacob, O. O., Chigozirim, A., Alenoghena, R. O., Abayomi, J. O., & Aliu, F. O. (2026). Comparative Analysis of Custom and Pre-Trained Convolutional Neural Networks (CNNs) for Object Recognition on the Cifar-10 Dataset. International Journal of Research and Scientific Innovation, 13(6), 3499-3507. [Google Scholar] [Crossref]

17. Perez Alday, E. A., Gu, A., Shah, A. J., Liu, C., Sharma, A., Seyedi, S., Bahrami Rad, A., Reyna, M. A., & Clifford, G. D. (2020). Classification of 12-lead ECGs: The PhysioNet/Computing in Cardiology Challenge 2020. Physiological Measurement, 41(12), 124003. https://doi.org/10.1088/1361-6579/abc960 [Google Scholar] [Crossref]

18. Reddy, P., & Murthy, K. (2025). Particle swarm optimization enhanced neural network for cardiovascular disease prediction. Expert Systems with Applications, 269, 126095. [Google Scholar] [Crossref]

19. Simonyan, K., & Zisserman, A. (2015). Very deep convolutional networks for large-scale image recognition. International Conference on Learning Representations (ICLR). [Google Scholar] [Crossref]

20. Sokolova, M., & Lapalme, G. (2009). A systematic analysis of performance measures for classification tasks. Information Processing & Management, 45(4), 427–437. https://doi.org/10.1016/j.ipm.2009.03.002 [Google Scholar] [Crossref]

21. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., & Rabinovich, A. (2015). Going deeper with convolutions. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 1–9. https://doi.org/10.1109/CVPR.2015.7298594 [Google Scholar] [Crossref]

22. Tan, M., & Le, Q. V. (2019). EfficientNet: Rethinking model scaling for convolutional neural networks. Proceedings of the 36th International Conference on Machine Learning (ICML), 6105–6114. [Google Scholar] [Crossref]

23. Trigka, M., & Dritsas, E. (2025). Improving cardiovascular disease prediction with deep learning and correlation-aware SMOTE. IEEE Access, 13, 44590–44606. https://doi.org/10.1109/ACCESS.2025.3549417 [Google Scholar] [Crossref]

24. World Health Organization. (2021). Cardiovascular diseases (CVDs) [Fact sheet]. https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds) [Google Scholar] [Crossref]

Metrics

Views & Downloads

Similar Articles