Anti-coherence regularized absolute scaling for out-of-distribution detectionAnti-coherence Regularized Absolute Scaling for Out-of-Distribution Detection
The authors propose Anti-coh: applying an absolute-value correction to SCALE's scaling factor and regularizing it with Anti-coherence, achieving an average AUROC of 85.81 and FPR@95 of 52.76 on ten ImageNet backbones under OpenOOD v1.5.
A deployed classifier encounters inputs that deviate from the training distribution yet still gives confident predictions; the method is post-hoc OOD detection, operating on a frozen pretrained feature extractor without updating weights and without requiring training data, training labels, or gradient computation, using an OOD score to flag ID inputs before they are misclassified.
- OOD detection is an AI safety problem. The percentile scaling factor of the post-hoc method SCALE fails on backbones containing negative activations, such as ViT and Swin, due to positive-negative cancellation, and the existing ReLU correction discards negative activation information.
- The authors propose Absolute Fix, which computes the scaling factor on absolute-value activations; then they define Anti-coherence, the proportion of sign-mismatched terms in the max-logit contribution, and use it to regularize the scaling factor, all without requiring training data or gradients.
- Under the OpenOOD v1.5 protocol, Anti-coh achieves the best average AUROC and FPR@95 within the training-free, gradient-free group on ten ImageNet backbones, and matches or exceeds methods that rely on training data or gradients on most backbones; on CIFAR-10 it has the highest average AUROC.
- The authors point out: on backbones containing negative activations it still lags behind the strongest representation-based methods; on CIFAR-100 it is inferior to multiple baselines; on the fine-grained near-OOD dataset SSB-Hard it performs lower. The experiments cover only image classification backbones under the OpenOOD v1.5 protocol.
- Evaluated models
- ResNet-18ResNet-50ResNet-101Swin-BSwinV2-BViT-B/16ConvNeXt-BEfficientNet-B1MobileNetV2BEiTv2-BDeiT3-B
- Benchmarks
- OpenOOD v1.5CIFAR-10CIFAR-100ImageNetMNISTSVHNTexturePlaces365TINiNaturalistOpenImage-OSSB-HardNINCO
- Metrics
- AUROCFPR@95
SCALE is a training-data-free activation-shaping out-of-distribution (OOD) detection method, but positive-negative cancellation of negative activations invalidates its ratio and causes degradation on backbones such as ViT. The paper instead computes the ratio using absolute-value activations, and uses anti-coherence regularization to penalize the scaling factor by the proportion of maximum logit contribution from sign mismatches, suppressing unreliable evidence. On CIFAR-10 and ImageNet in OpenOOD v1.5, its AUROC and FPR@95 match or outperform activation-shaping methods that rely on training data.
Paper analysis
What problem does this paper attempt to solve?
To solve the problem of SCALE's scaling factor failing on backbones with negative activations, the authors propose Absolute Fix and Anti-coherence regularization.
Core problem: SCALE's percentile scaling factor loses its definition on backbones containing negative activations, such as ViT and Swin, causing degradation in OOD detection performance.
- Problem scenario: deep networks are trained under the closed-world assumption, and after deployment they still give confident predictions when encountering out-of-distribution inputs; the authors state this causes real harm in safety-critical domains such as robotics, cybersecurity, and medical imaging, and OOD detection is used to flag unfamiliar inputs before erroneous decisions.
- Shortcomings of existing methods: training-based methods require OOD data or additional training, which the authors state is often impractical in real deployment; the post-hoc activation-shaping method SCALE degrades on architectures containing negative activations, and the ReLU correction of Djurisic et al. (2025) discards all information carried by negative activations.
- Core observation: with negative activations, the signed summation of Q and Qp lets positive and negative contributions cancel each other, so r no longer reflects activation magnitude; the authors state that empirically on ViT and Swin, r cannot separate ID from OOD, and may even be larger for OOD (Figure 1).
- Proposed approach: propose Absolute Fix (computing the scaling factor on absolute-value activations) and Anti-coherence (regularizing the scaling factor with the proportion of sign-mismatched terms in the max-logit contribution), collectively called Anti-coh, requiring no training data, training labels, or gradients.
- Threat model:
- Protected object: a classifier encountering out-of-distribution inputs after deployment, with a frozen pretrained feature extractor.
- Defense level: post-hoc, rescaling the penultimate-layer activations at inference time and scoring with Energy, without updating model weights.
- Assumptions and cost: no training data, training labels, or gradient computation required; the paper does not report additional inference latency or utility degradation data.
What related research exists?
Related work is divided into three groups: activation-shaping, representation-based, and logit-based; this paper belongs to activation-shaping that does not require training data.
Activation-shaping methods
- ReAct (Sun et al., 2021) clips activations at a percentile threshold determined from training data; VRA (Xu et al., 2023) further clips the lower bound; DICE (Sun & Li, 2022) clips the weights connected to activations; ASH (Djurisic et al., 2023) combines clipping and scaling.
- SCALE (Xu et al., 2024) points out that clipping harms performance and that scaling alone achieves better detection; this paper builds directly on SCALE and points out that its percentile ratio degrades on architectures with negative activations.
- OptFS (Zhao et al., 2024) estimates an optimal feature scaling vector from training data; BATS (Zhu et al., 2022) and LAPS (He et al., 2024) use activation statistics of training samples to define a typical set and correct test activations; Catalyst and DAVIS (Hassan et al., 2026a, 2026b) use channel statistics of activation maps before GAP, and the paper points out that they presuppose spatial pre-pooling activation maps and cannot be directly applied to architectures such as ViT that have no explicit GAP.
Representation-based methods
- Mahalanobis (Lee et al., 2018) fits class-conditional Gaussians from training data statistics; subsequent work adds global information or ℓ2 normalization (Ren et al., 2021; Müller & Hein, 2025; Kim & Yoon, 2026); others include k-NN distance (Sun et al., 2022), decision boundary distance (Liu & Qin, 2024), Neural Collapse (Liu & Qin, 2025), ViM (Wang et al., 2022), etc.
- CADRef (Ling et al., 2025) partitions feature components by whether the sign of their weighted contribution to the max logit agrees with the classifier weights, similar to this paper's sign partition; the paper points out that CADRef requires class-conditional training means to compute the error term, whereas this paper's method requires no training data.
- The paper summarizes: these methods all require access to the training dataset, whereas this paper's method does not.
Logit-based methods
- MSP (Hendrycks & Gimpel, 2017) uses the maximum softmax probability as a baseline score; Energy (Liu et al., 2020) derives an energy score from logits; GEN (Liu et al., 2023) proposes a generalized entropy score.
- LTS (Djurisic et al., 2025) scales the logits themselves and computes the scaling factor using ReLU-corrected activations; this paper points out that the ReLU correction discards negative activation information, whereas Absolute Fix preserves the magnitude of negative activations.
Baselines and benchmarks: The compared methods are MSP, MaxLogit, Energy, ReAct, ASH-S, SCALE, VRA, OptFS, LTS, LAPS, AdaSCALE-A/L; DAVIS, Catalyst (require GAP architecture), and BATS (require batch normalization) are excluded because they cannot be implemented architecture-agnostically. Evaluation uses the OpenOOD v1.5 protocol, with CIFAR-10 and ImageNet as ID.
The authors position this paper as: within training-free, gradient-free activation-shaping, through absolute-value correction and sign regularization, matching or exceeding methods that rely on training data or gradients without requiring training data.
How does the paper address this problem?
First correct SCALE's scaling factor using absolute values, then regularize with the proportion of sign-mismatched terms in the max-logit contribution.
Overall idea: correct the definition of SCALE's scaling factor under negative activations, then inject the sign information of the classifier head into the scaling operation. The method is named Anti-coh, and the scaling factor is ranti.
Problem setting and SCALE review
- The feature extractor ϕ maps the input to the d-dimensional penultimate-layer activation z; SCALE's scaling factor is the ratio of the sum of all activations to the sum of activations exceeding the p-th percentile, r = Q/Qp; the activations are then multiplied by exp(r) and passed through the classifier head, and the Energy score is used for the decision.
- The threshold τ is fixed in the standard way so that the TPR of ID samples equals 95%; FPR@95 is the proportion of OOD misclassified as ID at this threshold.
Absolute Fix
- The authors point out: architectures such as ResNet have ReLU at the penultimate layer, so activations are non-negative and magnitude matches value; the activations of ViT and Swin are zero-centered by LayerNorm and contain negative values, so signed summation lets positive and negative cancel, and Q and Qp lose their original meaning.
- Figure 2 shows that on backbones containing negative activations, the activation distribution tail of OOD is heavier than that of ID, and the tail is symmetric about zero on both sides; Absolute Fix computes the ratio using the absolute values of activations at every step, denoted rabs.
- When activations are strictly non-negative (e.g., ResNet, MobileNetV2), rabs degenerates to the original r.
Anti-coherence regularization
- Lemma 4.1: as the scaling factor increases, the proportion ρ(r) of the max logit in the Energy score is monotonically non-decreasing and tends to 1; Table 1 shows that after applying rabs, the mean ρ of ID and OOD on ten backbones is close to 1, and the authors accordingly simplify the analysis from the Energy score to the single max logit term.
- The max logit is decomposed into the sign-matched contribution Cp and the sign-mismatched contribution Cn, and Anti-coherence is defined as the proportion of mismatched terms A(z) = Cn/(Cp + Cn); since exp(r) is order-preserving, A(z) is independent of r and can be computed from pre-scaling activations.
- Figure 3 shows that on six backbones, A(z) of OOD samples is generally higher than that of ID; the final scaling factor is ranti = rabs − λA(z), where λ ≥ 0 controls the regularization strength.
- Equivalently, the regularization amounts to multiplying the activation scale by a damping factor exp(−λA(z)) ∈ (0, 1]; A(z) requires only the activations of a single test sample and the classifier weights, and does not require training data or gradients.
Implementation and hyperparameters
- The predicted class c∗ is taken as the argmax of the unscaled logit including bias; the denominators of rabs and A(z) are truncated at 10⁻⁸ for numerical stability; the analysis assumes zero bias, but the implementation retains bias, and the authors state that removing bias does not affect performance.
- The hyperparameters p ∈ {0.5, 0.55, …, 0.95} and λ ∈ {0, 0.5, 1, 2, 3, 5, 8, 12} are tuned jointly, selected by validation AUROC using the validation split provided by OpenOOD v1.5, without using training data (Appendix F.2).
- The implementation is based on PyTorch 2.4.1, with hardware an AMD Ryzen 9 7950X and an RTX 4090; the Energy temperature T is fixed at 1.
What experiments did the paper conduct?
Evaluating 12 methods on the CIFAR-10 and ImageNet settings of OpenOOD v1.5, Anti-coh is on average the best within the training-free group.
Experimental setup
- Backbones tested: At small scale, ResNet-18 on CIFAR-10 (pretrained checkpoint released by OpenOOD v1.5); at large scale, ten backbones on ImageNet: ResNet-50, ResNet-101, Swin-B, SwinV2-B, ViT-B/16, ConvNeXt-B, EfficientNet-B1, MobileNetV2, BEiTv2-B, DeiT3-B, with pretrained weights from torchvision or timm.
- OOD datasets: Under the CIFAR-10 setting, far-OOD is MNIST, SVHN, Texture, Places365, and near-OOD is TIN, CIFAR-100; under the ImageNet setting, far-OOD is iNaturalist, Texture, OpenImage-O, and near-OOD is SSB-Hard, NINCO, with the main table averaging over the five OOD datasets.
- Baselines: MSP, MaxLogit, Energy, ReAct, ASH-S, SCALE, VRA, OptFS, LTS, LAPS, AdaSCALE-A/L, divided by resource requirements into three groups: training-data-dependent, gradient-dependent, and training-free and gradient-free.
- Metrics: AUROC and FPR@95 (%); hyperparameters selected by validation AUROC using the OpenOOD v1.5 validation split; CIFAR experiments use a single checkpoint, and the paper explicitly states that standard deviations are not reported; other repetition counts are not reported in the paper.
Main results
According to Table 2 (ImageNet, average over five OOD datasets, AUROC/FPR@95, %):
Swipe horizontally to read the table
Method RN-50 Swin-B ViT-B/16 ConvNeXt-B DeiT3-B Avg (ten backbones) OptFS (training data) 87.64/47.38 83.12/63.55 82.25/66.98 85.50/59.41 83.31/61.89 84.74/58.12 LAPS (training data) 86.34/52.15 83.22/67.58 80.25/71.50 84.76/68.22 83.81/66.59 84.27/61.46 AdaSCALE-A (gradient) 88.85/47.66 79.06/66.18 78.62/68.03 83.65/63.81 82.78/61.06 82.99/59.57 SCALE 90.24/38.97 63.58/87.50 68.31/72.90 64.32/92.10 80.49/65.09 71.28/70.39 LTS 90.12/39.38 76.71/66.93 79.35/63.43 80.37/62.02 82.04/60.75 80.78/58.45 Anti-coh 90.65/38.65 83.29/61.39 82.92/63.18 86.32/57.33 83.44/57.21 85.81/52.76 (The table lists only 6 backbones and 6 methods; the full ten backbones and 12 methods are in Table 2; the omitted backbones include SwinV2-B, RN-101, EfficientNet-B1, MobileNetV2, BEiTv2-B, among which VRA on BEiTv2-B is the lowest in the whole table at 38.95/96.07.)
- The authors state that Anti-coh has the lowest average FPR@95 across the ten backbones and the highest AUROC on six of them; it improves over SCALE on every backbone, with larger gains on backbones with negative activations.
- The four backbones where AUROC ranks second (SwinV2-B, DeiT3-B, EfficientNet-B1, BEiTv2-B) have gaps of 0.07, 0.37, 1.10, and 0.04 percentage points from the best method, which is LAPS or OptFS (both require training data).
- CIFAR-10 (Table 3): Anti-coh averages 91.62/40.68, with the highest average AUROC among all methods; however, on FPR@95 for MNIST and Places365 it lags behind several methods, and on Places365 it lags behind AdaSCALE-L by 1.50 percentage points.
Absolute Fix ablation
- Table 4 compares Energy, SCALE, SCALE+ReLU, and SCALE+Abs on seven backbones with negative activations: SCALE+Abs consistently improves over both SCALE and SCALE+ReLU on every backbone, and always outperforms Energy.
- Magnitudes of improvement: on EfficientNet-B1, +30.10/−35.08 relative to SCALE; on SwinV2-B, +29.81/−27.68; on DeiT3-B, AUROC is unchanged (+0.00/−2.56), which the authors attribute to fluctuation in activation density at large absolute values rather than monotonic decay.
- Exception: on BEiTv2-B, SCALE+ReLU is instead worse than Energy (75.38/62.96 vs. 78.72/59.03).
Anti-coherence ablation and comparison with representation-based methods
- Table 5: Anti-coh improves over SCALE+Abs on all metrics except FPR@95 on ViT-B/16 (+2.08 percentage points); gains are larger on backbones with negative activations, and on backbones without negative activations (RN-50, RN-101, MobileNetV2) the gains are 0.25–0.61 AUROC points.
- Table 7 (Appendix D): On RN-50, RN-101, MobileNetV2, Anti-coh outperforms all representation-based methods; on backbones with negative activations it still lags behind CADRef and Mahalanobis, e.g., on Swin-B, CADRef is 87.24/54.27 and Mahalanobis is 86.74/56.72, while Anti-coh is 83.29/61.39.
- CIFAR-100 (Table 11): Anti-coh averages 79.38/79.77, lower than several baselines (the highest is AdaSCALE-L at 81.64/73.37); the authors state that most methods have lower absolute performance on CIFAR-100 than on CIFAR-10, and suspect this stems from the limited number of training images per class.
Other ablations and analyses
- Table 1: After applying rabs, the max logit proportion ρ is close to 1 across the ten backbones (e.g., 1.000/1.000 for ViT-B/16), whereas unscaled it is only 0.780/0.318 for DeiT3-B.
- Figure 6 (Appendix E): On four backbones with negative activations, AUROC changes gently as λ increases; on EfficientNet-B1 and MobileNetV2, AUROC peaks at intermediate λ and then decreases, most noticeably on Texture.
- Appendix B (Table 6): On SwinV2-B, the original SCALE's average AUROC lags behind Energy by more than 21 percentage points (51.24 vs. 72.82).
What are some points that can be further explored?
The authors list the gap versus representation methods on negative-activation backbones, the shortcomings on CIFAR-100 and SSB-Hard, and future directions.
Limitations and future directions noted by the authors
- On backbones containing negative activations it still lags behind the strongest representation-based methods (Appendix H Limitation; Appendix D).
- The method relies only on the activations of a single test sample and the classifier weights, and cannot exploit the class-conditional statistics that representation methods estimate from the training set; the authors consider this may constitute a fundamental limit on how much training-free methods can close the gap (Appendix H).
- On CIFAR-100 it is inferior to multiple baselines; the authors suspect that the limited number of training images per class prevents the pretrained model from learning sufficiently discriminative features, and consider this limits the reliability of evaluation on this dataset (Appendix H, Appendix G).
- It performs lower on SSB-Hard; the authors state that improvement on fine-grained near-OOD datasets is a promising future direction (Appendix H).
- Closing the gap with representation methods without relying on training data is called by the authors an important direction for future activation-shaping methods (Conclusion, Appendix D).
Scope of experiments
- The backbones tested are ResNet-18 on CIFAR-10/CIFAR-100 and ten backbones on ImageNet, eleven model settings in total, all image classification backbones (Section 5.1).
- The evaluation protocol is OpenOOD v1.5, with ID being CIFAR-10, CIFAR-100, and ImageNet; there are 11 OOD datasets in total, and the ImageNet main results are averaged over five OOD datasets (Section 5.1, Table 2).
- There are 12 comparison methods, grouped by dependence on training data and on gradients, and training-free and gradient-free; DAVIS, Catalyst, and BATS are excluded due to architectural constraints (Section 5.1).
- The metrics are AUROC and FPR@95; the CIFAR experiments use a single checkpoint and the paper explicitly does not report standard deviations, and the number of repetitions for other settings is not reported in the paper (Appendix F.1).
- Hyperparameters are selected by validation AUROC using the OpenOOD v1.5 validation split, without using training data (Appendix F.2); the paper does not report inference cost or runtime comparisons.
Summarize the main content of the paper
The authors state that the absolute-value fix plus Anti-coherence regularization allows SCALE to match or exceed methods that rely on training data without requiring training data.
A post-hoc OOD detection paper addressing the failure of the activation-shaping method SCALE on backbones with negative activations.
- Problem: SCALE's scaling factor is the ratio of the sum of all activations to the sum of activations above a high percentile; the penultimate-layer activations of backbones such as ViT and Swin contain negative values, and positive-negative cancellation makes this ratio meaningless, while the existing ReLU fix discards negative activation information.
- Method: Absolute Fix computes the scaling factor rabs on absolute-value activations; Anti-coherence decomposes the max logit into sign-matching and sign-mismatching contributions, and regularizes the scaling factor with the proportion of mismatching terms A(z), ranti = rabs − λA(z), requiring no training data, training labels, or gradients.
- Main results: Under the OpenOOD v1.5 protocol, the average AUROC/FPR@95 across ten ImageNet backbones is 85.81/52.76, and within the training-free and gradient-free group it is on average best on every backbone (Table 2); on CIFAR-10 the average is 91.62/40.68, with the highest average AUROC among all methods (Table 3).
- Ablation: SCALE+Abs consistently outperforms SCALE and SCALE+ReLU on seven backbones with negative activations, with an improvement over SCALE of +30.10/−35.08 on EfficientNet-B1 (Table 4); Anti-coherence further improves on it, with the exception that FPR@95 on ViT-B/16 worsens by 2.08 percentage points (Table 5).
- Exceptions: On CIFAR-100, Anti-coh averages 79.38/79.77, lower than several baselines (Table 11); on backbones with negative activations it still lags behind CADRef and Mahalanobis, which require training statistics (Table 7).
- Authors' conclusion: The method matches or exceeds methods that rely on training data or gradients without requiring training data, with larger gains on backbones with negative activations; the authors state that narrowing the gap with representation-based methods without relying on training data is a future direction.