Towards Myocardial Infarction Diagnosis: An Investigation into Machine Learning and Deep Learning Algorithms using ECG Data
Organizations: Department of Computer Science and Engineering, BRAC University, Dhaka, Bangladesh
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 MI screening.
Figures & tables
| Model | Type | Biosppy | EHC | VisionaryV2 |
|---|---|---|---|---|
| SVM | Accuracy | 0.811 | 0.751 | 0.811 |
| Precision | 0.811 | 0.819 | 0.811 | |
| Recall | 0.811 | 0.751 | 0.811 | |
| F1 Score | 0.726 | 0.763 | 0.726 | |
| KNN | Accuracy | 0.811 | 0.942 | 0.855 |
| Precision | 0.764 | 0.943 | 0.847 |
| Model Name | Type | Biosppy | EHC | VisionaryV2 |
|---|---|---|---|---|
| Random Forest | Accuracy | 0.877 | 0.971 | 0.955 |
| Precision | 0.877 | 0.971 | 0.948 | |
| Recall | 0.877 | 0.971 | 0.955 | |
| F1 Score | 0.859 | 0.971 | 0.953 | |
| XGBoost ∗ | Accuracy | 0.855 | 0.985 | 0.955 |
| Precision | – | 0.985 | – |
| Model Name | Result Type | Healthy | MI |
|---|---|---|---|
| Custom CNN | Precision | 0.987 | 0.986 |
| Recall | 0.986 | 0.987 | |
| F1 Score | 0.986 | 0.987 | |
| Sensitivity | 0.986 | 0.987 | |
| Specificity | 0.987 | 0.987 | |
| Custom ResNet-50 | Precision | 1.000 | 0.999 |
Electrocardiogram Classification
Electrocardiogram classification uses machine learning to identify heart rhythms and cardiac conditions from ECG waveforms for screening, diagnosis, and monitoring.
See all 111 papers