Training OOD Detectors in their Natural Habitats
February 17, 2022 ยท View on GitHub
This is the official repository of Training OOD Detectors in their Natural Habitats by Julian Katz-Samuels, Julia Nakhleh, Rob Nowak, and Yixuan Li. This method trains OOD detectors effectively using auxiliary data that may be a mixture of both inlier and outlier examples.
Pretrained models
You can find the pretrained models in
./CIFAR/snapshots/pretrained
Datasets
Download the data in the folder
./data
Run
To run the code, execute
bash run.sh score in_distribution aux_distribution test_distribution
For example, to run woods on cifar10 using dtd as the mixture distribution and the test_distribution, execute
bash run.sh woods cifar10 dtd dtd
pi is set to 0.1 as default. See the run.sh for more details and options.
Main Files
CIFAR/train.pycontains the main code used to train model(s) under our framework.CIFAR/make_datasets.pycontains the code for reading datasets into PyTorch.CIFAR/plot_results.pycontains code for loading and analyzing experimental results.CIFAR/test.pycontains code for testing experimental results in OOD setting.
Datasets
Here are links for the less common outlier datasets used in the paper: Textures, Places365, LSUN, LSUN-R, iSUN, and 300K Random Images.