Inspiration

Heart disease remains the leading cause of death globally, and early warning signs often go unnoticed until it’s too late.

We wanted to create a virtual heart health assistant that empowers everyday people to check symptoms, understand risk, and get personalized recommendations, especially focused on the people of San Jose.

What it does

HeartSafe Assistant is a groundbreaking, AI-powered health platform that empowers users to assess their heart health risk with precision and ease. Users can: -Predict their personalized heart risk level (low, moderate, or high) by inputting simple health metrics like age, gender, blood pressure, glucose, and troponin levels — powered by a machine learning model with a 98% F1 score.

  • Have a text-to-text conversation with our Gemini AI chatbot that acts like a friendly, intelligent virtual heart doctor.
  • Speak directly with our voice-enabled assistant powered by Eleven Labs, making healthcare accessible even without typing.

How we built it

We fused machine learning, large language models, and voice AI to create HeartSafe Assistant:

Model Training: We trained a supervised learning model using clinical heart health features (age, gender, blood pressure, glucose, troponin) to predict heart disease risk with a 98% F1 score.

Backend (Flask API): We built a Flask server with two main endpoints:

/predict — Receives user health stats and returns personalized risk levels.

/chatH — Interfaces with Gemini AI to conduct intelligent heart health conversations.

Text Interaction (Gemini AI): We integrated the Gemini model with a custom doctor-prompt that enables natural, empathetic conversations. The assistant listens to user symptoms, asks smart follow-ups, and offers actionable advice — while always encouraging users to seek real doctors for serious concerns.

Voice Interaction (ElevenLabs): We connected ElevenLabs voice synthesis to enable real-time voice conversations. Users can speak their symptoms and concerns and receive spoken personalized advice — dramatically improving accessibility.

Challenges we ran into

Initially, the flask application was receiving an error when users inputted their features and attempted to predict heart rate risk. After debugging, we discovered that the feature names in the Flask API were mismatched compared to the ones used during model training. Once we corrected the feature naming to align properly, the model began predicting accurately and consistently.

Accomplishments that we're proud of

-Achieved a 98% F1 score on heart disease risk prediction. -Built a working end-to-end platform — from model training, API development, to user-friendly frontend — within a short time frame. -Successfully integrated Gemini AI for intelligent, empathetic conversations that can guide users through heart health concerns. -Implemented voice interaction powered by ElevenLabs, enabling users to seamlessly talk with the assistant and making heart health support accessible through natural conversation.

What we learned

-Building highly accurate and reliable machine learning models in a short time frame. The importance of feature alignment between training data and live user inputs — even small mismatches can break predictions. -How to troubleshoot API errors quickly under tight deadlines to keep pushing forward.

What's next for HeartSafe Assistant

-Expand the medical capabilities beyond heart risk to include predictions for conditions like diabetes, stroke, and hypertension. -Enhance the conversation engine by integrating more advanced medical reasoning with Gemini, including dynamic follow-up questions. -Add multilingual support to better serve San Jose’s diverse communities and reduce healthcare disparities.

Built With

Share this project:

Updates