Optimal Parameter and Neuron Pruning for Out-of-Distribution Detection

For a machine learning model deployed in real world scenarios, the ability of detecting out-of-distribution (OOD) samples is indispensable and challenging. Most existing OOD detection methods focused on exploring advanced training skills or training-free tricks to prevent the model from yielding overconfident confidence score for unknown samples. The training-based methods require expensive training cost and rely on OOD samples which are not always available, while most training-free methods can not efficiently utilize the prior information from the training data. In this work, we propose an \textbf{O}ptimal \textbf{P}arameter and \textbf{N}euron \textbf{P}runing (\textbf{OPNP}) approach, which aims to identify and remove those parameters and neurons that lead to over-fitting. The main method is divided into two steps. In the first step, we evaluate the sensitivity of the model parameters and neurons by averaging gradients over all training samples. In the second step, the parameters and neurons with exceptionally large or close to zero sensitivities are removed for prediction. Our proposal is training-free, compatible with other post-hoc methods, and exploring the information from all training data. Extensive experiments are performed on multiple OOD detection tasks and model architectures, showing that our proposed OPNP consistently outperforms the existing methods by a large margin.

Paper

References (56)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer qR616/10 · confidence 4/52023-06-25

Summary

This paper contributes a new parameter and neuron pruning methods for OOD detection. Built upon the energy-based score, this paper defines the sensitivity of a parameter (neuron) wrt the energy-score by using gradient.

Strengths

The arguments are clear and easily understood. The method is well motivated by removing the weights and neurons. The experiments are comprehensive and clear, and the results are promising.

Weaknesses

$\bullet$ The major weakness is the theoretical explanation between the sensitivity and OOD performance, but this is clearly pointed out in the paper. $\bullet$ The usage of the sensitivity is based on intuition, while this is a good technique for solving OOD problems.

Questions

$\bullet$ What are the techniques (feature ensemble or/and input preprocessing) used in Mahalanbis score in comparison? $\bullet$ This pruning method seems to be very promising. I understand this was discussed as limitation and future work, but is it possible to share the insights why the sensitivity term(s) will work?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

4 excellent

Contribution

2 fair

Limitations

The limitations are fully discussed with explanations.

Reviewer tCft6/10 · confidence 4/52023-07-03

Summary

This paper proposes a parameter and neuron pruning strategy to enhance out-of-distribution detection. The approach involves removing near-zero- and high-sensitivity parameters, which are measured by the average gradient corresponding to all training in-distribution samples. Empirical results demonstrate the superior performance of the proposed algorithm.

Strengths

The proposed algorithm is characterized by its simplicity and remarkable effectiveness in out-of-distribution detection tasks, exhibiting consistently high performance.

Weaknesses

While the proposed principle shows promising results, providing theoretical explanations for its success would be valuable. Additionally, selecting the appropriate hyper-parameters beforehand presents challenges.

Questions

Although empirical evidence indicates performance gains when pruning the largest sensitivity value (as seen in Figure 3), understanding its behavior and identifying optimal values require further investigation. Users would benefit from discussions clarifying such cases and receiving intuitive suggestions to aid in parameter selection. Additionally, exploring the impact of using a fixed threshold instead of a percentile for pruning sensitivity values may lead to improved performance. The reliance on the average sensitivity of connection weights for neuron pruning lacks an intuitive explanation. Other statistics, such as min, max, or median, could also be considered as potential alternatives. An explicit explanation of how to combine OPNP with ReAct should be provided. To enhance efficiency, it is advisable to consider pruning based on a subset of the training set rather than the entire set.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

4 excellent

Presentation

3 good

Contribution

4 excellent

Limitations

The authors have addressed some limitations of their work, and there are additional suggestions for improvement in the 'Paper Weakness'' part and "Questions" part.

Reviewer 8qxy5/10 · confidence 3/52023-07-06

Summary

This submission proposes a post-hoc method for detecting out-of-distribution samples, by pruning the final classification layer, using a sensitivity metric based on the gradients of the energy scores. The proposed method is mainly validated on residual networks and visual transformers based on the ImageNet dataset.

Strengths

- The submission proposes an interesting application using pruning to out-of-distribution detection, the latter being an important research problem - The proposed method is simple, and can be applied with a fairly small computational overhead - The results suggest that the proposed method, also when used in conjunction with other methods, can achieve state-of-the-art results on several tasks.

