Leveraging Intermediate Representations for Better Out-of-Distribution Detection

Gianluca Guglielmo, Marc Masana
2/18/2025
6 citations
cs.LGcs.CV

No official code found. Best implementation: gigug/LIR (3 stars, Python, last commit 2025-02-19).

Abstract

In real-world applications, machine learning models must reliably detect Out-of-Distribution (OoD) samples to prevent unsafe decisions. Current OoD detection methods often rely on analyzing the logits or the embeddings of the penultimate layer of a neural network.

Show full abstract

However, little work has been conducted on the exploitation of the rich information encoded in intermediate layers. To address this, we analyze the discriminative power of intermediate layers and show that they can positively be used for OoD detection. Therefore, we propose to regularize intermediate layers with an energy-based contrastive loss, and by grouping multiple layers in a single aggregated response. We demonstrate that intermediate layer activations improves OoD detection performance by running a comprehensive evaluation across multiple datasets.

View on arXivView PDF

Code Implementations(1)

gigug/LIRCommunity64%

[CVWW2025] Source code for the paper Leveraging Intermediate Representations for Better Out-of-Distribution Detection by Gianluca Guglielmo and Marc Masana.

30PythonFeb 17, 20251 years ago

Similar Papers

Cite this paper

@article{guglielmo2025leveraging,
  title  = {Leveraging Intermediate Representations for Better Out-of-Distribution Detection},
  author = {Gianluca Guglielmo and Marc Masana},
  year   = {2025},
  eprint = {2502.12849},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.12849v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.12849.svg)](https://codeofpaper.com/paper/2502.12849)

Discussion