Investigating Machine Learning Models in Acute Myocardial Infarction to Predict Mortality

Cheragh Hussain1, Muhammad Idrees Khan2, Nazeef Ullah3, Abid Ullah3, Rayan Shah3, Aurangzeb Khan4

1Department of Cardiology, Khyber Girls Medical College, Peshawar; 2Peshawar Regional Blood Centre, Khyber Pakhtunkhwa; 3Department of Cardiology, Post Graduate Medical Institute (PGMI), Peshawar; Department of Pathology, Swat Medical College, Saidu, Swat

Objective: Pakistan and the rest of the world suffer from a high rate of acute myocardial infarctions (AMIs). In this study, we employed a machine learning model to predict mortality in patients with Acute Myocardial Infarction (AMI). By analyzing various variables, they assessed the impact of these factors on the predictive models, highlighting the potential of machine learning in improving mortality prediction and informing clinical decision-making in AMI cases.
Methodology: This study conducted three experiments using a Kaggle dataset to predict mortality in Acute Myocardial Infarction (AMI) patients with machine learning. Relevant input features were selected, and three models (SVM, DT, KNN) classified mortality status. Model performance was rigorously evaluated with metrics like Accuracy, AUC, Precision, Recall, and F1-score. Data preprocessing, including handling missing values and normalization, preceded model training.
Results: Among the evaluated models, the Support Vector Machine (SVM) exhibited the highest accuracy of approximately 87.66% and demonstrated robust discrimination capabilities, with an AUC score of 0.796. Precision, recall, and F1 scores indicated a balanced trade-off between correctly identifying negative outcomes and effectively capturing positive cases.
Conclusion: The SVM model emerged as the most promising classifier, showcasing strong potential for predicting patient mortality in the context of AMI. However, further refinements and optimizations may be necessary to enhance model performance, ensuring its clinical relevance and utility in real-world medical scenarios.
Keywords: Machine Learning, Acute Myocardial Infarction, Coronary Artery Disease, Predictive models