Weaknesses

- The submission is not very well written, particularly the introduction, with quite a few typos and grammar issues (e.g. using “post-hot” instead of “post-hoc” in quite a few places). This makes reading a bit difficult. - The proposed method is not very novel, as other OOD detection methods have used pruning (e.g. references 20, 35 seem quite similar) - The performance of the method depends quite heavily on the pruning thresholds (see Figure 3) and can substantially decrease the accuracy on the original ID classification task (see Table 3). This makes the method less likely to be used “out of the box”. - While the authors introduce their method as "post-hoc", in fact it has a similar cost to training the model for one epoch, since the gradients for all the samples have to be computed.

Questions

- Suggestion: I would advise the authors to go through the submission and correct the typos and grammar issues, for the next revision - I believe Equation (4) is an approximation, rather than an identity. Have the authors considered what would be a theoretical explanation that would connect the approximation in Equation (4) and the removal of least and most sensitive weights? - What is the norm in Equation (6)? Should it be an absolute value instead? - Can the authors provide more explanations on the intuition that “parameters and neurons with exceptionally large sensitivity can easily lead to overconfidence” (51-52)? - Lines 145-147: it is hard to see these differences from Figure 1, I would suggest adding numbers - Lines 181-182: this is not really a Gaussian (e.g it is not symmetric) - Can you provide more details on how OPNP is combined with ReAct? - In Table 2, can you provide results for DICE + ReAct? - Some of the plots and tables do not include information about the model and dataset used. For example, what is the model used in Table 3 or Table 4? What is the model and dataset from Figure 4? - The authors show results when (independently) pruning other layers in a ResNet50 model (Appendix Table 3). What happens if the weights are pruned globally, instead of each layer at a time? - Have the authors considered second order information for computing the sensitivity metric? For example, a second order Taylor approximation could be used instead of Equation (4), and since pruning is only done for the final layer, the Hessian could be more easily calculated. This is a similar approach to Optimal Brain Surgeon (Hassibi et al.) - Can you clarify what is meant by "(subset of) iNaturalist, SUN, Place and Texture" (line 211)? Are the same corresponding datasets used for evaluation when comparing with the other methods from Tables 1 and 2? - Can you please confirm that the ID test set used for validation (and determining the pruning hyperparameters and OOD threshold) was different than the one used for the final testing? - Can you please clarify the differences between Algorithm 1 and the text which specifies that the parameter and neuron sensitivities are computed based on the entire training set? In line 5 from Algorithm 1, it sounds like neuron pruning is done individually for each sample, but from the text the neuron sensitivities are computed on the entire training set. In my understanding, the model is pruned only once, and the same sparse model is used for evaluation on different OOD tasks. Can you please confirm whether my understanding is correct?

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

2 fair

Presentation

2 fair

Contribution

2 fair

Limitations

While the authors have addressed some of the limitations of their work in Section 5, I believe the proposed method, in its current form, has some technical limitations that would make it more difficult to use “plug-and-play” as the authors hope. For example, the method relies quite heavily on the optimal hyperparameters (thresholds) for pruning and it can have a substantial negative impact on the ID classification accuracy for the original task. I would advise the authors to consider how the search of the pruning hyperparameters could be automatized, or at least made more efficient. -------------------------------- **Edited after rebuttals** After reading the authors' answer, I have raised my score from 4 to 5.

Reviewer 8qxy2023-08-15

Thank you for addressing my questions! After reading the answers and the other reviews, I have raised my score from 4 to 5.

Authorsrebuttal2023-08-16

We thank the reviewer again for evaluating our work and carefully reading our response. It is more than welcome to post any further comments.

Reviewer Dntp5/10 · confidence 4/52023-07-07

Summary

This paper proposes to adopt weight and neuron pruning for OOD detection. The proposed method is able to be combined with training-based approaches, demonstrating SOTA performance.

Strengths

1. The motivation of the method is reasonable and sound. 2. The results of OPNP+ReAct is strong.

Weaknesses

