Source-linked AI summary

A Comprehensive Survey on Test-Time Adaptation under Distribution Shifts

Jian Liang, Ran He, Tieniu Tan

arXiv:2303.15361v2cs.LGcs.AIcs.CV

TL;DR

Unknown test distributions can degrade models trained to generalize under distribution shifts. This survey unifies test-time domain, batch, and online adaptation, reviews their methods and applications, and identifies open research problems. It concludes that TTA remains focused mainly on robustness while theoretical understanding and broader trustworthy-machine-learning goals remain open concerns.

  • Problem

    Distribution shifts and unknown test distributions make it difficult for trained models to maintain performance on deployed test data.

  • Method

    The survey unifies test-time domain adaptation, test-time batch adaptation, and online test-time adaptation, then organizes their algorithms, applications, and research directions.

  • Results

    The survey provides a comprehensive review and taxonomy of the three TTA topics, together with application coverage and an outlook on emerging trends and open problems.

  • Takeaways & Limitations

    TTA is presented as a broad paradigm for adapting pre-trained models to unlabeled target data during testing before prediction.

  • Takeaways & Limitations

    Theoretical analysis of when and why TTA works remains an open problem, especially for deep learning.

Abstract

from arXiv · show

Machine learning methods strive to acquire a robust model during the training process that can effectively generalize to test samples, even in the presence of distribution shifts. However, these methods often suffer from performance degradation due to unknown test distributions. Test-time adaptation (TTA), an emerging paradigm, has the potential to adapt a pre-trained model to unlabeled data during testing, before making predictions. Recent progress in this paradigm has highlighted the significant benefits of using unlabeled data to train self-adapted models prior to inference. In this survey, we categorize TTA into several distinct groups based on the form of test data, namely, test-time domain adaptation, test-time batch adaptation, and online test-time adaptation. For each category, we provide a comprehensive taxonomy of advanced algorithms and discuss various learning scenarios. Furthermore, we analyze relevant applications of TTA and discuss open challenges and promising areas for future research. For a comprehensive list of TTA methods, kindly refer to \url{https://github.com/tim-learn/awesome-test-time-adaptation}.

1 Introduction

Distribution shifts undermine models trained under i.i.d. assumptions, motivating test-time adaptation from unlabeled target data. The survey unifies TTDA, TTBA, and OTTA, and organizes their methods, applications, and open problems.

  • Distribution shifts arise when test data differ from training data, challenging systems deployed across cameras, cities, and hospitals.
  • TTA adapts a pre-trained source model to unlabeled target data during testing before predictions are made.
  • TTDA uses all test batches for multi-epoch adaptation, TTBA adapts independently to one or a few instances, and OTTA adapts online while observing each batch once.
  • The survey defines TTA broadly and treats test-time domain, batch, and online adaptation as special cases.
  • It proposes a taxonomy of existing methods, reviews TTA applications, and discusses emerging trends and open problems.
  • Unlike prior surveys centered on domain adaptation or source-free adaptation, this survey unifies related model-adaptation topics under distribution shifts.

2 Related Research Topics

TTA is connected to domain adaptation, hypothesis transfer, domain generalization, self-supervised learning, semi-supervised learning, and test-time augmentation. These neighboring paradigms differ in their data access, supervision, adaptation timing, or objective.

  • Domain adaptation transfers knowledge from labeled source data to an unlabeled target domain with a different distribution.
  • Online domain adaptation uses streaming unlabeled target data that are promptly deleted after adaptation, closely relating it to OTTA.
  • Hypothesis transfer learning uses pre-trained source hypotheses but typically requires some labeled target data, unlike TTA's unlabeled test-data setting.
  • Domain generalization trains on one or more related domains to generalize to unseen testing domains, while meta-learning can prepare fast adaptation without test data during meta-training.
  • Self-supervised learning obtains supervisory signals from data through pretext tasks, which can provide discriminative features or auxiliary objectives for TTA.
  • Test-time augmentation transforms test images and aggregates predictions to improve accuracy, estimate uncertainty, or enhance robustness.

3.1 Problem Definition

The survey formalizes domains as joint input-label distributions and distinguishes labeled source data from unlabeled target data under distribution shifts. Its source-free setting adapts a trained classifier using target data without source-domain access.

  • A domain is a joint distribution p(x, y) over an input-output space, with x denoting input data and y denoting labels.
  • The source domain provides labeled data, whereas the target domain provides unlabeled data under a shifted distribution.
  • The formal setup includes covariate shift, where pS(y|x) = pT(y|x) while pS(x) ≠ pT(x), with other shifts discussed separately.
  • Source-free domain adaptation adapts a source classifier to unlabeled target features without access to source data during adaptation.

Definition 2 (Test-Time Domain Adaptation,

Test-time domain adaptation uses the labeled knowledge embedded in a trained source classifier to infer labels for all unlabeled target samples. Adaptation is transductive and requires seeing all target data during adaptation.

  • TTDA leverages a well-trained source classifier to infer labels for every sample in an unlabeled target domain.
  • TTDA follows a transductive learning manner and requires all target data to be observed during adaptation.

3.2 Taxonomy on TTDA Algorithms

TTDA methods use unlabeled target data through pseudo-labeling, consistency training, and clustering-based strategies, with source-distribution estimation providing another adaptation route.

  • Pseudo-labeling: Most TTDA methods adapt to unlabeled target domains using semi-supervised learning techniques, especially pseudo-labeling.
  • Pseudo-labeling: Pseudo-labeling methods improve adaptation by denoising labels, filtering inaccurate samples, or using robust divergences for noisy supervision.
  • Pseudo-labeling: Centroid-based labels assign samples to class centroids, while neighbor-based labels aggregate predictions from locally similar target samples.
  • Pseudo-labeling: Other pseudo-labeling strategies use complementary labels, distribution-aware optimization, or ensembles of predictions and labeling criteria.
  • Consistency training: Consistency training enforces similar predictions or features across data variants and model variants, including teacher-student formulations.

3.3 Learning Scenarios of TTDA Algorithms

TTDA learning scenarios vary by label-space relationship and by whether the shift concerns input data or label distributions.

  • Label-space scenarios: Most TTDA methods assume a closed-set scenario, while some address partial-set and open-set target label spaces.
  • Model and distribution scenarios: TTDA research also considers black-box models and label shifts, where the target label distribution differs from the source distribution.

4 Test-Time Batch Adaptation

Test-time batch adaptation adapts a source-trained classifier to one or a few unlabeled target instances before prediction. It connects instance-level and batch-level adaptation, with batch size determining the relationship between TTIA, TTBA, and TTDA.

  • TTIA adapts an off-the-shelf source-trained model to an individual unlabeled target instance under distribution shift.
  • TTBA adapts a source-trained classifier to a mini-batch of unlabeled target instances and predicts for them simultaneously.
  • Predictions within TTBA are interdependent because each instance can influence adaptation using the other instances in its mini-batch.
  • TTBA approaches TTDA for sufficiently large batches and becomes TTIA when the batch size equals 1.
  • These adaptation schemes typically assume no access to source data or target-domain ground-truth labels.

4.2 Taxonomy on TTBA Algorithms

TTBA algorithms primarily calibrate normalization statistics or optimize model parameters using unlabeled test data. The survey organizes parameter optimization around auxiliary self-supervised tasks and unsupervised fine-tuning objectives.

  • Batch Normalization Calibration: Batch-normalization methods replace or combine source statistics with target-batch estimates to reduce domain mismatch during inference.PredBN replaces training statistics, while PredBN+ and TTN interpolate or calibrate statistics using test-time estimates.
  • Batch Normalization Calibration: Normalization-statistics methods can struggle with small batches, especially B = 1, motivating mixtures with instance normalization or augmented batches.SaN mixes instance- and training-BN statistics, InstCal learns their weighting, and AugBN constructs an augmented batch.
  • Model Optimization: Parameter-optimization methods either train with auxiliary self-supervised tasks or fine-tune with unsupervised objectives at test time.
  • Model Optimization: TTT and OSHOT use a shared self-supervised task during training and testing to adapt feature representations for each test instance or batch.TTT adjusts the feature encoder, whereas OSHOT updates both the feature encoder and self-supervised head.
  • Model Optimization: Follow-up methods strengthen task coupling, diversify self-supervision, or use consistency objectives for spatial, temporal, and other application-specific adaptation.Examples include GeOS, SR-TTT, TTT-MAE, and video methods enforcing temporal consistency.
  • Model Optimization: Meta-learning methods prepare models for rapid adaptation using a few unlabeled test samples and gradient steps or instance-specific forward mechanisms.MLSR adapts a meta-learned network for super-resolution, while related methods extend meta-tailoring and auxiliary learning.

4.3 Learning Scenarios of TTBA Algorithms

TTBA learning scenarios vary by whether adaptation uses a single instance or a batch and whether the source model was customized for test-time adaptation. The survey also distinguishes single-source from multiple-source settings.

  • Instance v.s. Batch: TTBA learning scenarios distinguish instance adaptation from batch adaptation according to whether one target instance or a target batch is available.
  • Customized v.s. Training-Agnostic: Some methods assume customized source-domain training, such as an auxiliary-head architecture, while others adapt models without customized source training.
  • Single v.s. Multiple: The survey further contrasts vanilla TTA using one source domain with methods designed for multiple source domains.

5 Online Test-Time Adaptation

Online test-time adaptation updates predictions sequentially from a stream of unlabeled mini-batches while accumulating knowledge from previously seen data. Its methods include normalization calibration and objective-based model updates, but streaming shifts create risks such as error accumulation and catastrophic forgetting.

  • Online Test-Time Adaptation: Offline adaptation may be infeasible for streaming data, motivating online methods that operate as data arrive sequentially.
  • Online Test-Time Adaptation: OTTA adapts a source-trained classifier to a sequence of unlabeled target mini-batches while carrying knowledge from earlier batches forward.
  • Online Test-Time Adaptation: When test samples span varied distributions, OTTA faces challenges including error accumulation and catastrophic forgetting.
  • Batch Normalization Calibration: Online BN calibration replaces, interpolates, or recursively updates source statistics using statistics estimated from current and previous test batches.Tent and RNCR replace fixed statistics; Core interpolates source and test statistics; ONDA uses running updates.
  • Batch Normalization Calibration: Moving-average test-time statistics and stop-gradient formulations are used to stabilize online BN adaptation.
  • Batch Normalization Calibration: Online single-sample methods mix instance and BN statistics, decay weighting, construct augmented batches, or maintain class-balanced memory banks.
  • Model Optimization: Online model optimization commonly uses entropy minimization, selective sample updates, alternative objectives, pseudo labels, or prediction consistency.The survey also covers mutual-information and nuclear-norm objectives, teacher-student consistency, augmentation consistency, and temporal consistency.

6 Applications 4

TTA is applied across diverse visual, medical, signal, language, retrieval, generative, and defense tasks. The survey also emphasizes that evaluation protocols must align test-time optimization with immediate or subsequent evaluation settings.

  • Applications: TTA is most commonly evaluated for multi-class image classification, including domain-adaptation and corruption benchmarks.TTDA uses Digits, Office, Office-Home, VisDA-C, and DomainNet, while TTBA and OTTA use CIFAR-C, ImageNet-C, and ImageNet-R.
  • Applications: Semantic segmentation uses synthetic-to-real and cross-city datasets, while object detection evaluates shifts across cities, weather, and domains.Examples include GTA5-to-Cityscapes, SYNTHIA-to-Cityscapes, Cityscapes-to-Cross-City, and multiple Cityscapes, KITTI, VOC, and BDD100k transfers.
  • Applications: TTA extends beyond core vision to medical imaging, low-level vision, retrieval, generative modeling, adversarial defense, NLP, graphs, speech, and other signals.The surveyed tasks include segmentation, super-resolution, deblurring, image-text matching, question answering, graph classification, speech recognition, radar, EEG, and vibration signals.
  • Evaluation: Evaluation protocols differ because some TTDA studies adapt on an unlabeled target set and evaluate on a same-distribution test set, unlike standard OTTA.The survey recommends that continual TTA follow the standard OTTA protocol, where optimization is conducted ahead of evaluation.

7 Emerging Trends and Open Problems

The survey identifies expanding application settings alongside unresolved theoretical, validation, fairness, security, privacy, and explainability challenges. In particular, understanding when TTA works and validating methods without labeled target data remain open problems.

  • Emerging Trends: Emerging TTA applications include video, multimodal data, 3D point clouds, regression, and open-world adaptation beyond conventional visual tasks.Existing methods generally follow a closed-set assumption, motivating broader settings.
  • Open Problems: Theoretical explanations of when and why TTA works remain limited, especially for deep learning models and substantial distribution shifts.Existing theoretical results mainly analyze specific designs under linear models, while deeper analyses are identified as a research need.
  • Open Problems: Validation remains unsolved because TTA typically lacks a labeled validation set, despite newly proposed benchmarks for fairer comparisons.Recent benchmarks cover architectures such as ViT and continuously changing corruptions, but do not resolve validation without labels.
  • Open Problems: Class-wise fairness, backdoor security, prediction overconfidence, privacy, and explainability are insufficiently investigated in current TTA methods.The survey specifically notes missing worst-class accuracy analysis and risks from malicious source models and overconfident predictions.

8 Conclusion

The survey unifies test-time domain adaptation, test-time batch adaptation, and online test-time adaptation under the broader TTA paradigm. It reviews their taxonomies, applications, emerging trends, and open problems to characterize the field's current state.

  • Conclusion: TTA adapts pre-trained models to unlabeled data under distribution shifts and unifies TTDA, TTBA, and OTTA as related topics.The survey provides definitions and taxonomies for each topic, then reviews applications and emerging research directions.
Loading 2303.15361v2…