Out-of-Distribution Detection with Negative Prompts
Jun Nie, Yonggang Zhang, Zhen Fang, Tongliang Liu, Bo Han, Xinmei Tian
Abstract
Out-of-distribution (OOD) detection is indispensable for open-world machine learning models. Inspired by recent success in large pre-trained language-vision models, e.g., CLIP, advanced works have achieved impressive OOD detection results by matching the similarity between image features and features of learned prompts, i.e., positive prompts. However, existing works typically struggle with OOD samples having features similar to those of known classes. One straightforward approach is to introduce negative prompts to achieve a dissimilarity matching, which further assesses the anomaly level of image features by introducing the absence of specific features. Unfortunately, our experimental observations show that employing a prompt like "not a photo of a" or learning a shared prompt for all classes fails to capture the dissimilarity for identifying OOD samples. The failure may be attributed to the diversity of negative features, i.e., tons of features could indicate features not belonging to a known class. To this end, we propose to learn a set of negative prompts for each class. The learned positive prompt (for all classes) and negative prompts (for each class) are leveraged to measure the similarity and dissimilarity in the feature space simultaneously, enabling more accurate detection of OOD samples. Extensive experiments are conducted on diverse OOD detection benchmarks, showing the effectiveness of our proposed method.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
27 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Conjugated Semantic Pool Improves OOD Detection with Pre-trained Vision-Language Models cites Energy-based Out-of-distribution Detection
- Conjugated Semantic Pool Improves OOD Detection with Pre-trained Vision-Language Models cites ReAct: Out-of-distribution Detection With Rectified Activations
- Conjugated Semantic Pool Improves OOD Detection with Pre-trained Vision-Language Models cites Out-of-Distribution Detection with Deep Nearest Neighbors
- Conjugated Semantic Pool Improves OOD Detection with Pre-trained Vision-Language Models cites Learning Transferable Visual Models From Natural Language Supervision
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models cites Energy-based Out-of-distribution Detection
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models cites ReAct: Out-of-distribution Detection With Rectified Activations
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models cites Out-of-Distribution Detection with Deep Nearest Neighbors
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models cites Learning Transferable Visual Models From Natural Language Supervision
- Self-Calibrated Tuning of Vision-Language Models for Out-of-Distribution Detection cites Energy-based Out-of-distribution Detection
- Self-Calibrated Tuning of Vision-Language Models for Out-of-Distribution Detection cites ReAct: Out-of-distribution Detection With Rectified Activations
- Self-Calibrated Tuning of Vision-Language Models for Out-of-Distribution Detection cites Learning Transferable Visual Models From Natural Language Supervision
- BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation cites Learning Transferable Visual Models From Natural Language Supervision
- ReAct: Out-of-distribution Detection With Rectified Activations cites Energy-based Out-of-distribution Detection
- Learning to Shape In-distribution Feature Space for Out-of-distribution Detection cites Energy-based Out-of-distribution Detection
- Learning to Shape In-distribution Feature Space for Out-of-distribution Detection cites ReAct: Out-of-distribution Detection With Rectified Activations
- Learning to Shape In-distribution Feature Space for Out-of-distribution Detection cites Out-of-Distribution Detection with Deep Nearest Neighbors
- Out-of-Distribution Detection with Deep Nearest Neighbors cites Energy-based Out-of-distribution Detection
- Out-of-Distribution Detection with Deep Nearest Neighbors cites ReAct: Out-of-distribution Detection With Rectified Activations
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and Reasoning cites Conjugated Semantic Pool Improves OOD Detection with Pre-trained Vision-Language Models
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and Reasoning cites Energy-based Out-of-distribution Detection
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and Reasoning cites AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and Reasoning cites Self-Calibrated Tuning of Vision-Language Models for Out-of-Distribution Detection
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and Reasoning cites ReAct: Out-of-distribution Detection With Rectified Activations
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and Reasoning cites Learning Transferable Visual Models From Natural Language Supervision
Cited by top-tier papers27
- Learning to Shape In-distribution Feature Space for Out-of-distribution DetectionYonggang Zhang, Jie Lu, Bo Peng, Zhen Fang et al.NeurIPS 2024 · 33 citations
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language ModelsYabin Zhang, Lei ZhangNeurIPS 2024 · 30 citations
- Self-Calibrated Tuning of Vision-Language Models for Out-of-Distribution DetectionGeng Yu, Jianing Zhu, Jiangchao Yao, Bo HanNeurIPS 2024 · 26 citations
- Conjugated Semantic Pool Improves OOD Detection with Pre-trained Vision-Language ModelsMengyuan Chen, Junyu Gao, Changsheng XuNeurIPS 2024 · 21 citations
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and ReasoningWenjie Zhu, Yabin Zhang, Xin Jin, Wenjun Zeng et al.CVPR 2026 · 12 citations
Builds on24
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and GenerationJunnan Li, Dongxu Li, Caiming Xiong, Steven C. H. HoiICML 2022 · 6,549 citations
- Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
- Out-of-Distribution Detection with Deep Nearest NeighborsYiyou Sun, Yifei Ming, Xiaojin Zhu, Yixuan LiICML 2022 · 789 citations
- ReAct: Out-of-distribution Detection With Rectified ActivationsYiyou Sun, Chuan Guo, Yixuan LiNeurIPS 2021 · 733 citations
Related papers
- Out-of-Distribution Detection with Positive and Negative Prompt Supervision Using Large Language ModelsZhixia He, Chen Zhao, Minglai Shao, Xintao Wu et al.AAAI 2026
- Learning Transferable Negative Prompts for Out-of-Distribution DetectionTianqi Li, Guansong Pang, Xiao Bai, Wenjun Miao et al.CVPR 2024
- CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say NoHualiang Wang, Yi Li, Huifeng Yao, Xiaomeng LiICCV 2023 · 171 citations
- FA: Forced Prompt Learning of Vision-Language Models for Out-of-Distribution DetectionXinhua Lu, Runhe Lai, Yanqi Wu, Kanghao Chen et al.ICCV 2025 · 1 citation
- Envisioning Outlier Exposure by Large Language Models for Out-of-Distribution DetectionChentao Cao, Zhun Zhong, Zhanke Zhou, Yang Liu et al.ICML 2024 · 34 citations
