CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No
Hualiang Wang, Yi Li, Huifeng Yao, Xiaomeng Li
摘要
Out-of-distribution (OOD) detection refers to training the model on an in-distribution (ID) dataset to classify whether the input images come from unknown classes. Considerable effort has been invested in designing various OOD detection methods based on either convolutional neural networks or transformers. However, zero-shot OOD detection methods driven by CLIP, which only require class names for ID, have received less attention. This paper presents a novel method, namely CLIP saying "no" (CLIPN), which empowers the logic of saying "no" within CLIP. Our key motivation is to equip CLIP with the capability of distinguishing OOD and ID samples using positive-semantic prompts and negation-semantic prompts. Specifically, we design a novel learnable "no" prompt and a "no" text encoder to capture negation semantics within images. Subsequently, we introduce two loss functions: the image-text binary-opposite loss and the text semantic-opposite loss, which we use to teach CLIPN to associate images with "no" prompts, thereby enabling it to identify unknown samples. Furthermore, we propose two threshold-free inference algorithms to perform OOD detection by utilizing negation semantics from "no" prompts and the text encoder. Experimental results on 9 benchmark datasets (3 ID datasets and 6 OOD datasets) for the OOD detection task demonstrate that CLIPN, based on ViT-B-16, outperforms 7 well-used algorithms by at least 2.34% and 11.64% in terms of AUROC and FPR95 for zero-shot OOD detection on ImageNet-1K. Our CLIPN can serve as a solid foundation for effectively leveraging CLIP in downstream OOD tasks. The code is available on https://github.com/xmed-lab/CLIPN.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 57 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- MultiOOD: Scaling Out-of-Distribution Detection for Multiple Modalities 引用了 Energy-based Out-of-distribution Detection
- MultiOOD: Scaling Out-of-Distribution Detection for Multiple Modalities 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Conditional Prompt Learning for Vision-Language Models 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Conditional Prompt Learning for Vision-Language Models 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Envisioning Outlier Exposure by Large Language Models for Out-of-Distribution Detection 引用了 Conditional Prompt Learning for Vision-Language Models
- Envisioning Outlier Exposure by Large Language Models for Out-of-Distribution Detection 引用了 Energy-based Out-of-distribution Detection
- Envisioning Outlier Exposure by Large Language Models for Out-of-Distribution Detection 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Envisioning Outlier Exposure by Large Language Models for Out-of-Distribution Detection 引用了 Learning Transferable Visual Models From Natural Language Supervision
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models 引用了 Energy-based Out-of-distribution Detection
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models 引用了 Learning Transferable Visual Models From Natural Language Supervision
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models 引用了 Out-of-Distribution Detection with Negative Prompts
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Improving Context Understanding in Multimodal Large Language Models via Multimodal Composition Learning 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Learning Transferable Visual Models From Natural Language Supervision 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Out-of-Distribution Detection with Negative Prompts 引用了 Energy-based Out-of-distribution Detection
- Out-of-Distribution Detection with Negative Prompts 引用了 Learning Transferable Visual Models From Natural Language Supervision
引用它的顶会 Paper57
- Improving Context Understanding in Multimodal Large Language Models via Multimodal Composition LearningWei Li, Hehe Fan, Yongkang Wong, Yi Yang 等ICML 2024 · 49 次引用
- Out-of-Distribution Detection with Negative PromptsJun Nie, Yonggang Zhang, Zhen Fang, Tongliang Liu 等ICLR 2024 · 48 次引用
- MultiOOD: Scaling Out-of-Distribution Detection for Multiple ModalitiesHao Dong, Yue Zhao, Eleni N. Chatzi, Olga FinkNeurIPS 2024 · 43 次引用
- Envisioning Outlier Exposure by Large Language Models for Out-of-Distribution DetectionChentao Cao, Zhun Zhong, Zhanke Zhou, Yang Liu 等ICML 2024 · 34 次引用
- AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language ModelsYabin Zhang, Lei ZhangNeurIPS 2024 · 30 次引用
它引用的 Paper16
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh 等ICML 2021 · 47,906 次引用
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 次引用
- Conditional Prompt Learning for Vision-Language ModelsKaiyang Zhou, Jingkang Yang, Chen Change Loy, Ziwei LiuCVPR 2022 · 1,438 次引用
相关 Paper
- Zero-Shot Out-of-Distribution Detection Based on the Pre-trained Model CLIPSepideh Esmaeilpour, Bing Liu, Eric Robertson, Lei ShuAAAI 2022 · 219 次引用
- Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution DetectionXiang Fang, Arvind Easwaran, Blaise GenestICML 2025
- LoCoOp: Few-Shot Out-of-Distribution Detection via Prompt LearningAtsuyuki Miyai, Qing Yu, Go Irie, Kiyoharu AizawaNeurIPS 2023 · 174 次引用
- Exploring the Limits of Out-of-Distribution DetectionStanislav Fort, Jie Ren, Balaji LakshminarayananNeurIPS 2021 · 443 次引用
- ID-like Prompt Learning for Few-Shot Out-of-Distribution DetectionYichen Bai, Zongbo Han, Bing Cao, Xiaoheng Jiang 等CVPR 2024
