Abstract
Out-of-distribution (OOD) detection is a critical safety component for deploying machine learning models in open-world environments. Traditional methods often rely on a closed-world assumption, focusing solely on the characteristics of in-distribution (ID) classes. This paper discusses NegLabel, a novel post-hoc, zero-shot framework that leverages the extensive textual knowledge of pretrained Vision-Language Models (VLMs) like CLIP. By mining a massive set of "negative labels"—words semantically distinct from the known ID classes—NegLabel effectively transforms OOD detection into a world-scale classification task. Experimental results on the ImageNet-1k benchmark demonstrate that NegLabel achieves state-of-the-art performance, significantly reducing false positive rates while maintaining minimal computational overhead.
1. Introduction
When machine learning models are deployed in the real world, they frequently encounter inputs from classes they were never trained to recognize. Standard classifiers, constrained by a fixed vocabulary, often exhibit high-confidence misclassifications—for instance, labeling a "galaxy" as a "jellyfish" simply because the latter is the most similar known category. This overconfidence poses significant risks in safety-critical domains such as autonomous driving and medical diagnostics.
While Vision-Language Models (VLMs) possess a broad understanding of the world through training on billions of image-text pairs, existing OOD detection methods typically only utilize the ID labels. NegLabel addresses this limitation by asking not just how much an image resembles known classes, but how much it resembles the vast space of "everything else."
2. The NegLabel Framework
NegLabel introduces a three-pronged approach to OOD detection that requires no retraining or fine-tuning of the underlying VLM.
2.1 Negative Label Mining (NegMining)
Rather than using arbitrary words, NegLabel employs a systematic algorithm to select high-quality negative labels from a large corpus (e.g., WordNet). The process involves calculating the semantic distance between candidate words and ID labels using the VLM's text encoder. By selecting words at a specific "percentile distance," the framework ensures that negative labels are sufficiently different from ID classes to prevent false negatives, yet relevant enough to define a useful decision boundary.
2.2 The NegLabel Score
The core of the detection mechanism is a new scoring function based on a "sum-softmax" formulation. This function calculates the probability of an input image belonging to the ID label space versus an expanded negative label space. If an image shows higher similarity to negative labels (e.g., "nebula" or "microchip") than to ID labels (e.g., "dog" or "cat"), it is flagged as OOD.
2.3 Grouping Strategy for Robustness
To enhance stability, the framework divides thousands of negative labels into multiple distinct groups. Scores are calculated for each group and then averaged. This serves as a variance reduction technique, ensuring that a single anomalous match with a negative label does not lead to an incorrect classification.
3. Theoretical Foundation
The authors provide mathematical justification for this approach, proving that as the number of high-quality negative labels ($M$) increases, the False Positive Rate (FPR) consistently decreases. This provides a rigorous foundation for the intuition that scaling the label space improves the model's ability to distinguish between known and unknown distributions.
4. Experimental Evaluation
NegLabel was evaluated on the rigorous ImageNet-1k OOD benchmark. The study utilized ImageNet-1k as the In-Distribution (ID) set and tested against several Out-of-Distribution (OOD) datasets, including iNaturalist, SUN, Places, and Textures. Additionally, the researchers tested the method on "Hard OOD" tasks (ImageNet-10, 20, and 100) and various domain shift sets (ImageNet-Sketch, ImageNet-A, ImageNet-R, and ImageNet-V2).
4.1 Key Results
- State-of-the-Art Performance: On the ImageNet-1k benchmark, NegLabel achieved an AUROC of 94.21% and a False Positive Rate (FPR95) of 25.40%. This performance significantly exceeds previous VLM-based methods such as MCM and ZOC.
- Zero-Shot Superiority: Remarkably, this zero-shot, post-hoc method outperformed several traditional OOD detectors that required specific fine-tuning on ID data.
- Robustness to Domain Shift: While competing methods often see performance degradation when ID data shifts (e.g., from photos to sketches), NegLabel remained highly stable across different domains.
- Efficiency: Despite processing over 10,000 labels, the method adds only approximately 1ms of latency per image, making it suitable for real-time deployment.
5. Discussion and Limitations
While NegLabel represents a significant advancement, it is subject to "label saturation." Adding infinite labels eventually leads to semantic overlap with ID classes or redundancy, resulting in a performance plateau. Furthermore, the quality of detection is inherently tied to the diversity of the text corpus. While WordNet is effective for general tasks, specialized domains like satellite imagery or microscopic biology may require more tailored corpora.
6. Conclusion
NegLabel demonstrates that the latent knowledge within pretrained VLMs can be effectively harnessed for OOD detection by looking beyond the in-distribution classes. By leveraging a massive, mined negative label space, NegLabel provides a robust, efficient, and state-of-the-art solution for identifying unknown inputs in open-world machine learning applications.
Summary updated