arXiv:2611.04689cs.LGNov 2026

Manuscript Offprint

arXiv:2611.04689

Uncertainty-Aware Prototype Learning for Open-Set Test-Time Adaptation

Jinwu Hu, Langyu Bian, Jian Sun, Dongjin Yang, Chao Shuai, Yufeng Wang, Kai Zhou, Bin Xiao, Mingkui Tan, Hongmin Cai, Wei Luo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Jinwu Hu*, Langyu Bian*, Jian Sun, Dongjin Yang, Chao Shuai, Yufeng Wang, Kai Zhou, Bin Xiao†, Mingkui Tan†, Member, IEEE, Hongmin Cai†, Senior Member, IEEE, Wei Luo†

Abstract—Open-set test-time adaptation (TTA) aims to adapt source-trained models to unlabeled test streams where covariate-shifted in-distribution (csID) samples and covariate-shifted out-of-distribution (csOOD) samples may coexist. Existing TTA methods are typically designed under a closed-set assumption and therefore lack explicit mechanisms for reliably distinguishing csID from csOOD samples. Consequently, csOOD samples may be mistakenly included in confidence-enhancing adaptation, producing harmful gradients that degrade known-class performance. To address this, we propose Uncertainty-Aware Prototype Learning for Open-Set Test-Time Adaptation (UAPA), a plug-and-play method for reliable open-set adaptation. Specifically, we first introduce Uncertainty-Driven ID/OOD Separation, which combines a classifier-prototype score with a mini-batch-normalized evidence-derived uncertainty score to distinguish csID from csOOD samples. We then propose a Dynamic Prototype Refinement strategy that periodically refines class-specific target prototypes using buffered csID features to progressively follow the estimated class directions. Lastly, we introduce Contrastive Prototype Entropy Adaptation, which applies entropy minimization to csID samples and entropy maximization to csOOD samples, while prototype-level contrastive learning aligns csID features with their corresponding target prototypes and reduces the maximum similarity between csOOD features and known-class prototypes. Empirically, UAPA outperforms the strongest baselines on the CIFAR benchmarks and Tiny-ImageNet-C, improving average OSCR by 2.08 and 1.28 percentage points, respectively.

Index Terms—Open-set recognition, out-of-distribution detection, prototype learning, test-time adaptation

I. INTRODUCTION

Deep neural networks have achieved remarkable progress in visual recognition tasks [1–6], yet their reliability can substantially degrade when deployed in open-world environments [7–10]. In real-world test streams, known-class

samples may undergo appearance-level changes caused by weather variations, motion blur, sensor noise, or other visual corruptions while retaining the source label space, a setting known as covariate shift [11]. Meanwhile, test samples may also come from classes outside the source label space, leading to semantic shift [12]. In practice, these two shifts are often coupled: unknown-class samples may appear under the same degraded conditions as shifted known-class samples. For example, an autonomous driving system may encounter familiar vehicles under fog or motion blur, while also observing unseen obstacles or rare objects that were absent during training. A reliable deployed model is therefore expected not only to adapt to shifted known classes, but also to avoid being misled by shifted unknown classes [13–17].

To improve robustness under covariate shift, test-time adaptation (TTA) updates a source-trained model online using unlabeled test data [18, 19, 21–23]. Representative TTA methods combine unsupervised adaptation objectives, such as entropy minimization [18, 19] or prediction consistency [23, 24], with update strategies such as reliability-based sample selection [19, 22]. These designs enable the model to adapt to shifted test distributions without requiring access to the original source data. However, many TTA methods are developed under an implicit closed-set assumption, where each test sample is assumed to belong to one of the source classes despite possible changes in the test distribution. Under this assumption, encouraging confident predictions or selecting reliable samples can help

Figure

Fig. 1: OSCR comparison on CIFAR-100-C before and after incorporating UAPA into representative TTA methods [18–21]. Values above the arrows denote absolute OSCR gains in percentage points.

Jinwu Hu, Langyu Bian, Jian Sun, Dongjin Yang, and Kai Zhou are with the School of Software Engineering, South China University of Technology, Guangzhou, China (E-mail: fhujinwu@gmail.com, blangy2003@gmail.com, jiansun97@163.com, dongjinyang2003@gmail.com, kayjoe0723@gmail.com).

