CD-TTA: Compound Domain Test-time Adaptation for Semantic Segmentation

Junha Song, KwanYong Park, Inkyu Shin, Sanghyun Woo, In So Kweon

Abstract

Prior to the deployment of robotic systems, pre-training deep-recognition models on all potential visual cases is infeasible in practice. Test-time adaptation (TTA) allows a model to adapt to novel environments and improve its performance during inference (i.e., lifelong adaptation). While several TTA methods show promise in continuously changing environments, our investigation reveals they are vulnerable to dynamic distributional changes and often lead to overfitting. To address this, we present a robust TTA framework with compound domain knowledge management. Our framework enables the model to harvest knowledge from multiple representative domains and conduct adaptation based on this compound knowledge. Additionally, we devise a novel regularization technique that modulates adaptation rates using domain-similarity between the source and current target domains to prevent overfitting. We achieve consistent performance improvements in diverse TTA scenarios, particularly under dynamic domain shifts, across ImageNet-C, C-driving, and corrupted Cityscapes datasets.

Introduction

Deep learning models often fail when the test environment differs from the training environment due to domain shift. While Test-Time Adaptation (TTA) allows models to update themselves using unlabeled data on the fly, most current methods suffer from two major flaws: catastrophic forgetting and error accumulation.

Catastrophic forgetting occurs when a model focuses only on the current batch of data; for instance, a self-driving car adapting to a dark tunnel might "forget" how to drive in bright sunlight once it exits. Error accumulation happens when adapting to very noisy domains (like heavy rain) using unsupervised losses, leading to "model collapse" where the model learns from its own incorrect predictions.

Figure 1: Conceptual overview of the CD-TTA framework. (a) and (b) illustrate how managing compound domain knowledge prevents the forgetting seen in previous works, while (c) provides a performance comparison on standard benchmarks.

Methodology

To overcome these challenges, we propose a framework with three integrated components designed for lifelong adaptation in dynamic environments.

Compound Domain TTA Framework

Instead of a single set of parameters, our model maintains $K$ separate sets of Batch Normalization (BN) layers. These act as specialized "experts" for different sub-domains (e.g., sunny, rainy, night). By switching between these experts, the model can manage compound domain knowledge without overwriting previously learned environmental states.

Continual Domain-Matching Algorithm

To decide which expert to use for an incoming image, the model extracts "Domain Distinctive Features" (ddf)—statistical signatures from shallow layers that represent the "style" of the image. We use the Bhattacharyya distance to match the image to the nearest domain prototype. This method is significantly faster and more effective for identifying styles than standard clustering methods like k-means.

Figure 2: The proposed TTA framework architecture, detailing (a) the construction of domain-specific BN layers, (b) the domain-matching process, and (c) the adaptation mechanism with similarity-based regularization.

Domain Similarity-based Regularization

Not all data is equally reliable for learning. We introduce a weighting term, $\omega(x_i)$, which modulates the adaptation rate. If a target image is statistically very different from the source (pre-training) domain, the model slows down its learning rate to prevent noisy gradients from causing overfitting or collapse.

Experimental Results

We evaluated our approach across several challenging benchmarks, including ImageNet-C for classification and Cityscapes-C for semantic segmentation.

  • Superior Accuracy: On ImageNet-C, CD-TTA achieved an average error rate of 53.5%, outperforming SOTA methods like CoTTA (54.6%) and EATA (54.9%).
  • Robustness to Cycles: In the Cityscapes-C cyclical test, which simulates recurring environmental changes, the model maintained a mean Intersection over Union (mIoU) of 61.5. In contrast, competitors like TENT dropped to 49.6 as they overfitted to the most recent corruption.
  • Efficiency: Our domain-matching algorithm is highly efficient, processing 5,000 samples in just 32 seconds (156 fps), compared to over 28 minutes (3 fps) for k-means-based approaches.

Conclusion

CD-TTA provides a robust solution for test-time adaptation in compound domains. By utilizing BN layers as knowledge containers and implementing principled domain-matching and regularization, we mitigate the risks of forgetting and error accumulation. Future work will investigate methods to automatically discover and initialize new sub-domains in a completely unsupervised, lifelong learning setting.

Summary updated

BibTeX
@article{song2023cd,
  author = {Junha Song and KwanYong Park and Inkyu Shin and Sanghyun Woo and In So Kweon},
  title = {{CD-TTA: Compound Domain Test-time Adaptation for Semantic Segmentation}},
  journal = {IEEE Robotics Autom. Lett.},
  year = {2023},
  doi = {10.1109/lra.2023.3308063},
}
Figure