This is the source code for our WACV 2023 Highlight paper Out-of-distribution Detection via Frequency-regularized Generative Models by Mu Cai, and Yixuan Li. The main idea and code are heavily borrowed from Frequency Domain Image Translation: More Photo-realistic, Better Identity-preserving.
@inproceedings{cai-wacv2023,
title = {Out-of-distribution Detection via Frequency-regularized Generative Models},
author = {Cai, Mu and Li, Yixuan},
booktitle = {Winter Conference on Applications of Computer Vision (WACV)},
year = {2023}
}
Here we provide the VAE trained on CIFAR-10 as an example.
We provide links and instructions to download the dataset:
Download them and place them in the folder of ./data
.
For all the other datasets, PyTorch will automatically download them for you.
It is tested under Ubuntu Linux 20.04 and Python 3.8 environment, and requires some packages to be installed:
Using pip
to install such packages is fine.
To train a frequency-regularized VAE model, use the following command:
cd train_VAE
python train_VAE_freq.py
Alternatively, you can download a pretrained checkpoint here, and put it under ./saved_models/VAE_cifar10
.
To evaluate the AUROC, use the following command:
python compute_AUROC.py
You will get the average AUROC of 0.908 on all of the OOD datasets.
Code is modified from Frequency Domain Image Translation: More Photo-realistic, Better Identity-preserving, Likelihood Regret, and ROSE.