Wang Yinan, Sun Wenbo, Jin Jionghua, Kong Zhenyu, Yue Xiaowei
IEEE Trans Pattern Anal Mach Intell. 2024 Feb;46(2):944-956. doi: 10.1109/TPAMI.2023.3328883. Epub 2024 Jan 8.
The training and testing data for deep-neural-network-based classifiers are usually assumed to be sampled from the same distribution. When part of the testing samples are drawn from a distribution that is sufficiently far away from that of the training samples (a.k.a. out-of-distribution (OOD) samples), the trained neural network has a tendency to make high-confidence predictions for these OOD samples. Detection of the OOD samples is critical when training a neural network used for image classification, object detection, etc. It can enhance the classifier's robustness to irrelevant inputs, and improve the system's resilience and security under different forms of attacks. Detection of OOD samples has three main challenges: (i) the proposed OOD detection method should be compatible with various architectures of classifiers (e.g., DenseNet, ResNet) without significantly increasing the model complexity and requirements on computational resources; (ii) the OOD samples may come from multiple distributions, whose class labels are commonly unavailable; (iii) a score function needs to be defined to effectively separate OOD samples from in-distribution (InD) samples. To overcome these challenges, we propose a Wasserstein-based out-of-distribution detection (WOOD) method. The basic idea is to define a Wasserstein-based score that evaluates the dissimilarity between a test sample and the distribution of InD samples. An optimization problem is then formulated and solved based on the proposed score function. The statistical learning bound of the proposed method is investigated to guarantee that the loss value achieved by the empirical optimizer approximates the global optimum. The comparison study results demonstrate that the proposed WOOD consistently outperforms other existing OOD detection methods.
基于深度神经网络的分类器的训练数据和测试数据通常假定是从相同分布中采样得到的。当部分测试样本是从与训练样本分布相距足够远的分布(即所谓的分布外(OOD)样本)中抽取时,训练好的神经网络倾向于对这些OOD样本做出高置信度的预测。在训练用于图像分类、目标检测等的神经网络时,检测OOD样本至关重要。它可以增强分类器对无关输入的鲁棒性,并提高系统在不同形式攻击下的恢复能力和安全性。检测OOD样本存在三个主要挑战:(i)所提出的OOD检测方法应与各种分类器架构(如DenseNet、ResNet)兼容,而不会显著增加模型复杂度和对计算资源的要求;(ii)OOD样本可能来自多个分布,其类别标签通常不可用;(iii)需要定义一个评分函数,以有效地将OOD样本与分布内(InD)样本区分开来。为了克服这些挑战,我们提出了一种基于瓦瑟斯坦距离的分布外检测(WOOD)方法。基本思想是定义一个基于瓦瑟斯坦距离的评分,用于评估测试样本与InD样本分布之间的差异。然后基于所提出的评分函数制定并解决一个优化问题。研究了所提出方法的统计学习界,以确保经验优化器实现的损失值接近全局最优。比较研究结果表明,所提出的WOOD始终优于其他现有的OOD检测方法。