Extremely Simple Activation Shaping for Out-of-Distribution Detection

Andrija Djurisic, Nebojsa Bozanic, Arjun Ashok, Rosanne Liu
9/20/2022
304 citations
cs.LGcs.CV

Official code: andrijazz/ash (56 stars, Jupyter Notebook, MIT, last commit 2024-08-30).

Abstract

The separation between training and deployment of machine learning models implies that not all scenarios encountered in deployment can be anticipated during training, and therefore relying solely on advancements in training has its limits. Out-of-distribution (OOD) detection is an important area that stress-tests a model's ability to handle unseen situations: Do models know when they don't know?

Show full abstract

Existing OOD detection methods either incur extra training steps, additional data or make nontrivial modifications to the trained network. In contrast, in this work, we propose an extremely simple, post-hoc, on-the-fly activation shaping method, ASH, where a large portion (e.g. 90%) of a sample's activation at a late layer is removed, and the rest (e.g. 10%) simplified or lightly adjusted. The shaping is applied at inference time, and does not require any statistics calculated from training data. Experiments show that such a simple treatment enhances in-distribution and out-of-distribution distinction so as to allow state-of-the-art OOD detection on ImageNet, and does not noticeably deteriorate the in-distribution accuracy. Video, animation and code can be found at: https://andrijazz.github.io/ash

View on arXivView PDF

Code Implementations(1)

andrijazz/ashOfficial100%
MIT

Code release for paper Extremely Simple Activation Shaping for Out-of-Distribution Detection

561Jupyter Notebook, PythonMay 17, 20222 years agoMIT

Similar Papers

Cite this paper

@article{djurisic2022extremely,
  title  = {Extremely Simple Activation Shaping for Out-of-Distribution Detection},
  author = {Andrija Djurisic and Nebojsa Bozanic and Arjun Ashok and Rosanne Liu},
  year   = {2022},
  eprint = {2209.09858},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.09858}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.09858.svg)](https://codeofpaper.com/paper/2209.09858)

Discussion