Inspiration
Xerneas was inspired by a silent danger in ORs — a patient can suffer critical blood loss while their vital signs still look normal.
Hemorrhage, or severe bleeding, is the leading cause of preventable death after trauma, accounting for roughly 30-40% of trauma-related deaths worldwide. The body fights to hide blood loss by speeding up the heart and tightening blood vessels, so blood pressure, the number most monitors alarm on, can look stable until the body runs out of tricks and the pressure suddenly drops. This leaves a window where someone could still be helped.
We wanted to use that window by watching the body's effort in order to raise an alarm before the circulatory system collapses. That involved watching signs like a rising heart rate and a shrinking gap between the top and bottom blood pressure numbers (called pulse pressure). Using machine learning, we built a tool that learns what those early changes look like and warns clinicians before blood pressure falls.
What it does
Xerneas is a research prototype that watches for early signs of bleeding before blood pressure indicates it. It tracks how a patient's heart rate and blood pressure are changing compared to their baseline figures (medians of the first 10 minutes of monitoring), and flags signs that the body is working harder to stay stable, like a rising heart rate and a narrowing gap between the top and bottom blood pressure numbers (pulse pressure). When the heart is working harder and pulse pressure is narrowing, it raises an alert and shows the reasons, so a clinician can decide what to do. If too much data is missing, it says "insufficient data" instead of guessing.
You can try it two ways:
- Replay of a recorded patient: a recorded surgery patient, sped up 30x and clearly labeled as recorded, not live, plays next to a standard low-blood-pressure alarm so you can see which one fires first. The replays include a case where it missed and one where it raised a false alarm.
- Simulated bleed: A slider controls how much blood a made-up patient loses, so you can watch the warning signs appear while blood pressure still looks normal. A "blunted response" checkbox shows what happens when the heart rate barely reacts, as with beta-blockers.
How we built it
Sourcing data: We used VitalDB, a collection of patient monitor data from surgeries released by Seoul National University Hospital, with heart rate and blood pressure logged every few seconds. We cleaned the recordings and marked every time blood pressure stayed dangerously low (average pressure below 65 for at least 60 seconds).
Building the model: We went through the recordings one minute at a time and asked: using only what has happened so far, will blood pressure drop dangerously low in the next 15 minutes? For each minute, we calculated heart rate, pulse pressure, shock index (heart rate divided by top blood pressure number), how fast each is changing, and how far each has moved from the patient's own baseline. A transparent logistic regression model learned which patterns come before a drop. We calibrated it so a "30%" risk means roughly 30%, and added a silent period after each alert, because without it a patient whose risk stays high would trigger a new alert every minute for as long as it lasted.
Building the test: Real surgery data doesn't record when bleeding starts, so we couldn't tell whether a drop in blood pressure was caused by bleeding. To fix that, we built a simulator. We took calm stretches of real patient recordings, kept their natural heartbeat wobble and sensor glitches, and added a simulated bleed on top, like a flight simulator where we control exactly when the failure happens. The bleeds follow the stages doctors are taught for trauma: heart rate climbs, the gap between the top and bottom blood pressure numbers (pulse pressure) narrows, and then pressure collapses. Because we know exactly when each bleed starts, we could measure how many minutes of warning Xerneas gave.
The demo and tools used: A plain HTML, CSS, and JavaScript page with no frameworks and no internet needed, so the tool works regardless of Wi-Fi. Every simulated view says SYNTHETIC; every real view says "Recorded patient, surgical, VitalDB (Korea). Not live," and no number on the page is typed by hand. It's built so a real monitor feed could plug in later, but we haven't built that.
We used Python (pandas, NumPy, SciPy, PyArrow, scikit-learn), pytest for tests, and Claude Code as our coding assistant. There was no generative AI inside the product.
Challenges we ran into
Using real surgery data was a problem because nobody records the moment bleeding starts, and blood pressure can drop for many other reasons, like anesthesia and medication. Building a simulated test solved that, but it also meant our simulated results only show the method works if real bleeding follows the textbook.
Our idea also didn't work as well on real patients as we hoped. On real surgery recordings, watching heart rate and pulse pressure did about as well as a simple blood pressure alarm. We checked this several times, including on 175 patients we never looked at until the end. Other researchers found the same with a commercial low-blood-pressure prediction tool, so we describe our real-data alert as an early blood pressure alert.
Accomplishments that we're proud of
On simulated bleeds, our model caught 96.1% of them with a median of 7.9 minutes of advance warning at 0.63 false alarms per hour. Meanwhile, a simple blood pressure alarm gave 3.4 minutes of warning at 1.04 false alarms per hour, and a standard monitor rule gave 5.0 minutes at just 0.26 false alarms per hour. So our model warned about twice as early as the simple blood pressure alarm, with fewer false alarms, and almost 3 minutes earlier than the standard monitor, though the standard monitor had fewer false alarms than we did.
Xerneas doesn't catch more bleeds than the other alarms, since almost every method catches almost every collapse, but it gains significantly on time. More minutes of warning means more time for a clinician to check on the patient.
We also hit our target of catching at least 95% of bleeds on our two main test levels: 97.6% on textbook-style simulated bleeds and 95.5% on more realistic ones.
What we learned
We learned a lot about how easy it is to fool yourself with data. A model can look impressive if it sees information it shouldn't, if a shortcut in the data gives away the answer, or if the test gets adjusted until it passes. We only found our two shortcuts because we went looking for ways to cheat before training.
We also learned that warning time was more important than catching bleeds, and that accuracy hides this. And we learned that a simulator and real data can tell different stories. In simulation, where bleeding follows the textbook, heart rate and pulse pressure trends gave about twice the warning of a blood pressure cutoff. On real surgical data, where we can't tell bleeding from other causes of low pressure, they didn't beat blood pressure alone. That gap is our main finding, and studies of real trauma patients show many don't follow the textbook, especially in heart rate.
What's next for Xerneas
Our next step is to test Xerneas on real trauma or ICU data where bleeding is actually recorded, such as which patients needed a transfusion. That would settle the gap between our simulated and real results, though it requires special access to those datasets, which we're working on gaining. We'd also retrain it for ambulances, which use blood pressure cuff readings every few minutes instead of a continuous reading, and look for signals that still work in patients whose heart rate barely rises. To make the results more reliable, we'd test on more patients from more hospitals, since our data comes from just one hospital in one country. Finally, we'd ask doctors and nurses how alerts should look and how to avoid alarm fatigue, and build a connection to a live monitor feed, which the demo is designed for but doesn't have yet.
Built With
- claudecode
- css
- html
- javascript
- numpy
- pandas
- pyarrow
- pytest
- python
- scikit-learn
- scipy
- vitaldb
Log in or sign up for Devpost to join the conversation.