Try the Application Here β‘οΈ https://cardiovascular-risk-prediction-using.onrender.com
Interface.Demo.Video.mp4
An intelligent healthcare prediction platform that combines
Machine Learning + H2O AutoML + Explainable AI + Streamlit + Docker Deployment
Cardiovascular diseases remain one of the leading causes of death globally.
Early prediction and preventive healthcare can significantly improve patient outcomes and reduce mortality.
This project presents an AI-powered Cardiovascular Risk Prediction System capable of:
- π§ Predicting cardiovascular disease risk in real-time
- β‘ Automatically training multiple machine learning models using H2O AutoML
- π Explaining AI predictions using SHAP Explainable AI
- π Delivering predictions through an interactive Streamlit dashboard
- βοΈ Deploying seamlessly using Docker on Render Cloud Platform
The system transforms raw health metrics into meaningful medical intelligence.
Traditional healthcare prediction systems face several challenges:
- β Manual diagnosis processes
- β Limited real-time prediction systems
- β Black-box AI models with no explainability
- β Lack of accessible healthcare intelligence platforms
- β Difficulty interpreting ML-based medical decisions
This project solves these challenges using:
β
AutoML for intelligent model selection
β
Explainable AI for transparency
β
Real-time prediction system
β
Cloud-based deployment
β
Interactive healthcare dashboard
The proposed system integrates:
- Uses H2O AutoML
- Automatically trains and compares multiple models
- Selects the best-performing algorithm
- Generates accurate real-time predictions
Using SHAP (SHapley Additive Explanations):
- Explains why predictions are high-risk or low-risk
- Shows feature contribution importance
- Improves transparency in medical AI systems
Built using Streamlit:
- Real-time cardiovascular prediction
- BMI calculation
- Health metric visualization
- User-friendly interface
flowchart TB
%% USER LAYER
A[User Inputs Health Metrics]
%% FRONTEND
A --> B[Streamlit Frontend Dashboard]
%% PREPROCESSING
B --> C[Data Preprocessing Pipeline]
C --> C1[Missing Value Handling]
C --> C2[BMI Calculation]
C --> C3[Feature Encoding]
C --> C4[Data Transformation]
%% AUTOML
C --> D[H2O AutoML Engine]
D --> D1[Random Forest]
D --> D2[Gradient Boosting Machine]
D --> D3[XGBoost]
D --> D4[Deep Learning]
D --> D5[Stacked Ensembles]
%% MODEL EVALUATION
D --> E[Leaderboard Evaluation]
E --> F[Best Performing Model]
%% PREDICTION
F --> G[Prediction Engine]
G --> H{Cardiovascular Risk Classification}
H -->|Low Risk| I[Healthy Prediction]
H -->|High Risk| J[High Risk Alert]
%% EXPLAINABILITY
G --> K[SHAP Explainable AI]
K --> K1[Feature Importance]
K --> K2[SHAP Visualization]
K --> K3[Prediction Interpretation]
%% OUTPUT
I --> L[Final Dashboard Output]
J --> L
K --> L
%% DEPLOYMENT
L --> M[Docker Container]
M --> N[Render Cloud Deployment]
flowchart LR
A[Prediction Model] --> B[SHAP Explainer]
B --> C[Feature Contribution Analysis]
C --> D1[Age Impact]
C --> D2[Blood Pressure Impact]
C --> D3[BMI Impact]
C --> D4[Cholesterol Impact]
D1 --> E[Prediction Explanation Dashboard]
D2 --> E
D3 --> E
D4 --> E
| Category | Technologies |
|---|---|
| Programming Language | Python 3.10 |
| Frontend | Streamlit |
| Machine Learning | H2O AutoML |
| Explainable AI | SHAP |
| Data Processing | Pandas, NumPy |
| Visualization | Matplotlib, Seaborn |
| Deployment | Docker, Render |
| Version Control | Git & GitHub |
| ML Algorithms | GBM, Random Forest, XGBoost, Ensembles |
The system uses a cardiovascular healthcare dataset containing approximately 70,000 patient records.
| Feature | Description |
|---|---|
| Age | Patient Age |
| Gender | Male / Female |
| Height | Height in cm |
| Weight | Weight in kg |
| ap_hi | Systolic Blood Pressure |
| ap_lo | Diastolic Blood Pressure |
| Cholesterol | Cholesterol Level |
| Glucose | Glucose Level |
| Smoke | Smoking Status |
| Alcohol | Alcohol Consumption |
| Active | Physical Activity |
| BMI | Body Mass Index |
| Cardio | Target Variable |
- Handling missing values
- Removing duplicates
- Outlier filtering
- BMI feature engineering
- Data normalization
- Feature encoding
The system automatically trains:
- π² Random Forest
- π Gradient Boosting Machines
- β‘ XGBoost
- π Stacked Ensembles
- 𧬠Deep Learning Models
- Hyperparameter tuning
- Cross-validation
- Model ranking
- Leaderboard generation
User Input
β
Feature Engineering
β
H2O AutoML Leader Model
β
Risk Prediction
β
SHAP Explainability
β
Dashboard Visualization
- Real-time prediction
- AutoML-powered intelligence
- Leader model selection
- BMI calculator
- Blood pressure monitoring
- Cholesterol evaluation
- Glucose analysis
- Risk score generation
- SHAP feature importance
- Transparent AI decisions
- Risk interpretation
- Dockerized architecture
- Render cloud hosting
- Production-ready deployment
Health Data Input
β
Streamlit Dashboard
β
Data Preprocessing
β
H2O AutoML Model
β
Prediction Engine
β
SHAP Explainability
β
Risk Visualization Dashboard
| Metric | Score |
|---|---|
| Accuracy | ~73%+ |
| AUC Score | ~0.80 |
| Best Models | GBM / Ensemble Models |
- π ROC Curve
- π₯ Correlation Heatmap
- π Histograms
- π Scatter Plots
- π¦ BMI Distribution Plot
- π§ Feature Importance Graphs
- β Confusion Matrix
git clone https://github.com/Keerthishreekesavan/AutoML-and-XAI-for-Cardiovascular-Risk-Predictioncd AutoML-and-XAI-for-Cardiovascular-Risk-Predictionpython -m venv venvsource venv/bin/activatevenv\Scripts\activatepip install -r requirements.txtstreamlit run app.pystreamlit
pandas
numpy
matplotlib
seaborn
h2o==3.46.0.6
shap
scikit-learn
xgboost
lightgbmdocker build -t cardio-risk-app .docker run -p 8501:8501 cardio-risk-app- Push project to GitHub
- Create new Render Web Service
- Select Docker Environment
- Connect GitHub repository
- Deploy application π
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN apt-get update && apt-get install -y default-jdk
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]Cannot find Java
Install Java runtime or use Docker image with OpenJDK.
Found version X, running version Y
Use identical H2O versions for training and deployment.
Avoid:
applymap()Use:
map()- π± Mobile Application
- 𧬠Deep Learning Integration
- β Wearable Device Support
- π₯ Hospital EHR Integration
- π Personalized Healthcare Recommendations
- π Multi-Disease Prediction Platform
- βοΈ CI/CD Pipeline Integration
This project is intended for:
- Educational purposes
- Research applications
- Health awareness
π« This is NOT a substitute for professional medical diagnosis.
Always consult certified healthcare professionals for medical advice.
- π Live Demo: https://cardiovascular-risk-prediction-using.onrender.com
- π» GitHub: https://github.com/Keerthishreekesavan/AutoML-and-XAI-for-Cardiovascular-Risk-Prediction
- βΉοΈ LinkedIn: https://www.linkedin.com/in/keerthishreekesavan/
This project is licensed under the MIT License.
See the LICENSE file for more information.
If you like this project:
- β Star this repository
- π΄ Fork the project
- π Report issues
- π Contribute improvements