Skip to main content
Back

NYU's MedCertAIn Teaches Clinical AI to Admit When It's Wrong

MedCertAIn uses Bayesian learning and self-supervised priors to tell ICU clinicians not just what it predicts, but how confident it is — cutting uncertain cases before they reach a decision.

Pro

Paper, Full Access
  • MedCertAIn is a Bayesian uncertainty framework for ICU mortality prediction that combines EHR time-series and chest X-ray data. [Paper]
  • It builds data-driven priors automatically — no expert annotation needed — using corrupted inputs and self-supervised cross-modal similarity.
  • Achieves a 195% improvement in selective AUPRC over the deterministic MedFuse baseline, meaning it reliably knows which predictions to defer.
  • Standard AUROC improves modestly (+1.93%), but selective AUROC jumps 30%, showing the real gain is in uncertainty calibration, not raw accuracy.
  • Gains are consistent across age and sex subgroups, a critical requirement for clinical deployment and regulatory approval.
  • Code is implemented in JAX and wraps around existing architectures without requiring model redesign. [Code]

Most clinical AI models give you a prediction. What they rarely give you is an honest answer about whether that prediction should be trusted. MedCertAIn, a new framework from researchers at NYU and the University of Toronto, tackles exactly that problem: building a model that knows when to flag its own uncertainty and hand a case back to a clinician, rather than confidently guessing wrong.

The problem no one wants to talk about

Trustworthy implementation of machine learning models in healthcare requires robust uncertainty measurements, considering the safety-critical nature of clinical practice. But in practice, most deployed models output a single probability score with no sense of how reliable that score is. Uncertainty in machine learning models can be due to model parameters, noise and bias of the calibration data, or deployment of the model in an out-of-distribution scenario , all inherent characteristics of any real-world clinical scenario.

The problem compounds when you move to multimodal data , combining, say, a patient's lab time-series with their chest X-ray. Existing work on uncertainty quantification in healthcare has been mainly studied in the unimodal setting, with a particular focus on medical imaging applications. Effective quantification of predictive uncertainty in the context of multimodal clinical problems remains a challenging and unsolved task.

What selective prediction actually means

Before diving into MedCertAIn's mechanics, it helps to understand selective prediction , the core concept the paper is built around. Rather than always returning an answer, a selective prediction model can abstain: it ranks its predictions by uncertainty and defers the least-confident ones to a human. Selective prediction introduces a "reject option" via a selection function that determines whether to output a prediction for an input. Given a rejection threshold and using entropy as the selection score, the model either outputs a prediction or defers.

The key metric here is selective AUROC and selective AUPRC: you compute the model's discrimination score only on the cases it chose to answer, across all possible deferral thresholds, and average. A model that defers its worst guesses should see its score rise as coverage drops. A poorly calibrated model , one that's most confident on the cases it gets wrong , will actually get worse.

How MedCertAIn works

MedCertAIn is a multimodal uncertainty-aware learning framework designed to produce calibrated predictions and to explicitly defer low-confidence cases in safety-critical clinical settings. Rather than modifying network design, MedCertAIn operates at the level of context prior selection and loss formulation, enabling reliable selective prediction across existing multimodal models.

The core idea is to use data-driven priors , a Bayesian term for the initial beliefs you bake into a model's parameters before training. Instead of using a generic Gaussian prior (which is the default and often performs poorly), MedCertAIn builds priors from real data that the model is expected to find hard. The training objective has three terms:

  • Expected log-likelihood: standard supervised loss on the training data
  • KL regularization: keeps the learned parameter distribution close to the prior
  • Uncertainty regularization: penalizes the model for being confident on a curated set of hard, ambiguous examples

That third term is the key innovation. Letting the context label distribution encourage high uncertainty in the predictions on the set of context points, the model is trained to remain non-confident on ambiguous inputs.

Building the hard-example set , without labels

The clever part is how MedCertAIn identifies which examples should be in that hard set, entirely without human annotation. It uses two strategies in combination:

  1. Modality-specific corruptions: For EHR time-series, the model drops initial sequence segments, adds Gaussian noise, or reverses the time dimension. For chest X-rays, it applies random crops, flips, Gaussian blur, solarization, inversion, and color jitter. These corrupted versions are treated as inherently uncertain inputs.
  2. Cross-modal similarity in latent space: A ConVIRT model is trained with the infoNCE loss to obtain per-modality representations. Cosine distance is computed between EHR and CXR embeddings, and samples falling below a threshold , meaning the two modalities disagree in latent space , are selected as high-uncertainty context points.

The intuition behind the second strategy is elegant: if a patient's lab values and their X-ray are telling very different stories in the model's embedding space, that's a signal the case is genuinely ambiguous. The assumption is that modality mismatch corresponds to higher predictive uncertainty. Combining both strategies into a single context set gave the best results across all ablations.