Chao Shuai is with Zhejiang University, Hangzhou, China (E-mail: chaoshuai@zju.edu.cn).

Yufeng Wang and Hongmin Cai are with the School of Future Technology, South China University of Technology, Guangzhou, China (E-mail: yufeng6568@gmail.com, hmcai@scut.edu.cn).

Bin Xiao is with the Chongqing University of Posts and Telecommunications, Chongqing, China (E-mail: xiaobin@cqupt.edu.cn).

Mingkui Tan is with the School of Software Engineering, South China University of Technology, and also with the Key Laboratory of Big Data and Intelligent Robot, Ministry of Education, Guangzhou, China (E-mail: mingkuitan@scut.edu.cn).

Wei Luo is with the South China Agricultural University (E-mail: cswluo@gmail.com).

  • Authors contributed equally. †Corresponding authors

the model adapt to shifted known-class samples.

In open-set test streams, this closed-set assumption no longer holds because the target stream may contain both known-class samples with appearance or quality shifts, referred to as covariate-shifted in-distribution (csID) samples, and unknown-class samples outside the source label space under similar shifts, referred to as covariate-shifted out-of-distribution (csOOD) samples [15, 16, 25]. This setting raises two key challenges. 1) Negative adaptation caused by csOOD samples. Entropy minimization encourages confident predictions for target samples. If csOOD samples are adapted in the same way as csID samples, they may be pushed toward overconfident known-class predictions, yielding harmful gradients that distort decision boundaries and cause negative adaptation. 2) Unreliable separation between csID and csOOD samples. The model must decide which samples can support known-class adaptation and which should be excluded from confidence-enhancing updates. This is difficult because severe covariate shifts can make csID samples uncertain, whereas some csOOD samples may appear confident. Thus, relying on a single confidence, entropy, or prototype-similarity score [15] can produce unreliable partitions and unstable adaptation.

To address these challenges, we propose Uncertainty-Aware Prototype Learning for Open-Set Test-Time Adaptation (UAPA), a plug-and-play method (see Fig. 1) for reliability-aware adaptation in open-set test streams. The key idea of UAPA is to determine the adaptation role of each test sample according to both its geometric relation to known classes and an evidence-derived uncertainty score computed from the online-model logits. Specifically, UAPA first introduces Uncertainty-Driven ID/OOD Separation, which combines a classifier-prototype score with a mini-batch-normalized evidence-derived uncertainty score to partition incoming samples into csID and csOOD subsets. It then performs Dynamic Prototype Refinement (DPR), which accumulates selected csID features in class-wise buffers and periodically updates class-specific target prototypes. Finally, UAPA develops Contrastive Prototype Entropy Adaptation (CPEA), which applies different entropy objectives to the estimated csID and csOOD subsets and uses progressively initialized target prototypes to provide stage-dependent, prototype-relative regularization. In this way, UAPA jointly performs sample separation, prototype maintenance, and direction-aware adaptation to suppress negative adaptation in open-set test-time adaptation. Our main contributions are as follows:

  • We propose an uncertainty-driven ID/OOD separation mechanism for open-set test-time adaptation. By jointly considering a classifier-prototype score and a mini-batch-normalized evidence-derived uncertainty score, UAPA incorporates complementary geometric and uncertainty-related cues for csID/csOOD partitioning. We characterize the conditional separability and bounded-perturbation stability of the fused score, while clarifying the mini-batch dependence of the normalized uncertainty score and its distinction from GMM-based posterior gating.

  • We propose Dynamic Prototype Refinement and Contrastive Prototype Entropy Adaptation for open-set test-time adaptation. DPR periodically updates class-specific

target prototypes using buffered csID features, while CPEA combines csID entropy minimization, csOOD entropy maximization, and prototype-level contrastive learning to suppress negative adaptation. We show that DPR induces one-step angular non-expansion toward the buffered class direction, while CPEA encourages pseudo-label-relative margin enlargement for selected csID samples and nearest-prototype separation for selected csOOD samples in the hyperspherical feature space.

  • Extensive experiments on CIFAR-C and Tiny-ImageNet-C benchmarks demonstrate that UAPA consistently improves open-set classification performance across different backbones and state-of-the-art TTA baselines. Further plug-and-play and efficiency analyses show that UAPA can be integrated into existing TTA methods with low additional computational cost.

References (62)