Out-of-distribution (OOD) detection, crucial for reliable pattern classification, discerns whether a sample originates outside the training distribution. This paper concentrates on the high-dimensional features output by the final convolutional layer, which contain rich image features. Our key idea is to project these high-dimensional features into two specific feature subspaces, leveraging the dimensionality reduction capacity of the network's linear layers, trained with Predefined Evenly-Distribution Class Centroids (PEDCC)-Loss. This involves calculating the cosines of three projection angles and the norm values of features, thereby identifying distinctive information for in-distribution (ID) and OOD data, which assists in OOD detection. Building upon this, we have modified the batch normalization (BN) and ReLU layer preceding the fully connected layer, diminishing their impact on the output feature distributions and thereby widening the distribution gap between ID and OOD data features. Our method requires only the training of the classification network model, eschewing any need for input pre-processing or specific OOD data pre-tuning. Extensive experiments on several benchmark datasets demonstrates that our approach delivers state-of-the-art performance. Our code is available at https://github.com/Hewell0/ProjOOD.
翻译:分布外(OOD)检测对于可靠的模式分类至关重要,它能够判断样本是否源自训练分布之外。本文聚焦于最后一个卷积层输出的高维特征,这些特征包含丰富的图像信息。我们的核心思想是利用网络线性层的降维能力(该层使用预定义等分布类中心(PEDCC)损失进行训练),将这些高维特征投影到两个特定的特征子空间中。该方法涉及计算三个投影角的余弦值及特征的范数值,从而提取分布内(ID)和分布外(OOD)数据的区分性信息,以辅助OOD检测。在此基础上,我们修改了全连接层之前的批归一化(BN)和ReLU层,减弱它们对输出特征分布的影响,从而扩大ID与OOD数据特征之间的分布差异。我们的方法仅需训练分类网络模型,无需任何输入预处理或特定OOD数据的预调优。在多个基准数据集上的大量实验表明,我们的方法达到了当前最优性能。我们的代码可在https://github.com/Hewell0/ProjOOD获取。