Abstract
It is important to quantify the uncertainty of input samples, especially in mission-critical domains such as autonomous driving and healthcare, where failure predictions on out-of-distribution (OOD) data are likely to cause big problems. OOD detection problem fundamentally begins in that the model cannot express what it is not aware of. Post-hoc OOD detection approaches are widely explored because they do not require an additional re-training process which might degrade the model's performance and increase the training cost. In this study, from the perspective of neurons in the deep layer of the model representing high-level features, we introduce a new aspect for analyzing the difference in model outputs between in-distribution data and OOD data. We propose a novel method, Leveraging Important Neurons (LINe), for post-hoc Out of distribution detection. Shapley value-based pruning reduces the effects of noisy outputs by selecting only high-contribution neurons for predicting specific classes of input data and masking the rest. Activation clipping fixes all values above a certain threshold into the same value, allowing LINe to treat all the class-specific features equally and just consider the difference between the number of activated feature differences between in-distribution and OOD data. Comprehensive experiments verify the effectiveness of the proposed method by outperforming state-of-the-art post-hoc OOD detection methods on CIFAR-10, CIFAR-100, and ImageNet datasets.
Introduction
Deep learning models are notoriously overconfident when encountering out-of-distribution (OOD) samples. In safety-critical applications, a model must be able to signal uncertainty rather than making incorrect, high-confidence predictions. While post-hoc methods are popular due to their efficiency, they often struggle with "noisy" signals from neurons that do not contribute meaningfully to classification. A key observation driving this work is that in-distribution (ID) samples consistently activate a larger number of high-level feature neurons in the penultimate layer compared to OOD samples.
Methodology
The proposed LINe framework leverages "important" neurons through a three-pronged approach:
- Shapley-based Pruning: Unlike magnitude-based methods, LINe uses Shapley values—calculated via a computationally efficient Taylor approximation—to quantify a neuron's actual contribution to a class prediction. Activation Pruning (AP) masks low-contribution neurons, while Weight Pruning (WP) refines the final layer weights to align with important features.
- Activation Clipping (AC): Neuron activations are capped at a threshold $\delta$. This prevents a few high-magnitude activations from dominating the OOD score, effectively shifting the focus to the breadth of features detected rather than the intensity of a few noisy neurons.
- Post-hoc Integration: LINe modifies only the inference step using a pre-computed importance matrix, requiring zero retraining and maintaining original classification accuracy.
Key Results
LINe consistently outperforms state-of-the-art methods like DICE and ReAct across standard benchmarks. On CIFAR-100, LINe reduced the FPR95 (False Positive Rate at a 95% True Positive Rate) to 35.67%, a 14.05% improvement over the previous best method (DICE). On ImageNet, it achieved an average FPR95 of 20.70%, significantly better than ReAct (31.43%) and DICE (34.75%). These results demonstrate that counting valid high-level features is a robust proxy for OOD detection.
Conclusion and Future Work
LINe provides a novel perspective on OOD detection by focusing on the quantity of class-specific feature activations. By combining Shapley-based pruning with activation clipping, it isolates meaningful signals from noise without the overhead of retraining. Future work includes exploring hyperparameter sensitivity across different architectures and extending the method to non-visual domains like Natural Language Processing.
Summary updated