Cardiovascular diseases are responsible for a significant proportion of deaths in both the European Union and the United States, accounting for approximately 30% of total mortality. This highlights the substantial impact of these diseases on public health1,3. The primary cause of death worldwide and hospitalization is AMI. This cardiovascular disease has significant implications for public health, necessitating the development of predictive models using machine learning techniques to analyze mortality rates and identify factors that impact patient outcomes (3),(4). The COVID-19 pandemic highlighted the importance of maintaining high-quality acute care for patients with AMI. During this period, there were significant increases in AMI mortality rates, emphasizing the need for effective and timely medical intervention to mitigate adverse outcomes.3,6
In recent decades, advancements in technology, optimization of therapeutic approaches, implementation of preventive policies, improvements in pre-hospital care, and the establishment of guidelines have had a significant impact on reducing mortality rates and hospital stays in various medical conditions, including AMI. These efforts have contributed to improved patient outcomes and enhanced healthcare practices.3,7 AMI mortality rate after 30 days in the hospital, which is indicative of the quality of care and clinical interventions, exhibits significant variation among European Union (EU) countries. This suggests that the provision of care and clinical interventions for AMI patients differs across EU countries, leading to varying mortality outcomes within 30 days.8,9 The text states that the lowest 30-day in-hospital mortality rates for AMI are observed in countries such as The Netherlands, Sweden, Slovenia, Denmark, Poland, and Ireland, with rates below 5.0%. These variations in mortality rates among EU countries highlight the influence of different factors and healthcare systems on AMI outcomes.3 The mortality rate of AMI is influenced by various factors, as stated by the European Society of Cardiology. Several factors influence the risk of death, including age, sex, comorbidities, high heart rate, and changes in certain laboratory findings. Understanding and monitoring these risk factors is crucial in managing AMI patients and improving outcomes.10,11
During a medical emergency, it is crucial to manage factors that influence mortality in patients with AMI. Early identification of symptoms and prompt intervention can help prevent or delay the progression of the condition, potentially reducing the high mortality rate observed within the first few hours after symptom onset. This highlights the importance of timely medical care and interventions in improving outcomes for AMI patients12,13,14.
In the digital health era, the availability of vast amounts of data has opened up opportunities for leveraging machine learning (ML) and data mining algorithms to enhance clinical decision support. These technologies have the potential to analyze and interpret complex healthcare data, aiding in early screening, diagnosis, disease prevention, treatment management, and improved patient outcomes. In this study, ML and data mining algorithms are being used to develop a model for predicting mortality in patients with AMI.15 In the context of cardiovascular diseases, the use of machine learning (ML) and data mining algorithms has shown promise in various aspects of patient care, such as early screening, diagnosis, and disease prevention by identifying risk factors, treatment management, monitoring with improved pharmacovigilance and patient safety, and ultimately, improved outcomes and care provision. These advancements in ML have demonstrated their potential to outperform traditional statistical models in predicting patient mortality, readmission, and the occurrence of arrhythmia after AMI, across different populations and settings.13,19
Cardiovascular diseases are multifaceted and diverse, arising from a combination of genetic, environmental, and behavioral factors. Consequently, there is an increasing demand to analyze data from various sources, including administrative records, laboratory tests, and medical imaging, to interpret, diagnose, and make informed decisions regarding these conditions. This comprehensive data analysis approach enables a deeper understanding of cardiovascular diseases and facilitates personalized treatment strategies.10,11 In addition, data analysis in healthcare can lead to resource optimization, improved patient experiences, and enhanced interactions with healthcare organizations. By leveraging sophisticated technology, such as machine learning and data mining algorithms, waste reduction can be achieved, ensuring efficient use of resources and enhancing the overall patient journey. This can empower healthcare organizations to make informed decisions and provide better care outcomes.20,21,22
In recent years, there has been a significant focus on machine learning (ML) research in the context of AMI. This research primarily revolves around predicting patient mortality, patient readmission, and the occurrence of arrhythmia following an AMI. ML models have shown promising results in these areas, outperforming traditional statistical models and demonstrating their potential to improve risk assessment and patient outcomes in AMI cases.18,23,24,25
In recent years, machine learning (ML) research in AMI has primarily focused on predicting patient mortality, readmission, and the occurrence of arrhythmia. These ML models have demonstrated superior predictive capabilities compared to traditional statistical models, and their performance has been observed across various settings and populations, including Europe, the United States, and Asia, with a particular emphasis on predicting one-year or 30-day survival after AMI.19,23,24,26
The researchers aim to develop a predictive model for mortality in patients with AMI upon hospital admission in this study. They investigate the impact of incorporating cardiac test results, physiological data, and administrative data using machine learning techniques. The goal is to assess the predictive capability of these additional variables in improving mortality prediction for AMI patients. In the context of forecasting in-hospital mortality, this passage outlines three distinct methodologies. The initial approach, referred to as experiment 1, solely considers variables accessible at the time of admission. In experiment 2, we delve into the influence of supplementary data from laboratory results, comorbidity information, and the performance of surgical interventions, all of which can be gathered throughout the patient's hospitalization. Experiment 3, on the other hand, examines the integration of more precise pathology-related factors, including body mass index, symptomatology, the onset time of heart rate, ACS and the extent of injury across different segments. These approaches aim to enhance the accuracy of mortality prediction models by incorporating various factors and data collected at different stages of the patient's hospitalization.

Figure 1 showcases the comprehensive methodology employed in this study, encompassing a series of pivotal steps that lead to accurate predictions:

  • Collection of Data
  • Choosing of Input or Feature
  • Machine Learning Modelling
  • The predictive capability of assessment.
Let's dive into each step and unravel their significance

Data Source: This study utilized a Kaggle dataset, comprising data related to patients diagnosed with AMI. The dataset was employed as the foundation for conducting three distinct experiments aimed at predicting patient mortality.

Experimental Design: The research design consisted of three separate experiments, each utilizing a different machine-learning technique to assess its effectiveness in predicting mortality among AMI patients. These experiments aimed to compare the performance of the models under investigation.

Machine Learning Models: Three machine-learning models were employed in the experiments:
  1. Support Vector Machine (SVM)
    This model was utilized to classify patients into mortality categories. It was selected due to its strong classification capabilities and potential for handling complex datasets.

  2. Decision Tree (DT)
    The Decision Tree model was used to build a classification model based on the provided dataset. Decision Trees are known for their interpretability and are valuable for understanding feature importance.

  3. k-Nearest Neighbors (KNN)
    KNN was employed as a third classification model, with a focus on examining its performance in predicting patient mortality. KNN is a proximity-based algorithm that can be effective in certain scenarios.
