Lune

ICLR2024Top-tier venue

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

Qinyu Zhao, Ming Xu, Kartik Gupta, Akshay Asthana, Liang Zheng, Stephen Gould

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. 1

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • MLP-Mixer: An all-MLP Architecture for Vision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • AdaSCALE: Adaptive Scaling for OOD Detection cites Energy-based Out-of-distribution Detection
  • AdaSCALE: Adaptive Scaling for OOD Detection cites ReAct: Out-of-distribution Detection With Rectified Activations
  • AdaSCALE: Adaptive Scaling for OOD Detection cites Learning to Shape In-distribution Feature Space for Out-of-distribution Detection
  • ReAct: Out-of-distribution Detection With Rectified Activations cites Energy-based Out-of-distribution Detection
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites MLP-Mixer: An all-MLP Architecture for Vision
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Learning to Shape In-distribution Feature Space for Out-of-distribution Detection cites Energy-based Out-of-distribution Detection
  • Learning to Shape In-distribution Feature Space for Out-of-distribution Detection cites ReAct: Out-of-distribution Detection With Rectified Activations
  • A Geometry-Based View of Mahalanobis OOD Detection cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Diffusion-based Layer-wise Semantic Reconstruction for Unsupervised Out-of-Distribution Detection cites Energy-based Out-of-distribution Detection
  • DCAC: Dynamic Class-Aware Cache Creates Stronger Out-of-Distribution Detectors cites Energy-based Out-of-distribution Detection
  • DCAC: Dynamic Class-Aware Cache Creates Stronger Out-of-Distribution Detectors cites ReAct: Out-of-distribution Detection With Rectified Activations
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Learning to Shape In-distribution Feature Space for Out-of-distribution DetectionYonggang Zhang, Jie Lu, Bo Peng, Zhen Fang et al.NeurIPS 2024 · 33 citations
  2. AdaSCALE: Adaptive Scaling for OOD DetectionSudarshan RegmiICML 2026 · 9 citations
  3. Diffusion-based Layer-wise Semantic Reconstruction for Unsupervised Out-of-Distribution DetectionYing Yang, De Cheng, Chaowei Fang, Yubiao Wang et al.NeurIPS 2024 · 9 citations
  4. A Geometry-Based View of Mahalanobis OOD DetectionDenis Janiak, Jakub Binkowski, Tomasz KajdanowiczICML 2026 · 3 citations
  5. DCAC: Dynamic Class-Aware Cache Creates Stronger Out-of-Distribution DetectorsYanqi Wu, Qichao Chen, Runhe Lai, Xinhua Lu et al.AAAI 2026 · 1 citation

Builds on13

  1. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  3. MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer et al.NeurIPS 2021 · 3,862 citations
  4. Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
  5. ReAct: Out-of-distribution Detection With Rectified ActivationsYiyou Sun, Chuan Guo, Yixuan LiNeurIPS 2021 · 733 citations

Related papers

  1. A Variational Information Theoretic Approach to Out-of-Distribution DetectionSudeepta Mondal, Zhuolin Jiang, Ganesh SundaramoorthiICML 2025
  2. Watermarking for Out-of-distribution DetectionQizhou Wang, Feng Liu, Yonggang Zhang, Jing Zhang et al.NeurIPS 2022 · 44 citations
  3. Extremely Simple Activation Shaping for Out-of-Distribution DetectionAndrija Djurisic, Nebojsa Bozanic, Arjun Ashok, Rosanne LiuICLR 2023 · 23 citations
  4. Scaling for Training Time and Post-hoc Out-of-distribution Detection EnhancementKai Xu, Rongyu Chen, Gianni Franchi, Angela YaoICLR 2024 · 81 citations
  5. Activation Subspaces for Out-of-Distribution DetectionBaris Zöngür, Robin Hesse, Stefan RothICCV 2025 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines