TL;DR
This paper tackles the critical problem of Out-of-Distribution (OOD) detection in neural networks, revealing that OOD detection performance suffers from instability and overfitting during training. They propose "Average of Pruning" (AoP), a novel method combining model averaging and pruning, to significantly improve both performance and stability.
What Problem Does This Paper Address?
In real-world applications, neural networks often encounter data that differs from their training distribution (OOD data). Reliably detecting these OOD inputs is crucial for safety-critical systems like autonomous driving, where misclassifying an unseen animal as a traffic sign could have severe consequences. While many OOD detection methods exist, this paper highlights a previously overlooked issue: the performance of OOD detection can be highly unstable and prone to overfitting during the training process. Specifically, the authors observe that OOD detection accuracy can decrease even as training error approaches zero, and performance can fluctuate wildly in the later stages of training, making it difficult to select a reliable model.
Methods
The proposed solution, "Average of Pruning" (AoP), addresses the identified issues through two main components:
- Model Averaging: To combat instability, the authors employ model averaging. This technique averages the parameters of the neural network over a period of training. The intuition is that averaging can smooth out the loss landscape, making the model less sensitive to small perturbations in its weights and leading to more stable OOD detection performance. They specifically use a form of stochastic weight averaging (SWA).
- Pruning: To tackle overfitting, AoP utilizes pruning. Overfitting in OOD detection is attributed to the model memorizing noisy and redundant features from the training data, which can overlap with OOD data. Pruning, particularly through methods like the Lottery Ticket Hypothesis (LTH) with weight rewinding, aims to create sparser networks by removing less important weights. This encourages the model to learn more essential features and discard redundant ones, thereby mitigating overfitting.
AoP is designed as a plug-and-play module that can be easily integrated with existing OOD detection methods.
Datasets
The paper uses standard datasets for evaluation:
- In-distribution datasets: CIFAR-10, CIFAR-100, Tiny-ImageNet, and ImageNet.
- Out-of-distribution datasets: Textures, SVHN, LSUN-Crop, LSUN-resize, Place365, and iSUN.
Key Insights and Ideas
- OOD Detection Instability is a Training Dynamics Problem: The paper's core insight is that OOD detection performance is not just about the final model but also heavily influenced by the training process itself, exhibiting instability and overfitting.
- Overfitting in OOD Detection is Due to Memorizing Redundant Features: The authors theorize that over-parameterized models, when trained to near-zero error, start memorizing noisy features that can confuse them with OOD data.
- Model Averaging Smooths the Landscape for Stability: Averaging model weights helps create a more robust and stable OOD detection performance by reducing sensitivity to weight perturbations.
- Pruning Reduces Overfitting by Eliminating Redundant Features: By forcing sparsity, pruning encourages the model to focus on more discriminative features, thus improving its ability to distinguish between in-distribution and out-of-distribution data.
- AoP is a Generalizable Improvement: The proposed AoP method demonstrably improves performance when applied to various existing OOD detection techniques.
Key Results
- AoP significantly improves OOD detection performance across various benchmarks and network architectures.
- When applied to existing methods like KNN and ViM, AoP leads to substantial performance gains. For instance, on CIFAR-10 with ViM, AoP improves AUROC from 96.31% to 99.14%.
- AoP also boosts the performance of other OOD scoring functions, such as MSP and MaxLogit. For example, with MSP on CIFAR-10, AoP increases AUROC from 91.63% to 93.32%.
- The method shows consistent improvement even when combined with Outlier Exposure (OE), a strong OOD detection baseline.
- AoP is particularly beneficial for near-OOD detection tasks, where the OOD samples are semantically similar to in-distribution data.
- Ablation studies confirm that both model averaging and pruning are essential components of AoP for achieving its performance gains.
Limitations and Future Work
- Pruning Techniques: While LTH with weight rewinding is used and shown to be effective, the paper also explores other during-training pruning methods (GMP, RigL, GraNet) which show promise but are generally outperformed by LTH. Future work could explore more efficient or effective pruning strategies.
- Theoretical Analysis: The paper provides theoretical analysis for linear models and connections to LASSO. Extending this theoretical understanding to deep neural networks for OOD detection could be a future direction.
- Computational Cost: While AoP is designed to be plug-and-play, pruning inherently adds computational overhead. The paper mentions that some pruning methods are more efficient, suggesting future work could focus on optimizing the computational efficiency of AoP.
- Misclassification Detection: The paper also shows AoP improves misclassification detection, which is related to OOD detection. Further exploration of this connection and its applications could be beneficial.
Summary updated