Skip to main content
QUICK REVIEW

[Paper Review] In or Out? Fixing ImageNet Out-of-Distribution Detection Evaluation

Julian Bitterwolf, Maximilian A. Müller|arXiv (Cornell University)|Jun 1, 2023
Adversarial Robustness in Machine LearningComputer Science11 citations
TL;DR

The paper shows that many ImageNet-1K OOD datasets contain ID contamination, introduces NINCO (No ImageNet Class Objects) with 64 OOD classes and 5879 cleaned images, and analyzes a broad set of OOD detectors across architectures, highlighting the impact of pretraining and the need for per-class evaluation and OOD unit-tests.

ABSTRACT

Out-of-distribution (OOD) detection is the problem of identifying inputs which are unrelated to the in-distribution task. The OOD detection performance when the in-distribution (ID) is ImageNet-1K is commonly being tested on a small range of test OOD datasets. We find that most of the currently used test OOD datasets, including datasets from the open set recognition (OSR) literature, have severe issues: In some cases more than 50$\%$ of the dataset contains objects belonging to one of the ID classes. These erroneous samples heavily distort the evaluation of OOD detectors. As a solution, we introduce with NINCO a novel test OOD dataset, each sample checked to be ID free, which with its fine-grained range of OOD classes allows for a detailed analysis of an OOD detector's strengths and failure modes, particularly when paired with a number of synthetic "OOD unit-tests". We provide detailed evaluations across a large set of architectures and OOD detection methods on NINCO and the unit-tests, revealing new insights about model weaknesses and the effects of pretraining on OOD detection performance. We provide code and data at https://github.com/j-cb/NINCO.

Motivation & Objective

  • Identify and quantify ID contamination in widely used ImageNet-1K OOD test datasets.
  • Propose a clean, challenging OOD test set (NINCO) with per-class evaluation to better understand detector weaknesses.
  • Analyze how different OOD detection methods perform across diverse architectures and pretraining regimes.
  • Introduce OOD unit-tests to probe detector weaknesses beyond natural images.
  • Provide recommendations for fair evaluation and reporting of OOD detectors.

Proposed method

  • Systematic manual inspection of 400 random samples per commonly used OOD dataset to measure ID contamination.
  • Construction of NINCO with 5879 images across 64 OOD classes, manually verified to be ID-free, plus 17 synthetic OOD unit-tests.
  • Evaluation of 11 OOD detection methods across multiple architectures (ViT, ConvNets) with various pretraining (IN-21K, CLIP, JFT, etc.).
  • Analysis of MSP baseline, feature-based detectors (Maha, RMaha, ViM), and other methods (MaxLogit, Energy, KL-Matching, KNN, ReAct, etc.), including pre-logit feature usage.
  • Assessment of how pretraining affects OOD detection performance and the reliability of aggregate vs. per-class metrics.
Figure 3: OOD-detection before and after removing samples with ID-objects: We show FPR (lower is better) of two OOD detectors (MSP and Mahalanobis distance) for a ViT, evaluated on cleaned and full subsets of four popular OOD datasets.
Figure 3: OOD-detection before and after removing samples with ID-objects: We show FPR (lower is better) of two OOD detectors (MSP and Mahalanobis distance) for a ViT, evaluated on cleaned and full subsets of four popular OOD datasets.

Experimental results

Research questions

  • RQ1How contaminated are existing ImageNet-1K OOD test datasets with in-distribution objects?
  • RQ2Can a cleaned, ID-free OOD test set (NINCO) provide a more reliable evaluation of OOD detectors across architectures?
  • RQ3What is the impact of pretraining type and feature usage on OOD detection performance?
  • RQ4Do synthetic OOD unit-tests reveal weaknesses not exposed by natural image datasets?
  • RQ5What evaluation practices (per-class distributions, unit-tests) should be adopted for fair OOD detector benchmarking?

Key findings

  • Many widely used OOD datasets for IN-1K contain substantial ID contamination, often over 50% in places like Places and Species datasets.
  • ID contaminations can unfairly penalize strong detectors and inflate false positives, as detectors may correctly identify ID content that shouldn't be considered OOD.
  • NINCO provides 64 manually verified OOD classes with 5,879 images that are ID-free, enabling detailed analysis of detector strengths and failure modes, plus 17 synthetic unit-tests to probe weaknesses.
  • Pretraining on larger datasets generally improves OOD detection, and pre-logit feature-based methods tend to outperform MSP, though the benefit depends strongly on the model and pretraining.
  • Explicitly using pre-logit features (feature-based detectors) yields more consistent improvements across models; however, zero-shot CLIP-based methods do not outperform IN-1K classifiers on NINCO.
  • Mean FPR improvements with advanced detectors are more pronounced on NINCO than on some traditional benchmarks, and per-class analysis reveals that performance varies widely across OOD classes.
Figure 5: Cumulative distribution of the % of NINCO-classes for which an FPR at least as low as a given x-value is achieved. The area over this curve corresponds to the mean FPR. The further in the top left corner, the better. The best methods explicitly access pre-logit features (Left): Different O
Figure 5: Cumulative distribution of the % of NINCO-classes for which an FPR at least as low as a given x-value is achieved. The area over this curve corresponds to the mean FPR. The further in the top left corner, the better. The best methods explicitly access pre-logit features (Left): Different O

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.