Inspiration

Cardiovascular diseases remain one of the leading causes of death worldwide, yet many cases can be prevented through early detection and lifestyle awareness. We wanted to create a solution that empowers individuals and healthcare providers to predict cardiovascular risk using data-driven insights — turning raw health data into actionable prevention.

What it does

Hack4Health is a machine learning–powered web app that predicts the likelihood of cardiovascular disease based on key health indicators such as age, blood pressure, cholesterol, glucose levels, and lifestyle habits. Using a trained Random Forest model, the app provides users with a risk prediction and probability score, helping support proactive heart health decisions.

How we built it

Collected and cleaned the dataset (cardiac_failure_processed.csv) with over 70,000 records.

Removed invalid entries and performed preprocessing: scaling, encoding, and normalization.

Trained a Random Forest Classifier using scikit-learn, achieving 71.15% accuracy and an ROC AUC score of 0.77.

Saved the model with joblib and deployed it using Streamlit for an interactive user interface.

The app takes user input (e.g., age, blood pressure, cholesterol) and returns an instant disease risk prediction.

Challenges we ran into

Handling inconsistent and implausible data values (e.g., incorrect blood pressure readings).

Maintaining feature consistency between training and deployment (model input mismatches).

Optimizing model accuracy while preventing overfitting.

Integrating preprocessing pipelines for real-time prediction in Streamlit.

Accomplishments that we're proud of

Built a fully functional AI-based cardiovascular risk prediction app.

Achieved a balanced model performance (Precision 0.71, Recall 0.69, F1 0.70).

Created a clean, user-friendly Streamlit interface for real-time predictions.

Learned to handle real-world data preprocessing, model persistence, and deployment.

What we learned

The importance of data quality in health-based machine learning.

How to use pipelines, feature scaling, and encoding effectively.

Integrating ML models into an accessible web interface.

Balancing recall and precision for medical predictions.

What's next for Hack4Health

Improve model accuracy using ensemble learning or gradient boosting.

Integrate additional parameters such as ECG data or lifestyle trends.

Develop an API version for integration with healthcare platforms or wearables.

Add visual explanations (SHAP plots) for transparency in predictions.

Deploy on a cloud platform (AWS, GCP, or Streamlit Cloud) for global accessibility.

Built With

  • numpy==1.26.4
  • pandas==2.2.0
  • python
  • scikit-learn==1.4.0
  • streamlit==1.31.0
Share this project:

Updates