Giter VIP home page Giter VIP logo

divoe's Introduction

Diversified Outlier Exposure for Out-of-Distribution Detection via Informative Extrapolation

This repo contains the sample code of our proposed DivOE in our paper: Diversified Outlier Exposure for Out-of-Distribution Detection via Informative Extrapolation (NeurIPS 2023).

Required Packages

The following packages are required to be installed:

All of our experiments are conducted on NVIDIA GeForce RTX451 3090 GPUs with Python 3.7, PyTorch 1.12 and Torchvision 0.13

Pretrained Models

For CIFAR-10/CIFAR-100, pretrained WRN models are provided in folder

./CIFAR/snapshots/

For ImageNet, we used the pre-trained ResNet-50 provided by Pytorch.

Datasets

Please download the datasets in folder

./data/

1. CIFAR-10/100 as ID dataset

Auxiliary OOD Dataset

Test OOD Datasets

2. ImageNet as ID dataset

Auxiliary OOD Dataset

We employ the ImageNet-21K-P dataset as the auxiliary OOD dataset, which makes invalid classes cleansing and image resizing compared with the original ImageNet-21K

Test OOD Datasets

We employed iNaturalist, SUN, Places365, and Texture, following the same experiment settings as MOS. To download these four test OOD datasets, one could follow the instructions in the code repository of MOS.

Fine-tuning and Testing

run MSP score training and testing for cifar10 WRN

bash run.sh oe_tune 0 

run MSP score training and testing for cifar100 WRN

bash run.sh oe_tune 1

run MSP score training and testing for ImageNet ResNet-50

bash run.sh oe_tune 2

run DivOE with MSP score for extrapolation on cifar10 WRN with the following hyperparameters $r=0.5,\epsilon=0.05, relative,step,size=0.25,k=5$

bash run.sh MSP_DivOE 0 0.5 0.05 0.25 5  

run DivOE with MSP score for extrapolation on cifar100 WRN with the following hyperparameters $r=0.5,\epsilon=0.05, relative,step,size=0.25,k=5$

bash run.sh MSP_DivOE 1 0.5 0.05 0.25 5 

run DivOE with MSP score for extrapolation on ImageNet ResNet-50 with the following hyperparameters $r=0.5,\epsilon=0.05, relative,step,size=0.25,k=5$

bash run.sh MSP_DivOE 2 0.5 0.05 0.25 5 

Results

Our method achieves the following average performance on all test OOD datasets:

CIFAR-10 CIFAR-10 CIFAR-100 CIFAR-100 ImageNet ImageNet
FPR95 AUROC FPR95 AUROC FPR95 AUROC
OE 13.76 97.53 27.67 91.89 61.94 81.58
DivOE 11.66 97.82 24.80 92.91 60.12 81.96

If you find our paper and repo useful, please cite our paper:

@inproceedings{zhu2023diversified,
title     ={Diversified Outlier Exposure for Out-of-Distribution Detection via Informative Extrapolation},
author    ={Jianing Zhu, Geng Yu, Jiangchao Yao, Tongliang Liu, Gang Niu, Masashi Sugiyama, Bo Han},
booktitle ={Thirty-seventh Conference on Neural Information Processing Systems},
year      ={2023}
}

divoe's People

Contributors

zfancy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.