Activation-Aware Negative Label Mining for OOD
- 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 be the set of in-distribution (ID) labels and the corpus of candidate labels. For any test example , pre-trained encoders yield a normalized image feature and a normalized text feature for any label , where is a prompt template (e.g., “a photo of a ”).
The zero-shot softmax probability over labels is given by: where are the mined negative labels (0).
This framework supports dynamic, test-time re-evaluation of 1 as label activations shift during inference.
2. Label Activation Metrics
The informational content of a candidate negative label 2 is quantified by its ability to activate upon OOD versus ID samples. The oracle activation difference is: 3 where
4
In the absence of ground-truth OOD labels at inference, TANL maintains two size-5 FIFO queues—6 (predicted ID, high-confidence) and 7 (predicted OOD, high-confidence)—to estimate the empirical activation gap: 8 The high-confidence sets are updated per batch by thresholding an OOD score 9 (defined below) with gap 0 around 1.
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 (2). The combined batch-adaptive metric is: 3 with
4
where 5 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 6 most activated candidate negatives 7 are selected according to 8 or 9, OOD scoring for any test image feature 0 is performed via: 1 This formula endows negatives with higher activation greater implicit weight: 2 appears in all denominators, 3 in all but one, etc. The score is maximized when 4 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:
6
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 5 is controlled by: 6 where 7, 8. Effectiveness of additional negatives (9) for decreasing 0 hinges on 1; i.e., the selected negatives must activate more on OOD than ID. TANL’s metric 2 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 3 of negatives: for small 4 it outperforms NegLabel, and for large 5 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).