Evaluation of Out-of-Distribution Detection Performance of Self-Supervised Learning in a Controllable Environment

Jeonghoon Park, Kyungmin Jo, Daehoon Gwak, Jimin Hong, Jaegul Choo, Edward ChoiarXiv 2020

TL;DR

This paper introduces a novel "controllable" evaluation framework for Out-of-Distribution (OOD) detection, allowing researchers to systematically adjust the difficulty of OOD samples. They demonstrate that Self-Supervised Learning (SSL) methods consistently outperform traditional approaches across various modalities, especially when OOD samples are challenging (i.e., close to in-distribution data).

What Problem Does This Paper Address?

Detecting out-of-distribution (OOD) data – samples that don't belong to the training distribution – is crucial for robust AI systems. Current evaluation methods often rely on fixed datasets, making it hard to understand how models perform under varying levels of OOD difficulty. For instance, the difference between two similar image datasets (like CIFAR10 and CIFAR100) is likely less challenging for OOD detection than the difference between an image dataset and a text dataset. This paper addresses the lack of a systematic way to control and measure OOD detection performance as a function of this "difficulty" or "distance" between in-distribution (ID) and OOD data.

Methods

The core contribution is a controllable evaluation framework. This framework works by gradually adjusting the "distance" between ID and OOD samples using a "distance factor."

  • 2D Simulated Dataset: OOD samples are generated in a 2D space, forming a circle with a radius controlled by a factor r. As r increases, the OOD samples move further from the ID samples.
  • Image Dataset: The Mixup technique is used to create OOD samples by blending ID and OOD images with varying mixing ratios. This ratio is assumed to correlate with the ID-OOD distance.
  • Text Dataset: Consecutive sentences in ID documents are replaced with Vietnamese sentences to create OOD samples, controlled by a mixing ratio.

The paper then evaluates various OOD detection algorithms, including those enhanced by Self-Supervised Learning (SSL), within this framework. They compare different classification losses (Cross-Entropy vs. OVADM) and OOD scoring methods (Baseline, Mahalanobis Distance, ODIN).

Datasets

  • Simulated Data: A custom 2D dataset with controlled distance between ID and OOD samples.
  • Image Data:
    • In-distribution (ID): CIFAR10, CIFAR100.
  • Out-of-distribution (OOD): TinyImagenet, LSUN, SVHN, CIFAR100 (when ID is CIFAR10), CIFAR10 (when ID is CIFAR100).
  • Text Data:
    • In-distribution (ID): English and French documents from the IWSLT 2015 dataset.
  • Out-of-distribution (OOD): Vietnamese documents.

Key Insights and Ideas

  • Controllable Difficulty is Key: Using fixed OOD datasets can be misleading. A controllable framework is essential for truly understanding and comparing OOD detection methods, especially for identifying weaknesses when OOD samples are "close" to ID data.
  • SSL is a Game Changer for OOD: Self-supervised learning consistently improves OOD detection performance across all tested modalities and OOD scoring methods. This is particularly true for harder OOD detection scenarios.
  • Distance Matters: Methods that explicitly consider the "distance" between ID and OOD samples (like OVADM loss or Mahalanobis Distance scoring) generally perform better and show more predictable behavior as OOD difficulty increases.
  • SSL Enhances Monotonicity: SSL not only boosts AUROC but also helps models exhibit a more consistently increasing OOD detection performance as the OOD distance increases, making their behavior more predictable.

Key Results

  • Consistent SSL Improvement: Across all three modalities (2D simulated, images, text), SSL-based methods consistently achieved higher AUROC scores for OOD detection compared to their non-SSL counterparts.
  • Image Domain: For image datasets, SSL application led to a quicker inflection point and a steeper slope in AUROC curves as the mixing ratio (representing OOD distance) increased. ODIN showed a considerable AUROC difference with SSL, and Mahalanobis Distance showed a large gap with BYOL.
  • Text Domain: SSL-based text models also demonstrated better OOD detection performance. The behavior of non-SSL models varied significantly depending on the language and OOD scoring method, highlighting the need for controlled evaluation.
  • Classification Accuracy: While SSL improved OOD detection, its impact on pure classification accuracy was sometimes marginal or even slightly detrimental in some image settings (e.g., OVADM vs. CE). This underscores that OOD detection is a distinct challenge from in-distribution classification.

Limitations and Future Work

  • Controllable Text Datasets: The authors acknowledge that the controllable text dataset (using Vietnamese sentences) has limitations and suggest extending it to more principled and realistic methods, potentially using generative models like VAEs or GANs.
  • Mixup Assumption: The assumption that the mixing ratio in the image domain directly correlates with distance is noted as potentially debatable, though the results generally support it.
  • Broader Impact: The authors state that the broader impact of this work is not applicable to them.

Summary updated

BibTeX
@misc{park2020evaluation,
  author = {Jeonghoon Park and Kyungmin Jo and Daehoon Gwak and Jimin Hong and Jaegul Choo and Edward Choi},
  title = {{Evaluation of Out-of-Distribution Detection Performance of Self-Supervised Learning in a Controllable Environment}},
  year = {2020},
  eprint = {2011.13120},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.13120},
}
Figure