1 of 32

Acute Ischemic Stroke Prediction

Group 4

​

Alekya Yakama, Ritvik Chebolu, Ganesh Sandeep,

Murali Krishna, Sai Tulasi Kamma

​

2 of 32

Table Of Contents

  • Introduction
  • Problem Description
  • Dataset Description
  • Data Preparation
  • Data Visualization
  • Model Building
  • Fine Tuning
  • Result and Analysis
  • References

3 of 32

Introduction

  • An acute ischemic stroke occurs when blood flow through a brain artery is blocked by a clot, a mass of thickened blood.
  • Clots can either be thrombotic or embolic, depending on their location of development inside the body.
  • A thrombotic stroke, the most common of the two, occurs when a clot forms within an artery in the brain.

4 of 32

Problem Statement

Cerebrovascular accident or stroke is a life-threatening neurological disorder. It accounts for more than 50% of people hospitalized. Recent studies predict that in the coming decade, strokes might emerge as the second leading cause of morbidity and mortality in several developed countries. Our goal is to predict the acute ischemic stroke severity using medical features like GCS, Serum Albumin and SSS Score .

​

5 of 32

About our Dataset

  • Our dataset is a compilation of 200 data-points that was collected by post-graduate doctors from a hospital (Gandhi Medical Hospital, Hyderabad) in India, in the year 2020.
  • This data was collected from patients who reported to have experienced an acute ischemic stroke (brain stroke in simple terms) and were admitted in the hospital.
  • The dataset contains several medical factors that could possibly be the critical factors influencing the severity of these hemorrhagic stroke in patients.

6 of 32

The above image indicates all the necessary information regarding the dataset at a glance.

7 of 32

A snippet of first ten records of dataset.

8 of 32

Data Wrangling

  • We prepare the data to train the ML model firstly by converting the categorical columns into numerical columns.
  • The data provided is of real time and it is utmost perfect without existence of missing values or duplicates.
  • Then, we randomly split the data for training and testing in the ratio 75:25.
  • Our next step was feature engineering, where we dropped a few insignificant columns like Name, Patient ID, Sl No, Addictions and Comorbid conditions.
  • Though the data seemed to be clean, we had a troublesome time while applying One Hot Encoding to a addictions and comorbid conditions columns in the dataset.
  • Label encoding has been performed on the required columns like Sex and Stroke_Severity.
  • Since we had a small of 200 patients, we used k-fold cross validation so that we do not lose a portion of the data for training.

9 of 32

Data Visualization

  • Used sweet viz, seaborn, matplotlib, pandas_profiling libraries for data visualization of the features present in dataset
  • Through data visualization correlations , missing values and interactions of variables are acquired
  • Heat maps are generated for entire data frame to analyze relationships between the multiple features at a higher dimensional space

​

10 of 32

Heatmap showing correlation coefficients between all features of the dataset

11 of 32

Distribution of Serum Albumin, a feature that greatly impacts the Stroke severity

12 of 32

Model Building

Models Used to predict Severity of Stroke

  • Logistic Regression Classifier
  • K Nearest Neighbors Classifier
  • Gaussian Naive Bayes
  • Bernoulli Naive Bayes
  • Support Vector Classifier
  • Decision Tree Classifier
  • Random Forest Classification
  • Extreme Gradient Boosting Classifier

13 of 32

Logistic Regression

  • Logistic regression model identifies a relationship between the predictor variables and response categorical variables.
  • It helps to estimate a probability of falling into a certain level of the categorical response based on the given set of predictors and assigning weights to each feature.

​

​

14 of 32

K-Nearest Neighbors

  • K-Nearest Neighbours(KNN) is an relatively simple classifier which uses similarity function to perform classification.
  • The similarity is defined according to a distance metric between two data points like euclidean distance whose mathematical formula is as follows.

​

15 of 32

Gaussian Naive Bayes

  • A Naive Bayes classifier works basis on the Naive Bayes mathematical algorithm so the Gaussian Naive Bayes is derived as one such classifier but with Gaussian distribution.
  • Gaussian is the easiest to find out the mean and the standard deviation from the training data and it is also suitable to continuous data.

​

16 of 32

Bernoulli Naive Bayes

  • Bernoulli Naive Bayes model is an acquisition of Naive Bayes classifier .
  • It predicts the probability of input being classified for all the classes.
  • This model is based on Bayes theorem and conditional probability.
  • All features are given equal importance in this classifier. But each feature should be independent of the rest of the features.

17 of 32

