← 开源
facebookresearch

odin

A simple and effective method for detecting out-of-distribution images in neural networks.

Model DevelopmentTraining toolkitsPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
545
Star
103
Fork
+0
本周
1
贡献者
创建于 2018-02-10 · 更新于 2026-09-07 · 今日第 17324 名
主要开发者
YixuanLi

facebookresearch/odin 排名第 17,324,有 545 个星标。

同类别比较

facebookresearch/odin 排名第 17,324,此处有 8 个同类条目;allenai/dont-stop-pretraining 排名第 17,321。

同类别比较
名称排名指标
RLHFlow/Online-RLHF17,316
语言:
Python
星标数:
545
分叉数:
48
简介:
A recipe for online RLHF and online iterative DPO.
Sohl-Dickstein/Diffusion-Probabilistic-Models17,319
语言:
Python
星标数:
545
分叉数:
83
简介:
Reference implementation for Deep Unsupervised Learning using Nonequilibrium Thermodynamics
akanimax/T2F17,320
语言:
Python
星标数:
545
分叉数:
95
简介:
T2F: text to face generation using Deep Learning
allenai/dont-stop-pretraining17,321
语言:
Python
星标数:
545
分叉数:
72
简介:
Code associated with the Don't Stop Pretraining ACL 2020 paper
rowanz/neural-motifs17,332
语言:
Python
星标数:
545
分叉数:
116
简介:
Code for Neural Motifs: Scene Graph Parsing with Global Context (CVPR 2018)
Gen-Verse/ReasonFlux17,334
语言:
Python
星标数:
544
分叉数:
39
JayYip/m3tl17,336
语言:
Jupyter Notebook
星标数:
544
分叉数:
122
简介:
BERT for Multitask Learning
Quantinuum/lambeq17,338
语言:
Python
星标数:
544
分叉数:
130
简介:
A high-level Python library for Quantum Natural Language Processing
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Training toolkits
星标数545
分叉数103
贡献者1
创建日期2018-02-10
更新日期2026-09-07
1 天星标数0
7 天星标数0
排名17,324
上次排名17,106
排名变化-218
7 天星标排名16,043
上次 7 天星标排名16,048
7 天星标排名变化5
总星标排名18,111
上次总星标排名18,079
总星标排名变化-32
国家USA
README 摘录

ODIN: Out-of-Distribution Detector for Neural Networks This is a PyTorch implementation for detecting out-of-distribution examples in neural networks. The method is described in the paper Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networks by S. The method reduces the false positive rate from the baseline 34. 3% on the DenseNet (applied to CIFAR-10) when the true positive rate is 95%. Experimental Results We used two neural network architectures, DenseNet-BC and

Wide ResNet. The PyTorch implementation of DenseNet-BC is provided by Andreas Veit and Brandon Amos. The PyTorch implementation of Wide ResNet is provided by Sergey Zagoruyko. The experimental results are shown as follows. The definition of each metric can be found in the paper. Pre-trained Models We provide four pre-trained neural networks: (1) two DenseNet-BC networks trained on CIFAR-10 and CIFAR-100 respectively; (2) two Wide ResNet networks trained on CIFAR-10 and CIFAR-100

respectively. 86 Running the code Dependencies CUDA 8. 0 PyTorch Anaconda2 or 3 At least **three** GPU Downloading Out-of-Distribtion Datasets We provide download links of five out-of-distributin datasets: **Tiny-ImageNet (crop)** **Tiny-ImageNet (resize)** **LSUN (crop)** **LSUN (resize)** **iSUN** Here is an example code of downloading Tiny-ImageNet (crop) dataset. In the **root** directory, run Downloading Neural Network Models We provide download links of four pre-trained models. **DenseNet-BC trained on CIFAR-10** **DenseNet-BC

trained on CIFAR-100** **Wide ResNet trained on CIFAR-10** **Wide ResNet trained on CIFAR-100** Here is an example code of downloading DenseNet-BC trained on CIFAR-10. In the **root** directory, run Running Here is an example code reproducing the results of DenseNet-BC trained on CIFAR-10 where TinyImageNet (crop) is the out-of-distribution dataset. The temperature is set as 1000, and perturbation magnitude is set as 0. In the **root** directory, run **Note:** Please choose

arguments according to the following. nn**: the arguments of neural networks are shown as follows **args. out_dataset**: the arguments of out-of-distribution datasets are shown as follows **args. magnitude**: the optimal noise magnitude can be found below. In practice, the optimal choices of noise magnitude are model-specific and need to be tuned accordingly. temperature**: temperature is set to 1000 in all cases. gpu**: make sure you use the following gpu when running the code: Outputs Here is

an example of output.

常见问题

记录了多少星标和分叉?

facebookresearch/odin 有 545 个星标和 103 个分叉。

仓库排名是多少?

facebookresearch/odin 排名第 17,324。

