CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No

08/23/2023
by   Hualiang Wang, et al.
0

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 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/02/2023

LoCoOp: Few-Shot Out-of-Distribution Detection via Prompt Learning

We present a novel vision-language prompt learning approach for few-shot...
research
04/10/2023

Zero-Shot In-Distribution Detection in Multi-Object Settings Using Vision-Language Foundation Models

Removing out-of-distribution (OOD) images from noisy images scraped from...
research
09/06/2021

Zero-Shot Open Set Detection by Extending CLIP

In a regular open set detection problem, samples of known classes (also ...
research
12/01/2021

A Unified Benchmark for the Unknown Detection Capability of Deep Neural Networks

Deep neural networks have achieved outstanding performance over various ...
research
07/15/2022

Augmenting Softmax Information for Selective Classification with Out-of-Distribution Data

Detecting out-of-distribution (OOD) data is a task that is receiving an ...
research
06/01/2023

In or Out? Fixing ImageNet Out-of-Distribution Detection Evaluation

Out-of-distribution (OOD) detection is the problem of identifying inputs...
research
06/26/2023

Beyond AUROC co. for evaluating out-of-distribution detection performance

While there has been a growing research interest in developing out-of-di...

Please sign up or login with your details

Forgot password? Click here to reset