TL;DR
LINe (Leveraging Important Neurons) is a novel, post-hoc out-of-distribution (OOD) detection method that identifies and isolates class-specific neurons using Shapley values and activation clipping. Without requiring any model retraining, LINe significantly cuts down false positive rates—reducing FPR95 by up to 14.05% on standard benchmarks—making deep learning models safer for mission-critical deployments.
What Problem Does This Paper Address?
Deep learning models are notoriously overconfident. When presented with out-of-distribution (OOD) data—unseen classes or environments completely different from the training set—they often make highly confident, incorrect predictions. In mission-critical applications like autonomous driving or medical diagnosis, these silent failures can be catastrophic.
To fix this, researchers use OOD detection. "Post-hoc" methods are highly desirable because they work on pre-trained models without needing expensive retraining, which can degrade original model accuracy. However, existing post-hoc methods struggle to filter out "noisy" signals in the final layers of deep networks, often failing to clearly distinguish between in-distribution (ID) and OOD inputs.
Methods
The authors introduce LINe, a post-hoc framework that operates on the penultimate layer of a neural network. It consists of three main components:
- Activation Clipping (AC): This technique caps activation values above a certain threshold ($\delta$). By flattening abnormally high activations, the model treats all activated high-level features equally, shifting the focus to the number of activated features rather than their raw magnitude.
- Activation Pruning (AP): Using a precomputed contribution matrix based on Shapley values (approximated via Taylor expansion), LINe identifies which neurons contribute most to predicting a specific class and masks out the rest to eliminate noise.
- Weight Pruning (WP): Similar to AP, this selectively masks out less important weights in the penultimate layer to reduce the influence of an overparameterized model's noisy signals.
The overall workflow is illustrated below:
Datasets
The authors evaluated LINe across several standard computer vision benchmarks:
- In-Distribution (ID) Datasets: CIFAR-10, CIFAR-100, and ImageNet-1K.
- Out-of-Distribution (OOD) Datasets: SVHN, Textures, iSUN, LSUN-Crop, LSUN-Resize, Places365, iNaturalist, and SUN.
Key Insights and Ideas
- The Activation Gap: The core "aha moment" of the paper is that ID data and OOD data activate the penultimate layer's neurons differently. ID samples typically activate a vast majority of the neurons, whereas OOD samples activate significantly fewer (see Figure 1).
- Counting over Magnitude: By applying Activation Clipping, the method stops a few highly active "noisy" neurons from dominating the OOD score. This allows the system to effectively leverage the count of activated class-specific features as a reliable proxy for distribution membership.
- Shapley Values for Pruning: Instead of relying purely on activation magnitude to determine neuron importance (which can be misleading), LINe uses mathematically grounded Shapley values to calculate true class-specific feature contributions.
Key Results
LINe achieves state-of-the-art performance across multiple benchmarks, notably outperforming competitive post-hoc methods like ReAct and DICE:
- CIFAR-100: LINe achieved an FPR95 (False Positive Rate at a 95% True Positive Rate) of 35.67%, a massive 14.05% reduction compared to DICE's 49.72%.
- ImageNet: LINe achieved an average FPR95 of 20.70% and an AUROC of 95.03% across four OOD datasets, outperforming DICE + ReAct (27.25% FPR95).
The authors also demonstrated that the choice of the clipping threshold ($\delta$) is critical. As shown in the ablation study below, performance peaks at $\delta = 0.8$ for ImageNet before degrading if clipped too aggressively:
Limitations and Future Work
While highly effective, LINe introduces a fundamental trade-off: pruning too many neurons to reduce noise can destroy the model's ability to count class-specific features accurately. Consequently, users must carefully tune hyperparameters—specifically the clipping threshold ($\delta$) and pruning percentiles ($p_w, p_a$)—based on how overparameterized the underlying model is.
The authors hope that viewing OOD detection through the lens of feature presentation and neuron-concept association will inspire future research across adjacent domains.
Summary updated