Analysis of Confident-Classifiers for Out-of-distribution Detection

Sachin Vernekar, Ashish Gaurav, Taylor Denouden, Buu Phan, Vahdat Abdelzad, Rick Salay, Krzysztof CzarneckiarXiv 2019

TL;DR

This paper analyzes a popular "confident-classifier" approach for detecting out-of-distribution (OOD) data, finding it can still produce overly confident predictions for OOD samples far from the training data. The authors propose and empirically support using an explicit "reject" class as a more robust alternative for OOD detection.

What Problem Does This Paper Address?

Deep neural networks (DNNs) have achieved remarkable success in various tasks, but they often exhibit a critical flaw: they can become highly confident in their predictions even when presented with data that is fundamentally different from what they were trained on (out-of-distribution or OOD data). This "overconfidence" is problematic, especially in safety-critical applications like autonomous driving, where misclassifying OOD inputs could have severe consequences. Existing OOD detection methods aim to identify these unfamiliar inputs. One prominent approach, termed "confident-classifier," trains a model to minimize standard cross-entropy on in-distribution data and a KL divergence term on generated OOD samples to encourage low confidence (high entropy) for OOD inputs. This paper investigates the effectiveness and theoretical underpinnings of this "confident-classifier" method.

Methods

The authors analyze the "confident-classifier" approach both theoretically and experimentally.

  • Theoretical Analysis: They leverage existing theoretical results (Hein et al., 2019) showing that ReLU networks, common in DNNs, can produce arbitrarily high confidence predictions for inputs far away from the training distribution, regardless of the OOD training objective. This is because the piecewise affine nature of ReLU networks can lead to unbounded regions in the input space where a single class dominates.
  • Experimental Analysis: They conduct experiments on synthetic 2D datasets to evaluate the "confident-classifier" in two scenarios:
  • Boundary OOD Samples: OOD samples are generated close to the in-distribution's low-density boundaries, mimicking the setup of prior work (Lee et al., 2018a).
  • General OOD Samples: OOD samples are sampled more broadly from the input space.
  • Proposed Alternative: Based on their analysis, the authors propose an alternative approach: training a classifier with an explicit "reject" class for OOD samples. This transforms the OOD detection problem into a multi-class classification task where one class is specifically designated for unknown inputs.

Datasets

The paper uses synthetic 2D datasets for its experiments. The in-distribution consists of two classes sampled from Gaussian distributions. OOD samples are generated in two ways:

  • Boundary OOD Samples: Generated close to the low-density boundaries of the in-distribution data.
  • General OOD Samples: Uniformly sampled from a larger 2D box, excluding the in-distribution regions.

The paper does not introduce new benchmark datasets.

Key Insights and Ideas

  • "Confident-Classifier" Limitations: The core insight is that even with the KL divergence term designed to penalize high confidence on OOD data, "confident-classifiers" can still exhibit arbitrarily high confidence for OOD samples that are sufficiently far from the in-distribution data. This is a direct consequence of the unbounded nature of ReLU networks.
  • The "Reject" Class Advantage: Introducing an explicit "reject" class for OOD samples offers a more promising solution. The intuition is that if the reject class is assigned to the unbounded regions of the input space, the classifier will naturally assign high confidence to OOD samples in these regions, effectively flagging them as unknown.
  • GAN-Generated OOD Samples are Sub-optimal: The paper also analyzes the use of Generative Adversarial Networks (GANs) to produce OOD samples for training. They find that GANs, even with careful tuning, struggle to generate diverse OOD samples that adequately cover the entire in-distribution boundary, leading to suboptimal OOD detection performance.

Key Results

  • Boundary OOD Samples: In experiments with boundary OOD samples, the "confident-classifier" showed highly confident predictions for many OOD samples, rendering it ineffective. In contrast, the classifier trained with an explicit "reject" class successfully classified these OOD samples as such.
  • General OOD Samples: When using more broadly sampled OOD data, both the "confident-classifier" and the "reject-classifier" were able to distinguish in-distribution from OOD samples effectively, with no clear winner between the two in this specific scenario.
  • Theoretical Support: The theoretical analysis supports the experimental findings, explaining why unbounded confidence is possible for certain network architectures and input distributions.

Limitations and Future Work

  • Theoretical Guarantee for Reject Class: While empirically supported, the paper acknowledges that they cannot theoretically guarantee that training with a "reject" class will always result in the ideal bounded decision boundaries.
  • GAN Limitations: The authors highlight the difficulty of using GANs to generate effective OOD training samples, particularly in covering the entire in-distribution boundary.
  • Future Work: The paper suggests investigating other approaches for generating OOD samples that can better capture the in-distribution boundaries. Further research into alternative OOD detection strategies beyond the "confident-classifier" is also implied.

Summary updated

BibTeX
@misc{vernekar2019analysis,
  author = {Sachin Vernekar and Ashish Gaurav and Taylor Denouden and Buu Phan and Vahdat Abdelzad and Rick Salay and Krzysztof Czarnecki},
  title = {{Analysis of Confident-Classifiers for Out-of-distribution Detection}},
  year = {2019},
  eprint = {1904.12220},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.12220},
}
Figure