Revisiting Energy-Based Model for Out-of-Distribution Detection

Yifan Wu, Xichen Ye, Songmin Dai, Dengye Pan, Xiaoqiang Li, Weizhong Zhang, Yifan ChenarXiv 2024 · DOI

Introduction

Deep neural networks often exhibit overconfidence when presented with inputs that fall outside their training distribution. This phenomenon, known as the Out-of-Distribution (OOD) detection problem, poses significant risks in safety-critical applications. Traditional approaches often rely on "Outlier Exposure," which requires large, manually curated datasets of external outliers. However, such datasets are often scarce or fail to generalize to unseen test-time anomalies.

This paper introduces OEST, a novel framework that addresses these challenges by generating "proxy" outliers through simple transformations of the existing in-distribution data. By establishing a theoretically grounded energy barrier, OEST enables models to distinguish between normal data and outliers more effectively without the need for external data.

Methodology: Outlier Exposure by Simple Transformations (OEST)

The core innovation of OEST lies in the definition and utilization of Peripheral-Distribution (PD)* data. Rather than searching for external outliers, the authors apply six simple transformations to In-Distribution (ID) samples: cutout, permutation, rotation, Gaussian noise, Gaussian blur, and Sobel filtering.

Examples of simple transformations used to generate Peripheral-Distribution (PD) data from the original In-Distribution (ID) sample.

These transformations create samples that are semantically related to the ID data but structurally "off," serving as an effective interpolation between the known distribution and true unknown outliers.

The Energy Barrier Framework

The authors leverage Energy-Based Models (EBMs) to define the likelihood of an input. In an EBM, lower energy corresponds to a higher probability of being in-distribution. The goal of OEST* is to create a distinct "gap" or barrier in the energy landscape between ID and PD samples.

Conceptual illustration of the energy barrier between In-Distribution (ID), Peripheral-Distribution (PD), and Out-of-Distribution (OOD) samples.

While the initial version (OEST) utilized a standard energy-bounded loss, the authors observed that the partition function $Z$ (a normalization constant) fluctuates significantly during training, leading to instability. To resolve this, they developed OEST, which employs a new energy-barrier loss*. This loss function focuses on the relative energy difference between ID and PD samples, ensuring a more stable and theoretically sound training process.

Theoretical Guarantee

The paper provides a mathematical proof (Theorem 1) demonstrating that establishing an energy barrier between ID and PD data statistically guarantees a separation between ID and true OOD data. This provides a rigorous foundation for using simple transformations as proxies for complex outliers.

Experimental Evaluation

The researchers evaluated OEST* across standard benchmarks including CIFAR-10, CIFAR-100, MNIST, and SVHN. The method was tested against various OOD datasets such as Tiny ImageNet, Textures, and Places365 using ResNet and WideResNet backbones.

Key Results

  • Performance: On CIFAR-10, OEST achieved an average AUROC of 96.30% and an FPR95 of 15.33%*, outperforming established methods like RotPred and EBO.
  • CIFAR-100 Improvement: The method showed a significant +3.62% improvement in AUROC over previous baselines, reaching 88.03%.
  • Efficiency: OEST is highly practical, requiring only 10 epochs* of fine-tuning on a pre-trained classifier to achieve state-of-the-art results.
  • Task Preservation: Crucially, the fine-tuning process does not degrade the model's original classification accuracy on in-distribution tasks.

Discussion and Limitations

A primary limitation identified is the "stylistic similarity" between certain ID and OOD datasets (e.g., CIFAR-10 vs. CIFAR-100). In such cases, simple transformations might cause PD data to overlap with the ID distribution, potentially weakening the energy barrier. The authors found that employing stronger backbones, such as ResNet-50, helps mitigate this by learning more discriminative features.

Conclusion

OEST* represents a significant step forward in OOD detection by demonstrating that simple, automated transformations can replace expensive outlier datasets. By focusing on the relative energy gap rather than absolute values, the framework provides a robust and efficient solution for building more reliable deep learning systems.

Summary updated

BibTeX
@misc{wu2024revisiting,
  author = {Yifan Wu and Xichen Ye and Songmin Dai and Dengye Pan and Xiaoqiang Li and Weizhong Zhang and Yifan Chen},
  title = {{Revisiting Energy-Based Model for Out-of-Distribution Detection}},
  year = {2024},
  eprint = {2412.03058},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.03058},
}
Figure