All Projects → engkarat → cosine-ood-detector

engkarat / cosine-ood-detector

Licence: other
Hyperparameter-Free Out-of-Distribution Detection Using Softmax of Scaled Cosine Similarity

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to cosine-ood-detector

VT-UNet
[MICCAI2022] This is an official PyTorch implementation for A Robust Volumetric Transformer for Accurate 3D Tumor Segmentation
Stars: ✭ 151 (+403.33%)
Mutual labels:  pytorch-implementation
cycleGAN-PyTorch
A clean and lucid implementation of cycleGAN using PyTorch
Stars: ✭ 107 (+256.67%)
Mutual labels:  pytorch-implementation
onn
Online Deep Learning: Learning Deep Neural Networks on the Fly / Non-linear Contextual Bandit Algorithm (ONN_THS)
Stars: ✭ 139 (+363.33%)
Mutual labels:  pytorch-implementation
neuro-symbolic-ai-soc
Neuro-Symbolic Visual Question Answering on Sort-of-CLEVR using PyTorch
Stars: ✭ 41 (+36.67%)
Mutual labels:  pytorch-implementation
MolDQN-pytorch
A PyTorch Implementation of "Optimization of Molecules via Deep Reinforcement Learning".
Stars: ✭ 58 (+93.33%)
Mutual labels:  pytorch-implementation
NGCF-PyTorch
PyTorch Implementation for Neural Graph Collaborative Filtering
Stars: ✭ 200 (+566.67%)
Mutual labels:  pytorch-implementation
out-of-distribution-detection
The Ultimate Reference for Out of Distribution Detection with Deep Neural Networks
Stars: ✭ 117 (+290%)
Mutual labels:  out-of-distribution-detection
RandLA-Net-pytorch
🍀 Pytorch Implementation of RandLA-Net (https://arxiv.org/abs/1911.11236)
Stars: ✭ 69 (+130%)
Mutual labels:  pytorch-implementation
pre-training
Pre-Training Buys Better Robustness and Uncertainty Estimates (ICML 2019)
Stars: ✭ 90 (+200%)
Mutual labels:  out-of-distribution-detection
svae cf
[ WSDM '19 ] Sequential Variational Autoencoders for Collaborative Filtering
Stars: ✭ 38 (+26.67%)
Mutual labels:  pytorch-implementation
CheXpert-Challenge
Code for CheXpert Challenge 2019 Top 1 && Top 2 solution
Stars: ✭ 30 (+0%)
Mutual labels:  pytorch-implementation
3D-UNet-PyTorch-Implementation
The implementation of 3D-UNet using PyTorch
Stars: ✭ 78 (+160%)
Mutual labels:  pytorch-implementation
OKD-Reading-List
Papers for Open Knowledge Discovery
Stars: ✭ 102 (+240%)
Mutual labels:  out-of-distribution-detection
ResUNetPlusPlus-with-CRF-and-TTA
ResUNet++, CRF, and TTA for segmentation of medical images (IEEE JBIHI)
Stars: ✭ 98 (+226.67%)
Mutual labels:  pytorch-implementation
Text-Classification-LSTMs-PyTorch
The aim of this repository is to show a baseline model for text classification by implementing a LSTM-based model coded in PyTorch. In order to provide a better understanding of the model, it will be used a Tweets dataset provided by Kaggle.
Stars: ✭ 45 (+50%)
Mutual labels:  pytorch-implementation
pytorch-convcnp
A PyTorch Implementation of Convolutional Conditional Neural Process.
Stars: ✭ 41 (+36.67%)
Mutual labels:  pytorch-implementation
Representation-Learning-for-Information-Extraction
Pytorch implementation of Paper by Google Research - Representation Learning for Information Extraction from Form-like Documents.
Stars: ✭ 82 (+173.33%)
Mutual labels:  pytorch-implementation
semi-supervised-paper-implementation
Reproduce some methods in semi-supervised papers.
Stars: ✭ 35 (+16.67%)
Mutual labels:  pytorch-implementation
MobileHumanPose
This repo is official PyTorch implementation of MobileHumanPose: Toward real-time 3D human pose estimation in mobile devices(CVPRW 2021).
Stars: ✭ 206 (+586.67%)
Mutual labels:  pytorch-implementation
FSSD OoD Detection
Feature Space Singularity for Out-of-Distribution Detection. (SafeAI 2021)
Stars: ✭ 66 (+120%)
Mutual labels:  out-of-distribution-detection

Hyperparameter-Free Out-of-Distribution Detection Using Softmax of Scaled Cosine Similarity

This repository is an PyTorch implementation for to paper "Hyperparameter-Free Out-of-Distribution Detection Using Softmax of Scaled Cosine Similarity" [arxiv] by Engkarat Techapanurak and Takayuki Okatani. Influenced by metrics learning, our classifier is built utilizing the cosine similarity with scaling factor. It allows our network to improve ability on out-of-distribution detection. The results from paper are shown below.

alt text

If you find this work useful in your research, please cite:

@article{techapanurak2019cosine,
  title={Hyperparameter-free out-of-Distribution detection using softmax of scaled cosine similarity},
  author={Techapanurak, Engkarat and Okatani, Takayuki},
  journal={arXiv:1905.10628},
  year={2019}
}

Datasets and Checkpoints

Datasets and checkpoints used in this implementation can be downloaded at datasets and checkpoints. For datasets, please extract and store them below 'data' directory such that './data/ood_dataset/' exists. For checkpoint, please put them below 'ckpt' directory such that './ckpt/std/' and './ckpt/cos/' exist.

Requirements

Please install required packages, using this command:

pip install -r requirements.txt

Other requirements:

  • GPU: 1 unit
  • Python version: 3.7

Running the code

1. Using pre-trained checkpoints

To examine the out-of-distribution detection result using pre-trained network, checkpoints should be stored as described above. Then, run commands:

Standard Network

# Standard DenseNet with CIFAR-10
python std_ood_detector.py --nn dense-100 --tr_dset cifar10
# Standard DenseNet with CIFAR-100
python std_ood_detector.py --nn dense-100 --tr_dset cifar100
# Standard WRN-28-10 with CIFAR-10
python std_ood_detector.py --nn wrn-28-10 --tr_dset cifar10
# Standard WRN-28-10 with CIFAR-100
python std_ood_detector.py --nn wrn-28-10 --tr_dset cifar100

Scaled Cosine Network

# Scaled Cosine DenseNet with CIFAR-10
python cosine_ood_detector.py --nn dense-100 --tr_dset cifar10
# Scaled Cosine DenseNet with CIFAR-100
python cosine_ood_detector.py --nn dense-100 --tr_dset cifar100
# Scaled Cosine WRN-28-10 with CIFAR-10
python cosine_ood_detector.py --nn wrn-28-10 --tr_dset cifar10
# Scaled Cosine WRN-28-10 with CIFAR-100
python cosine_ood_detector.py --nn wrn-28-10 --tr_dset cifar100

2. Training from scratch

To re-confirm the out-of-distribution detection performance, network can also be trained from scratch. To do so, one needs to remove checkpoint files of that specific task, e.g. running scaled cosine DenseNet with CIFAR-10 from scratch requires ./ckpt/cos/dense-100/cifar10/ to be empty, no any checkpoint exists in the directory.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].