Ranked Activation Shift for Post-Hoc Out-of-Distribution Detection

Gianluca Guglielmo, Marc Masana
3/27/2026
cs.LGcs.CV

No official code found. Best implementation: gigug/RAS (7 stars, last commit 2026-06-30).

Abstract

State-of-the-art post-hoc out-of-distribution detection methods rely on intermediate layer activation editing. However, they exhibit inconsistent performance across datasets and models.

Show full abstract

We show that this instability is driven by differences in the activation distributions, and identify a failure mode of scaling-based methods that arises when penultimate layer activations are not rectified. Motivated by this analysis, we propose RAS, a hyperparameter-free post-hoc method that replaces sorted activation magnitudes with a fixed in-distribution reference profile. Our simple plug-and-play method shows strong and consistent performance across datasets and architectures without assumptions on the penultimate layer activation function, and without requiring any hyperparameter tuning, while empirically preserving in-distribution classification accuracy. We further analyze what drives the improvement, showing that both inhibiting and exciting activation shifts independently contribute to better out-of-distribution discrimination.

View on arXivView PDF

Code Implementations(1)

gigug/RASCommunity67%

[ECCV26] Source code for the paper Ranked Activation Shift for Post-Hoc Out-of-Distribution Detection by Gianluca Guglielmo and Marc Masana.

70Mar 25, 20265 months ago

Similar Papers

Cite this paper

@article{guglielmo2026ranked,
  title  = {Ranked Activation Shift for Post-Hoc Out-of-Distribution Detection},
  author = {Gianluca Guglielmo and Marc Masana},
  year   = {2026},
  eprint = {2604.08572},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.08572v2},
  journal = {ECCV 2026 2026}
}

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/2604.08572.svg)](https://codeofpaper.com/paper/2604.08572)

Discussion