About CardioSense: AI-Powered Cardiovascular Risk Prediction Inspiration Every 34 seconds, someone dies from heart disease often because risk is detected too late. As a student passionate about healthcare AI, we wanted to build a tool that not only predicts cardiovascular risk but also explains its predictions. The UCI Heart Disease dataset (303 patients, 14 features) provided a perfect starting point to demonstrate how machine learning can assist clinicians.
What we Learned Model comparison matters – different algorithms (Random Forest, Gradient Boosting, Logistic Regression) have different strengths; showing all three builds trust.
Interpretability – feature importance (e.g., thalach and cp as top predictors) is as valuable as accuracy.
Full‑stack integration – connecting a Flask API with a React frontend, containerising with Docker, and deploying on Hugging Face Spaces taught me practical MLOps.
How we Built It Backend: Flask REST API serving three scikit‑learn models trained on the Cleveland dataset.
Frontend: React + Tailwind CSS + Recharts for a responsive, medical‑friendly dashboard.
Deployment: Dockerised and hosted on Hugging Face Spaces (free tier).
Batch mode: CSV upload for bulk predictions, returning a downloadable results table.
Challenges Faced Class imbalance – addressed with class_weight='balanced' and stratified cross‑validation.
Model consistency – ensuring all three models receive the same scaled features via a shared StandardScaler.
Real‑time performance – optimised inference to <50 ms per request by pre‑loading models into memory.
Frontend‑backend communication – handling CORS and asynchronous file uploads with Axios.
Disclaimer: CardioSense is for research and education only—not a certified medical device. Always consult a healthcare professional.
Built With
- docker
- flask-3.0
- hf
- pytorch-2.2
- react-19
- resnet50
Log in or sign up for Devpost to join the conversation.