Skip to main content
QUICK REVIEW

[Paper Review] Block Selection Method for Using Feature Norm in Out-of-distribution Detection

Yeonguk Yu, Sungho Shin|arXiv (Cornell University)|Dec 5, 2022
Digital Media Forensic Detection4 citations
TL;DR

This paper proposes a novel post-hoc out-of-distribution (OOD) detection method that selects the optimal network block for OOD detection using FeatureNorm (norm of feature maps) and NormRatio (ratio of FeatureNorm between in-distribution and pseudo-OOD data). By generating Jigsaw puzzle images as pseudo-OOD data to identify the block with the largest NormRatio, the method achieves state-of-the-art performance, reducing FPR95 by up to 52.77% on CIFAR-10 and 48.53% on ImageNet.

ABSTRACT

Detecting out-of-distribution (OOD) inputs during the inference stage is crucial for deploying neural networks in the real world. Previous methods commonly relied on the output of a network derived from the highly activated feature map. In this study, we first revealed that a norm of the feature map obtained from the other block than the last block can be a better indicator of OOD detection. Motivated by this, we propose a simple framework consisting of FeatureNorm: a norm of the feature map and NormRatio: a ratio of FeatureNorm for ID and OOD to measure the OOD detection performance of each block. In particular, to select the block that provides the largest difference between FeatureNorm of ID and FeatureNorm of OOD, we create Jigsaw puzzle images as pseudo OOD from ID training samples and calculate NormRatio, and the block with the largest value is selected. After the suitable block is selected, OOD detection with the FeatureNorm outperforms other OOD detection methods by reducing FPR95 by up to 52.77% on CIFAR10 benchmark and by up to 48.53% on ImageNet benchmark. We demonstrate that our framework can generalize to various architectures and the importance of block selection, which can improve previous OOD detection methods as well.

Motivation & Objective

  • Address the challenge of detecting out-of-distribution (OOD) inputs in real-world neural network deployments, where misclassification of unseen data can lead to dangerous outcomes.
  • Investigate whether the norm of feature maps from intermediate network blocks can serve as a reliable indicator for OOD detection, challenging the assumption that the final layer is optimal.
  • Develop a post-hoc framework that selects the most discriminative block for OOD detection without requiring access to true OOD data during deployment.
  • Improve the performance of existing OOD detection methods by leveraging block-specific feature norm statistics and a novel block selection strategy.

Proposed method

  • Introduce FeatureNorm as the L2 norm of the feature map from a specific network block, used as an OOD score indicator.
  • Define NormRatio as the ratio of FeatureNorm for in-distribution (ID) data to that for pseudo-OOD data, used to evaluate block suitability for OOD detection.
  • Generate pseudo-OOD data using Jigsaw puzzle augmentation from ID training images to simulate out-of-distribution inputs without requiring external OOD data.
  • Select the block with the maximum NormRatio across all blocks as the optimal block for OOD detection, based on its ability to separate ID and OOD feature norms.
  • Use the FeatureNorm from the selected block during inference to classify inputs as OOD if the norm falls below a learned threshold.
  • Apply the framework post-hoc, requiring no model retraining or architectural changes, enabling compatibility with pre-trained models.
Figure 1 : Histogram of norm of the feature map produced by convolutional blocks of ResNet18. In last block (a), the norm of ID (black) is hard to separate from OOD (blue, orange) compared to the one from the penultimate block (b).
Figure 1 : Histogram of norm of the feature map produced by convolutional blocks of ResNet18. In last block (a), the norm of ID (black) is hard to separate from OOD (blue, orange) compared to the one from the penultimate block (b).

Experimental results

Research questions

  • RQ1Can the norm of feature maps from intermediate network blocks serve as a more effective OOD detection signal than the final layer?
  • RQ2Is there a specific block in a neural network that exhibits greater discriminability between in-distribution and out-of-distribution inputs based on feature norm?
  • RQ3Can pseudo-OOD data generated from in-distribution samples be used to reliably select the optimal block for OOD detection without access to true OOD data?
  • RQ4Does selecting the best-performing block using NormRatio lead to significant improvements in OOD detection performance compared to using the final layer or default blocks?
  • RQ5Can this block selection and feature norm-based detection framework be generalized across different architectures and benchmarks?

Key findings

  • The penultimate block of ResNet18 exhibits significantly better OOD separation than the final block, as evidenced by a larger gap in FeatureNorm between ID and OOD inputs.
  • The proposed block selection strategy using Jigsaw-generated pseudo-OOD data successfully identifies the optimal block for OOD detection, achieving state-of-the-art performance.
  • On the CIFAR-10 benchmark, the method reduces FPR95 by up to 52.77% compared to the best baseline, demonstrating substantial improvement in OOD detection performance.
  • On the ImageNet benchmark, the method reduces FPR95 by up to 48.53% compared to the best baseline, confirming its effectiveness on large-scale datasets.
  • The framework generalizes across multiple architectures and improves performance when applied as a post-hoc enhancement to existing OOD detection methods.
  • Ablation and theoretical analysis confirm that the norm of the feature map from a well-chosen block is a more reliable OOD indicator than output probabilities or energy-based scores.
Figure 2 : Illustration of our proposed out-of-distribution detection framework. FeatureNorm refers to a norm calculation for the given feature map produced by the block. We use NormRatio of ID and pseudo OOD (i.e., Jigsaw puzzle images) to find which block is suitable for OOD detection (a). During
Figure 2 : Illustration of our proposed out-of-distribution detection framework. FeatureNorm refers to a norm calculation for the given feature map produced by the block. We use NormRatio of ID and pseudo OOD (i.e., Jigsaw puzzle images) to find which block is suitable for OOD detection (a). During

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.