Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Learning Transferable Negative Prompts for Out-of-Distribution Detection

About

Existing prompt learning methods have shown certain capabilities in Out-of-Distribution (OOD) detection, but the lack of OOD images in the target dataset in their training can lead to mismatches between OOD images and In-Distribution (ID) categories, resulting in a high false positive rate. To address this issue, we introduce a novel OOD detection method, named 'NegPrompt', to learn a set of negative prompts, each representing a negative connotation of a given class label, for delineating the boundaries between ID and OOD images. It learns such negative prompts with ID data only, without any reliance on external outlier data. Further, current methods assume the availability of samples of all ID classes, rendering them ineffective in open-vocabulary learning scenarios where the inference stage can contain novel ID classes not present during training. In contrast, our learned negative prompts are transferable to novel class labels. Experiments on various ImageNet benchmarks show that NegPrompt surpasses state-of-the-art prompt-learning-based OOD detection methods and maintains a consistent lead in hard OOD detection in closed- and open-vocabulary classification scenarios. Code is available at https://github.com/mala-lab/negprompt.

Tianqi Li, Guansong Pang, Xiao Bai, Wenjun Miao, Jin Zheng• 2024

Related benchmarks

TaskDatasetResultRank
Out-of-Distribution DetectionTextures
AUROC0.8838
141
OOD DetectionPlaces (OOD)
AUROC91.16
76
OOD DetectionSUN (OOD)
AUROC92.25
72
OOD DetectionImageNet-1K OOD (Average: OpenImage-O, Texture, iNaturalist, ImageNet-O) 1.0 (test)
AUROC94.81
61
Out-of-Distribution DetectionImageNet-1k Textures ID OOD
AUROC91.6
59
OOD DetectionImageNet SUN
FPR@9522.89
43
OOD DetectioniNaturalist
AUROC90.49
40
OOD DetectionImageNet-1k ID Places OOD
AUROC93.34
35
Out-of-Distribution DetectionImageNet-1K (ID) vs Textures (OOD) (test)
FPR9535.21
34
OOD DetectioniNaturalist (OOD) / ImageNet-1k (ID) 1.0 (test)
FPR956.32
33
Showing 10 of 13 rows

Other info

Follow for update