PyTorch implementation of our paper Task-agnostic Out-of-Distribution Detection Using Kernel Density Estimation by Ertunc Erdil (email), Krishna Chaitanya, Neerav Karani, and Ender Konukoglu.
If you find this code helpful in your research please cite the following paper:
@article{erdil2021taskagnostic,
title={Task-agnostic out-of-distribution detection using kernel density estimation},
author={Erdil, Ertunc and Chaitanya, Krishna and Karani, Neerav and Konukoglu, Ender},
journal={arXiv preprint arXiv:2006.10712},
year={2021}
}
conda create --name <env_name> # Create virtual environment - optional
conda install -c conda-forge scikit-learn
conda install numpy
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch
pip install torchsummary
Download the datasets and copy to ./data folder
Download the pre-trained models and copy to ./pre_trained folder
python main_train.py config/cifar10/cifar10_kde_cfg_01.py # Running on CIFAR10 dataset
python main_train.py config/cifar100/cifar100_kde_cfg_01.py # Running on CIFAR100 dataset