Introduction
As per the World Health Organisation (WHO), Cardiovascular Diseases (CVDs) are the leading cause of death globally. An estimated 17.9 million lives were lost in 2019 due to CVDs, accounting for 32% of all deaths worldwide. Of these deaths, 85% were due to heart attacks and strokes, and 38% of these deaths occurred prematurely in people under 70 years of age[1]. In recent years, an alarming spate of sudden deaths of serving soldiers due to cardiac arrest has been reported in the media [2]. Armed Forces personnel who are at high cardiovascular risk due to one or more risk factors, such as hypertension, diabetes, and hyperlipidemia, need early detection and management of heart disease. Artificial Intelligence (A.I.) can be leveraged to assist military doctors in the early detection of heart disease in combatants, which can potentially save many precious lives. With this as motivation, the author has developed a prototype web-based A.I. Diagnostic Decision Support System (DDSS) for the early detection of heart disease. The system performed with 91% accuracy on the test data. It is proposed that the prototype AI DDSS be test bedded in the Army Research and Referral Hospital (AHRR). Once the system is successfully evaluated, it can be deployed in military hospitals as a virtual medical assistant to service doctors for making data-driven decisions in early risk prediction of deadly heart disease in combatants.
Applied and Explainable A.I. (XAI)
Applied A.I. begins with first identifying real-world problems or use cases and the associated historical data. It then involves the methodical application of A.I. algorithms on the historical data to generate insights, perform predictive analytics and make data-driven decisions towards finding solutions to those problems. Often predictions made by A.I. or Machine Learning (ML) models are challenging to explain, and so these models were erstwhile called ‘black-box’ models. These black box models shall take inputs and generate an output without giving any plausible reasoning or explanation for doing so. On the contrary, Explainable A.I. (XAI) gives us an ingenious ability to explain the outputs of ML models, thus turning these ‘black boxes’ into ‘white boxes. Each output or prediction made by the ML model can now be explained, thus making the model more interpretable. Apropos, XAI boosts confidence and trust levels when exploiting A.I. for predictive analytics in health care and other critical domains where outputs need explanation.
ML Modeling, Training, and Evaluation
To develop an effective ML model for predicting the risk of heart disease, there was a need first to acquire historical data on patients who were diagnosed with heart disease. The dataset for the ML model has been obtained from Kaggle[3] and the University of California Irvine (UCI) online machine learning repositories[4]. The dataset is an aggregation of patient data contributed by four hospitals viz the Hungarian Institute of Cardiology in Budapest, the University Hospital in Zurich (Switzerland), the University Hospital in Basel (Switzerland), and the V.A Medical Centre, Long Beach and Cleveland Clinic Foundation (USA). The dataset comprises 918 samples, out of which 508 samples are labelled with heart disease, and the remaining 410 samples are labelled with no heart disease. Each data sample in the dataset has 11 attributes or features of a patient, as explained below.
- Age (in years)
- Sex (Male/ Female)
- Chest pain type (Typical Angina/Atypical Anginal/ Non-Anginal Pain/Asymptomatic)
- Resting blood pressure on admission to the hospital (in mmHg)
- Cholesterol (in mg/dl)
- Fasting blood sugar > 120 mg/dl (True/ False)
- Resting ECG results (regular/having ST-T wave abnormality (T wave inversions and S.T. elevation or depression > 0.05 mv/ showing probable or definite left ventricular hypertrophy by Estes’ criteria)
- Maximum heart rate achieved
- Exercise-induced angina (Yes/ No)
- T. depression induced by exercise relative to rest
- The slope of the peak exercise S.T. segment (Up Sloping/Flat/Down Sloping)
- Heart disease (Yes/ No) – Target label
The dataset was split into a training set (818 samples) for training the ML model and a test set (100 samples) for evaluating the performance of the trained model. The datasets were pre-processed, and a ‘Logistic Regression’ ML model was fitted on the pre-processed training dataset. During training, the model estimated the importance of different features which had impacted the model’s output. The importance scores of different features are ordered, and the same is depicted in figure 1 below.
Figure 1: Feature Importance Plot
On studying the feature importance plot, it is evident that during the process of mapping the input features to the labelled output (heart disease/ no heart disease), the model learned that ‘Asymptomatic Chest Pain’ was the most important feature followed by ‘Slope of Peak Exercise S.T. Segment (Flat/Up)’ feature and then the ‘Fasting Blood Sugar < 120 mg/dl’ feature. Consequently, the model has automatically learned and ranked the importance of these features, thus giving us a global insight into the relative importance of causative factors contributing to the risk of heart disease.
Subsequently, the trained ML model was evaluated on the test dataset comprising 100 ‘unseen’ samples. Overall, the model correctly predicted the outputs of 91 out of 100 test samples, thus achieving a prediction accuracy of 91%. Precision is defined as the percentage of correct predictions made by the model for each class (heart disease or no heart disease). The model achieved precision scores of 97% (33 out of 34) and 88% (58 out of 66), corresponding to no heart disease and heart disease, respectively. Recall or sensitivity is defined as the percentage of predictions made by the model which were correct for each class. The model achieved sensitivity scores of 80% (33 out of 41) and 98% (58 out of 59), corresponding to no heart disease and heart disease, respectively. The F1 score metric combines both precision and sensitivity scores by calculating their harmonic means. The model achieved F1 scores of 0.88 and 0.93 for no heart disease and heart disease, respectively. The ‘confusion matrix’ (model predictions vs ground truth) and the classification report are given in table 1 and table 2, respectively.
Table 1: Confusion Matrix
Table 2: Classification Report
A.I. Heart Disease Diagnostic Decision Support System
Using the above trained ML model, a web-based A.I. Disease Diagnostic Decision Support System (DDSS) application for predicting the risk of heart disease in patients was developed with a user-friendly Graphical User Interface (GUI). A screenshot of the front-end GUI of the application is depicted in figure 2.
Figure 2: Application GUI
The user can input the attributes of a patient through the GUI and then click on the ‘Predict’ button to get the heart disease risk prediction profile. The application predicts the risk probabilities of heart disease along with a bar chart. To meet the requirement of ‘explainability’, a line chart depicting contributions made by the relevant features towards arriving at the model’s prediction output is also displayed to the user. For a better understanding of the application, let us consider the following two test cases.
- Case 1: High-Risk
The user entered the following attributes of a patient through the GUI
On clicking the ‘Predict’ button, the model predicted that the patient had a 94 % chance of suffering from heart disease. The prediction probabilities are given as a bar chart (green) in figure 3. A line chart, just below the bar chart, ‘explains’ the predictions made by the model in this instant case. The red colour portion of the line chart depicts the positive contributions made by the relevant features, thus taking the model output in a positive direction (high risk of heart disease), while the blue portion shows the negative contributions made by the relevant features pushing the model’s output towards the negative direction (low risk of heart disease). In this instant case, ‘Flat S.T. Slope’, ‘No Upward S.T. Slope’, ‘Asymptomatic Chest Pain’ and ‘Exercise-Induced Angina’ features have positively contributed towards the model’s output, while ‘Fasting Blood Sugar < 120 mg/dl’ was the most relevant feature contributing towards the model’s negative output. As a result, the model generated resultant output between 2.5 and 3.0, thus classifying the patient in the high-risk category.
Figure 3: Risk Probabilities and Explainability Plots (High-Risk Case)
- Case 2: Low-Risk
The user entered the following attributes of a patient through the GUI
On clicking the ‘Predict’ button, the model predicted that the patient has only an 11 % chance of suffering from heart disease. The prediction probabilities are given as a bar chart (green) in figure 4. A line chart below the bar chart ‘explains’ the predictions made by the model in this instant case. The relevant features like ‘Upward S.T. Slope’, ‘No Asymptomatic Chest Pain’, ‘No Flat S.T. Slope’ and ‘Non-Anginal Chest Pain’ have negatively contributed, thus taking the model’s output towards the low-risk zone while negating the effects of positive contributing features. The resultant model output was between -2.5 and -2.0, thus classifying the patient in the low-risk category.
Figure 4: Risk Probabilities and Explainability Plots (Low-Risk Case)
Way Forward
- Artificial Intelligence DDSS for heart disease risk prediction is a prototype web application that is proposed to be deployed in the Army Research and Referral Hospital (AHRR) for test-bedding under the supervision of a senior cardiologist.
- During the test trials, historical medical records of patients who had suffered cardiovascular diseases and undergone treatment can be made available to augment the ML dataset. Thereafter, the ML model can be re-trained on the augmented dataset and re-evaluated. It is expected that the performance of the ML model will enhance in terms of prediction accuracy as it is believed that more quality data generally enhances the ML model’s learning ability.
- After successful test-bed trials, the AI DDSS can be deployed in military hospitals as a virtual medical assistant to service doctors for making data-driven decisions in early risk prediction of deadly heart disease in combatants.
Conclusion
In recent years, there has been a spike in the number of cases of sudden death due to cardiac arrest in serving soldiers leading to undesirable non-war fatalities and loss of precious lives. Thus, there is a need to find solutions to the problem at hand. Besides several remedial steps which are already being instituted to arrest the menace in the environment, A.I. can be leveraged to a great extent for early detection of the risk of cardiovascular disease in combatants. The prototype AI DDSS System for early risk prediction of heart disease is an effort towards this direction. The system needs to be validated in the field in a premier military research hospital such as AHRR. In addition, there is a need to drive the digitisation of historical and current medical records in our military hospitals. This will lead us to garner a wealth of insights and predictive analytics capability through A.I. for making data-driven decisions in combat health care.
Notes
a) “Spate of sudden deaths by heart attack among middle-ranking Army officers puts the spotlight on stress, fitness” – Indian Express, 29 September 2020.
b) “Army man dies of cardiac arrest in J&K’s Uri” – Early Times, 20 April 2020.
c) “Armed Forces personnel dies of cardiac arrest during a military operation in south Kashmir’s Shopian” – Free Press Kashmir, 12 December 2020.
d) “Army officer, who died of cardiac arrest, cremated with military honours in Jammu” – The Hindu, 21 February 2021.
e) “Army JCO dies of cardiac arrest”- Kashmir Life.net, 05 January 2022.
f) “Army personnel from Budgam dies of cardiac arrest in Ladakh” – thekashmirwala.com, 22 February 2022.
g) “Soldier from Gokak dies due to cardiac arrest” – Deccan Herald, 14 September 2022.
h) “Subedar dies of cardiac arrest during the 30-km run in Hyderabad” – Telangana Today, 02 November 2022.
3. https://www.kaggle.com/datasets/fedesoriano/heart-failure-prediction.