Inspiration
After a serious hospital stay, such as an ICU admission or severe COVID, many patients are left with lung damage. One of the key measures of it is DLCO, which shows how well the lungs pass oxygen into the blood. Hospitals check it again at 3 and 6 months, but today almost every patient gets the same follow-up. Some patients would recover on their own and others will not, and a good number never come back for the 6-month visit at all, so nobody ever finds out how they are doing. We wanted to help doctors decide earlier who needs what kind of follow-up, and which patients they should not lose track of.
What it does
From the data of the 3-month visit, Secuelas-Group9 predicts two things for each patient. The first is what their lung function (DLCO) will be at 6 months, with a range that shows how certain the prediction is, and how likely they are to stay below the 80% level that doctors consider abnormal. This prediction describes the patients who come back for the 6-month test, because only they have a measured value. The second is how likely the patient is to come back for that visit, which is there precisely because many do not.
Both predictions appear on a simple patient card in a web app. The doctor fills in a few basic facts about the patient and moves a slider for the 3-month DLCO, and the card updates instantly. It then suggests one of three follow-up options: a remote check (teleassessment) if the patient is expected to recover well, an in-person visit if recovery looks poor but the patient will probably attend, or active outreach if recovery looks poor and the patient may disappear. It is a research prototype, not a clinical tool.
How we built it
We combined three real patient groups: CIBERES (a national ICU registry), POSTCOVID-Lleida (a post-COVID clinic) and TENACITY (mostly non-COVID ICU patients), about 2,100 patients in total. We only used the 13 variables that all three groups record in the same way, so the data could be mixed fairly.
Before building the model, we cleaned and aligned the data. The clinic in Lleida changed its reference equation for DLCO around 2024, which made the percentages jump by about 15% without any real change in the lungs. We detected this and converted all values to one common equation.
The model is a hierarchical Bayesian model, written in R with brms. It lets each hospital have its own baseline, which matters because hospitals differ a lot. A Python and Flask web app then serves the fitted models, so the patient card gives predictions in real time.
Challenges we ran into
The biggest challenge was making sure the results were honest. We defined two tests before running them: one that trains on earlier patients and tests on later ones, and one that tests on hospitals the model had never seen. That is much harder than a random split, but much closer to real use.
The data also gave us problems. The DLCO equation change had to be found and corrected. Each cohort recorded things slightly differently, and CIBERES does not even have the absolute DLCO value. Patients who were admitted later in the pandemic recovered more slowly than the model expected, and the type of illness, the time period and the hospital are mixed together in these data, so we cannot separate their effects. Predicting who will return was also hard, especially in new hospitals.
Accomplishments that we're proud of
Our model is wrong by about 6 to 8 DLCO points on average, and it beats the simple guess of "no change since the 3-month visit" in all six of our test groups. Its 90% ranges contain the real value for 88 to 98% of patients, so the uncertainty it reports can be trusted. We also found that most of the useful information is already in the 3-month DLCO, which makes the tool practical, because doctors need very little input.
We are also proud that we went from raw, messy data to a working interactive card that a doctor can understand in seconds, and that we were open about the limits: the small TENACITY test with 39 patients, and the fact that whether a patient returns depends more on the hospital than on the patient.
What we learned
We learned that careful data preparation matters as much as the model, since a silent change in a reference equation can distort everything. We learned that testing on hospitals the model has never seen is a much more honest test than a random split. And we learned that the 3-month DLCO carries most of the predictive power, while attendance is mostly a hospital-level issue. Whether a patient returns says more about how a hospital works than about the patient, which suggests that outreach could be organised at the hospital level too.
What's next for Secuelas-Group9
The first step is to work with clinicians to set the decision thresholds for the three follow-up options. The 50% cut-offs on the card today are placeholders. After that, we want to extend the model to predict DLCO at 12 months, which we have not validated yet. We also want to test the model on more hospitals and more recent patients, since recovery has changed over time. We do not claim to know how many visits or how much cost this could save, and we would only estimate that after validation with clinicians.
Log in or sign up for Devpost to join the conversation.