CareGap-AI: Patient Risk & Care Gap Analytics

Inspiration

Modern healthcare generates massive amounts of patient data, yet clinicians often struggle to identify high-risk patients early or detect missed care opportunities.

We wanted to build a system that could:

  • Predict patient health risk using clinical and follow-up data
  • Highlight care gaps like missed visits or abnormal lab values
  • Provide explainable insights for clinicians to act on

This inspired CareGap-AI, a dashboard that combines machine learning, analytics, and interactive visualizations to make patient care smarter and proactive.


What We Learned

During this project, we learned:

  1. Healthcare data simulation – Generating realistic patient records for testing without compromising privacy.
  2. Machine learning for risk prediction – Using features like age, lab values, chronic conditions, and follow-up behavior.
  3. Explainable AI – Implementing Feature Importance to highlight which factors influence risk scores.
  4. Full-stack development – Integrating Flask backend, HTML/CSS/JS frontend, and Chart.js visualizations.
  5. Deployment – Hosting the dashboard live on Render for accessibility.

How We Built It

  1. Data Generation – Created synthetic patient data using Python (generate_realistic_data.py) with fields like Age, HbA1c, Cholesterol, Follow-up status, and Outcome.

  2. Machine Learning Model – Trained a RandomForestClassifier to predict risk scores and risk levels. Saved the model with joblib.

  3. Backend (Flask)

    • Routes for serving the dashboard
    • API endpoints for existing patient data and new patient predictions
    • Integrated Feature Importance JSON
  4. Frontend (HTML/CSS/JS)

    • Dashboard with tiles/cards for risk summary
    • Interactive charts using Chart.js
    • Patient selection, table, and “Try Your Own Data” popup
    • Color-coded risk levels: Low, Medium, High
    • Care Gap warnings:
  5. Deployment – Hosted live on Render with dynamic port binding (0.0.0.0), fully accessible from any device.


Challenges Faced

  • Synthetic data realism – Balancing realistic lab values with meaningful risk patterns
  • Feature Importance for new patients – Had to show global model importance while maintaining clinical interpretability
  • Frontend interactivity – Ensuring both existing patient selection and new patient simulations update all charts and tables dynamically
  • Deployment issues – Flask binds to 127.0.0.1 by default, which required changing to 0.0.0.0 for Render

Impact

CareGap-AI helps clinicians:

  • Identify high-risk patients before disease progression
  • Detect care gaps like missed follow-ups or abnormal labs
  • Visualize patient journeys for better decision-making
  • Explain predictions using feature importance

“Early detection saves lives.”

CareGap-AI demonstrates how data-driven AI, combined with responsible design, can make healthcare smarter, safer, and proactive.

Share this project:

Updates