Dynamic Domains, Dynamic Solutions: DPCore for Continual Test-Time Adaptation

Yunbei Zhang, Akshay Mehra, Jihun Hamm · DOI

TL;DR

This paper introduces DPCore, a novel method for Continual Test-Time Adaptation (CTTA) that excels in dynamic, real-world scenarios where target domains change unpredictably. DPCore uses a "dynamic prompt coreset" to efficiently adapt pre-trained models to these shifting environments, achieving state-of-the-art results with significantly fewer parameters and computation.

What Problem Does This Paper Address?

Deep learning models often struggle when deployed in environments where the data distribution changes over time. Continual Test-Time Adaptation (CTTA) aims to address this by adapting pre-trained models to new, unseen target domains during inference without retraining. However, existing CTTA methods often assume structured, predictable domain changes with uniform durations. Real-world scenarios, like autonomous driving, are far more dynamic, with domains recurring at varying frequencies and durations. These "Continual Dynamic Change" (CDC) environments pose significant challenges for current CTTA methods, leading to performance degradation due to issues like:

  • Convergence Issues: Brief domain exposures make it hard for models to adapt effectively.
  • Catastrophic Forgetting: Models forget previously learned knowledge as they adapt to new domains.
  • Negative Transfer: Knowledge learned from one domain can negatively impact adaptation to a different one.
  • Computational Inefficiency: Many methods require extensive warm-up or large numbers of additional parameters.

Methods

DPCore tackles these challenges with a three-pronged approach:

  1. Visual Prompt Adaptation (VPA): Instead of adapting the entire model, DPCore uses small, learnable "visual prompts" (extra tokens added to the input) to align the model with new domains. This is done by matching the statistics (mean and standard deviation) of the current batch's features with those of the source domain. This is computationally efficient and requires no source data labels.
  2. Prompt Coreset: This is the core innovation. It acts as a memory bank storing learned prompts and their associated statistics from previously encountered domains. This allows DPCore to reuse knowledge from similar domains.
  3. Dynamic Update Mechanism: This component intelligently manages the prompt coreset. When a new test batch arrives, DPCore first evaluates its similarity to existing prompts in the coreset.
  4. If the batch is similar to existing domains, the coreset prompts are refined.
  5. If the batch is significantly different, a new prompt is learned from scratch and added to the coreset. This prevents negative transfer and ensures efficient adaptation.

This dynamic coreset approach, inspired by online K-Means, allows DPCore to adapt to diverse domain change patterns without needing to know the number of domains beforehand.

Datasets

The authors evaluate DPCore on several standard benchmarks:

  • Classification:

    • ImageNet-to-ImageNet-C
    • CIFAR100-to-CIFAR100C
    • CIFAR10-to-CIFAR10C These datasets involve adapting models to corrupted versions of the original datasets, with 15 types of corruption categorized into Noise, Blur, Weather, and Digital.
  • Segmentation:

    • Cityscapes-to-ACDC

They also introduce the Continual Dynamic Change (CDC) setting, which simulates more realistic scenarios with varying domain frequencies and durations, contrasting with the traditional Continual Structured Change (CSC) setting.

Key Insights and Ideas

  • Real-world domains are messy: The paper convincingly argues that traditional CTTA settings are too simplistic and that dynamic, recurring domain changes are the norm.
  • Prompts are powerful and transferable: Visual prompts offer an efficient way to adapt models, and DPCore shows that prompts learned for similar domains can transfer effectively.
  • A dynamic memory is key: The "Prompt Coreset" acts as a smart memory, allowing DPCore to retain useful knowledge while discarding or adapting to new information, crucial for avoiding catastrophic forgetting and negative transfer.
  • Efficiency is paramount: DPCore achieves state-of-the-art performance with a dramatic reduction in trainable parameters (99% fewer than ViDA) and computation time.

Key Results

  • State-of-the-art performance: DPCore consistently outperforms existing CTTA methods on both classification and segmentation tasks in both CSC and the new CDC settings.
  • CDC robustness: In the challenging CDC setting on ImageNet-to-ImageNet-C, DPCore's error rate only increased slightly (from 39.9% to 42.1%), while previous SOTA methods like ViDA saw a significant jump (from 43.4% to 52.1%). DPCore achieved a 10.0% improvement over the second-best method in CDC.
  • Parameter efficiency: DPCore uses only 0.08M trainable parameters, a 89x reduction compared to ViDA.
  • Computational efficiency: DPCore achieves a 55.6% reduction in computation time compared to ViDA.
  • Segmentation improvement: DPCore improved mIoU scores by 0.6% and 1.8% in CSC and CDC settings respectively on the Cityscapes-to-ACDC dataset.

Limitations and Future Work

  • Source data dependency: DPCore requires access to source statistics or reference data for initial prompt learning. While they show it can work with just 300 unlabeled examples from a related dataset (like STL10 for ImageNet), this is still a requirement.
  • Batch assumption: DPCore assumes each test batch comes from a single domain. In real-world scenarios, batches might contain samples from multiple domains, which could destabilize statistics and reduce efficiency. The authors propose DPCore-B as a step towards handling small batches but acknowledge that mixed-domain batches remain a challenge.
  • Computational overhead: While efficient, DPCore still introduces some computational overhead during adaptation, which might be a concern in applications with strict latency requirements.
  • Future work: The authors identify handling mixed-domain batches and exploring more sophisticated domain similarity metrics as avenues for future research.

Summary updated

Abstract

Continual Test-Time Adaptation (CTTA) seeks to adapt a source pre-trained model to continually changing, unlabeled target domains. Existing TTA methods are typically designed for environments where domain changes occur sequentially and can struggle in more dynamic scenarios, as illustrated in Figure \ref{fig:settings}. Inspired by the principles of online K-Means, we introduce a novel approach to CTTA through visual prompting. We propose a \emph{Dynamic Prompt Coreset} that not only preserves knowledge from previously visited domains but also accommodates learning from new potential domains. This is complemented by a distance-based \emph{Weight Updating Mechanism} that ensures the coreset remains current and relevant. Our approach employs a fixed model architecture alongside the coreset and an innovative updating system to effectively mitigate challenges such as catastrophic forgetting and error accumulation. Extensive testing on four widely-used benchmarks demonstrates that our method consistently outperforms state-of-the-art alternatives in both classification and segmentation CTTA tasks across the structured and dynamic CTTA settings, with $99\%$ fewer trainable parameters.
BibTeX
@inproceedings{zhang2025dynamic,
  author = {Yunbei Zhang and Akshay Mehra and Jihun Hamm},
  title = {{Dynamic Domains, Dynamic Solutions: DPCore for Continual Test-Time Adaptation}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=A6zDim0rQf},
}
Figure