MEDSENSE AI

Predicting Patient Deterioration Before Hospitals Can See It


## Inspiration

Modern hospitals generate enormous amounts of patient data every second, including vital signs, lab reports, imaging data, and clinical notes. However, most healthcare systems still operate reactively, where doctors often respond only after a patient’s condition has already worsened.

We were inspired by a critical question:

What if hospitals could predict deterioration before it becomes life-threatening?

Conditions like sepsis, respiratory failure, and cardiac events often show warning patterns hours before a crisis occurs, but identifying these subtle signals manually is extremely difficult in busy hospital environments.

This inspired us to build MEDSENSE AI, a multimodal AI-powered hospital intelligence system designed to help healthcare professionals detect, explain, and prevent medical emergencies before they happen.


## What it does

MEDSENSE AI is an AI-powered clinical early warning and hospital intelligence platform that:

  • Predicts patient deterioration in real time
  • Forecasts future clinical risk progression
  • Detects sepsis, cardiac events, and ICU escalation risks
  • Provides explainable AI-powered clinical reasoning
  • Simulates treatment-delay consequences using a Digital Twin system
  • Visualizes hospital-wide patient status through an interactive dashboard

Our most innovative feature is Temporal Cascade Prediction, where the system predicts not just if a patient is at risk, but when deterioration is likely to happen.

The prediction trajectory is represented as:

$$ R(t) = {r_{30m}, r_{1h}, r_{2h}, r_{4h}, r_{6h}, r_{12h}} $$

This allows doctors to proactively intervene before a critical event occurs.

We also integrated Gemini AI as a medical copilot capable of:

  • Explaining risk predictions
  • Summarizing critical patients
  • Generating clinical reports
  • Translating medical jargon into patient-friendly language
  • Narrating treatment simulation outcomes

## How we built it

We built MEDSENSE AI using a full-stack AI architecture.

Frontend

  • React
  • Next.js
  • Tailwind CSS
  • Framer Motion
  • Recharts
  • Three.js

The frontend includes:

  • Real-time hospital dashboards
  • ICU heatmaps
  • Live emergency alerts
  • Organ stress visualization
  • Cascade prediction timelines
  • AI-powered patient monitoring cards

Backend

  • FastAPI
  • Python
  • WebSockets

The backend handles:

  • Real-time data streaming
  • Prediction inference
  • AI alert generation
  • Gemini API integration
  • Digital Twin simulations

Machine Learning

We used an ensemble prediction system combining:

  • XGBoost
  • LightGBM
  • CatBoost
  • LSTM neural networks

Our composite risk model combines multiple clinical predictions:

$$ R_{composite} = w_1R_{sepsis} + w_2R_{cardiac} + w_3R_{ICU} + w_4R_{cascade} $$

where:

  • (R_{sepsis}) = sepsis probability
  • (R_{cardiac}) = cardiac event probability
  • (R_{ICU}) = ICU transfer probability
  • (R_{cascade}) = future deterioration trajectory

We also built a Digital Twin Patient Simulator that models how a patient’s condition changes under different treatment scenarios such as delayed antibiotics or oxygen intervention.


## Challenges we ran into

One of our biggest challenges was balancing:

  • clinical realism,
  • technical complexity,
  • and hackathon time constraints.

Healthcare data is extremely complex and often incomplete, so designing realistic synthetic patient data and prediction pipelines required careful feature engineering.

Another major challenge was creating a smooth real-time dashboard capable of visualizing streaming medical data while maintaining high performance and cinematic UI animations.

Integrating Gemini AI meaningfully was also difficult. We wanted Gemini to function as a true clinical reasoning assistant rather than a simple chatbot, which required extensive prompt engineering and contextual patient-data injection.

Finally, building the Temporal Cascade Prediction system was challenging because we had to move beyond traditional static classification models and instead forecast how deterioration evolves over time.


## Accomplishments that we're proud of

We are especially proud of:

  • Building a multimodal AI healthcare platform within hackathon constraints
  • Designing a novel Temporal Cascade Prediction system
  • Creating a futuristic real-time hospital command dashboard
  • Integrating Gemini AI as a contextual medical copilot
  • Developing a Digital Twin simulation engine for treatment-delay analysis
  • Combining predictive AI, explainability, and visualization into one unified platform

One of our proudest achievements was transforming healthcare prediction from:

reactive care → predictive care

We also successfully demonstrated how AI can provide not only predictions, but meaningful clinical explanations and actionable hospital intelligence.


## What we learned

Through MEDSENSE AI, we learned:

  • how predictive AI can improve emergency medicine,
  • how multimodal systems enhance healthcare intelligence,
  • how explainable AI increases clinical trust,
  • and how real-time visualization improves medical decision-making.

We also gained hands-on experience with:

  • ensemble machine learning,
  • LSTM-based time-series forecasting,
  • real-time system architecture,
  • AI-assisted medical reasoning,
  • and full-stack healthcare platform development.

Most importantly, we learned that impactful healthcare technology is not only about prediction accuracy, but about helping clinicians make faster, safer, and more informed decisions.


## What's next for MEDSENSE AI

In the future, we want to expand MEDSENSE AI into:

  • a deployable hospital intelligence platform,
  • a remote ICU monitoring system,
  • a federated healthcare AI network,
  • and a predictive emergency response platform for smart hospitals.

Future improvements include:

  • integration with wearable medical devices,
  • real electronic health record (EHR) support,
  • multilingual voice-based AI assistance,
  • federated learning for privacy-preserving healthcare AI,
  • and advanced reinforcement learning for treatment optimization.

Our long-term vision is to create an AI ecosystem that helps hospitals detect, explain, and prevent medical emergencies before they happen, ultimately improving patient outcomes and saving lives.

Built With

Share this project:

Updates