arXiv:2610.37709eess.IVOct 2026

Manuscript Offprint

arXiv:2610.37709

Towards Myocardial Infarction Diagnosis: An Investigation into Machine Learning and Deep Learning Algorithms using ECG Data

Rafid Ahnaf, Husne Mubarak, Fahim Ahsan, G. M. Refatul Islam, Rafeed Rahman, Nabuat Zaman Nahim

Abstract

Myocardial Infarction (MI) is a severe and potentially fatal cardiac condition caused by myocardial injury due to ischemia, and timely detection can substantially reduce its mortality. Electrocardiography (ECG) is the primary diagnostic modality for MI, but manual interpretation is susceptible to human error. In this work, we propose Visionary V2, a multi-step, adaptive filtration method for ECG signal normalization, and use it to study machine learning (ML) and deep learning (DL) approaches to MI detection on the PTB Diagnostic ECG Database using all 15 available leads. On statistical features extracted from the filtered signals, such as the R-R interval, a Bagging ensemble of decision trees reaches 96.6% accuracy, compared with 87.7% when the signals are processed with BioSPPy. We further generate an image dataset from the filtered signals, on which a custom ResNet-50 misclassifies only 1 of 7,000 validation images and a custom CNN reaches an F1 score of about 98.7%. Finally, we apply LIME, Grad-CAM and Integrated Gradients to verify that the image models attend to the ECG waveform rather than the background. These results indicate that careful signal normalization combined with ML and DL models can support fast and accurate automated

Email addresses: rafid.ahnaf@g.bracu.ac.bd (Rafid Ahnaf), husne.mubarak@g.bracu.ac.bd (Husne Mubarak), fahim.ahsan@g.bracu.ac.bd (Fahim Ahsan), gm.refatul.islam@g.bracu.ac.bd (G. M. Refatul Islam), rahman.rafeed@bracu.ac.bd (Rafeed Rahman), nabuat.zaman@bracu.ac.bd (Nabuat Zaman Nahim)

MI screening.

Keywords: Myocardial Infarction, Signal Processing, ECG Filtering, Data Augmentation, Interpretable AI

1. Introduction

Myocardial Infarction (MI), commonly called “heart attack,” is a life-threatening cardiovascular condition caused by the complete or partial obstruction of the coronary arteries responsible for providing oxygenated blood to the cardiac muscle. MI affected heart muscles may introduce increased mechanical stress to the heart during muscle contraction for pumping blood which may result in structural and conformational changes like left ventricular remodeling. While symptoms like unconsciousness, breathing problems, and chest pain are common, many victims fail to exhibit the symptoms at an early stage. Additionally, factors such as biophysical conditions, previous medical conditions, and lifestyle choices can contribute to the development of MI.

Given the high mortality rate associated with it, early detection is crucial for providing timely treatment. Traditional electrocardiogram (ECG) analysis, while effective, has limitations such as being subject to human error and misdiagnosis. It also can’t identify all possible MI risk factors, leading to false negatives or positives. Research suggests that in cases of individuals presenting with significant symptoms of cardiac disease, cancer, and infection, 10% are misdiagnosed or are already at an advanced stage of the disease. Furthermore, 53.9% of these individuals have either become disabled or passed away as a result of medical errors or incorrect diagnosis. As a result, automated detection consisting of high-class accuracy and precision is a prerequisite for assisting medical practitioners with quick and accurate diagnosis of MI. This motivated us to explore the domain of how we can detect Myocardial Infarction in people of all genders and ages with more accuracy and efficiency within a short time than the traditional methods by utilizing modern machine learning and deep learning approaches. In our work, we came across several machine and deep learning models that can accurately classify ECG signals as indicative of MI or not both from numerical and image data derived from ECG. In order to denoise the raw ECG signal for better extraction of features, we also developed a dynamic robust pre-processing filter with the ability of adaptive filtering. Moreover, imple-menting explainable AI techniques in our work has brought the explication of the applied models to a higher dimension using our derived results. We believe this combination of accurate detection and interpretable outputs can meaningfully support clinicians in diagnosing MI.