Towards Optimal Feature-Shaping Methods for Out-of-Distribution Detection

Qinyu Zhao, Ming Xu, Kartik Gupta, Akshay Asthana, Liang Zheng +1 more
2/1/2024
cs.CVcs.LG

No official code found. Best implementation: Qinyu-Allen-Zhao/OptFSOOD (17 stars, last commit 2024-04-20).

Abstract

Feature shaping refers to a family of methods that exhibit state-of-the-art performance for out-of-distribution (OOD) detection. These approaches manipulate the feature representation, typically from the penultimate layer of a pre-trained deep learning model, so as to better differentiate between in-distribution (ID) and OOD samples. However, existing feature-shaping methods usually employ rules manually designed for specific model architectures and OOD datasets, which consequently limit their generalization ability. To address this gap, we first formulate an abstract optimization framework for studying feature-shaping methods. We then propose a concrete reduction of the framework with a simple piecewise constant shaping function and show that existing feature-shaping methods approximate the optimal solution to the concrete optimization problem. Further, assuming that OOD data is inaccessible, we propose a formulation that yields a closed-form solution for the piecewise constant shaping function, utilizing solely the ID data. Through extensive experiments, we show that the feature-shaping function optimized by our method improves the generalization ability of OOD detection across a large variety of datasets and model architectures.

View on arXivView PDF

Code Implementations(1)

Code for ICLR 2024 paper "Towards Optimal Feature-Shaping Methods for Out-of-Distribution Detection"

172Shell, PythonFeb 1, 20242 years ago

Similar Papers

Cite this paper

@article{zhao2024towards,
  title  = {Towards Optimal Feature-Shaping Methods for Out-of-Distribution Detection},
  author = {Qinyu Zhao and Ming Xu and Kartik Gupta and Akshay Asthana and Liang Zheng and Stephen Gould},
  year   = {2024},
  eprint = {2402.00865},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.00865v1},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.00865.svg)](https://codeofpaper.com/paper/2402.00865)

Discussion