Deep neural networks (DNNs) often fail silently with over-confident predictions on out-of-distribution (OOD) samples, posing risks in real-world deployments. Existing techniques predominantly emphasize either the feature representation space or the gradient norms computed with respect to DNN parameters, yet they overlook the intricate gradient distribution and the topology of classification regions. To address this gap, we introduce GRadient-aware Out-Of-Distribution detection in interpolated manifolds (GROOD), a novel framework that relies on the discriminative power of gradient space to distinguish between in-distribution (ID) and OOD samples. To build this space, GROOD relies on class prototypes together with a prototype that specifically captures OOD characteristics. Uniquely, our approach incorporates a targeted mix-up operation at an early intermediate layer of the DNN to refine the separation of gradient spaces between ID and OOD samples. We quantify OOD detection efficacy using the distance to the nearest neighbor gradients derived from the training set, yielding a robust OOD score. Experimental evaluations substantiate that the introduction of targeted input mix-upamplifies the separation between ID and OOD in the gradient space, yielding impressive results across diverse datasets. Notably, when benchmarked against ImageNet-1k, GROOD surpasses the established robustness of state-of-the-art baselines. Through this work, we establish the utility of leveraging gradient spaces and class prototypes for enhanced OOD detection for DNN in image classification.
翻译:摘要:深度神经网络(DNN)常因对分布外样本做出过度自信的预测而无声地失败,这给实际部署带来了风险。现有技术主要强调特征表示空间或基于DNN参数计算的梯度范数,却忽视了复杂的梯度分布与分类区域的拓扑结构。为弥补这一缺陷,我们提出了插值流形中的梯度感知分布外检测(GROOD),该新型框架利用梯度空间的判别能力来区分分布内样本与分布外样本。为构建该空间,GROOD依赖于类原型以及专门捕获分布外特征的原型。独特的是,我们的方法在DNN的早期中间层引入了目标混合操作,以优化分布内与分布外样本在梯度空间中的分离效果。我们通过计算与训练集最近邻梯度的距离来量化分布外检测效能,从而获得稳健的分布外评分。实验评估证实,引入目标输入混合操作能增强梯度空间中分布内与分布外样本的分离度,并在多个数据集上取得了显著成果。值得注意的是,在与ImageNet-1k的基准测试中,GROOD超越了现有最先进基线的稳健性。通过本研究,我们确立了利用梯度空间与类原型增强图像分类DNN分布外检测效能的实用价值。