Skip to main content
Back

UCL's AI Spots Hospital Patients Ready to Switch Off IV Antibiotics 3x Faster

A UCL team uses neural processes to forecast patient vital signs and flag who is ready to switch from IV to oral antibiotics, outperforming random selection by up to 3.2x across two hospital datasets.

Pro

  • A UCL team built an AI system that forecasts patient vital signs to identify who is ready to switch from IV to oral antibiotics, avoiding the trap of learning from flawed historical clinical decisions.
  • The system uses a Convolutional Neural Process (ConvCNP) to produce probabilistic 12-hour vital sign forecasts, then applies clinical guidelines to those forecasts to generate a switch-readiness probability.
  • Validated on 6,333 ICU encounters (MIMIC-IV) and 10,584 general hospital encounters (UCLH), the model selects 2.2–3.2x more switch-ready patients than random selection.
  • Because clinical criteria are applied after forecasting, guidelines can be updated and per-patient adjustments made without retraining the model.
  • Key limitation: no prospective clinical evaluation yet -- it is unknown whether the ranked list actually changes clinician behaviour or improves switching rates in practice.
  • Code is publicly available on GitHub; MIMIC-IV data is open access via PhysioNet.

Every day, hospital wards across England hold patients on intravenous (IV) antibiotics longer than necessary. The timely transition from IV to oral antimicrobial therapy can shorten hospital stays and reduce catheter-related bloodstream infections, yet 19% of patients in England remain on IV antibiotics despite meeting switching criteria. The problem is not ignorance of the rules -- it is the sheer volume of patients, the busyness of wards, and the difficulty of spotting the right moment to act.

A team from University College London and University College London Hospitals (UCLH) now has a concrete proposal: use probabilistic machine learning to forecast where each patient's vital signs are heading, apply clinical guidelines to those forecasts, and hand clinicians a ranked list of who to review first. The work is described in a new paper on arXiv, and the code is publicly available.

Why existing AI approaches fall short

The obvious way to build a clinical decision support system (CDSS) for this problem is to train a model on historical data: look at what clinicians did in the past and learn to replicate it. The problem is that past practice is exactly what you are trying to improve. Approaches that learn from historical decisions reproduce the delays and inconsistencies of routine practice -- if the training signal is what clinicians did, the best the model can do is reproduce that sub-optimal behaviour.

There is also a practical labelling problem. Obtaining ground truth for switch-readiness is challenging: the decision to switch is multifaceted, involving factors beyond vital signs such as infection type and severity, antibiotic availability, patient comorbidities, and social circumstances affecting discharge planning. Historical switching records in electronic health records (EHRs) are noisy, and reconstructing clean antibiotic courses from prescription data alone is notoriously difficult.

Rule-based systems have shown real impact -- a promising stewardship intervention to facilitate timely switching is a CDSS that automatically generates reminding alerts -- but an important pitfall that can impede the success of a CDSS is alert fatigue. Fixed rules also cannot assess whether a patient is improving, only whether they meet a threshold at a single point in time.

Forecast first, apply rules second

The UCL team's key insight is to flip the pipeline. Instead of learning from past switch decisions, the system learns to forecast patient physiology, then applies clinical guidelines to those forecasts. This separation has several downstream benefits that go beyond accuracy.

The architecture has three stages:

  1. Forecast vital signs. A neural process model takes the last 48 hours of a patient's vital sign measurements -- heart rate, respiratory rate, oxygen saturation, systolic blood pressure, and temperature -- and produces a probabilistic forecast over the next 12 hours. Crucially, it outputs a full distribution over possible future values, not just a point estimate.
  2. Apply clinical criteria. The system checks what fraction of the forecast distribution falls within clinically normal ranges for all five vital signs across the 12-hour window. This yields a switch-readiness probability: the chance the patient will remain stable enough to safely switch.
  3. Rank patients for review. Patients are sorted by their switch-readiness probability and presented to the antimicrobial stewardship team as a prioritised list each morning.

Because criteria are applied after forecasting, the system can be updated as clinical standards evolve without retraining the forecasting model, and it can be adapted in non-standard cases -- for example, discounting respiratory rate for a patient on mechanical ventilation, where the ventilator artificially controls breathing.

The model: Convolutional Neural Processes

Neural Processes (NPs) are a class of probabilistic meta-learning models. The intuition is that each patient encounter is treated as a separate task, and the model learns a general mapping from observed history to a predictive distribution over future values. This makes them well-suited to clinical time series, which are irregularly sampled, frequently missing measurements, and vary enormously between patients.

The specific architecture used here is a Convolutional Conditional Neural Process (ConvCNP). It works as follows:

  • Encoder: Raw vital sign measurements are placed onto a discretised time grid using radial basis function (RBF) kernel smoothing -- a way of spreading each observation's influence across nearby time points.
  • Processor: A UNet convolutional architecture (4 layers before and after a bottleneck) processes the gridded representation and extracts temporal patterns.
  • Decoder: For each future time point, the model outputs the mean and variance of a Gaussian distribution over the predicted vital sign value.

Switch-readiness probability is then computed analytically: for each vital sign at each 3-hour interval in the forecast window, the model calculates the probability that the Gaussian distribution falls within the clinical threshold range. These probabilities are multiplied together across all vital signs and time points to get a single switch-readiness score.

