不依赖训练,用多层特征融合提升图像异常检测效果
Prototype Fusion: A Training-Free Multi-Layer Approach to OOD Detection
- 跨多个卷积层聚合特征,构建类内原型
- 在多个数据集上实现最高4.41%的AUROC提升
- 适合部署在安全关键场景的模型可靠性增强
深度学习模型在安全关键应用中日益普及,可靠的事后分布外(OOD)检测对保障鲁棒性至关重要。现有方法主要依赖神经网络倒数第二层激活值,假设其包含最丰富的分布内(ID)表征。本文重新审视这一假设,发现中间层同样蕴含丰富且具区分性的信息。基于此,提出一种无需训练、通用性强的方法:从连续卷积块中聚合特征,计算类别均值嵌入,并进行L2归一化形成紧凑的ID原型。推理时,测试样本与各原型的余弦相似度作为OOD评分——ID样本至少与一个原型高度相关,而OOD样本则保持均匀远距离。在多种主流架构和基准上的广泛实验表明,该方法具备强鲁棒性和跨架构泛化能力,显著优于传统单层方法。尤其在标准评估指标上,最大提升达AUROC 4.41%,FPR降低13.58%。结果揭示了多层特征融合是尚未被充分挖掘的高效信号,挑战了以倒数第二层为核心的主流范式。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。