Md Shazid Islam
MICCAI 2025

ODES

Online Domain Adaptation with Expert Guidance for Medical Image Segmentation

Md Shazid Islam, Sayak Nag, Arindam Dutta, Sk Miraj Ahmed, Fahim Faisal Niloy, Shreyangshu Bera, Amit K. Roy-Chowdhury

University of California, Riverside

Animated overview of ODES: offline vs online adaptation, the per-batch pipeline, diversity weighting, and results

A segmentation model trained on one scanner breaks on another. ODES fixes it on the fly, one batch of patients at a time. It asks an expert to label just 1% of the pixels, on the images and patches that matter most. It never sees the source data and stores nothing.

The problem

Medical segmentation models lose accuracy under domain shift. A new scanner, a new MRI contrast, or a new hospital is enough. In a clinic, patient scans arrive one after another, so the model has to adapt online. It sees each batch once and gets exactly one forward and backward pass.

Existing options each fall short:

  • Unsupervised domain adaptation needs the labeled source data, which privacy rules often block, and a large offline target set.
  • Test-time adaptation (TTA) works online, but it learns from the model's own pseudo-labels. These are noisy, and errors hurt most on small organs.
  • Offline active domain adaptation adds expert labels, but it needs to store training data and annotations and run many passes.
Three adaptation setups: offline ADA with annotation storage, TTA without expert input, and ODES with expert input and no storage
Three setups. (a) Offline active domain adaptation stores data and annotations. (b) Test-time adaptation has no expert in the loop. (c) ODES brings in the expert online, with no source data and no storage.

ODES fits real clinical timing. The expert labels a few patches during the turnover time between two patients’ scans, so the workflow is not slowed down.

How ODES works

For every incoming batch, ODES runs an infer, acquire, update loop.

ODES pipeline: a stream of batches goes into the pretrained model, then image pruning and acquisition pick patches for expert feedback, and the loss updates the model
The online loop. The pretrained model predicts on the batch. The active learning block prunes the batch (IP), picks the most useful patches (A), gets expert labels, and updates the model before the next batch arrives.

1Image pruning: label only the most shifted images

Not every image in a batch is equally shifted, so labeling all of them wastes the expert’s time. ODES compares each image’s batch-normalization statistics with the statistics stored from the source domain. Each image is lightly augmented (flips, small rotations, brightness changes). Then a KL divergence is computed between the source and target per-channel Gaussians across BN layers. Only the top K% most shifted images move on.

2Acquisition: find the uncertain, mixed regions

Within each kept image, ODES scores square patches with two signals:

  • Uncertainty: the average pixel entropy of the prediction inside the patch.
  • Regional impurity: how many classes are mixed inside the patch, which flags boundaries between organs.

Multiplying the two gives an initial acquisition map. On its own, though, it tends to pick many patches that sit next to each other and look alike.

3Diversity weighting: spread the labels out

ODES runs farthest-first traversal twice on the high-uncertainty points. The first pass spreads them out in image space (Euclidean distance). The second spreads them out in feature space (cosine distance). It places a Gaussian at each chosen point to build two weight maps and multiplies them. The final map is uncertainty × impurity × diversity weight. The expert labels the top b% of the image area from this map.

Diversity weighting: the initial acquisition map is reweighted by spatial and feature diversity maps to form the final map
Diversity weighting. Uncertain patches start clustered (Ainit). Spatial (Wd) and feature (Wf) diversity maps spread them out in the final map (Afinal).

4Update: one quick pass

Only the batch-normalization layers are updated. The loss has two parts:

  • A supervised cross-entropy loss on the expert-labeled patches.
  • A continuity loss between neighboring MRI slices, since one volume changes smoothly from slice to slice.

Then the model moves on to the next patient.

Results

ODES was tested on three domain shifts:

  • CHAOS T1 MRI, in-phase to out-of-phase (liver, both kidneys, spleen).
  • CHAOS T2-SPIR to DUKE (liver).
  • Prostate MRI from BMC to RUNMC.

The backbone is DeepLabv3, the annotation budget is 1% of pixels, and the metric is Dice.

78.61mean Dice, CHAOS IP→OOP. Best TTA: 73.19
71.65liver Dice, CHAOS→DUKE. Best TTA: 58.39
79.34prostate Dice, BMC→RUNMC. Best TTA: 74.91
1%of pixels labeled by the expert

Against online test-time adaptation

MethodCHAOS IP→OOP (mean)CHAOS→DUKE (liver)BMC→RUNMC (prostate)
Source only52.9926.2865.32
TENT67.3046.6471.02
CoTTA67.1052.5873.87
F-TTA70.1348.2973.18
STTA67.1353.3673.51
SaTTCA73.1958.3974.91
TTAS69.4149.3972.81
ODES (K = 100)78.6171.6579.34
ODES (K = 50)78.5670.1678.36
ODES (K = 10)76.8066.1177.47

Dice scores (%). K is the share of each batch kept after image pruning.

Labeling far fewer images costs little. On CHAOS→DUKE, keeping 50% of each batch instead of all of it drops Dice by only 1.49%. Keeping 10% drops it by 5.54%.

Against offline active domain adaptation

Offline methods such as RIPU and LabOR train with many passes over stored data. ODES gets one pass per batch, yet stays close to them. Its gap to LabOR is 2.79%, 1.06%, and 2.66% on the three shifts.

Visual comparison: input MRI, ground truth, SaTTCA, RIPU, and ODES masks
Visual comparison. From left: input, ground truth, SaTTCA (test-time adaptation), RIPU (offline), and ODES.

Code

The code is open source at github.com/ShazidAraf/ODES. It needs Python 3.8+, PyTorch 1.10+, OpenCV, NumPy, SciPy, and scikit-learn.

git clone https://github.com/ShazidAraf/ODES.git
cd ODES
python demo_ODES.py --cfg cfgs/example_config.yaml

Edit the YAML config to point at your dataset and set K and the budget b.

Citation

@inproceedings{islam2025odes,
  title     = {ODES: Online Domain Adaptation with Expert Guidance for Medical Image Segmentation},
  author    = {Islam, Md Shazid and Nag, Sayak and Dutta, Arindam and Ahmed, Sk Miraj and
               Niloy, Fahim Faisal and Bera, Shreyangshu and Roy-Chowdhury, Amit K.},
  booktitle = {Medical Image Computing and Computer Assisted Intervention (MICCAI)},
  year      = {2025}
}

This work was supported by the U.S. National Science Foundation under grants OAC-2411453 and DMS-2029814.