记录的语言和类别是什么?

facebookresearch/odin 有 545 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

facebookresearch/odin 与 allenai/dont-stop-pretraining 比较,后者排名第 17,321,有 545 个星标。

README

ODIN: Out-of-Distribution Detector for Neural Networks

This is a PyTorch implementation for detecting out-of-distribution examples in neural networks. The method is described in the paper Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networks by S. Liang, Yixuan Li and R. Srikant. The method reduces the false positive rate from the baseline 34.7% to 4.3% on the DenseNet (applied to CIFAR-10) when the true positive rate is 95%.

Experimental Results

We used two neural network architectures, DenseNet-BC and Wide ResNet. The PyTorch implementation of DenseNet-BC is provided by Andreas Veit and Brandon Amos. The PyTorch implementation of Wide ResNet is provided by Sergey Zagoruyko. The experimental results are shown as follows. The definition of each metric can be found in the paper.

Pre-trained Models

We provide four pre-trained neural networks: (1) two DenseNet-BC networks trained on CIFAR-10 and CIFAR-100 respectively; (2) two Wide ResNet networks trained on CIFAR-10 and CIFAR-100 respectively. The test error rates are given by:

Architecture CIFAR-10 CIFAR-100
DenseNet-BC 4.81 22.37
Wide ResNet 3.71 19.86

Running the code

Dependencies

  • CUDA 8.0

  • PyTorch

  • Anaconda2 or 3

  • At least three GPU

    Note: Reproducing results of DenseNet-BC only requires one GPU, but reproducing results of Wide ResNet requires three GPUs. Single GPU version for Wide ResNet will be released soon in the future.

Downloading Out-of-Distribtion Datasets

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 ..

Downloading Neural Network Models

We provide download links of four pre-trained models.

Here is an example code of downloading DenseNet-BC trained on CIFAR-10. In the root directory, run

mkdir models
cd models
wget https://www.dropbox.com/s/wr4kjintq1tmorr/densenet10.pth.tar.gz
tar -xvzf densenet10.pth.tar.gz
cd ..

Running

Here is an example code reproducing the results of DenseNet-BC trained on CIFAR-10 where TinyImageNet (crop) is the out-of-distribution dataset. The temperature is set as 1000, and perturbation magnitude is set as 0.0014. In the root directory, run

cd code
# model: DenseNet-BC, in-distribution: CIFAR-10, out-distribution: TinyImageNet (crop)
# magnitude: 0.0014, temperature 1000, gpu: 0
python main.py --nn densenet10 --out_dataset Imagenet --magnitude 0.0014 --temperature 1000 --gpu 0

Note: Please choose arguments according to the following.

args

  • args.nn: the arguments of neural networks are shown as follows

    Nerual Network Models args.nn
    DenseNet-BC trained on CIFAR-10 densenet10
    DenseNet-BC trained on CIFAR-100 densenet100
  • args.out_dataset: the arguments of out-of-distribution datasets are shown as follows

    Out-of-Distribution Datasets args.out_dataset
    Tiny-ImageNet (crop) Imagenet
    Tiny-ImageNet (resize) Imagenet_resize
    LSUN (crop) LSUN
    LSUN (resize) LSUN_resize
    iSUN iSUN
    Uniform random noise Uniform
    Gaussian random noise Gaussian
  • args.magnitude: the optimal noise magnitude can be found below. In practice, the optimal choices of noise magnitude are model-specific and need to be tuned accordingly.

    Out-of-Distribution Datasets densenet10 densenet100 wideresnet10 wideresnet100
    Tiny-ImageNet (crop) 0.0014 0.0014 0.0005 0.0028
    Tiny-ImageNet (resize) 0.0014 0.0028 0.0011 0.0028
    LSUN (crop) 0 0.0028 0 0.0048
    LSUN (resize) 0.0014 0.0028 0.0006 0.002
    iSUN 0.0014 0.0028 0.0008 0.0028
    Uniform random noise 0.0014 0.0028 0.0014 0.0028
    Gaussian random noise 0.0014 0.0028 0.0014 0.0028
  • args.temperature: temperature is set to 1000 in all cases.

  • args.gpu: make sure you use the following gpu when running the code:

    Neural Network Models args.gpu
    densenet10 0
    densenet100 0
    wideresnet10 1
    wideresnet100 2

Outputs

Here is an example of output.

Neural network architecture:          DenseNet-BC-100
In-distribution dataset:                     CIFAR-10
Out-of-distribution dataset:     Tiny-ImageNet (crop)

                          Baseline         Our Method
FPR at TPR 95%:              34.8%               4.3%
Detection error:              9.9%               4.6%
AUROC:                       95.3%              99.1%
AUPR In:                     96.4%              99.2%
AUPR Out:                    93.8%              99.1%

License

Please refer to the LICENSE.

排名相邻
同类项目