Performance Metrics: The performance of each machine learning model was evaluated using a range of metrics, including but not limited. Here are several key metrics used to evaluate the performance of a machine-learning model:
  • Accuracy: This metric measures the overall correct classification rate, indicating how often the model's predictions are accurate across all classes.
  • Area under the ROC Curve (AUC): AUC assesses the model's discriminatory power and its ability to distinguish between positive and negative classes. It's particularly useful when dealing with imbalanced datasets.
  • Precision: Precision determines the model's ability to correctly classify positive cases. It calculates the ratio of true positives to the total predicted positives, emphasizing the accuracy of positive predictions.
  • Recall: Recall measures the model's capability to identify true positive cases. It calculates the ratio of true positives to the total actual positives, emphasizing the model's sensitivity to positive cases
  • F1-score: The F1-score combines precision and recall providing a balanced assessment of model performance. It is particularly useful when you want to strike a balance between precision and recall, and it's especially valuable in scenarios where class distribution is imbalanced.
These metrics help in evaluating different aspects of a machine learning model's performance, enabling a comprehensive understanding of its strengths and weaknesses.

Data Preprocessing: Before model training, data preprocessing was conducted, which included handling missing values, feature selection, and normalization. To facilitate the training and evaluation of the model, the data was partitioned into separate training and testing sets.
Evaluation: The models' performance was evaluated using the specified metrics, and the results were analyzed to determine the most effective model for predicting patient mortality in the context of AMI.

This section presents the outcomes of our study, focusing on the performance of three distinct machine learning models Decision Tree (DT), Support Vector Machine (SVM) and k-nearest Neighbors (KNN)—in the classification of a specific medical condition. We assessed these models using various evaluation metrics, including accuracy, the area under the ROC curve (AUC), confusion matrices, and classification reports.

Support Vector Machine (SVM) Model
The SVM model exhibited the highest level of accuracy among the three models, achieving an accuracy of approximately 87.66%. It demonstrated a robust ability to discriminate between the negative and positive classes, as evidenced by an AUC score of 0.796. In terms of precision, the SVM model showed a high precision of 0.92 for the negative class (0.0), indicating that it accurately predicted negative outcomes in the majority of cases. However, its precision for the positive class (1.0) was lower at 0.49, implying a higher rate of false positives for positive outcomes. The model demonstrated moderate recall for both classes, with higher recall for the negative class (0.94) compared to the positive class (0.43). The F1 scores also reflected the trade-off between precision and recall, with an F1 score of 0.93 for the negative class and 0.45 for the positive class.

Figure 2: Classification Report of SVM


Figure 3: ROC Curve of SVM Model


Figure 4: Confusion Matrix of SVM Model


Decision Tree (DT) Model
The Decision Tree model achieved an accuracy of approximately 83.55%, which, while slightly lower than the SVM model, still demonstrated competent classification performance. However, its AUC score of 0.640 indicated somewhat weaker discrimination between the two classes. The DT model showed a high precision of 0.91 for the negative class (0.0), reflecting a low false-positive rate. In contrast, its precision for the positive class (1.0) was relatively low at 0.34, indicating a higher rate of false positives for positive outcomes. The recall for the negative class was high at 0.90, while the recall for the positive class was 0.38, signifying a lesser ability to identify true positive cases. The F1 scores for both classes were moderate, with a higher score for the negative class (0.91) than for the positive class (0.36).

Figure 5: Classification Report of DT Model


Figure 6: ROC Curve of DT Model


Figure 7: Confusion Matrix of DT Model


k-Nearest Neighbors (KNN) Model
The KNN model achieved an accuracy of approximately 86.12%, positioning it between the SVM and DT models in terms of overall accuracy. However, it exhibited a major limitation in its inability to correctly classify any instances of the positive class (1.0), leading to a precision of 0.00 for the positive class. The model's recall for the negative class was high at 0.98, indicating a strong ability to capture true negative cases. Nonetheless, the recall for the positive class was 0.00, signifying a complete failure to identify any true positive cases. Consequently, the F1-score for the negative class was 0.93, highlighting the model's capacity to classify true negatives. However, the F1-score for the positive class was 0.00, underlining its inability to classify true positives.

Figure 8: Classification Report of k-NN Model


Figure 9 ROC Curve of k-NN Model


Figure 10: Confusion Matrix of k-NN Model Models

Result
The SVM model demonstrated superior overall performance among the three models, showcasing the highest accuracy and AUC score. It struck a balanced trade-off between precision and recall for both classes, making it a strong candidate for this classification task. Nonetheless, further refinement and optimization may be necessary to enhance the models abilities, particularly in correctly identifying positive cases. Additionally, the clinical implications of the model's performance should be considered, considering the potential consequences of false positives and false negatives in the context of the specific medical condition under study.



In this section, we will examine and analyze the outcomes derived from three distinct machine learning models: SVM, DT, and KNN. These models were evaluated on their performance in classifying a specific medical condition, with a focus on metrics such as accuracy, the area under the ROC curve (AUC), the confusion matrix, and the classification report.

Support Vector Machine (SVM) Model: The SVM model demonstrated the highest accuracy among the three models, achieving an accuracy of approximately 87.66%. The confusion matrix demonstrates that the model accurately classified 321 instances as the negative class (0.0) and 20 instances as the positive class (1.0). However, it misclassified 21 instances from the negative class and 27 instances from the positive class.
The precision-recall trade-off is evident in the classification report. The precision for the negative class (0.0) is relatively high at 0.92, indicating that when the model predicts a negative outcome, it is accurate 92% of the time. However, the precision for the positive class (1.0) is lower at 0.49, suggesting that the model is less accurate in predicting positive outcomes.
The recall for both classes is moderate, with a higher recall for the negative class (0.94) compared to the positive class (0.43). This indicates that the model is better at identifying true negative cases but less effective at capturing true positive cases.
The F1-score, which combines precision and recall, is 0.93 for the negative class and 0.45 for the positive class, reflecting the trade-off between the two classes.
The AUC score of 0.796 suggests that the SVM model performs reasonably well in distinguishing between the two classes. Overall, the SVM model exhibits a relatively strong discriminatory ability.

Decision Tree (DT) Model: The Decision Tree model achieved an accuracy of approximately 83.55%, which is slightly lower than the SVM model. In the confusion matrix, it is evident that the model correctly classified 307 instances belonging to the negative class and 18 instances in the positive class. However, it made misclassifications by assigning 35 instances to the negative class and 29 instances to the positive class erroneously.
In the classification report, the precision for the negative class (0.0) is high at 0.91, indicating a low false-positive rate. However, the precision for the positive class (1.0) is relatively low at 0.34, suggesting that the model has a higher rate of false positives for positive outcomes.
The recall for the negative class stands at 0.90, signifying that the model effectively captures a substantial proportion of true negative cases. Conversely, the recall for the positive class is 0.38, suggesting a reduced capability to correctly identify true positive cases.
The F1 scores for both classes are moderate, with a higher score for the negative class (0.91) compared to the positive class (0.36).
The AUC score of 0.640 suggests that the Decision Tree model's discriminatory performance is lower than that of the SVM model.

k-Nearest Neighbors (KNN) Model: The KNN model achieved an accuracy of approximately 86.12%, falling between the SVM and Decision Tree models. The confusion matrix indicates that it correctly classified 335 instances of the negative class but failed to correctly classify any instances of the positive class, resulting in a precision of 0.00 for the positive class.
The recall for the negative class is high at 0.98, indicating a strong ability to capture true negative cases. However, the recall for the positive class is 0.00, indicating that the model does not identify any true positive cases.
The F1-score for the negative class is 0.93, showcasing the model's proficiency in accurately classifying true negatives. In contrast, the F1-score for the positive class is 0.00, suggesting a complete inability to classify true positives.
In summary, the KNN model demonstrates high accuracy in identifying the negative class but performs poorly in identifying the positive class, resulting in a low overall AUC score.

Overall Comparison: In conclusion, the SVM model outperforms the Decision Tree and KNN models in terms of accuracy, AUC, and overall classification performance. The SVM model exhibits a good balance between precision and recall for both classes, making it a suitable choice for this classification task. However, further optimization and fine-tuning of these models may be necessary to improve their performance, particularly in identifying positive cases. Additionally, it is essential to consider the clinical implications of model performance in the context of the specific medical condition being studied and the potential consequences of false positives and false negatives.