Here's a simplified view of what the training loop looks like:

# Pseudocode for MedCertAIn training step
for batch, context_batch in zip(train_loader, context_loader):
    x_ehr, x_cxr, y = batch
    x_ehr_c, x_cxr_c = context_batch  # corrupted + low-similarity pairs
    # Forward pass on training data
    logits = model(x_ehr, x_cxr)
    log_likelihood = binary_cross_entropy(logits, y)
    # KL divergence between variational posterior and prior
    kl = compute_kl(model.variational_params, model.prior_params)
    # Uncertainty regularization: model should be maximally uncertain on context
    context_logits = model(x_ehr_c, x_cxr_c)
    uncertainty_reg = log_prob_uniform(context_logits)  # push toward 0.5
    loss = -log_likelihood + kl - uncertainty_reg
    loss.backward()

At inference time, uncertainty is quantified using the Shannon entropy of the predictive distribution, obtained via Monte Carlo sampling from the variational posterior. Higher entropy indicates greater predictive uncertainty. Cases above a chosen entropy threshold get flagged for clinician review.

Datasets and baselines

The framework was trained and evaluated on two publicly available modalities: EHR time-series data from MIMIC-IV, which contains more than 60,000 ICU stays collected between 2001 and 2019, and chest X-ray images from MIMIC-CXR. The task is in-hospital mortality prediction , a binary classification estimating mortality after 48 hours in the ICU. After requiring complete paired samples (both modalities present), the dataset shrinks to 6,215 patients , a realistic constraint that reflects real-world data availability.

MedCertAIn was compared against three baselines:

  • MedFuse , a deterministic LSTM + ResNet-34 fusion model, used as the architectural backbone
  • DrFuse , a transformer-based model that dynamically weights EHR and imaging inputs
  • Uninformative Bayesian prior , Gaussian mean-field variational inference with a standard Gaussian prior, isolating the effect of Bayesian training without smart priors

The backbone architecture, MedFuse, encodes EHR time-series with a two-layer LSTM and chest X-rays with a ResNet-34, then concatenates the representations for classification. MedCertAIn wraps around this without changing the architecture itself.

The numbers tell a clear story

MedCertAIn achieves the strongest standard predictive performance, with AUROC 0.835 and AUPRC 0.498. Relative to MedFuse, this corresponds to a 1.93% gain in AUROC and a 7.00% gain in AUPRC. Those standard metric gains are modest. The real story is in selective prediction.

ModelAUROCAUPRCSelective AUROCSelective AUPRC
DrFuse0.8170.4720.7850.437
MedFuse0.8190.4660.6590.203
Uninformative Prior0.8200.4850.7110.357
MedCertAIn0.8350.4980.8570.599

MedCertAIn consistently improves selective performance, achieving selective AUROC 0.857 and selective AUPRC 0.599. Compared to MedFuse, this yields a 30.0% improvement in selective AUROC and a 195% increase in selective AUPRC. That 195% jump in selective AUPRC is the headline: MedFuse essentially cannot identify which of its predictions to trust. MedCertAIn can.

The gains also hold across patient subgroups. For age groups, MedCertAIn improves selective AUROC from 0.559 to 0.723 (ages 18-45), 0.554 to 0.730 (45-60), and 0.631 to 0.863 (over 60). Across sex subgroups, MedCertAIn also improves performance for both male and female patients. Consistent subgroup performance matters enormously for clinical deployment, where demographic fairness is a regulatory and ethical requirement.

What it can't do yet

The authors are candid about the limitations. The experiments are confined to a single task , in-hospital mortality prediction , and a single dataset, MIMIC. Reliance on the MIMIC dataset may limit external validity across institutions and patient populations, motivating evaluation in diverse clinical settings. The framework also only handles two modalities (EHR + CXR), and the corruption strategies for building the context set were adapted from prior work rather than designed with clinical domain knowledge.

There's also a practical cost: stochastic models require forward passes over sampled context points during training, making fine-tuning more computationally expensive than the deterministic baseline. The team ran experiments on NVIDIA A100 and V100 80GB GPUs.

The real breakthrough

The deeper contribution here isn't the architecture , it's the pipeline for building uncertainty-aware priors without any expert annotation. The method combines Bayesian learning with automated, label-free priors to enable selective prediction without manual annotation or domain-specific expert input, making it scalable across diverse clinical settings. That's the bottleneck that has historically made Bayesian methods impractical in healthcare: you needed medical experts to curate the context set. MedCertAIn automates that entirely using self-supervised representations and data augmentation.

The code is implemented in JAX and is publicly available. The framework is designed to wrap around existing multimodal architectures, meaning teams already running MedFuse or similar pipelines could layer uncertainty estimation on top without rebuilding their models. For teams building clinical decision support systems where a wrong confident prediction is worse than a deferred uncertain one, that's a meaningful practical path forward.