LoCoOp: Few-Shot Out-of-Distribution Detection via Prompt Learning
Atsuyuki Miyai, Qing Yu, Go Irie, Kiyoharu Aizawa
Abstract
We present a novel vision-language prompt learning approach for few-shot out-of-distribution (OOD) detection. Few-shot OOD detection aims to detect OOD images from classes that are unseen during training using only a few labeled in-distribution (ID) images. While prompt learning methods such as CoOp have shown effectiveness and efficiency in few-shot ID classification, they still face limitations in OOD detection due to the potential presence of ID-irrelevant information in text embeddings. To address this issue, we introduce a new approach called Local regularized Context Optimization (LoCoOp), which performs OOD regularization that utilizes the portions of CLIP local features as OOD features during training. CLIP's local features have a lot of ID-irrelevant nuisances (e.g., backgrounds), and by learning to push them away from the ID class text embeddings, we can remove the nuisances in the ID class text embeddings and enhance the separation between ID and OOD. Experiments on the large-scale ImageNet OOD detection benchmarks demonstrate the superiority of our LoCoOp over zero-shot, fully supervised detection methods and prompt learning methods. Notably, even in a one-shot setting -- just one label per class, LoCoOp outperforms existing zero-shot and fully supervised detection methods. The code will be available via https://github.com/AtsuMiyai/LoCoOp.
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.
41 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
- Conditional Prompt Learning for Vision-Language Models cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Conditional Prompt Learning for 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 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 Conditional Prompt Learning for Vision-Language Models
- 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 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Self-Calibrated Tuning of Vision-Language Models for Out-of-Distribution Detection cites Learning Transferable Visual Models From Natural Language Supervision
- An Information-theoretical Framework for Understanding Out-of-distribution Detection with Pretrained Vision-Language Models cites Energy-based Out-of-distribution Detection
- An Information-theoretical Framework for Understanding Out-of-distribution Detection with Pretrained Vision-Language Models cites AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models
- An Information-theoretical Framework for Understanding Out-of-distribution Detection with Pretrained Vision-Language Models cites Out-of-Distribution Detection with Deep Nearest Neighbors
- An Information-theoretical Framework for Understanding Out-of-distribution Detection with Pretrained Vision-Language Models cites Learning Transferable Visual Models From Natural Language Supervision
- Out-of-Distribution Detection with Deep Nearest Neighbors cites Energy-based Out-of-distribution Detection
- Out-of-Distribution Detection with Deep Nearest Neighbors cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- What If the Input is Expanded in OOD Detection? cites Energy-based Out-of-distribution Detection
- What If the Input is Expanded in OOD Detection? cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- What If the Input is Expanded in OOD Detection? cites Out-of-Distribution Detection with Deep Nearest Neighbors
- What If the Input is Expanded in OOD Detection? cites Learning Transferable Visual Models From Natural Language Supervision
- 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 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- 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 Learning Transferable Visual Models From Natural Language Supervision
- ANTS: Adaptive Negative Textual Space Shaping for OOD Detection via Test-Time MLLM Understanding and Reasoning cites What If the Input is Expanded in OOD Detection?
Cited by top-tier papers41
- 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
- What If the Input is Expanded in OOD Detection?Boxuan Zhang, Jianing Zhu, Zengmao Wang, Tongliang Liu et al.NeurIPS 2024 · 19 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
- An Information-theoretical Framework for Understanding Out-of-distribution Detection with Pretrained Vision-Language ModelsBo Peng, Jie Lu, Guangquan Zhang, Zhen FangNeurIPS 2025 · 9 citations
Builds on32
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
- Conditional Prompt Learning for Vision-Language ModelsKaiyang Zhou, Jingkang Yang, Chen Change Loy, Ziwei LiuCVPR 2022 · 1,438 citations
- Out-of-Distribution Detection with Deep Nearest NeighborsYiyou Sun, Yifei Ming, Xiaojin Zhu, Yixuan LiICML 2022 · 789 citations
Related papers
- Overcoming Shortcut Problem in VLM for Robust Out-of-Distribution DetectionZhuo Xu, Xiang Xiang, Yifan LiangCVPR 2025
- 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
- DeCoOp: Robust Prompt Tuning with Out-of-Distribution DetectionZhi Zhou, Ming Yang, Jiang-Xin Shi, Lan-Zhe Guo et al.ICML 2024 · 14 citations
- Knowledge-Aware Prompt Tuning for Generalizable Vision-Language ModelsBaoshuo Kan, Teng Wang, Wenpeng Lu, Xiantong Zhen et al.ICCV 2023 · 53 citations
- Enhanced OoD Detection through Cross-Modal Alignment of Multi-Modal RepresentationsJeonghyeon Kim, Sangheum HwangCVPR 2025