In this study, we conducted a comprehensive analysis of three machine learning models Support Vector Machine (SVM), Decision Tree (DT), and k-nearest Neighbors (KNN)—to assess their efficacy in classifying a specific medical condition. Our evaluation considered various performance metrics, including accuracy, area under the ROC curve (AUC), precision, recall, and F1-score, to provide a holistic understanding of their capabilities.
Among the models evaluated, the Support Vector Machine (SVM) model emerged as the most promising candidate. It demonstrated the highest accuracy of approximately 87.66% and exhibited a robust ability to discriminate between negative and positive cases, as evidenced by its AUC score of 0.796. While the model excelled in accurately predicting negative outcomes (0.0) with a high precision of 0.

  1. Mansoor H, Elgendy IY, Segal R, Bavry AA, Bian J. Risk prediction model for in-hospital mortality in women with ST-elevation myocardial infarction: A machine learning approach. Hear Lung J Acute Crit Care [Internet]. 2017;46(6):405–11. Available from: https://doi.org/10.1016/j.hrtlng.2017.09.003
  2. Roth GA, Huffman MD, Moran AE, Feigin V, Mensah GA, Naghavi M, et al. Global and regional patterns in cardiovascular mortality from 1990 to 2013. Circulation. 2015;132(17):1667–78.
  3. OECD/European Union. Health at a Glance: Europe 2022: State of Health in the EU. Vol. 6011, Tuberculosis. 2020. 20812 p.
  4. Instituto Nacional de Estatística. Causas de morte 2020 (Dados provisórios). 2021.
  5. Pourasghari H, Tavolinejad H, Soleimanpour S, Abdi Z, Arabloo J, Bragazzi NL, et al. Hospitalization, major complications and mortality in acute myocardial infarction patients during the COVID-19 era: A systematic review and meta-analysis. IJC Hear Vasc [Internet]. 2022;41(May):101058. Available from: https://doi.org/10.1016/j.ijcha.2022.101058
  6. Yeo YH, Wang M, He X, Lv F, Zhang Y, Zu J, et al. Excess risk for acute myocardial infarction mortality during the COVID‐19 pandemic. J Med Virol [Internet]. 2023 Jan 7;95(1). Available from: https://onlinelibrary.wiley.com/doi/10.1002/jmv.28187
  7. Virani SS, Alonso A, Benjamin EJ, Bittencourt MS, Callaway CW, Carson AP, et al. Heart Disease and Stroke Statistics—2020 Update: A Report From the American Heart Association. Circulation [Internet]. 2020 Mar 3;141(9). Available from: https://www.ahajournals.org/doi/10.1161/CIR.0000000000000757
  8. 30-Day Acute Myocardial Infarction In-Hospital Mortality | CIHI. Available from: https://www.cihi.ca/en/indicators/30-day-acute-myocardial-infarction-in-hospi
  9. Moledina SM, Shoaib A, Sun LY, Myint PK, Kotronias RA, Shah BN, et al. Impact of the admitting ward on care quality and outcomes in non-ST-segment elevation myocardial infarction: insights from a national registry. Eur Hear J - Qual Care Clin Outcomes [Internet]. 2022 Sep 5;8(6):681–91. Available from: https://academic.oup.com/ehjqcco/article/8/6/681/6364357
  10. Ibanez B, James S, Agewall S, Antunes MJ, Bucciarelli-Ducci C, Bueno H, et al. 2017 ESC Guidelines for the management of acute myocardial infarction in patients presenting with ST-segment elevation. Eur Heart J [Internet]. 2018 Jan 7;39(2):119–77. Available from: https://academic.oup.com/eurheartj/article/39/2/119/4095042
  11. Collet JP, Thiele H, Barbato E, Barthélémy O, Bauersachs J, Bhatt DL, et al. 2020 ESC Guidelines for the management of acute coronary syndromes in patients presenting without persistent ST-segment elevation. Eur Heart J [Internet]. 2021 Apr 7;42(14):1289–367. Available from: https://academic.oup.com/eurheartj/article/42/14/1289/5898842
  12. Tsien CL, Fraser HSF, Long WJ, Kennedy RL. Using classification tree and logistic regression methods to diagnose myocardial infarction. Stud Health Technol Inform. 1998;52(Mi):493–7.
  13. Jiang F, Jiang Y, Zhi H, Dong Y, Li H, Ma S, et al. Artificial intelligence in healthcare: past, present and future. Stroke Vasc Neurol [Internet]. 2017 Dec;2(4):230–43. Available from: https://svn.bmj.com/lookup/doi/10.1136/svn-2017-000101
  14. Krittanawong C, Zhang H, Wang Z, Aydar M, Kitai T. Artificial Intelligence in Precision Cardiovascular Medicine. J Am Coll Cardiol [Internet]. 2017 May;69(21):2657–64. Available from: https://linkinghub.elsevier.com/retrieve/pii/S0735109717368456
  15. Pina A, Macedo MP HR. Clustering Clinical Data in R. In: Mat_thiesen R, editor. Mass Spectrometry Data Analysis in Proteomics. 2019;p. 309–43.(p. 309–43.).
  16. Pina AF, Meneses MJ, Sousa‐Lima I, Henriques R, Raposo JF, Macedo MP. Big data and machine learning to tackle diabetes management. Eur J Clin Invest [Internet]. 2023 Jan 5;53(1).
  17. Pina A, Helgadottir S, Mancina RM, Pavanello C, Pirazzi C, Montalcini T, et al. Virtual genetic diagnosis for familial hypercholesterolemia powered by machine learning. Eur J Prev Cardiol [Internet]. 2020 Oct 4;27(15):1639–46.
  18. Barrett LA, Payrovnaziri SN, Bian J, He Z. Building Computational Models to Predict One-Year Mortality in ICU Patients with Acute Myocardial Infarction and Post Myocardial Infarction Syndrome. AMIA Jt Summits Transl Sci proceedings AMIA Jt Summits Transl Sci [Internet]. 2019;2019:407–16.
  19. Wallert J, Tomasoni M, Madison G, Held C. Predicting two-year survival versus non-survival after first myocardial infarction using machine learning and Swedish national register data. BMC Med Inform Decis Mak [Internet]. 2017 Dec 5;17(1):99. Available from: http://bmcmedinformdecismak.biomedcentral.com/articles/10.1186/s12911-017-0500-y
  20. Shilo S, Rossman H, Segal E. Axes of a revolution: challenges and promises of big data in healthcare. Nat Med [Internet]. 2020 Jan 13;26(1):29–38. Available from: https://www.nature.com/articles/s41591-019-0727-5
  21. Mehta N, Pandit A, Shukla S. Transforming healthcare with big data analytics and artificial intelligence: A systematic mapping study. J Biomed Inform [Internet]. 2019 Dec;100:103311. Available from: https://linkinghub.elsevier.com/retrieve/pii/S1532046419302308
  22. Galetsi P, Katsaliaki K, Kumar S. Values, challenges and future directions of big data analytics in healthcare: A systematic review. Soc Sci Med [Internet]. 2019 Nov;241:112533. Available from: https://linkinghub.elsevier.com/retrieve/pii/S0277953619305271
  23. Payrovnaziri SN, Barrett LA, Bis D, Bian J, He Z. Enhancing prediction models for one-year mortality in patients with acute myocardial infarction and post myocardial infarction syndrome. Stud Health Technol Inform. 2019;264:273–7.
  24. Kasim S, Malek S, Cheen S, Safiruz MS, Ahmad WAW, Ibrahim KS, et al. In-hospital risk stratification algorithm of Asian elderly patients. Sci Rep [Internet]. 2022 Oct 20;12(1):17592. Available from: https://www.nature.com/articles/s41598-022-18839-9
  25. Zhang Z, Qiu H, Li W, Chen Y. A stacking-based model for predicting 30-day all-cause hospital readmissions of patients with acute myocardial infarction. BMC Med Inform Decis Mak [Internet]. 2020 Dec 14;20(1):335. Available from: https://bmcmedinformdecismak.biomedcentral.com/articles/10.1186/s12911-020-01358-w
  26. Lee W, Lee J, Woo S Il, Choi SH, Bae JW, Jung S, et al. Machine learning enhances the performance of short and long-term mortality prediction model in non-ST-segment elevation myocardial infarction. Sci Rep [Internet]. 2021;11(1):1–14. Available from: https://doi.org/10.1038/s41598-021-92362-1