cs.CVMar 24, 2026

Prototype Fusion: A Training-Free Multi-Layer Approach to OOD Detection

Authors: Shreen Gul, Mohamed Elmahallawy, Ardhendu Tripathy, Sanjay Madria

Organizations: Missouri University of Science and Technology, Rolla, MO 65401, USA · Washington State University, Richland, WA 99354, USA

Abstract

Deep learning models are increasingly deployed in safety-critical applications, where reliable out-of-distribution (OOD) detection is essential to ensure robustness. Existing methods predominantly rely on the penultimate-layer activations of neural networks, assuming they encapsulate the most informative in-distribution (ID) representations. In this work, we revisit this assumption to show that intermediate layers encode equally rich and discriminative information for OOD detection. Based on this observation, we propose a simple yet effective model-agnostic approach that leverages internal representations across multiple layers. Our scheme aggregates features from successive convolutional blocks, computes class-wise mean embeddings, and applies L_2 normalization to form compact ID prototypes capturing class semantics. During inference, cosine similarity between test features and these prototypes serves as an OOD score--ID samples exhibit strong affinity to at least one prototype, whereas OOD samples remain uniformly distant. Extensive experiments on state-of-the-art OOD benchmarks across diverse architectures demonstrate that our approach delivers robust, architecture-agnostic performance and strong generalization for image classification. Notably, it improves AUROC by up to 4.41% and reduces FPR by 13.58%, highlighting multi-layer feature aggregation as a powerful yet underexplored signal for OOD detection, challenging the dominance of penultimate-layer-based methods. Our code is available at: https://github.com/sgchr273/cosine-layers.git.

Figures & tables

Explore similar work

CardsList
  1. DynProto: Dynamic Prototype Evolution for Out-of-Distribution Detection

    Apr 26, 2026Yanqi Wu, Xinhua Lu, Runhe Lai +4Prototype-Based ClassificationOOD Detection

  2. MM++: Post-Hoc Scale-Invariant Multilayer OOD Detection via Top-K Gated Feature Fusion

    Jun 15, 2026Rahim Hossain, Md Tawheedul Islam Bhuian, Md Farhan Shadiq +1Diffusion-Based OOD DetectionOOD Detection

  3. Unified Multi-Layer Subspace Modeling for Cross-Domain OOD Detection

    Sep 6, 2026Gerhard Krumpl, Henning Avenhaus, Horst PosseggerOOD Detection