3 个月前

单层预测性归一化最大似然用于分布外检测

单层预测性归一化最大似然用于分布外检测

摘要

在关键安全系统中,基于机器学习的模型需要能够有效检测分布外(Out-of-Distribution, OOD)样本,这对保障系统可靠性至关重要。现有的主流OOD检测方法通常假设在训练阶段可获得部分OOD样本,但在实际应用场景中,此类样本往往难以获取。为此,本文采用预测性归一化最大似然(predictive normalized maximum likelihood, pNML)学习器,该方法无需对测试输入做出任何先验假设。本文推导了单层神经网络(NN)的pNML及其泛化误差(称为遗憾,regret)的显式表达式。研究发现,当满足以下任一条件时,该学习器具有良好的泛化性能:(i)测试向量位于训练数据经验相关矩阵的大特征值所对应的特征向量张成的子空间中;或(ii)测试样本远离决策边界。此外,本文提出一种高效方法,将推导出的pNML遗憾度应用于任意预训练的深度神经网络(deep NN):仅需在最后一层使用显式pNML表达式,并结合softmax函数即可实现。该方法在应用时无需引入额外可调参数,也无需额外数据。我们在多个基准测试中对所提方法进行了全面评估,使用DenseNet-100、ResNet-34和WideResNet-40模型,基于CIFAR-100、CIFAR-10、SVHN和ImageNet-30数据集进行训练,在共74个OOD检测任务中,相较于近期领先方法,性能提升最高达15.6%,显著优于现有技术。

代码仓库

kobybibas/pnml_ood_detection
官方
pytorch
GitHub 中提及

基准测试

基准方法指标
out-of-distribution-detection-on-cifar-10-vs-2DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-2ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-cifar-10-vs-3DenseNet-BC-100
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-3ResNet-34
AUROC: 99.5
out-of-distribution-detection-on-cifar-10-vs-4ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-4DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-5ResNet-34
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-5DenseNet-BC-100
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-6ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-cifar-10-vs-6DenseNet-BC-100
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-7DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-7ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-8DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-8ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-9ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-9DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-1DenseNet-BC-100
AUROC: 99.5
out-of-distribution-detection-on-cifar-100-vs-1ResNet-34
AUROC: 99.3
out-of-distribution-detection-on-cifar-100-vs-2DenseNet-BC-100
AUROC: 96.1
out-of-distribution-detection-on-cifar-100-vs-2ResNet-34
AUROC: 97.8
out-of-distribution-detection-on-cifar-100-vs-3ResNet-34
AUROC: 99.6
out-of-distribution-detection-on-cifar-100-vs-3DenseNet-BC-100
AUROC: 99.7
out-of-distribution-detection-on-cifar-100-vs-4DenseNet-BC-100
AUROC: 99.5
out-of-distribution-detection-on-cifar-100-vs-4ResNet-34
AUROC: 99.2
out-of-distribution-detection-on-cifar-100-vs-5DenseNet-BC-100
AUROC: 99.0
out-of-distribution-detection-on-cifar-100-vs-5ResNet-34
AUROC: 98.4
out-of-distribution-detection-on-cifar-100-vs-6ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-6DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-7DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-7ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-8ResNet-34
AUROC: 97.9
out-of-distribution-detection-on-cifar-100-vs-8DenseNet-BC-100
AUROC: 98.4
out-of-distribution-detection-on-svhn-vsResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vsDenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-1DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-1ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-2DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-2ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-3DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-3ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-4DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-4ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-svhn-vs-5DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-5ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-svhn-vs-isunDenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-isunResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-lsunResNet-34
AUROC: 99.9
out-of-distribution-detection-on-svhn-vs-lsunDenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-lsun-1ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-lsun-1DenseNet-BC-100
AUROC: 100

用 AI 构建 AI

从想法到上线——通过免费 AI 协同编程、开箱即用的环境和市场最优价格的 GPU 加速您的 AI 开发

AI 协同编程
即用型 GPU
最优价格
立即开始

Hyper Newsletters

订阅我们的最新资讯
我们会在北京时间 每周一的上午九点 向您的邮箱投递本周内的最新更新
邮件发送服务由 MailChimp 提供
单层预测性归一化最大似然用于分布外检测 | 论文 | HyperAI超神经