Efficient and versatile Out-of-Distribution (OOD) detection is essential for the safe deployment of AI yet remains challenging for existing algorithms. Inspired by Neural Collapse, we discover that features of in-distribution (ID) samples cluster closer to the weight vectors compared to features of OOD samples. In addition, we reveal that ID features tend to expand in space to structure a simplex Equiangular Tight Framework, which nicely explains the prevalent observation that ID features reside further from the origin than OOD features. Taking both insights from Neural Collapse into consideration, we propose to leverage feature proximity to weight vectors for OOD detection and further complement this perspective by using feature norms to filter OOD samples. Extensive experiments on off-the-shelf models demonstrate the efficiency and effectiveness of our method across diverse classification tasks and model architectures, enhancing the generalization capability of OOD detection.
翻译:高效且通用的分布外(OOD)检测对于人工智能的安全部署至关重要,但对现有算法而言仍具挑战性。受神经坍缩现象启发,我们发现与分布内(ID)样本特征相比,OOD样本的特征更远离权重向量。此外,我们揭示ID特征倾向于在空间中扩展以构建单纯形等角紧框架,这很好地解释了ID特征通常比OOD特征距离原点更远的普遍观测现象。综合考虑神经坍缩提供的双重洞见,我们提出利用特征与权重向量的邻近性进行OOD检测,并进一步通过特征范数过滤OOD样本以补充该视角。在现成模型上的大量实验表明,我们的方法在不同分类任务和模型架构中均展现出高效性与有效性,显著提升了OOD检测的泛化能力。