TINS: Test-time ID-prototype-separated Negative Semantics Learning for OOD Detection

Yifeng Yang, Jubo Feng, Jing Xu, Xinbing Wang, Qinying Gu, Nanyang Ye · 2026

Read TINS: Test-time ID-prototype-separated Negative Semantics Learning for OOD Detection by Yifeng Yang, Jubo Feng, Jing Xu, Xinbing Wang, Qinying Gu, Nanyang Ye (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-10756.txt.

Introduction

Yang and five colleagues propose TINS, a test-time method for spotting out-of-distribution images with vision-language models. Instead of fixed negative labels, TINS learns sample-specific negative text embeddings by image-to-text inversion, kept apart from in-distribution semantics by prototype-separated regularization. Group-wise aggregation scores plus a buffer update stabilize the expansion. On the Four-OOD benchmark with ImageNet-1K as in-distribution data, it cuts the average false-positive rate at 95 percent recall from 14 point 04 to 6 point 72 percent.

Catalog record

CREATORYifeng Yang, Jubo Feng, Jing Xu, Xinbing Wang, Qinying Gu, Nanyang Ye
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE58604
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.10756

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

TINS: Test-time ID-prototype-separated Negative Semantics Learning for OOD Detection Yifeng Yang, Jubo Feng, Jing Xu, Xinbing Wang, Qinying Gu, Nanyang Ye Abstract Vision-language models enable OOD detection by comparing image alignment with ID labels and negative semantics. Existing negative-label-based methods mainly rely on static negative labels constructed before inference, limiting their ability to cover diverse and evolving OOD concepts. Although test-time expansion provides a natural solution, naively learning negative semantics from potential OOD samples may introduce hard ID contamination. To address this issue, we propose a T est-time I D-prototype-separated N egative S emantics learning method, termed TINS . TINS learns sample-specific negative text embeddings via image-to-text modality inversion and introduces ID-prototype-separated regularization to keep them separated from ID semantics. To further stabilize negative semantics expansion, TINS employs group-wise aggregation scoring and a buffer update strategy. Extensive experiments across Four-OOD, OpenOOD, Temporal-shift, and Various ID settings show consistent improvements over strong baselines. Notably, on the Four-OOD benchmark with ImageNet-1K as ID, TINS reduces the average FPR95 from 14.04% to 6.72%. Our code is available at https://github.com/zxk1212/tins . 1 Introduction Out-of-distribution (OOD) detection [ 18 , 29 , 31 ] is crucial for deploying vision-language model (VLM)-based classifiers in open-world scenarios. Given only the names of in-distribution (ID) classes, such models are required to classify ID samples while rejecting inputs from unknown OOD categories. This ability is especially important in safety-critical domains, including autonomous driving [ 52 , 1 ] and medical diagnosis [ 48 ] . Recent VLM-based methods tackle this problem by introducing negative labels outside the ID label space [ 25 , 6 ] , allowing OOD inputs to be detected when they show stronger alignment with negative semantics than with ID semantics. However, these VLM-based methods mainly depend on a static negative-label set constructed before inference. Although effective, these methods rely on static negative semantics that cannot anticipate diverse and evolving OOD concepts during deployment. Since test-time OOD samples naturally reflect the current OOD distribution, a promising direction is to learn negative semantics dynamically at test time. Nevertheless, recent test-time dynamic methods such as AdaNeg [ 60 ] , OODD [ 56 ] , and InterNeg [ 55 ] largely overlook an important challenge: The unlabeled test stream may include hard ID samples that are easily confused with OOD inputs. As a result, directly expanding negative semantics from potential OOD samples may contaminate the negative space with ID-related semantics. As shown in Figure 1 , dynamically learned negative features can complement static negative features by aligning more closely with real OOD samples. However, without proper constraints, the resulting ID/OOD score distributions may become confused in the ID-tail region. This suggests that effective test-time dynamic negative learning should be both OOD-adaptive and ID-prototype-separated. In this paper, we propose a T est-time I D-prototype-separated N egative S emantics learning method, termed TINS . TINS learns sample-specific negative text embeddings from test-time potential OOD samples via image-to-text modality inversion, while imposing ID-prototype-separated regularization to keep the learned embeddings away from ID prototypes. In this way, the negative space can adapt to emerging OOD semantics while mitigating contamination from hard ID samples. We further stabilize the dynamically expanded negative space with group-wise aggregation scoring and a buffer update strategy, enabling robust adaptation to evolving OOD distribution. Our contributions are summarized as follows: • We propose ID-prototype-separated regularization to keep learned negative semantics away from ID prototypes, effectively mitigating hard ID contamination. • We introduce group-wise aggregation scoring and a buffer update strategy to further stabilize the expansion of negative semantics at test time. • Our TINS demonstrates consistent improvements over recent strong baselines across Four-OOD, OpenOOD, Temporal-shift, and Various ID settings. Specifically, on the Four-OOD benchmark, TINS substantially reduces the average FPR95 from 14.04% to 6.72% compared with InterNeg. (a) t-SNE visualization (b) InterNeg (c) Ours Figure 1 : Comparison of ID/OOD feature visualizations and distributions using ImageNet-1K as ID and SUN as OOD: (a) t-SNE visualization comparing static negative features ( green ) and dynamically learned negative features ( purple ). (b) Score distributions of InterNeg [ 55 ] , where the lack of proper constraints leads to overlap between ID-tail and OOD samples. (c) Score distributions of our proposed TINS, showing clearer ID/OOD separation. 2 Related Work Traditional visual OOD detection. Traditional visual OOD detection methods mainly rely on supervised ID training and visual feature modeling, and can be broadly grouped into three categories: (1) score-based methods [ 18 , 29 , 30 , 31 , 24 , 51 ] , which design confidence, energy, or logit-space scores to separate ID and OOD samples; (2) distance-based methods [ 35 , 57 ] , which detect OOD samples by measuring their feature-space discrepancy from ID references, such as class prototypes [ 29 , 43 ] or nearest ID neighbors [ 45 , 12 , 35 ] ; (3) generative-based methods [ 42 , 26 ] , which model the ID distribution and regard samples with low likelihood or large reconstruction errors as OOD. OOD detection leveraging pre-trained VLMs. With the development of pretrained vision-language models (VLMs), incorporating textual semantics and cross-modal alignment into visual OOD detection has emerged as a new paradigm. Early methods such as LoCoOp [ 37 ] introduce prompt learning to improve few-shot OOD detection by learning ID prompts while exploiting background cues. LSN [ 39 ] , ID-Like [ 2 ] , and LAPT [ 61 ] further strengthen ID/OOD separability by constructing negative prompts from generated data, auxiliary samples, or local crops. In parallel, training-free VLM-based methods directly use CLIP-like alignment scores for detection: MCM [ 34 ] evaluates whether an image aligns with the ID label space; EOE [ 5 ] leverages LLMs to generate potential outlier class labels without accessing real OOD samples; NegLabel [ 25 ] mines negative labels from external corpora; and CSP [ 6 ] further enhances negative-label semantics based on NegLabel. Test-time adaptation methods for OOD detection. Recent studies [ 60 , 56 , 63 , 55 , 59 ] introduce test-time adaptation to OOD detection. Early methods such as AdaNeg [ 60 ] and OODD [ 56 ] mainly follow an optimization-free adaptation paradigm, where potential OOD visual features are cached at test time and update negative proxies. ANTS [ 63 ] further exploits historical test samples to identify suspicious OOD images and their visually similar ID categories, and leverages the image understanding ability of external MLLMs to generate negative labels for both Far-OOD and Near-OOD. InterNeg [ 55 ] selects and dynamically generates negative labels based on cross-modal image-text distances that are consistent with the CLIP training objective, rather than relying on uni-modal text-text or image-image distances, thereby improving the ID/OOD separability of VLM-based OOD detection. In contrast, our method learns sample-specific negative text embeddings directly from online test data without external MLLMs, and regularizes them to stay away from ID prototypes. 3 Methodology 3.1 Preliminaries OOD Detection. Let \mathcal{X} denote the image space and \mathcal{Y}^{+}=\{y_{1},\dots,y_{C}\} denote the set of ID class labels, where each label is a text token or phrase, e.g., \mathcal{Y}^{+}=\{\text{cat},\text{dog},\dots,\text{bird}\} . We use \mathcal{P}_{\mathrm{in}} and \mathcal{P}_{\mathrm{ood}} to denote the ID and OOD on \mathcal{X} , respectively. In standard closed-set classification, a test image

Read the complete text