Neural Mean Discrepancy for Efficient Out-of-Distribution Detection
Authors:
- 1 June 2022
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 19195-19205
Abstract
Various approaches have been proposed for out-of-distribution (OOD) detection by augmenting models, input examples, training sets, and optimization objectives. Deviating from existing work, we have a simple hypothesis that standard off-the-shelf models may already contain sufficient information about the training set distribution which can be leveraged for reliable OOD detection. Our empirical study on validating this hypothesis, which measures the model activation's mean for OOD and in-distribution (ID) minibatches, surprisingly finds that activation means of OOD mini-batches consistently deviate more from those of the training data. In addition, training data's activation means can be computed offline efficiently or retrieved from batch normalization layers as a ‘free lunch’. Based upon this observation, we propose a novel metric called Neural Mean Discrepancy (NMD), which compares neural means of the input examples and training data. Leveraging the simplicity of NMD, we propose an efficient OOD detector that computes neural means by a standard forward pass followed by a lightweight classifier. Extensive experiments show that NMD outperforms state-of-the-art OOD approaches across multiple datasets and model architectures in terms of both detection accuracy and computational cost.Keywords
All Related Versions
This publication has 25 references indexed in Scilit:
- Peeking Inside the Black-Box: A Survey on Explainable Artificial Intelligence (XAI)IEEE Access, 2018
- Adaptive Batch Normalization for practical domain adaptationPattern Recognition, 2018
- Adversarial Examples Are Not Easily Detected2017
- Network Dissection: Quantifying Interpretability of Deep Visual Representations2017
- Densely Connected Convolutional Networks2017
- Deep Residual Learning for Image Recognition2016
- Deep learningNature, 2015
- Subject independent facial expression recognition with robust face detection using a convolutional neural networkNeural Networks, 2003
- Integral Probability Metrics and Their Generating Classes of FunctionsAdvances in Applied Probability, 1997
- The Fréchet distance between multivariate normal distributionsJournal of Multivariate Analysis, 1982