Inspiration
Severe respiratory infections can lead to very different recovery paths. Two patients may appear similarly affected a few months after hospital discharge, yet evolve in completely different ways over time.
Our goal was therefore not to treat post-infectious sequelae as a static snapshot, but to study how patients recover longitudinally.
We wanted to answer two main questions:
- Can we identify clinically interpretable groups of patients who share similar recovery trajectories?
- Do these patterns remain recognisable when the model is applied to an independent cohort?
Rather than searching for the most complex model, we focused on building a methodology that was interpretable, reproducible and clinically meaningful.
What it does
Our project transforms longitudinal clinical follow-up into an interpretable map of post-infectious recovery phenotypes.
Recovery is represented through four complementary clinical dimensions:
- DLCO — pulmonary diffusion capacity
- FVC — pulmonary function
- 6-minute walk test (6MWT) — functional exercise capacity
- mMRC — perceived dyspnea
For each dimension, we summarize the patient's trajectory using two features:
- the estimated clinical status at approximately 3 months after discharge
- the monthly evolution over follow-up
This produces 8 interpretable trajectory features per patient.
Using POSTCOVID-Lleida as the discovery cohort, we identified five distinct recovery phenotypes. Importantly, these profiles are not simply five ordered levels of severity.
Some patients show marked functional limitation followed by strong recovery, others report substantial dyspnea despite relatively preserved exercise capacity, while another group presents physiological respiratory impairment with very little perceived dyspnea.
After discovering the phenotypes, we characterize them using variables that were not used to build the clusters, including age, sex, smoking, comorbidities, ICU admission, ARDS and hospital length of stay.
Finally, we freeze the full methodology and project an independent cohort, TENACITY, onto the phenotypes discovered in Lleida.
How we built it
The integrated dataset contains 9,809 patients from four cohorts and 4,956 variables.
A major challenge is that much of the missingness is structural: different cohorts collected different clinical domains. We therefore avoided treating all missing values as ordinary missing data and started from the harmonized clinical core and variable dictionary.
For the main phenotype discovery analysis, we used POSTCOVID-Lleida, which contains 624 patients and provides rich longitudinal follow-up.
1. Recovery representation
For each patient and each of the four selected dimensions, we use the real elapsed time since hospital discharge, rather than assuming that all visits occurred exactly at 3, 6 and 12 months.
We fit a simple linear trajectory:
y(t) = β0 + β1·t
and extract:
initial = ŷ(3)— estimated value at month 3evolution = β1— monthly rate of change
This gives:
- DLCO initial + evolution
- FVC initial + evolution
- 6MWT initial + evolution
- mMRC initial + evolution
for a total of 8 features.
The linear representation is a pragmatic and interpretable summary of recovery; it is not intended to claim that biological recovery is perfectly linear.
2. Eligibility
To ensure that every patient is represented in the same clinical space, we require at least two valid observations in all four dimensions.
This results in:
624 POSTCOVID-Lleida patients → 328 eligible patients
We deliberately avoid imputing an entire missing longitudinal dimension.
3. Preprocessing and clustering
Because the eight features have very different units and scales, we standardize them using StandardScaler.
We compared:
- K-Means
- Ward hierarchical clustering
with:
k = 2, 3, 4, 5, 6
We evaluated the solutions using:
- stability through 100 subsamples of 80% of patients
- Adjusted Rand Index (ARI)
- Silhouette score
- Davies–Bouldin index
- cluster size
- clinical interpretability
The most stable solution was k=2, but it produced a relatively coarse separation.
For the final MVP, we selected:
StandardScaler + K-Means + k=5
because it provided a useful balance between stability, non-trivial cluster sizes and clinically differentiated recovery patterns.
We do not claim that k=5 is mathematically optimal.
4. Clinical characterization
The phenotypes are defined exclusively from the longitudinal behavior of:
DLCO + FVC + 6MWT + mMRC
Variables such as age, sex, hypertension, diabetes, smoking, ICU admission, ARDS and hospital stay are examined after clustering.
This distinction allows us to ask:
Now that we have discovered a recovery phenotype, who are the patients that belong to it?
without allowing these characteristics to determine the clusters themselves.
5. External projection
Once the discovery methodology was selected, we froze:
- eligibility criteria
- trajectory representation
- preprocessing
- StandardScaler
- K-Means
k=5- model hyperparameters
TENACITY was not used to optimize any of these decisions.
Of 287 TENACITY patients, 62 met the same strict eligibility criteria.
They were then processed using:
Lleida scaler.transform()
followed by:
Lleida KMeans.predict()
There was no retraining or reclustering in TENACITY.
Patients from TENACITY were assigned to all five frozen Lleida phenotypes:
- P1: 13 patients
- P2: 6 patients
- P3: 15 patients
- P4: 3 patients
- P5: 25 patients
Because the external sample is small and evidence varies considerably across phenotypes, we describe the result as partial transportability, not definitive external validation.
Challenges we ran into
Structural missingness
The four cohorts were created from different clinical protocols and did not collect the same variables.
An empty value can therefore mean either:
- a measurement is missing for a particular patient, or
- that variable was never collected in that cohort.
Treating both situations identically would introduce artificial information.
Irregular longitudinal follow-up
Visits labelled as "3 months", "6 months" or "12 months" do not occur at exactly the same time for every patient.
We therefore use the real time elapsed since discharge when constructing trajectories.
Strict eligibility versus sample size
Requiring complete longitudinal information across all four clinical dimensions improves comparability but reduces the available population:
- POSTCOVID-Lleida: 328 / 624
- TENACITY: 62 / 287
This introduces a potential selection bias and limits generalisability.
Choosing the number of phenotypes
The mathematically most stable partition was not necessarily the most clinically informative one.
We therefore avoided selecting k from a single metric and instead considered stability, separation, cluster sizes and clinical interpretability together.
External evidence
The external cohort is considerably smaller after eligibility filtering, and some phenotypes receive very few patients.
For example, one phenotype receives only 3 TENACITY patients, meaning detailed external statistics cannot be interpreted reliably.
Accomplishments that we're proud of
We identified five clinically distinct recovery profiles from longitudinal data while keeping the representation small and interpretable.
One of the most interesting findings is that the phenotypes are not simply severity levels.
For example, two phenotypes have relatively similar exercise capacity and respiratory impairment but show markedly different levels of perceived dyspnea.
Another phenotype shows the most severe multidimensional impairment at the beginning of follow-up but also one of the strongest subsequent recoveries.
This highlights why recovery cannot always be understood using a single physiological measurement.
We are also proud of the methodological separation between:
- variables that define the phenotypes
- variables that characterize them afterwards
- and the independent cohort used for external projection
Finally, the entire clinical pipeline preserves patient privacy. Individual-level clinical data remain inside the authorized environment, while the dashboard uses only approved aggregate statistics.
Small-cell statistics are suppressed when fewer than five patients contribute to a result.
What we learned
The hardest part of clinical clustering is not choosing an algorithm.
The most important decisions happen before the clustering step:
- defining what "recovery" means
- selecting complementary clinical dimensions
- distinguishing structural missingness from ordinary missing data
- handling irregular follow-up times
- deciding how to represent trajectories
- preventing data leakage
- and defining a meaningful external evaluation strategy
We also learned that the mathematically most stable clustering is not automatically the most clinically useful one.
Finally, external validation should not be treated as a binary pass/fail exercise. A pattern may be strongly recognisable in another cohort, weakly represented in another, or impossible to evaluate due to limited sample size.
For this reason, we prefer the more cautious conclusion of partial transportability.
What's next
This project is a proof of concept, not a diagnostic clinical tool.
The next steps would be to:
- validate the phenotypes in larger independent cohorts
- study the effect of less restrictive longitudinal eligibility criteria
- investigate non-linear trajectory representations
- extend the analysis to additional domains such as quality of life, cognition, sleep or imaging
- evaluate longer-term follow-up
- and prospectively assess whether phenotype membership provides clinically useful information
A future version could also allow a new patient with sufficient follow-up data to be projected onto the existing phenotype map, helping clinicians contextualize that patient's recovery relative to previously observed patterns.
Such use would require additional validation before clinical deployment.
Log in or sign up for Devpost to join the conversation.