Inspiration

One of our close relatives is a chronic cardiac patient. It was difficult for us to provide rapid and effective attention at times of abrupt strokes. We were also afraid of losing him due to a sudden heart failure, but by God's grace, everything is well. With this in the back of our thoughts, we considered developing a system that might predict such cardiac failures in order to prepare quick medical care for the patient, perhaps saving lives.

What it does

The software accepts the following user inputs:

  1. Age
  2. Gender
  3. Type of Chest Pain
  4. Diastolic Blood Pressure / Resting Blood Pressure
  5. Levels of Cholesterol
  6. Fasting Blood Sugar Levels
  7. Characteristics of the Resting ECG
  8. Highest Heart Rate
  9. Any Impact of Exercise-Induced Angina
  10. Oldpeak Value
  11. Characteristics of the ST Slope

Using these user inputs, the AI system within the program predicts if there is a possibility of heart failure and presents the prognosis on the screen.

How we built it

Initially, we obtained the dataset from IEEE's official database collection. Then we had to do a thorough examination of the dataset and each component inside it, as well as what each component or attribute means and symbolizes, and how the output attribute is reliant on each other attribute.

The following goal was to select an algorithm to forecast our output. We created a way for selecting our algorithm. A collection of algorithms was chosen, and each one was implemented using a model. Among the algorithms were:

  1. Regression Logistic
  2. Tree of Decision
  3. Forest at Random
  4. Additional Trees
  5. KNN (K-Nearest Neighbors)
  6. SVM (Support Vector Machine)
  7. Gaussian Naive Bayes Model

As a result, we determined that the best-suited model was SVM (Support Vector Machine).

The next step was to create an app to carry out the work. We used Python's Tkinter to develop the app's user interface and implemented the SVM algorithm. So, all the user has to do is enter the information and click the submit button, and the prediction will appear on the screen.

Challenges we ran into

We started with two models that performed well in terms of accuracy: SVM and Extra Trees. The Extra Trees model, on the other hand, showed different degrees of accuracy (at times equal to or better than SVM and during other times worse than SVM). We modified the test-train ratio from 35:65 to 1:99 to get clarity on which method to use. Extra trees revealed different accuracies in the new ratio, but with a high of 90%. SVM and KNN demonstrated a maximum accuracy of 90%. We now have a better idea of what to choose. SVM was chosen over Extra Trees because it is a more stable model.

Even though it was more stable, as in the 35:65 ratio, the KNN model was less efficient than the SVM model. SVM performed well in general.

Accomplishments that we're proud of

  1. We developed an AI model with a 90% accuracy rate.

  2. We also created an app with a good user interface for the AI model, where the user can enter all of the details and obtain the forecast with the click of a button.

  3. The software runs on any computer-based platform, even if Python is not installed.

What we learned

  1. We learned about the numerous variables that might influence or cause heart disease and lead to heart failure.

  2. We gained a thorough knowledge of all the biology-related theoretical concepts needed for the research.

  3. We gained a thorough comprehension of numerous AI methods and models, as well as the ability to implement them in Python.

  4. We also investigated many novel approaches to showing attribute interdependence in the form of various graph designs.

  5. We considered all strategies for creating the user interface and had a thorough grasp of each one.

What's next for Heart Failure Predictor

We have now completed the fundamental software (level 1). The way forward for increasing usability, user-friendliness and effectiveness would be as follows.

Level 2:- Include additional criteria such as systolic blood pressure, cardiac muscle injury or weakness, the patient's location of residency, body-mass index (BMI), recommended dietary allowances (RDA), and any genetic component, as well as several degrees of risk.

Level 3:- Incorporate live data from the patient to create a continuous monitoring system.

Level 4:- Provide preventative steps for the patient based on the patient's risk level and tailored data.

Limitations & Solutions

The accuracy threshold was set at 90% due to a restricted dataset and many incorrect data points. The only approach to solve this and significantly improve accuracy is to create the dataset yourself. Using this approach, we may appropriately mine the data, filter it, and augment the dataset to meet our objectives.

PS: To obtain the complete code with the ".exe" application file please use the link provided below or the first link in the "Try it out" links section link

Built With

  • google-colab
  • python
  • python-numpy
  • python-plotly
  • python-pyplot
  • python-seaborn
  • python-sklearn
  • python-tkinter
  • text-editor-atom
Share this project:

Updates