Out-of-distribution detection based on subspace projection of high-dimensional features output by the last convolutional layer
This is a PyTorch implementation for detecting out-of-distribution examples in neural networks. The method is described in the paper Out-of-distribution detection based on subspace projection of high-dimensional features output by the last convolutional layer by Qiuyu Zhu,Yiwei He.
- CUDA 8.0
- PyTorch
- Anaconda2 or 3
We provide download links of five out-of-distributin datasets:
Here is an example code of downloading Tiny-ImageNet (crop) dataset. In the root directory, run
mkdir data
cd data
wget https://www.dropbox.com/s/avgm2u562itwpkl/Imagenet.tar.gz
tar -xvzf Imagenet.tar.gz
cd ..
- Run train.py to train the ID data classfier.
- Run OOD_test.py to get the immediate metrics.
- Run svm.py to fuse the metrics.
- Run metrics.py to get the experimental results.
- densnet.py is the DENSNET-100 network, which contains PEDCC layer
- center_pedcc.py to generate the PEDCC points
- conf.config is config document.
- utils.py is training progress code。
Please refer to the [LICENSE](ProjOOD/LICENSE at main · Hewell0/ProjOOD (github.com) ).