Source-linked AI summary

Out-of-Distribution Detection Using an Ensemble of Self Supervised Leave-out Classifiers

Apoorv Vyas, Nataraj Jammalamadaka, Xia Zhu, Dipankar Das, Bharat Kaul, Theodore L. Willke

arXiv:1809.03576v1cs.LGcs.CVstat.ML

TL;DR

Reliable OOD detection is important for deep-learning systems used in applications such as autonomous driving and medical diagnosis. The paper trains an ensemble of self-supervised leave-out classifiers with a margin-based entropy loss and combines their outputs into an OOD score and class prediction. It reports outperforming Hendrycks et al. and ODIN across several OOD detection benchmarks, while requiring substantial memory and computation and an OOD dataset for hyper-parameter search.

  • Problem

    Deep-learning applications need reliable detection of anomalous or OOD inputs, including unusual environments, novel biological phenomena, sensor failures, and cyber attacks.

  • Method

    The method trains an ensemble of leave-out classifiers using a margin-based entropy loss alongside ID cross-entropy, then combines temperature-scaled softmax and entropy outputs for OOD scoring and class prediction.

  • Results

    The proposed method significantly outperforms state-of-the-art methods, including ODIN, across almost all evaluated OOD detection benchmarks.

  • Takeaways & Limitations

    The results support the proposed loss, leave-out ensemble, and OOD scoring metric as effective components for improving OOD detection performance.

  • Takeaways & Limitations

    The ensemble requires large memory and computational resources, and hyper-parameter search currently requires an OOD dataset.

Abstract

from arXiv · show

As deep learning methods form a critical part in commercially important applications such as autonomous driving and medical diagnostics, it is important to reliably detect out-of-distribution (OOD) inputs while employing these algorithms. In this work, we propose an OOD detection algorithm which comprises of an ensemble of classifiers. We train each classifier in a self-supervised manner by leaving out a random subset of training data as OOD data and the rest as in-distribution (ID) data. We propose a novel margin-based loss over the softmax output which seeks to maintain at least a margin $m$ between the average entropy of the OOD and in-distribution samples. In conjunction with the standard cross-entropy loss, we minimize the novel loss to train an ensemble of classifiers. We also propose a novel method to combine the outputs of the ensemble of classifiers to obtain OOD detection score and class prediction. Overall, our method convincingly outperforms Hendrycks et al.[7] and the current state-of-the-art ODIN[13] on several OOD detection benchmarks.

1 Introduction

The paper targets reliable OOD detection for deep neural networks in commercially important applications. It introduces a self-supervised ensemble approach combining a margin-based loss, leave-out classifiers, and a new OOD score.

  • Deep neural networks require anomaly or OOD detection for applications including autonomous driving, medical diagnosis, and web search.
  • The method adds a margin-based entropy loss to cross-entropy, maintaining at least margin m between average OOD and ID entropies.
  • K leave-out classifiers are trained by partitioning classes and treating one partition as OOD while the remaining K −1 partitions serve as ID.
  • A new OOD detection score combines softmax prediction scores and entropy with temperature scaling.
  • The authors report outperforming existing methods, including ODIN, on several OOD detection benchmarks.

2 Related Work

Prior OOD detection methods differ in their access to OOD labels and data, while this work is positioned alongside methods using the same training setting. ODIN is identified as the contemporary state-of-the-art comparator.

  • OOD detection methods are categorized as supervised, semi-supervised, or unsupervised according to their access to OOD labels during training.
  • Methods in the same setting include isolation forests, Hendrycks and Gimpel, ODIN, and Lee et al.
  • Hendrycks and Gimpel use lower prediction probabilities for incorrect and OOD samples as an OOD detection signal.
  • Lee et al. generate OOD samples with a GAN and reduce the divergence between generated samples’ softmax distributions and the uniform distribution.
  • ODIN increases the separation between ID and OOD maximum softmax scores through temperature scaling and gradient-based input perturbation.
  • The paper reports that its approach outperforms the preceding methods by considerable margins.

