Abstract
When neural networks are confronted with unfamiliar data that deviate from their training set, this signifies a domain shift. While these networks output predictions on their inputs, they typically fail to account for their level of familiarity with these novel observations. While prevailing works navigate unsupervised domain adaptation with the goal of curtailing model entropy, they unintentionally birth models that grapple with sub-optimal calibration - a dilemma we term the over-certainty phenomenon. In this paper, we uncover a concerning trend in unsupervised domain adaptation and propose a solution that not only maintains accuracy but also addresses calibration.
Introduction
Modern machine learning models often struggle when deployed in environments that differ from their training data, a challenge known as domain shift. Test-Time Adaptation (TTA) has emerged as a powerful paradigm to address this, allowing models to update themselves on-the-fly using unlabeled target data. The prevailing strategy in TTA is entropy minimization, which encourages the model to produce high-confidence predictions.
However, this aggressive pursuit of certainty leads to a critical flaw: the Over-Certainty Phenomenon (OCP). By forcing a model to be certain on unfamiliar or corrupted data, standard TTA methods produce models that are "confidently wrong." This miscalibration poses significant safety risks in high-stakes applications like autonomous driving, where a model's ability to express doubt is as important as its accuracy.
Dynamic Entropy Control (DEC)
To mitigate OCP, we propose Dynamic Entropy Control (DEC). Unlike traditional methods that apply a uniform entropy reduction objective, DEC introduces a per-sample "certainty regularizer" to temper predictions based on input reliability.
Certainty Contrastive Regularizer (CCR)
The core of DEC is the CCR, which calculates a dynamic temperature ($\tau_i$) for each input. This temperature is derived from two key metrics:
- Entropy Contrast: The model compares the current input's entropy to a baseline average observed during training. High relative entropy triggers a higher temperature, softening the output distribution.
- Logit-Norm Awareness: Entropy alone can be a poor proxy for reliability. By incorporating the norm of the logit vector, DEC identifies low-signal inputs that might otherwise result in overconfident predictions.
Pseudo-Label Tempering and Architecture Agnostic Design
DEC utilizes these dynamic temperatures to create "soft" pseudo-labels. This adaptive label smoothing prevents the model from overfitting to its own potentially erroneous guesses. Furthermore, unlike methods that require modifying internal layers (like Batch Normalization), DEC operates on the model's outputs, making it compatible with a wide range of neural architectures.
Experimental Evaluation
We evaluated DEC across four diverse benchmarks: PACS, HomeOffice, Digits, and TinyImageNet-C (TIN-C), encompassing 26 different domain shifts.
Results and Discussion
DEC consistently outperforms state-of-the-art methods like TENT, T3A, and ETA in terms of calibration while maintaining competitive accuracy. On the HomeOffice dataset, DEC reduced the Expected Calibration Error (ECE) to 0.04-0.08, a significant improvement over the ~0.30 baseline and the >0.20 ECE of competing TTA methods.
As shown in Figure 4, DEC demonstrates remarkable robustness to increasing corruption levels. While other methods suffer from skyrocketing miscalibration as data quality degrades, DEC's dynamic temperature adjustment keeps the model's confidence aligned with its actual performance.
Conclusion
The over-certainty phenomenon is a significant hurdle for the safe deployment of TTA algorithms. By shifting the focus from blanket entropy minimization to dynamic, sample-aware entropy control, DEC provides a path forward. Our results demonstrate that it is possible to achieve state-of-the-art adaptation performance without sacrificing the model's ability to express uncertainty. Future work will explore the extension of this framework to regression tasks and further optimize the computational efficiency of the teacher-student architecture used during adaptation.
Summary updated