Out-of-Distribution Detection with Negative Prompts

Jun Nie, Yonggang Zhang*, Zhen Fang, Tongliang Liu, Bo Han, Xinmei Tian*

*Corresponding author for this work

Research output: Chapter in book/report/conference proceedingConference proceedingpeer-review

6 Citations (Scopus)

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 straightfor- ward 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.
Original languageEnglish
Title of host publicationProceedings of the Twelfth International Conference on Learning Representations, ICLR 2024
PublisherInternational Conference on Learning Representations
Pages1-20
Number of pages20
Publication statusPublished - May 2024
Event12th International Conference on Learning Representations, ICLR 2024 - Messe Wien Exhibition and Congress Center, Vienna, Austria
Duration: 7 May 202411 May 2024
https://iclr.cc/Conferences/2024 (Conference website)
https://iclr.cc/virtual/2024/calendar (Conference schedule )
https://openreview.net/group?id=ICLR.cc/2024/Conference#tab-accept-oral (Conference proceedings)

Publication series

NameProceedings of the International Conference on Learning Representations, ICLR

Conference

Conference12th International Conference on Learning Representations, ICLR 2024
Country/TerritoryAustria
CityVienna
Period7/05/2411/05/24
Internet address

Fingerprint

Dive into the research topics of 'Out-of-Distribution Detection with Negative Prompts'. Together they form a unique fingerprint.

Cite this