3 Out-of-Distribution (OOD) Classifier

The proposed classifier uses entropy-based margin training, mutually exclusive leave-out partitions, and ensemble scoring to distinguish ID from OOD inputs. Testing combines classifier outputs through remapped softmax scores, entropy, temperature scaling, and input preprocessing.

  • 3 Out-of-Distribution (OOD) Classifier: The method has three components: an entropy-based margin loss, an ensemble of leave-out classifiers, and OOD detection scores.
  • 3.1 Entropy based Margin-Loss: The loss combines ID cross-entropy with a margin term requiring average OOD entropy to exceed average ID entropy by at least m.
  • 3.1 Entropy based Margin-Loss: The loss reaches zero when the OOD–ID average entropy difference exceeds m; OOD entropy encourages equal class probabilities, while ID losses sharpen class predictions.
  • 3.2 Training Ensemble of leave-out classifiers: Classes are divided into K mutually exclusive partitions, and classifier Fi treats partition Xi as OOD and the remaining classes as ID.
  • 3.3 OOD Detection Score for Test Image: At test time, classifier softmax vectors are remapped to original class indices, averaged for class prediction, and combined with entropy for OOD scoring.
  • 3.3 OOD Detection Score for Test Image: Temperature scaling and input preprocessing are used during testing to further separate in-distribution and OOD samples.

4 Experimental Results

The experiments evaluate OOD detection and classification on CIFAR-10 and CIFAR-100 using multiple architectures, datasets, metrics, and ablations. The proposed loss, ensemble, and scoring method generally outperform ODIN, with improved separation on challenging OOD datasets but weaker results for some synthetic distributions.

  • Experimental setup: The study evaluates DenseNet and Wide ResNet architectures and reports test error rates alongside five OOD detection metrics.The metrics include FPR at 95% TPR, detection error, and AUROC, among others.
  • Ablation studies: The SFX+MarginEntropy loss performs better than other tested losses for both OOD detection and accurate classification.The authors identify this loss as the major factor in improvements over ODIN.
  • Ablation studies: (Softmax + Entropy)@Temperature with T = 1000 achieves the best OOD-scoring performance, while Softmax@Temperature with T = 1000 achieves the second best.These scoring methods are evaluated in the ablation study using CIFAR-100 as ID data and iSUN as OOD data.
  • Results and analysis: The proposed method significantly outperforms ODIN across architectures and almost all dataset pairs, especially on LSUN, iSUN, and resized ImageNet.It is slightly worse on uniform and some Gaussian-distribution results, while gains persist from CIFAR-10 to CIFAR-100 using five splits.
  • Results and analysis: The loss function, leave-out ensemble, and OOD scoring metric each contribute to performance improvements over ODIN.Histogram comparisons also show less overlap between ID and OOD scores for the proposed method than for ODIN.
  • Results and analysis: Random class partitions introduce stochasticity, but even the worst reported partition results outperform ODIN on more challenging datasets.Table 4 reports means and standard deviations across five random five-way partitions.

5 Conclusion and Future Work

The proposed anomaly detector combines leave-out classifiers, a margin-based entropy loss, and a novel OOD detector, outperforming state-of-the-art methods across almost all benchmarks. Its resource demands and hyperparameter dependence motivate future work.

  • The method significantly outperforms state-of-the-art OOD detection methods across almost all benchmarks.
  • The detector comprises a novel loss function, an ensemble of leave-out classifiers, and a novel out-of-distribution detector.
  • Each component improves OOD detection performance and can be applied independently on top of other methods.
  • The ensemble requires large memory and computational resources, creating a trade-off between detection performance and computational overhead through the number of splits.The authors recommend three splits when reducing computational time is critical.
  • The current method requires an OOD dataset for hyperparameter search.The authors suggest investigating better-behaved surrogate functions for entropy as a possible solution.
Loading 1809.03576v1…