A tuned variant (NP-tuned) adds a classification head on top of the frozen forecasting model, trained directly on switch-readiness labels to correct for a known calibration issue: the base NP tends to be overconfident in its uncertainty estimates due to outliers in EHR data, which causes it to systematically underestimate switch-readiness probabilities.

Here is a simplified sketch of how switch-readiness probability is derived from the model's outputs:

# For each vital sign c and each 3-hour interval t in the forecast window:
# model outputs mu[t,c] and sigma[t,c] (mean and std of predicted value)
from scipy.stats import norm
def switch_ready_prob(mu, sigma, lower, upper):
    # Probability that predicted value falls within [lower, upper]
    p_in_range = norm.cdf(upper, mu, sigma) - norm.cdf(lower, mu, sigma)
    return p_in_range
# Overall switch-readiness = product across all vitals and time points
# (under conditional independence assumption)
import numpy as np
overall_prob = np.prod([
    switch_ready_prob(mu[t][c], sigma[t][c], thresholds[c]['low'], thresholds[c]['high'])
    for t in forecast_times
    for c in vital_signs
])

Two very different hospitals, one model

The system was validated on two datasets that differ substantially in patient population and clinical practice:

DatasetEncountersSettingSwitch-ready days
MIMIC-IV6,333US ICU (Beth Israel Deaconess, Boston)12.2%
UCLH10,584UK general hospital group (London)40.2%

The two datasets represent significantly different populations: the MIMIC patients are generally much more unwell, vital signs are taken more regularly, and antibiotic prescribing patterns differ both in terms of route and agents. For instance, vancomycin is the most common IV antibiotic in MIMIC (65.7% of admissions), while co-amoxiclav dominates at UCLH (46.5%).

Results: 2.2x to 3.2x better than random

The headline metric is Precision@5: of the top 5 patients ranked by the model each day, what fraction are truly switch-ready? This directly mirrors how the system would be used in practice.

The NP model would select 2.2x more relevant patients than random selection on the UCLH data, and 3.2x on the MIMIC data. On UCLH, the NP-tuned model achieves a Precision@5 of 0.901, compared to a random baseline of roughly 0.40 (the class prevalence). On MIMIC, the NP achieves 0.393 versus a random baseline of 0.122.

The NP model also outperforms both baselines on forecasting accuracy across most vital signs at the 12-hour horizon. The mean improvement over gradient boosted decision trees (GBDT) was 2.25% on UCLH and 2.99% on MIMIC. The GBDT is a strong baseline for classification too -- but it requires two entirely separate models (one for forecasting, one for classification), while the NP serves both tasks from a single architecture.

The real breakthrough: decoupling learning from practice

The most important contribution here is not the accuracy numbers -- it is the formulation. By forecasting physiology rather than mimicking past clinical actions, the system sidesteps the fundamental trap that limits every supervised CDSS trained on historical data. If the goal of a CDSS is to improve upon current practice -- in this case by encouraging earlier switches and thus reducing the total number of IV therapy days -- then a model trained to mimic historical, suboptimal behaviour is inherently limited.

The separation between forecasting and criteria application also means the system is genuinely updatable. If national guidelines change (as they regularly do in antimicrobial stewardship), the clinical thresholds can be adjusted without touching the model. Individual patient context -- like a patient on antipyretics where fever is uninformative -- can be handled by simply excluding that variable from the criteria check for that patient.

Where it falls short

The authors are candid about the limitations:

  • No prospective evaluation. Without deploying the system in practice and measuring its impact on switching rates, total IV therapy days, patient outcomes, and clinician decision-making, it is not possible to definitively assess whether the model's predictions translate into improved clinical care.
  • Only five vital signs. Inflammatory markers like C-reactive protein and white blood cell count, which are clinically relevant for IVOS decisions, are not included -- mainly because they are measured less consistently across settings.
  • Oral suitability is out of scope. The system only addresses clinical stability (is the patient improving?). Whether the patient can tolerate oral medication, or whether an appropriate oral agent exists, remains entirely with the clinician.
  • Calibration issues in the base NP. The standard NP systematically underestimates switch-readiness probabilities due to how Gaussian likelihoods interact with EHR outliers. The NP-tuned variant fixes this but requires a separate training stage.
  • Rapid clinical changes. The model assumes recent history is informative of the near future, which may not hold during sudden deterioration or rapid improvement.

Who should care about this

This work is most directly relevant to teams building or evaluating AI tools for antimicrobial stewardship. Early intravenous-to-oral switching is a key antimicrobial stewardship strategy, offering benefits for patients, healthcare systems, and the environment, yet it remains underused in routine practice. The approach is also a useful template for any clinical decision support problem where the ground truth is contaminated by the sub-optimal behaviour you are trying to fix -- a pattern that appears across many areas of hospital medicine.

The code is available on GitHub, and the MIMIC-IV dataset used for validation is publicly accessible. The UCLH dataset requires a formal research collaboration agreement with the trust. The next step the authors identify is prospective deployment -- putting the ranked list in front of real stewardship teams and measuring whether it changes behaviour.