Source-linked AI summary
Continual Test-Time Domain Adaptation
Qin Wang, Olga Fink, Luc Van Gool, Dengxin Dai
TL;DR
Continual test-time adaptation must handle changing target distributions without source data, where unreliable pseudo-labels can cause error accumulation and forgetting. CoTTA addresses these problems with averaged predictions and stochastic restoration of source weights, significantly improving performance across classification and segmentation benchmarks.
Problem
Continual test-time adaptation addresses online adaptation to changing target data without access to source data, a setting relevant to real-world machine perception.
Method
CoTTA improves pseudo-labels with weight- and augmentation-averaged predictions and preserves source knowledge by stochastically restoring parts of the model to source weights.
Results
CoTTA significantly improves continual test-time adaptation performance on four classification tasks and one segmentation task.
Takeaways & Limitations
CoTTA can adapt off-the-shelf source-pre-trained models to continually changing target data without requiring access to source data.
Takeaways & Limitations
The online setup restricts the model to the current test-data stream, without access to the full test set or source data.
Abstract
from arXiv · showhide
Test-time domain adaptation aims to adapt a source pre-trained model to a target domain without using any source data. Existing works mainly consider the case where the target domain is static. However, real-world machine perception systems are running in non-stationary and continually changing environments where the target domain distribution can change over time. Existing methods, which are mostly based on self-training and entropy regularization, can suffer from these non-stationary environments. Due to the distribution shift over time in the target domain, pseudo-labels become unreliable. The noisy pseudo-labels can further lead to error accumulation and catastrophic forgetting. To tackle these issues, we propose a continual test-time adaptation approach~(CoTTA) which comprises two parts. Firstly, we propose to reduce the error accumulation by using weight-averaged and augmentation-averaged predictions which are often more accurate. On the other hand, to avoid catastrophic forgetting, we propose to stochastically restore a small part of the neurons to the source pre-trained weights during each iteration to help preserve source knowledge in the long-term. The proposed method enables the long-term adaptation for all parameters in the network. CoTTA is easy to implement and can be readily incorporated in off-the-shelf pre-trained models. We demonstrate the effectiveness of our approach on four classification tasks and a segmentation task for continual test-time adaptation, on which we outperform existing methods. Our code is available at \url{https://qin.ee/cotta}.
1. Introduction
Continual test-time adaptation addresses online model updating when unlabeled target data arrive from a changing environment without source-data access. CoTTA combines more reliable pseudo-labels with source-knowledge preservation to reduce error accumulation and forgetting during long-term adaptation.
- Problem: Changing target distributions make pseudo-labels noisier and mis-calibrated, increasing the risk of error accumulation and long-term forgetting.Existing self-training and entropy-based methods are more stable when test data come from a stationary domain.
- Problem: Continual test-time adaptation updates a source-pretrained model online from unlabeled target streams whose distribution changes over time, without source data.This setting targets real-world machine perception under non-stationary domain shifts.
- Approach: CoTTA reduces error accumulation with weight-averaged and augmentation-averaged pseudo-labels that are intended to provide more accurate predictions.The weight-averaged teacher supports prediction quality, while augmentation averaging helps under larger domain gaps.
- Approach: CoTTA alleviates forgetting by stochastically restoring a small part of the network’s neurons to the source pretrained weights.This explicitly preserves source knowledge while adapting the model continually.
- Evaluation: The method is readily incorporated into off-the-shelf pretrained models and significantly improves continual adaptation performance across four classification tasks and one segmentation task.The approach does not require retraining on source data.
2. Related Work
Related work spans source-free test-time adaptation, continuous domain adaptation, continual learning, and robustness-oriented augmentation. The paper distinguishes its setup by combining online adaptation, continually changing target data, and no source-data access.
- Test-time Adaptation: Unsupervised domain adaptation aligns labeled source and unlabeled target distributions during training, whereas test-time adaptation adapts during inference without source-domain data.Test-time adaptation may use generative alignment, entropy minimization, normalization statistics, or other model-update strategies.
- Test-time Adaptation: Most test-time adaptation methods address fixed target domains, while standard evaluation often provides the full test set rather than an online stream.The paper identifies online machine-perception settings as less realistic for these assumptions.
- Continuous Domain Adaptation: Continuous domain adaptation studies continually changing target data, but existing methods generally require access to both source and target domains for distribution alignment.Examples include adversarial alignment and assumptions of gradual domain continuity.
- Continuous Domain Adaptation: Continual test-time adaptation additionally performs adaptation at test time without source-data access, targeting long-term online updates under changing environments.The paper presents this as a practical scenario with limited applicable prior approaches.
- Related Directions: Continual-learning methods offer replay-based and regularization-based ideas for addressing catastrophic forgetting, while augmentation methods aim to improve robustness and generalizability.The paper relates these directions to, but does not equate them with, continual test-time adaptation.
3. Continual Test-Time Domain Adaptation
CoTTA addresses online adaptation to a continually changing target stream without source data by refining pseudo-labels and preserving source knowledge. It combines weight- and augmentation-averaged teacher predictions with stochastic restoration during continual updates.
- Problem Definition: The setup adapts an existing source-pretrained model online using only sequential unlabeled target data from a continually changing distribution.The model predicts and updates at each time step, with access limited to the current stream and no source data or full test set.
- Continual Test-Time Adaptation: CoTTA is designed for long-term adaptation of off-the-shelf pretrained networks in continually changing environments, unlike methods focused on fixed target domains.The setup is motivated by online machine perception applications such as autonomous driving.
- Weight-Averaged Pseudo-Labels: CoTTA uses a weight-averaged teacher to generate pseudo-labels and trains the student by consistency between teacher and student predictions.The teacher is initialized from the source model and updated by exponential moving average after student updates.
- Weight-Averaged Pseudo-Labels: Weight-averaged predictions incorporate information from past iterations, reducing error accumulation and making the model less prone to catastrophic forgetting.The paper links these benefits to the higher quality of weight-averaged predictions and their retained historical information.
- Augmentation-Averaged Pseudo-Labels: Confidence estimates determine whether the teacher prediction is used directly or refined with N random augmentations for augmentation-averaged pseudo-labels.High source-model confidence avoids augmentation, while low confidence triggers additional augmentations to improve pseudo-label quality.
- Stochastic Restoration: Stochastic restoration preserves source knowledge by restoring randomly selected trainable weight elements to their source values during adaptation.The restoration uses a mask and a small restore probability, and is combined with refined pseudo-labels in CoTTA.
4. Experiments
Experiments evaluate continual test-time adaptation across classification and semantic segmentation tasks under sequentially changing corruptions and adverse conditions. CoTTA consistently improves reported performance, including 10.4% error on gradual CIFAR10-to-CIFAR10C, 32.5% error on CIFAR100-to-CIFAR100C, and 58.6% mIoU on Cityscapes-to-ACDC.
- Datasets and tasks: The evaluation covers five benchmark tasks spanning CIFAR10, CIFAR100, ImageNet classification, and Cityscapes-to-ACDC semantic segmentation.Classification includes standard and gradual CIFAR10-to-CIFAR10C, CIFAR100-to-CIFAR100C, and ImageNet-to-ImageNet-C.
- CIFAR10-to-CIFAR10C: CIFAR10C experiments use online sequential corruption streams at severity level 5, with WideResNet-28 updated one step per test point.The setup uses 32 random augmentations and updates all trainable parameters with restoration probability p = 0.01.
- CIFAR10-to-CIFAR10C: 16.2% error is achieved after combining weight-averaged pseudo-labels, augmentation averaging, and stochastic restoration on standard CIFAR10-to-CIFAR10C.The ablation reports successive error rates of 20.7%, 18.3%, 17.4%, and 16.2% as components are added.
- CIFAR10-to-CIFAR10C: 10.4% error is obtained on gradually changing CIFAR10-to-CIFAR10C, compared with 30.7% for TENT.Results average performance over ten diverse corruption-type sequences.
- CIFAR100-to-CIFAR100C: 32.5% error on CIFAR100-to-CIFAR100C represents a 2.9% absolute improvement over BN stats adapt, with gains increasing over time.TENT-continual deteriorates rapidly on later corruption types because of error accumulation and forgetting.
- Cityscapes-to-ACDC: 58.6% mIoU is achieved on Cityscapes-to-ACDC, a 1.9% absolute improvement over the baseline for continual semantic segmentation.The method remains effective across different architectures and does not rely on selecting specific normalization layers.
5. Conclusion
CoTTA addresses continual test-time adaptation in non-stationary environments by reducing error accumulation and preserving source knowledge without source-data access.
- CoTTA targets continual test-time adaptation when the target distribution changes over time.
- Weight-averaged and augmentation-averaged predictions reduce error accumulation by improving pseudo-label quality.
- Stochastically restoring a small part of the weights to source pre-trained values helps preserve source knowledge.
- CoTTA works with off-the-shelf pre-trained models without access to source data and was evaluated on four classification and one segmentation task.