Protected Test-Time Adaptation via Online Entropy Matching: A Betting Approach
Yarin Bar, Shalev Shaer, Yaniv Romano
TL;DR
POEM addresses test-time adaptation under distribution shifts by detecting entropy drift with betting martingales and aligning test-time entropy to the source via an entropy-matching, OT-inspired loss. It replaces entropy minimization with a distribution-matching objective using a transport map $\tilde{Z}_j=F_s^{-1}(Q(u_j))$, where $u_j=F_s(Z^t_j)$ and $Q$ is a likelihood-ratio derived transform. The method updates only normalization layers and uses online SF-OGD to adapt the betting parameter, achieving a no-harm behavior in-distribution and improved accuracy under shifts. Empirical results on ImageNet-C, CIFAR-C, and OfficeHome demonstrate competitive or superior performance with controlled adaptation and maintained calibration.
Abstract
We present a novel approach for test-time adaptation via online self-training, consisting of two components. First, we introduce a statistical framework that detects distribution shifts in the classifier's entropy values obtained on a stream of unlabeled samples. Second, we devise an online adaptation mechanism that utilizes the evidence of distribution shifts captured by the detection tool to dynamically update the classifier's parameters. The resulting adaptation process drives the distribution of test entropy values obtained from the self-trained classifier to match those of the source domain, building invariance to distribution shifts. This approach departs from the conventional self-training method, which focuses on minimizing the classifier's entropy. Our approach combines concepts in betting martingales and online learning to form a detection tool capable of quickly reacting to distribution shifts. We then reveal a tight relation between our adaptation scheme and optimal transport, which forms the basis of our novel self-supervised loss. Experimental results demonstrate that our approach improves test-time accuracy under distribution shifts while maintaining accuracy and calibration in their absence, outperforming leading entropy minimization methods across various scenarios.
