Papers
Topics
Authors
Recent
Search
2000 character limit reached

Activation-Aware Negative Label Mining for OOD

Updated 30 March 2026
  • Activation-aware Negative Label Mining is a technique that dynamically selects negative labels at test time based on activation patterns to distinguish in-distribution from OOD samples.
  • It leverages both historical and batch-level activation metrics, using FIFO queues and interpolation to adaptively update negative label sets without retraining models.
  • The method achieves significant reductions in false positive rates across benchmarks, offering robust performance for CLIP-style vision-language models in diverse environments.

Activation-aware Negative Label Mining denotes a family of training-free techniques for out-of-distribution (OOD) detection in vision-LLMs, where negative labels are adaptively selected at test time based on observed activation patterns, rather than fixed a priori. Central to this approach is Test-time Activated Negative Labels (TANL), which mines negative labels with strong response to OOD samples using dynamically accumulated activation metrics drawn from historical and mini-batch test data. The resulting methodology enables online, robust, and adaptive distribution alignment for OOD detection across diverse data regimes without requiring re-training or modification of pre-trained CLIP-style models (Zhang et al., 26 Mar 2026).

1. Formal Framework and Notation

Let YID={y1,…,yC}\mathcal{Y}_{ID} = \{y_1, \dots, y_C\} be the set of in-distribution (ID) labels and Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\} the corpus of candidate labels. For any test example xx, pre-trained encoders yield a normalized image feature v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D and a normalized text feature t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D for any label yy, where ρ\rho is a prompt template (e.g., “a photo of a <y><y>”).

The zero-shot softmax probability over labels is given by: p(y∣v)=exp⁡(v⋅t(y))∑y′∈YID∪Ynegexp⁡(v⋅t(y′))p(y \mid v) = \frac{\exp(v \cdot t(y))}{\sum_{y' \in \mathcal{Y}_{ID} \cup \mathcal{Y}_{neg}} \exp(v \cdot t(y'))} where Yneg={y~1,…,y~M}⊆Ycor∖YID\mathcal{Y}_{neg} = \{\tilde{y}_1, \dots, \tilde{y}_M\} \subseteq \mathcal{Y}^{\mathrm{cor}} \setminus \mathcal{Y}_{ID} are the mined negative labels (Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}0).

This framework supports dynamic, test-time re-evaluation of Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}1 as label activations shift during inference.

2. Label Activation Metrics

The informational content of a candidate negative label Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}2 is quantified by its ability to activate upon OOD versus ID samples. The oracle activation difference is: Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}3 where

Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}4

In the absence of ground-truth OOD labels at inference, TANL maintains two size-Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}5 FIFO queues—Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}6 (predicted ID, high-confidence) and Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}7 (predicted OOD, high-confidence)—to estimate the empirical activation gap: Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}8 The high-confidence sets are updated per batch by thresholding an OOD score Ycor={y^1,…,y^N}\mathcal{Y}^{\mathrm{cor}} = \{\hat{y}_1, \dots, \hat{y}_N\}9 (defined below) with gap xx0 around xx1.

3. Batch-Adaptive Activation Mining

In addition to historical activation statistics, TANL leverages batch-level adaptivity by extracting high-confidence positive and negative feature vectors within the current test batch (xx2). The combined batch-adaptive metric is: xx3 with

xx4

where xx5 interpolates global and batch-local statistics. This enables TANL to rapidly adapt negative label selection in response to distribution drift or diversity in test-time batches.

4. Activation-aware OOD Scoring

Once the xx6 most activated candidate negatives xx7 are selected according to xx8 or xx9, OOD scoring for any test image feature v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D0 is performed via: v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D1 This formula endows negatives with higher activation greater implicit weight: v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D2 appears in all denominators, v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D3 in all but one, etc. The score is maximized when v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D4 is close to ID features and far from top-activated negatives, reflecting robust OOD/ID discrimination.

5. Algorithmic Workflow

The TANL procedure, summarized in the following pseudocode, alternates between online activation mining and OOD scoring:

t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D6

In this process, negative labels are dynamically aligned to historic and in-batch activation, yielding distribution-adaptive OOD scoring without requiring model or corpus retraining (Zhang et al., 26 Mar 2026).

6. Theoretical Properties

Building on multilabel detection theory, the change in false positive rate at a fixed decision threshold v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D5 is controlled by: v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D6 where v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D7, v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D8. Effectiveness of additional negatives (v=fimg(x)∈RDv = f_{img}(x) \in \mathbb{R}^D9) for decreasing t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D0 hinges on t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D1; i.e., the selected negatives must activate more on OOD than ID. TANL’s metric t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D2 is explicitly constructed to enforce this relationship, ensuring systematic selection of informative negatives (Zhang et al., 26 Mar 2026).

7. Empirical Performance and Robustness

The performance benefits of activation-aware mining are empirically validated across diverse benchmarks and architectures:

  • On ImageNet-1K vs. {iNat, SUN, Places, Textures}, NegLabel (agnostic) achieves FPR95 ≈ 25.4%, while TANL attains FPR95 ≈ 9.8% (15.6 percentage point absolute reduction).
  • Compared to recent conjugated-pool methods (FPR95 ≈ 17.5%), TANL achieves a 7.7 percentage point lower FPR95.
  • TANL is robust to the number t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D3 of negatives: for small t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D4 it outperforms NegLabel, and for large t(y)=ftxt(ρ(y))∈RDt(y) = f_{txt}(\rho(y)) \in \mathbb{R}^D5 the activation-aware score prevents the performance collapse observed in prior approaches.
  • Ablations on OpenOOD ImageNet demonstrate progressive improvement: distribution-adaptive only yields FPR95 ≈ 61.6% (vs. NegLabel 69.5%), with further reductions from batch-adaptive and activation-aware variants.
  • The method generalizes to various backbones (ResNet50, ViT-B/32, ViT-L/14) and is effective on CIFAR-10/100 and medical X-ray OOD benchmarks.

TANL integrates a principled activation metric, test-time adaptation, and an activation-aware scoring rule, mining the most informative negatives in an online fashion and effecting significant advances in CLIP-style OOD detection (Zhang et al., 26 Mar 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Activation-aware Negative Label Mining.