Test-time Unsupervised Domain Adaptation

Thomas Varsavsky, Mauricio Orbes-Arteaga, Carole H. Sudre, Mark S. Graham, Parashkev Nachev, M. Jorge CardosoarXiv 2020

TL;DR

Medical imaging models often fail when moved from research labs to clinical scanners due to "domain shift." This paper proposes test-time unsupervised domain adaptation (UDA), a framework where a model fine-tunes itself on a single unlabelled patient scan at the moment of testing. By treating every individual scan as its own unique domain, the authors achieve segmentation performance that rivals supervised models without requiring any new manual labels.

What Problem Does This Paper Address?

Deep learning models for brain MRI segmentation are notoriously brittle. A convolutional neural network (CNN) trained on a specific dataset (the "source domain") usually performs poorly when applied to data from a different scanner or acquisition protocol (the "target domain").

While traditional Unsupervised Domain Adaptation (UDA) tries to bridge this gap by training on a large batch of unlabelled data from the new scanner, clinical reality is much messier. The authors point out that a single hospital might use over 1,400 different MRI sequences. In such a heterogeneous environment, the "target domain" isn't a single scanner—it's every individual scan. The challenge is: how can we adapt a model to a specific patient's scan when we have zero labels for that patient?

Methods

The authors propose a method that combines Domain Adversarial Learning and Paired Consistency within a 2D U-Net architecture.

  1. Domain Adversarial Learning ($L_{adv}$): A domain discriminator tries to guess if a feature map came from the source or target domain. The segmentation network is trained to "fool" this discriminator, effectively forcing it to learn features that are invariant to the specific scanner or protocol.
  2. Paired Consistency ($L_{pc}$): This is the "self-supervised" heart of the approach. The model takes a target image, applies a random augmentation (like rotation or brightness shifts), and then forces the predictions for the original and augmented images to be consistent.
  3. Test-Time Adaptation: Unlike standard UDA, which adapts to a broad population, this method performs these optimizations on the specific test subject at hand. They call the version adapted to a single subject "one-shot UDA."
Fig. 1. Left: Our domain adaptation method uses a paired consistency loss Lpc which encourages predictions from the target image xT to be invariant to some augmentation g. The backbone is a single 2D U-Net (parameters are shared) with features from each depth being interpolated bilinearly, concatenated and fed to a domain discriminator which uses an adversarial loss Ladv to maximise domain confusion. Right: In a) we depict representations of pixels in some feature space, the green circle is source and red target with crosses and circles depicting foreground and background. b) shows what happens when we introduce an adversarial loss, the feature spaces are shifted such that they are indistinguishable from the source domain but the decision boundary is drawn with only souce data. In c) we show the effect of the PC loss in moving the decision boundary to an area of low-density

Datasets

The study focused on Multiple Sclerosis (MS) lesion segmentation:

  • Source Domains: Data from the MICCAI MS2008 and MS2016 challenges.
  • Target Domain: The ISBI2015 challenge dataset.
  • Preprocessing: All data underwent standard pipelines including skull-stripping, bias-field correction, and registration to a common space (MNI).

Key Insights and Ideas

  • The "Subject-as-a-Domain" Philosophy: The most important insight is that treating each scan as its own domain is more effective than trying to generalize across a broad, heterogeneous target domain.
  • Moving the Boundary: Adversarial loss is great for aligning distributions, but it doesn't necessarily help the classifier distinguish between classes. The consistency loss ($L_{pc}$) acts as a regularizer that pushes the decision boundary away from data clusters into "low-density" regions, which significantly improves the precision of the lesion masks.
  • Labels Aren't Always King: The authors show that adapting to the specific anatomy and pathology of a test subject—even without labels—can be more powerful than having seen many other (different) subjects from the same scanner.

Key Results

The authors compared their "Test-time UDA" against several baselines, including a "Classic UDA" (which sees other target subjects but not the test subject) and a "Supervised" gold standard.

As shown in the table below, the proposed test-time methods significantly outperformed both the "No Adaptation" baseline and the "Classic UDA" approach.

Quantitative results showing that Test-time UDA ranks second only to the Supervised model across multiple metrics like Dice score and Sensitivity.

Qualitatively, the results show that test-time adaptation helps eliminate false positives (blue) and capture more true lesion areas (green) compared to models that haven't been adapted to the specific subject.

Fig. 2. Some qualitative results comparing no adaptation, classic unsupervised domain adaptation, one-shot unsupervised domain adaptation, test-time unsupervised domain adaptation, and the hypothetical gold-standard using supervised learning. Red denotes the ground-truth annotation, true positives are shown in green, false negatives are in yellow and false positives are in blue.

Limitations and Future Work

  • Computational Overhead: Performing optimization at test time is significantly slower than a simple forward pass. While the paper doesn't dwell on timing, this could be a hurdle for real-time clinical applications.
  • Validation Noise: The authors note that one limitation of their validation is the low inter-rater agreement in the ISBI dataset, which can make it difficult to perfectly rank highly-performing models.
  • Future Directions: The team plans to extend this work to brain tumor segmentation and explore how other UDA methods perform when moved into this "test-time" framework.

Summary updated

BibTeX
@misc{varsavsky2020test,
  author = {Thomas Varsavsky and Mauricio Orbes-Arteaga and Carole H. Sudre and Mark S. Graham and Parashkev Nachev and M. Jorge Cardoso},
  title = {{Test-time Unsupervised Domain Adaptation}},
  year = {2020},
  eprint = {2010.01926},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.01926},
}
Figure