Table of Contents
Fetching ...

ITP: Instance-Aware Test Pruning for Out-of-Distribution Detection

Haonan Xu, Yang Yang

TL;DR

The paper tackles the brittleness of OOD detection stemming from over-parameterization by introducing Instance-aware Test Pruning (ITP), a post-hoc scheme combining coarse-grained redundancy pruning and fine-grained per-sample pruning guided by class-specific parameter contributions. By estimating Gaussian distributions of last-layer parameter contributions from in-distribution data and applying a right-tailed Z-test at test time, ITP selectively prunes parameters to reduce both general noise and instance-level overconfidence, yielding more reliable OOD scores. Empirical results on CIFAR and ImageNet show state-of-the-art performance across multiple OOD scores, with notable gains when coupled with ReAct and substantial reductions in preprocessing overhead. The method is lightweight to apply, compatible with existing OOD scoring approaches, and offers a practical route to robust OOD detection in real-world deployments.

Abstract

Out-of-distribution (OOD) detection is crucial for ensuring the reliable deployment of deep models in real-world scenarios. Recently, from the perspective of over-parameterization, a series of methods leveraging weight sparsification techniques have shown promising performance. These methods typically focus on selecting important parameters for in-distribution (ID) data to reduce the negative impact of redundant parameters on OOD detection. However, we empirically find that these selected parameters may behave overconfidently toward OOD data and hurt OOD detection. To address this issue, we propose a simple yet effective post-hoc method called Instance-aware Test Pruning (ITP), which performs OOD detection by considering both coarse-grained and fine-grained levels of parameter pruning. Specifically, ITP first estimates the class-specific parameter contribution distribution by exploring the ID data. By using the contribution distribution, ITP conducts coarse-grained pruning to eliminate redundant parameters. More importantly, ITP further adopts a fine-grained test pruning process based on the right-tailed Z-score test, which can adaptively remove instance-level overconfident parameters. Finally, ITP derives OOD scores from the pruned model to achieve more reliable predictions. Extensive experiments on widely adopted benchmarks verify the effectiveness of ITP, demonstrating its competitive performance.

ITP: Instance-Aware Test Pruning for Out-of-Distribution Detection

TL;DR

The paper tackles the brittleness of OOD detection stemming from over-parameterization by introducing Instance-aware Test Pruning (ITP), a post-hoc scheme combining coarse-grained redundancy pruning and fine-grained per-sample pruning guided by class-specific parameter contributions. By estimating Gaussian distributions of last-layer parameter contributions from in-distribution data and applying a right-tailed Z-test at test time, ITP selectively prunes parameters to reduce both general noise and instance-level overconfidence, yielding more reliable OOD scores. Empirical results on CIFAR and ImageNet show state-of-the-art performance across multiple OOD scores, with notable gains when coupled with ReAct and substantial reductions in preprocessing overhead. The method is lightweight to apply, compatible with existing OOD scoring approaches, and offers a practical route to robust OOD detection in real-world deployments.

Abstract

Out-of-distribution (OOD) detection is crucial for ensuring the reliable deployment of deep models in real-world scenarios. Recently, from the perspective of over-parameterization, a series of methods leveraging weight sparsification techniques have shown promising performance. These methods typically focus on selecting important parameters for in-distribution (ID) data to reduce the negative impact of redundant parameters on OOD detection. However, we empirically find that these selected parameters may behave overconfidently toward OOD data and hurt OOD detection. To address this issue, we propose a simple yet effective post-hoc method called Instance-aware Test Pruning (ITP), which performs OOD detection by considering both coarse-grained and fine-grained levels of parameter pruning. Specifically, ITP first estimates the class-specific parameter contribution distribution by exploring the ID data. By using the contribution distribution, ITP conducts coarse-grained pruning to eliminate redundant parameters. More importantly, ITP further adopts a fine-grained test pruning process based on the right-tailed Z-score test, which can adaptively remove instance-level overconfident parameters. Finally, ITP derives OOD scores from the pruned model to achieve more reliable predictions. Extensive experiments on widely adopted benchmarks verify the effectiveness of ITP, demonstrating its competitive performance.

Paper Structure

This paper contains 23 sections, 20 equations, 5 figures, 11 tables.

Figures (5)

  • Figure 1: The distribution of parameter contributions to ID prediction for the CIFAR-10 class ('airplane') on both ID and OOD data. The parameter is selected from the subset of weight parameters that are important for ID prediction in the last layer of DenseNet-101, with pre-ReLU activations utilized for visualization. Since the model outputs are determined by the parameter contribution, overconfident behaviors in the parameters increase the risk of misclassifying OOD data as ID and hurt OOD detection.
  • Figure 2: Illustration of OOD detection using ITP. The overall procedure involves three main steps. (1) Training data are used to estimate the class-specific parameter contribution distribution for a pre-trained model. (2) Coarse-grained redundancy pruning applies a fixed pruning pattern to the model's last layer to remove redundant parameters. (3) Fine-grained test pruning applies a customized pruning pattern to remove overconfident parameters for each test sample at test time. After applying ITP, the OOD scores derived from the model are better able to distinguish between ID and OOD data.
  • Figure 3: Changes in OOD score distribution using ITP on (a) iNaturalist benchmark and (b) Textures benchmark.
  • Figure 4: The FFPR95 and AUROC with different number of training samples on ImageNet benchmark. The results are averaged over five independent runs.
  • Figure 5: The distribution of parameter contributions on ID data (CIFAR-10) using (a) DenseNet-101 and (b) ResNet-18 as backbones. These parameters are randomly selected from the weights of the model's last fully connected layer.