arXiv:2610.32255cs.LGOct 2026

Manuscript Offprint

arXiv:2610.32255

Anti-coherence Regularized Absolute Scaling for Out-of-Distribution Detection

Donghwan Kim, Youngwoong Jin, Hyunsoo Yoon

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Donghwan Kim

Department of Industrial Engineering

Yonsei University

Seoul, South Korea

cain0709@yonsei.ac.kr

Youngwoong Jin

Department of Intelligent Data and Optimization

Yonsei University

Seoul, South Korea

duddnd1113@yonsei.ac.kr

Hyunsoo Yoon †^{\dagger}

Department of Industrial Engineering

Yonsei University

Seoul, South Korea

hs.yoon@yonsei.ac.kr

ABSTRACT

Out-of-distribution (OOD) detection is recognized as a critical problem in AI safety. SCALE is an effective post-hoc OOD detection method in the activation-shaping family that requires no training data and rescales penultimate activations using a percentile-based magnitude ratio. However, this ratio is ill-defined when negative activations are present, since positive and negative contributions cancel within the underlying sum, causing SCALE to degenerate on backbones such as ViT. We address this with an Absolute Fix that computes the ratio over absolute-valued activations rather than discarding negative activations through ReLU. Building on this corrected scale, we propose Anti-coherence regularization, which penalizes the scaling factor by the fraction of a sample's max-logit contributions to the max logit that are sign-mismatched and thereby suppresses unreliable evidence for the predicted class. Despite requiring no access to training data or training labels, our method ties or outperforms activation-shaping methods that rely on training data in terms of AUROC and FPR@95 on CIFAR-10 and ImageNet under the OpenOOD v1.5 protocol.

1 INTRODUCTION

A fundamental limitation of deep neural networks stems from the closed-world assumption under which they are trained: once deployed, these models frequently encounter inputs that deviate from the training distribution while continuing to produce confident predictions despite this mismatch. Such failures are consequential in safety-critical domains such as robotics (Isaku et al., 2025), cyber security (Corsini & Yang, 2023), and medical imaging (Hong et al., 2024), where an undetected distribution shift can lead to severe real-world harm. Out-of-distribution (OOD) detection has therefore emerged as a key safeguard that flags unfamiliar inputs before they translate into erroneous decisions, supporting the broader goal of building reliable and trustworthy AI (Yang et al., 2024).

Existing OOD detection methods can be broadly divided into two categories. The first category consists of training-based methods incorporating synthetic or real OOD data or auxiliary objectives into training to encourage better separation between in-distribution (ID) and OOD samples (Ming et al., 2023; Du et al., 2022; Zhu et al., 2023; Tao et al., 2023). However, practical access to OOD datasets is often restricted and the additional training adds computational cost that renders these methods impractical for real-world deployment (Yang et al., 2024). The second category consists of post-hoc methods, which operate on a frozen pretrained feature extractor without updating its weights. While some rely on statistics computed from training data or additional gradient computation, none require retraining the model or auxiliary OOD datasets.

Within post-hoc approaches, methods can be further categorized according to what they utilize to compute the OOD score. Logit-based methods (Hendrycks & Gimpel, 2017; Hendrycks et al., 2022) utilize the values of the output logits to compute the OOD score, representation-based methods (Ren et al., 2021; Lee et al., 2018; Sun et al., 2022) leverage statistics such as distance estimated from penultimate layer activations, and activation-shaping methods (Sun et al., 2021; Xu et al., 2023) manipulate the penultimate layer activations themselves prior to scoring. Among these, activation shaping has emerged as a promising direction, as it often requires no ID statistics and is implemented through simple operations (Regmi, 2026), such as scaling, rectifying, or pruning (e.g., Sun et al. (2021); Djurisic et al. (2023); Xu et al. (2024)), which are then combined with another post-hoc scoring function such as Energy (Liu et al., 2020) to compute the final OOD score.

The activation-shaping method SCALE (Xu et al., 2024) defines a scaling factor as the ratio between the sum of all penultimate activations and the sum of those exceeding a given percentile and applies this factor uniformly across the entire penultimate layer to achieve strong OOD detection performance. However, this percentile-based scaling has been reported to suffer substantial performance degeneration on architectures with negative penultimate activations such as ViT (Dosovitskiy et al., 2021) and Swin Transformer (Liu et al., 2021), whereas it remains stable on architectures such as ResNet (He et al., 2016) whose penultimate layer follows a ReLU and therefore contains no negative activations (Regmi, 2026). To address this architecture-dependent limitation, Djurisic et al. (2025) explicitly apply ReLU to the penultimate activations before computing the scaling factor and show that removing negative activations in this way improves performance. Yet this approach discards all information carried by negative activations, and thus a limitation remains in that it fails to fully reflect the entire penultimate layer when computing the scaling factor. Since this leaves room for improvement, we propose the Absolute Fix, which applies the absolute value function to the penultimate activations so that negative activations are also reflected in the scaling factor and yields more consistent performance gains than the ReLU-based rectification.

Building on this corrected scale, we decompose each sample's contribution to the max-logit and use the fraction of this contribution that drives the max-logit downward, which we term Anti-coherence, to regularize the scaling factor. In real-world deployment, training data is often inaccessible due to privacy constraints (Wagner et al., 2025), and our method requires no access to it. Despite this, it ties or outperforms activation-shaping methods that rely on training data or additional gradient computation under the OpenOOD v1.5 (Zhang et al., 2024) protocol on CIFAR-10 (Krizhevsky et al., 2009) and ImageNet (Deng et al., 2009) in-distribution settings. In particular, our method achieves consistent performance across a diverse set of backbones on ImageNet.

In summary, our contributions are threefold.

• We propose the Absolute Fix, which computes SCALE’s scaling factor over absolute-valued penultimate activations rather than through ReLU-based rectification, thereby preserving the magnitude of negative activations and yielding consistent performance gains across architectures with negative penultimate activations.

• We introduce Anti-coherence, a regularization term derived from decomposing each sample’s contribution to the maximum logit, which regularizes the scaling factor according to the fraction of this contribution that drives the maximum logit downward.

• We validate our method under the OpenOOD v1.5 protocol on CIFAR-10 and ImageNet, demonstrating that it ties or outperforms activation shaping methods that rely on training data or additional gradient computation, despite requiring neither.

References (68)