VIOS group Seminar | University of Edinburgh

On Uncertainty Quantification under Distribution Shift in Image Regression

Viacheslav (Slava) Borovitskiy

https://vab.im

Talk outline

Introduction

  • Uncertainty quantification: Motivation and background
  • Uncertainty quantification in image regression
  • The villain: Distribution shift

Solution #1: The principled baseline

  • The method
  • Scattering transforms
  • Discussion and benchmarking

Solution #2: Foundation model-based

  • The method
  • Discussion and benchmarking

Summary & future

Why do uncertainty quantification?

Why do uncertainty quantification?

Uncertainty quantification ≈ predicting magnitude/probability of error

Safety

Threshold on uncertainty — abstain from prediction when uncertainty is high

Decision Optimization

E.g. use uncertainty to prioritize data annotation — pick the most informative points to label next

$^*$Actual guarantees require assumptions on the model & data distribution

Formalism: Probabilistic models

Probabilistic models: input distribution (prediction + uncertainty)

Allows computing queries like mutual information: $\!\alpha(x) \!=\! I(y(x); f \given \mathcal{D})$

Can help selecting the optimal point to add to data [Active learning]

Main approaches for uncertainty quantification

Main approaches for uncertainty quantification

Bayesian neural networks

Deep ensembles

$\underbrace{\hphantom{\text{Bayesian Neural Networks}\qquad{Deep ensembles}}}_{\text{defined by neural network architectures}}$

Gaussian processes

$\underbrace{\hphantom{\text{Gaussian Processes}}}_{\text{defined by kernels}}$

Uncertainty quantification in image regression

For example:

Predict skin lesion size

$ \rightarrow $
$ \mathcal{N}(\mu, \sigma^2) $

Predict molecule properties

$ \rightarrow $
$ \mathcal{N}(\mu, \sigma^2) $

Default approach — deep ensembles:

  • Retrain one architecture $K$ times, get $f_1, \ldots, f_K$
  • Prediction: $f(x) = \tfrac{1}{K} \sum_{k=1}^K f_k(x)$
  • Uncertainty: $\sigma(x) = \bigl(\tfrac{1}{K} \sum_{k=1}^K (f_k(x) - f(x))^2\bigr)^{1/2}$

$^*$Usually $f_i$ are also trained to predict variance (formulas adjust)

The villain: Distribution shift

For example:

In distribution
(training set)

Out of distribution
(change in equipment & population)

You cannot expect to maintain quality of prediction under distribution shift

But: you would hope that uncertainty remains meaningful

It's usually not the case (e.g., for ensembles — Ovadia et al. 2019) 🙁

(It gets even worse if there is not a lot of data — common in biomed)

Ovadia et al. – Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift

Solution #1: The principled baseline

Solution #1: The principled baseline

The method is called Bayesian Scattering (Fichera et al. 2026)

Key idea:

  • Fixed features cannot overfit to train distribution
  • If we use a simple probabilistic head on top, might avoid it altogether

Where to find such fixed universal features?

Fichera et al. – Bayesian Scattering: A Principled Baseline for Uncertainty on Image Data

Finding fixed universal features

Go back 15 years. CNNs are the best.
Can we achieve same performance with little to no learning?

Yann LeCun

VS

Stephane Mallat

Mallat tried and... almost did it,
creating wavelet scattering transforms along the way.

Wavelet scattering transform: Desiderata

Problem: Find a feature map that transforms image $\rightarrow$ features,
with geometric properties applicable universally across all image data:

Translation (in,equi)variance

Stability to additive noise

Stability to smooth deformations

All this + preserving the bulk of information (invertibility in the limit)

Wavelet scattering transform: Solution

Problem: Find a feature map that transforms image $\rightarrow$ features,
with universal geometric properties + preserving information

Turns out it is not trivial at all

Mallat (2011), Bruna and Mallat (2012):
— solution based on repeated application of wavelet transforms

By the way, it generalizes to 3D and allows for rotation (in,equi)variance too!

Mallat (2011) — Group Invariant Scattering
Bruna and Mallat (2012) — Invariant Scattering Convolution Networks
Eickenberg et al. (2018) — Solid Harmonic Wavelet Scattering for Predictions of Molecule Properties

Why repeated application of wavelet transforms?

  • Fourier transform (simpler) + nonlinearity – not stable under deformations
  • Wavelet transform + nonlinearity – stable, but not translation-invariant
  • Averaging gives translation-invariance but loses information
  • Depth is the only missing ingredient...

Figure taken from DOI:10.48550/arXiv.2511.06226.

Wavelet scattering transform

Determined by

  • Depth parameter $m \geq 1$. Usually $m=2$
  • Rotational resolution $L \geq 1$ (the higher the better but saturates quickly)
  • Parameter $J$, with $2 \leq 2^J \leq $ image size
    Roughly, interpolates between translation equivariance and invariance

Figure taken from DOI:10.48550/arXiv.2511.06226.

Wavelet scattering transform: Implementation

Benchmarking

Benchmarking: Datasets

  • Training set size: 1000 (small data)
  • Distribution shifts:
    • SLP: different equipment and skin type distribution (Austria vs Australia)
    • HP: different institution with inherent variations in staining and sample preparation
    • AW: training and test sets are drawn from disjoint lists of nations

Benchmarking: Results

Primary metric is the Negative Log-Likelihood (NLL). Conceptually:

$$ \text{NLL} \approx \text{Prediction Error} + \text{Uncertainty Calibration} $$

Key outcome: Bayesian Scattering has vastly better NLL

Solution #2: Foundation model-based

Solution #2: Foundation model-based

Key idea — same as before

Features — embeddings of some image foundation model (e.g., DINO, JEPA)

  • Features encode very broad knowledge from massive pretraining
  • If not fine-tuned on labeled training data, features remain unbiased

Benchmarking: Datasets [Repeat]

  • Training set size: 1000 (small data)
  • Distribution shifts:
    • SLP: different equipment and skin type distribution (Austria vs Australia)
    • HP: different institution with inherent variations in staining and sample preparation
    • AW: training and test sets are drawn from disjoint lists of nations

Benchmarking: Results

But we should be able to do much more:

  • Domain-specific foundation models
  • Fine-tuning foundation models:
    • Improve predictive power
    • Remain unbiased: Avoid overfitting to the training distribution

Decision optimization example

Optimizing molecular properties

Problem: optimize some property of interest over molecules (e.g. energy).

Represent molecules as approximate electronic density images:

Both Solution #1 and #2 are probabilistic models.
Bayesian optimization: choose molecules with largest expected improvement
(optimal with respect to the model, so the better the model, the faster optimization convergence)

Optimizing molecular properties: Results

Bayesian Scattering on par with UMOL-based approach for planar molecules

Bayesian Scattering outperforms UMOL-based approach for 3D molecules

Summary & future

Summary & future

Key takeaways

  • Uncertainty quantification under distribution shift is hard
  • Methods based on "unbiased" features are highly promising

Future directions

  • Can we have domain-specific yet unbiased features?
    (have your cake and eat it too)
  • What are the most interesting biomed applications?
Main author
Bernardo Fichera
Paper Info
Bayesian Scattering: A Principled Baseline for Uncertainty on Image Data
B. Fichera, Z. Ivkovic, K. Jorner, P. Hennig, V. Borovitskiy
(Available on arXiv)