Home

Awesome

ATOM: Robustifying Out-of-distribution Detection Using Outlier Mining

This project is for the paper: ATOM: Robustifying Out-of-distribution Detection Using Outlier Mining.

Illustration

ATOM banner

Experimental Results

Main Results

Preliminaries

It is tested under Ubuntu Linux 16.04.1 and Python 3.6 environment, and requires some packages to be installed:

Downloading In-distribution Dataset

Downloading Auxiliary OOD Datasets

cd datasets/unlabeled_datasets/80M_Tiny_Images
wget http://horatio.cs.nyu.edu/mit/tiny/data/tiny_images.bin

Downloading Out-of-distribution Test Datasets

We provide links and instructions to download each dataset:

For example, run the following commands in the root directory to download LSUN-C:

cd datasets/ood_datasets
wget https://www.dropbox.com/s/fhtsw1m3qxlwj6h/LSUN.tar.gz
tar -xvzf LSUN.tar.gz

Downloading Pre-trained Models

We provide pre-trained DenseNet models for vanilla, SOFL, OE, ACET, CCU, ROWL, NTOM, and ATOM methods on SVHN, CIFAR-10, and CIFAR-100 datasets using TinyImages as auxiliary OOD dataset. We also provide pre-trained WideResNet models for vanilla, NTOM, and ATOM methods on SVHN, CIFAR-10, and CIFAR-100 datasets using TinyImages as auxiliary OOD dataset. They can be downloaded from Google Drive.

Overview of the Code

Running Experiments

Example

For CIFAR-10 experiments, you can run the following script to get the results:

./run_all_cifar10_exps.sh

To evaluate an OOD detection method, you can use the following command:

python eval_ood_detection.py --in-dataset {in-distribution dataset} --name {model name} --method {scoring function} [--adv or --corrupt or --adv-corrupt]

The argument --adv is to evaluate L_inf OOD, --corrupt is to evaluate Corrupted OOD, --adv-corrupt is to evaluate Comp. OOD. You can only specify one of them. Without them, it will evaluate natural OOD.

{in-distribution dataset} can be SVHN, CIFAR-10 or CIFAR-100.

{scoring function} can be msp, odin, mahalanobis, sofl, rowl, ntom or atom.

{model name} is the name of the model that you have trained. The model type should match the corresponding scoring function. See the following table for the matchings:

Model TypeScoring Function
vanillamsp
vanillaodin
vanillamahalanobis
SOFLsofl
OEmsp
ACETmsp
CCUmsp
ROWLrowl
NTOMntom
ATOMatom

Acknowledgements

Part of this code is inspired by ODIN, Outlier Exposure, Deep Mahalanobis Detector, Corruption and Perturbation Robustness and Certified Certain Uncertainty.

Citation

Please cite our work if you use the codebase:

@article{chen2021atom,
title={ATOM: Robustifying Out-of-distribution Detection Using Outlier Mining},
author={Chen, Jiefeng and Li, Yixuan and Wu, Xi and Liang, Yingyu and Jha, Somesh},
journal={In Proceedings of European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML PKDD)},
year={2021}
}

License

Please refer to the LICENSE.