1. It is not new for the ML community that sparsity can help improve OOD detection. Numerous related works have been proposed to adopt sparsity/pruning to improve OOD detection. While might having different pruning approaches, it is necessary to discuss and compare them in the submission. [1] Cheng, Zhen, et al. "Average of pruning: Improving performance and stability of out-of-distribution detection." arXiv preprint arXiv:2303.01201 (2023). [2] Djurisic, Andrija, et al. "Extremely simple activation shaping for out-of-distribution detection." arXiv preprint arXiv:2209.09858 (2022). [3] Sun, Yiyou, and Yixuan Li. "Dice: Leveraging sparsification for out-of-distribution detection." European Conference on Computer Vision. Cham: Springer Nature Switzerland, 2022. [4] Liu, Shiwei, et al. "Deep ensembling with no overhead for either training or testing: The all-round blessings of dynamic sparsity." arXiv preprint arXiv:2106.14568 (2021). 2. The pseudocode of Algorithm 1 looks very trivial, and can be significantly improved.

Questions

See the above limitation.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

2 fair

Contribution

2 fair

Limitations

n/a

Reviewer qR612023-08-11

Thank you for your reply

Thank you for your reply. I like the explanation. Thank you again and good luck.

Reviewer Dntp2023-08-12

Thanks

I thank the authors for the explanation. I would like to raise the score to Borderline accept. Could the authors explain why pruning weights and neurons that are the most and the least sensitive units for OOD detection is a better choice? Also, could the authors explain what we can observe from the Sensitivity distribution in Figure 2?

Authorsrebuttal2023-08-14

Thank you again for your further review and immediate feedback. And we appreciate that you can increase your rating of this submission. The explanations are provided below. > **Q1:** Could the authors explain why pruning weights and neurons that are the most and the least sensitive units for OOD detection is a better choice? **A:** Existing pruning based methods mainly remove the weights or features with low magnitude [1,2,3,4], which is able to avoid overconfident predictions and tends to improve OOD performance. The limitations of those methods are: (1) The magnitude of weights/features is not related to OOD scores directly, which makes magnitude based pruning less intuitive. (2) It is not guaranteed that the separability between ID and OOD samples can be improved by removing smaller weights/features, since the magnitude based metric does not take advantage of prior information about the ID/OOD distributions. (3) Most existing magnitude-based weights pruning are utilized in the training-based methods [2,4], which is relatively high cost. In contrast,the proposed sensitivity metric is obtained based on the ID distribution, which is able to identify both the redundant weights (the least sensitive weights) and the risky weights (with exceptionally large sensitivities). The advantagtes of the sensitivity based pruning are: (1) The sensitivity metric is able to make use of prior information about the ID distribution. (2) As the sensitivity metric is measured by the energy score,it better reflects the impact of weights on the OOD scores, making the sensitivity based pruning more intuitive. (3) The separability between ID and OOD distributions can be improved by pruning the least sensitive weights (see **Remark 2**). (4) The sensitivity based pruning is able to identify and remove the risky weights, which leads to flatter landscape and better generalization (see **Remark 3**). (5) The sensitivity based pruning is low-cost compared to the training-based methods [2,4] Therefore the sensitivity based pruning is a better choice to improve OOD detection performance. The experimental results in Table 1 and Table 4 demonstrate the superior of our sensitivity based pruning compared to other pruning methods [1] Dice: Leveraging sparsification for out-of-distribution detection. ECCV 2022. [2] Deep ensembling with no overhead for either training or testing: The all-round blessings of dynamic sparsity. ICLR 2022. [3] Extremely simple activation shaping for out-of-distribution detection. ICLR 2022. [4] Average of Pruning: Improving Performance and Stability of Out-of-Distribution Detection. Arxiv 2023. *** > **Q2:** Could the authors explain what we can observe from the Sensitivity distribution in Figure 2? **A:** In our global response (see **Ablations on global pruning**), we demonstrate the performance of pruning the whole model with a global threshold. The sensitivity distribution in Fig. 2 explains why pruning the whole model with a global threshold does not work better than only pruning the last FC layer. Fig.2 shows that the parameter sensitivity of the last FC layer and the shallow Conv layers are not on the same scale (the sensitivity of the FC layer is less than 1/10 of the shallow layers). This indicates that: (1) Pruning the weights in the Conv layers might lead to model collapse due to extreme high sensitivities. (2) The most sensitive weights in the FC layer can not be pruned when pruning the whole model with a global threshold. (3) There are very few redundant weights (low sensitivity weights) in the Conv layers. Therefore, pruning the weights in the Conv layers does not benefit to OOD detection performance, which explains why pruning the whole model does not work better than only pruning the last FC layer. *** We are happy to provide further explanations if needed. Thanks!

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC