🫀 Inspiration
Cardiovascular disease remains the leading cause of death globally, yet many at-risk individuals remain undiagnosed until it’s too late. There are many cases where patients have heart disease and visit doctor and get not diagnosed with heart disease and later die of heart failure. Doctors and medical providers are humans, after all, and they can mistakenly underdiagnose patients, that can lead to their deaths. We wanted to build a tool that empowers healthcare providers to assess heart disease risk quickly and intelligently—using AI insights and real patient data to support clinical decisions, especially in resource-constrained settings.
Use case of wrongfully not diagnosed heart disease
⚖️ Real Case: Failure to Order Common Cardiology Test Leads to Fatal Heart Attack What happened: A 40-year-old man in New York visited his cardiology clinic with symptoms including chest discomfort, a family history of heart disease, and high cholesterol. Despite these risk factors and his symptoms, his cardiologist relied on a stress test from two years prior and did not order a repeat nuclear stress test or other follow-up cardiac workup.
What followed: Six months later, he suffered a heart attack and died. An autopsy revealed significant coronary artery blockages, indicating that his risk profile had changed enough to warrant updated testing.
Legal outcome: His family sued the cardiologist for negligence. A jury awarded $3.1 million in damages, finding that the doctor failed to meet the standard of care by not ordering appropriate testing given the patient’s symptoms and history
🧠 Machine Learning Model & Feature Insights
To predict heart disease risk, we trained a Random Forest Classifier on the UCI Heart Disease dataset. Random Forest was chosen for its robustness, interpretability, and ability to handle both categorical and numerical features effectively without requiring complex preprocessing.
✅ Selected Features
We made plots of heart failure diagnosis (predicted attribute) vs many other attributes (predictors). After examining the plots, we noticed relationships heart failure diagnosis with 11 clinical attributes commonly used in cardiovascular assessment:
Age – Risk increases with age
Sex – Males typically have higher risk
ChestPainType – Categorical indicator of pain type (e.g. typical angina, asymptomatic)
RestingBP – Resting blood pressure (mmHg)
Cholesterol – Serum cholesterol (mg/dL)
FastingBS – Fasting blood sugar > 120 mg/dL (binary)
RestingECG – Resting electrocardiographic results
MaxHR – Maximum heart rate achieved during exercise
ExerciseAngina – Presence of angina during exercise (binary)
Oldpeak – ST depression induced by exercise relative to rest
ST_Slope – Slope of the peak exercise ST segment
📊 Feature Importance Analysis
As seen in the bar chart above:
ST_Slope was by far the most influential predictor. A flat or downsloping ST segment is strongly correlated with myocardial ischemia.
Oldpeak, Cholesterol, and ChestPainType followed as high-impact features—these align well with established clinical indicators.
Surprisingly, FastingBS, Sex, and RestingECG had lower predictive power in this dataset, suggesting that in isolation they may contribute less to the final prediction.
📈 Model Performance
We trained and validated a Random Forest Classifier using stratified 5-fold cross-validation on a heart disease dataset. The final model achieved:
Overall Accuracy: 88%
Precision (Positive Predictive Value): ~87%
Recall (Sensitivity for heart disease): 90%
Specificity (Correctly predicting no heart disease): 86%
AUC-ROC Score: 0.91
💡 What it does
CardioAssess is a web-based clinical assistant that:
Collects patient vitals and assessment results through a simple UI
Uses a trained machine learning model to predict heart disease risk
Sends the assessment data to Gemini 1.5 to generate a natural-language clinical summary
Displays actionable insights and recommendations that a doctor or nurse can use to prioritize care
🛠️ How we built it
Frontend: Built with Next.js and TypeScript, styled using TailwindCSS and Lucide Icons for a clean, responsive UI.
Backend: Powered by Flask, integrates:
A RandomForestClassifier trained on the UCI Heart Disease dataset
Google Gemini 1.5 Flash API for LLM-based insight generation
MongoDB to store and fetch patient records
AI Integration: The backend sends structured JSON assessment data to Gemini, which returns a clinically styled report.
🧩 Challenges we ran into
Gemini rate limits: We hit daily and per-minute quota limits while testing, so we had to optimize prompts and introduce fallback messaging.
Frontend/backend sync: Ensuring the LLM received full patient data required careful JSON validation and syncing form inputs across systems.
Clinical context: Designing a prompt that generates medically sound but non-diagnostic language was tricky—balancing insight with ethical boundaries.
🏆 Accomplishments that we're proud of
We successfully built an end-to-end AI-powered assessment tool within a weekend.
The Gemini-generated summaries are readable, informative, and highlight clinically relevant patterns in patient data.
Our system is modular and ready to plug into real-world EMR systems or telemedicine tools.
📚 What we learned
How to use Gemini 1.5 for structured prompt design and JSON-based output handling
Better data preprocessing and validation for medical machine learning applications
The importance of clarity and trust in health-related AI applications—every word matters when lives are on the line
🚀 What’s next for CardioAssess
Add dynamic prompt tuning based on risk factors or doctor preferences
Integrate FHIR or other health data standards for EMR compatibility
Implement user authentication for secure multi-provider use
Fine-tune a model using local data from specific populations or regions for increased accuracy

Log in or sign up for Devpost to join the conversation.