By Choubo Ding, Guansong Pang
Official PyTorch implementation of the paper “Zero-Shot Out-Of-Distribution Detection with Outlier Label Exposure”
Code is modified from CLIPN.
git clone https://github.com/Choubo/OLE.git
cd OLE
conda create -n ole python=3.8
conda activate ole
pip install -r requirements.txt
Our experiments utilize the following datasets:
- ImageNet-1K: The ILSVRC-2012 version, serving as our primary in-distribution dataset. It can be downloaded here
We use subsampled versions of the following datasets, with classes overlapping ImageNet-1K removed:
- iNaturalist
- SUN
- Places
- Texture
For detailed download instructions and preprocessing steps, please refer to the MOS.
-
Download and place the checkpoint:
- Download the checkpoint from this link.
- Place the downloaded checkpoint in the
src
folder:mv path/to/downloaded/clipn_checkpoint.pth src/
-
Run outlier prototype learning and OLE evaluation:
cd src bash run.sh
This script will execute the outlier prototype learning process and perform OLE evaluation.
If you use our codebase, please cite our work:
@inproceedings{
ding2024zero,
title={Zero-Shot Out-of-Distribution Detection with Outlier Label Exposure},
author={Choubo Ding and Guansong Pang},
booktitle={2024 International Joint Conference on Neural Networks},
year={2024}
}