Skip to content

yangdonghun3/Ensemble_based_OOD_Detection

Repository files navigation

Ensemble-Based Out-of-Distribution Detection

Introduction

This project is for the paper "Ensemble-Based Out-of-Distribution Detection" in MDPI Electronics. Some codes are from ODIN and Mahalanobis-based OOD Detection.

Requirements

  • Python 3.7
  • Pytorch 1.5 (GPU version is recomended)
  • scipy
  • scikit-learn
  • numpy

Experiments

We provide several expeiments of ood detection using various combinations of datasets.

  • 1-Channel image datasets: MNIST, and FashionMNIST
  • 3-Channel image datasets: CIFAR-10, CIFAR-100, SVHN, Tiny ImageNet, and LSUN,

Downloading Datasets

The datasets, excluding Tiny ImageNet and LSUN, are automatically downloaded from our code using the PyTorch library. To download Tiny ImageNet and LSUN datasets, we use following links from ODIN.

Please download and place them to ./data/.

Training Models (ResNet34, Siamise with ResNet34, Triplet with ResNet34)

The models, excluding ResNet34 on 3-Channel image, are trained in our code(network_trainer_1C.ipynb, and network_trainer_3C.ipynb) To download the trained ResNet34 on 3-Channel image, we provide following links.

Please download and place them to ./trained_models/.

  • Run all code in network_trainer_1C.ipynb, and network_trainer_3C.ipynb.
  • You can see all trained models in ./trained_models/.

Out-of-distribution Detection (Baseline, ODIN, Mahalanobis-based Method, DML-based Method, Ensemble-based Method (ours))

  • Run all code in MAIN_1c.ipynb and MAIN_3c.ipynb
  • All results will be printed in the each cell of Main_1c and Main_3c notebook

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages