NegPrompt
1.0.0
现有的及时学习方法已经证明了某些功能在分布(OOD)检测中,但是他们缺乏目标数据集中的OOD图像的感知可能会导致OOD图像与分配(ID)类别之间的不匹配,从而导致高误报率。为了解决这个问题,我们介绍了一种名为“ Negprompt”的新型OOD检测方法,该方法旨在学习一组负面提示,每个提示都代表给定类标签的负面含义,以描绘ID和OOD图像之间的边界。它仅使用ID数据来学习这种负面提示,从而消除了其对外部数据的依赖。此外,当前的方法假设所有ID类的样本的可用性使它们在开放式学习方案中无效,在培训数据中,推理阶段可以包含新的ID类。相比之下,我们学到的负面提示可以转移到新型类标签上。基于各种成像网基准的实验表明,负面影响超过了最先进的基于学习的OOD检测方法,并在闭合和开放式摄影库分类方案中保持硬OOD检测方面的一致铅。全文可用AR ARXIV。

否定环境需要做好准备:
conda create -n NegPrompt python=3.8
conda activate NegPrompt
pip install -r requirements.txt首先,制作一个新目录./data来存储数据集。
然后像https://github.com/atsumiyai/locoop下载数据集一样。
以这样的方式安排数据目录:
NegPrompt
|-- data/
|-- ImageNet1k/
|-- ILSVRC/
|-- Data/
|-- CLS-LOC/
|-- train/
|-- val/
|protocols/
|-- iNaturalist/
|--images/
|-- SUN/
|--images/
|-- Places/
|--images/
|-- dtd/
|--images/
...
培训Negprompt的对流OOD:
conda activate NegPrompt
python ./scripts/train_test_ood.py培训否定效果的硬OOD:
conda activate NegPrompt
python ./scripts/train_test_openset.py @inproceedings { li2024learning ,
title = { Learning Transferable Negative Prompts for Out-of-Distribution Detection } ,
author = { Li, Tianqi and Pang, Guansong and Bai, Xiao and Miao, Wenjun and Zheng, Jin } ,
booktitle = { Proceedings of the IEEE/CVF conference on computer vision and pattern recognition } ,
year = { 2024 }
}