Detecting Out-of-Distribution Examples with In-distribution Examples and Gram Matrices

Chandramouli Shama Sastry, Sageev Oore
12/28/2019
cs.LGcs.CVstat.ML

Official code: VectorInstitute/gram-ood-detection (47 stars, last commit 2020-12-20).

Abstract

When presented with Out-of-Distribution (OOD) examples, deep neural networks yield confident, incorrect predictions. Detecting OOD examples is challenging, and the potential risks are high. In this paper, we propose to detect OOD examples by identifying inconsistencies between activity patterns and class predicted. We find that characterizing activity patterns by Gram matrices and identifying anomalies in gram matrix values can yield high OOD detection rates. We identify anomalies in the gram matrices by simply comparing each value with its respective range observed over the training data. Unlike many approaches, this can be used with any pre-trained softmax classifier and does not require access to OOD data for fine-tuning hyperparameters, nor does it require OOD access for inferring parameters. The method is applicable across a variety of architectures and vision datasets and, for the important and surprisingly hard task of detecting far-from-distribution out-of-distribution examples, it generally performs better than or equal to state-of-the-art OOD detection methods (including those that do assume access to OOD examples).

View on arXivView PDF

Code Implementations(1)

476Shell, PythonDec 26, 20195 years ago

Similar Papers

Cite this paper

@article{sastry2019detecting,
  title  = {Detecting Out-of-Distribution Examples with In-distribution Examples and Gram Matrices},
  author = {Chandramouli Shama Sastry and Sageev Oore},
  year   = {2019},
  eprint = {1912.12510},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1912.12510}
}

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/1912.12510.svg)](https://codeofpaper.com/paper/1912.12510)

Discussion