Support Vector Classifier

  • An SVM model is a general representation of different classes in a hyperplane in multidimensional space. Hyperplanes are generated in an iterative manner in order to reduce the error.
  • The end goal of an SVM classifier is to divide the dataset into classes to find a maximum marginal hyperplane.
  • SVM algorithm is implemented with kernel that transforms an input data space into the required form.

18 of 32

Decision Tree Classifier

  • This tree directly aims to reduce the entropy (or simply improvement in MSE) at each node split.
  • Solely focuses on achieving low bias (trying to maximally overfit the training data), whereas bagging methods like Random Forest tries to achieve low variance.

19 of 32

Bias and Variance comparison [1]

20 of 32

Bias - Variance tradeoff [2]

21 of 32

Random Forest Classifier

  • Bagging method (bootstrapping) where several trees with all possible splits are considered as models (with given tree depths) and aggregated to build a model with enhanced accuracy.
  • Unlike the greedy decision tree, random forest considers all possible scenarios for split at each node in the trees and aggregates with weights for trees with greater accuracy.

22 of 32

Extreme Gradient Boosting Classifier

  • Boosting method where the output of one tree is input into another to make a stronger ensemble model.
  • Several weaker models are joined together to eventually build a model with better performance.
  • Typically used for accurate results in cases of high bias.

23 of 32

Hyper-parameter Optimization or Fine -Tuning

  • These are adjustable parameters that must be tuned in order to obtain a model with optimal performance.
  • For example, these include max tree depth and n estimators for random forest and entropy for decision trees.
  • A parameter grid will be built which includes a range of possible values for the said hyperparameters in order to check at which value the maximized accuracy can be obtained by the model.

24 of 32

Grid Search CV

  • A tuning technique that attempts to compute the optimum values of hyperparameters.
  • This method takes in grids with designated spacings and computes the accuracy of the ML models at all these grid points to arrive at the best model and makes a note of its hyperparameter.

25 of 32

Creating an Ensemble out of the tuned ML models…

We now have the hyper-parameter optimized ML models to make predictions.

​

BUT WHAT IF WE COULD GET MUCH IMPROVE THE ACCURACY BEYOND WHAT THESE MODELS CAN ACHIEVE ALONE?

​

This is a method of boosting where multiple weak models (lesser accuracy) are considered and boosted by aggregating these less accurate models to end up with better predictions than all the weaker models.

26 of 32

The Ensemble Model - A Voting Classifier

  • A Voting Classifier is a machine learning model that trains on an ensemble of various other models and predicts an output based on their highest probability of chosen class as the output.
  • It aggregates the findings of each classifier passed into Voting Classifier and predicts the output class based on the highest majority of voting.
  • Soft voting the output class is the prediction based on the average of probability given to that class.
  • NOTICE HOW THE ACCURACY, F1 & RECALL INCREASED COMPARED TO OUR BEST MODEL (XGBOOST)?

27 of 32

Analysis of this Study

  • From the correlation heatmap, we find that Stroke Severity is very strongly correlated to GCS (Glasgow Coma Scale) and SSS (Siriraj Stroke Score).
  • Also, we find that the Stroke severity is dependent on a few other factors like Serum Albumin, age and MRS Score (Modified Rankin Score).
  • This study also supports to some extent that there is a correlation between nicotine addiction and the stroke severity.
  • Also, the Disability which is an after-effect of the stroke, seems to be moderately correlated to the Stroke severity.
  • It might seem that the data is imbalance as there are no patients with smaller data. However, it is unlikely that such a stroke is observed in the younger population.

28 of 32

Inferences from this Project

  • An array of 9 ML models were created and trained on the training data to make predictions.
  • XGBoost Classifier shows max accuracy among all the models due to its boosting technique (but could also lead to overfitting).
  • We then move on to build an ensemble model (Voting Classifier) using the ML models that are better predictors (those with higher accuracy).
  • This ensemble model eventually serves the purpose of achieving better F1 score, accuracy, precision and recall.

29 of 32

Summary of all 8 ML models

30 of 32

Conclusion

  • Through analysis and data visualisation it was understood the various unheard features impacting the severity of a brain stroke.
  • In this project machine learning ensemble is build to perform classification through which we attained at 97.5% accuracy in predicting the different levels of severity of it like mild, severe and death.
  • Generally in projects related to healthcare the expected accuracy is 99% but we tried to achieve high accuracy with just 200 records of data by combining five well performing machine learning classifiers.
  • Future possibility is to build and train various other models and gather a larger dataset to create a more powerful ensemble in order to attain higher accuracy.

31 of 32

References

  1. Random Forests and the Bias-Variance Tradeoff | by Prratek Ramchandani
  2. Bias-Variance Tradeoff | TowardsDataScience

​

32 of 32

Thank You