Skip to main content
QUICK REVIEW

[论文解读] OODformer: Out-Of-Distribution Detection Transformer

Rajat Koner, Poulami Sinhamahapatra|arXiv (Cornell University)|Jul 19, 2021
Adversarial Robustness in Machine Learning被引用 14
一句话总结

OODformer 提出了一种新颖的分布外(OOD)检测方法,利用视觉变换器(ViT)捕捉全局图像上下文和基于注意力的特征相关性,以提升 OOD 泛化能力。通过利用 ViT 的 [class] token 嵌入表示的类别条件相似性以及置信度分数,该方法在 CIFAR-10/-100 和 ImageNet30 上实现了最先进性能,且无需负采样或在 OOD 数据上微调。

ABSTRACT

A serious problem in image classification is that a trained model might perform well for input data that originates from the same distribution as the data available for model training, but performs much worse for out-of-distribution (OOD) samples. In real-world safety-critical applications, in particular, it is important to be aware if a new data point is OOD. To date, OOD detection is typically addressed using either confidence scores, auto-encoder based reconstruction, or by contrastive learning. However, the global image context has not yet been explored to discriminate the non-local objectness between in-distribution and OOD samples. This paper proposes a first-of-its-kind OOD detection architecture named OODformer that leverages the contextualization capabilities of the transformer. Incorporating the trans\-former as the principal feature extractor allows us to exploit the object concepts and their discriminate attributes along with their co-occurrence via visual attention. Using the contextualised embedding, we demonstrate OOD detection using both class-conditioned latent space similarity and a network confidence score. Our approach shows improved generalizability across various datasets. We have achieved a new state-of-the-art result on CIFAR-10/-100 and ImageNet30.

研究动机与目标

  • 为解决在安全关键视觉应用中分布外(OOD)样本检测这一关键挑战,此类应用中模型性能会显著下降。
  • 探索视觉变换器(ViT)在捕捉全局图像上下文和物体属性共现模式方面的潜力,以提升 OOD 检测性能。
  • 开发一种无需依赖负采样、对比损失或在 OOD 数据上微调的跨数据集泛化方法。
  • 证明 ViT 中的自注意力机制本质上学习到的语义紧凑表征适用于 OOD 检测。

提出的方法

  • 使用标准交叉熵损失在分布内(ID)数据上训练视觉变换器(ViT)以进行监督分类。
  • 从 ViT 的最后一层提取 [class] token 嵌入,作为输入图像的全局上下文表征。
  • 计算 ID 嵌入与每个类别均值嵌入之间的类别条件距离度量(如余弦、马氏、欧氏距离),用于 OOD 检测。
  • 将分类头输出的 softmax 置信度分数用作第二种 OOD 检测信号。
  • 使用 AUROC 等标准指标在多个基准数据集上评估 OOD 检测性能。
  • 将基于 ViT 的 OODformer 与 ResNet 基线模型进行比较,包括随机初始化和 ImageNet 预训练模型,且在有无图像上采样的情况下进行对比。

实验结果

研究问题

  • RQ1视觉变换器(ViT)是否能在不使用显式对比损失或负采样的情况下有效检测分布外样本?
  • RQ2与 CNN 相比,ViT 中的全局上下文和多头自注意力机制是否能提升 OOD 泛化能力?
  • RQ3在 ViT 嵌入空间中,距离度量选择(余弦、欧氏、马氏)如何影响 OOD 检测性能?
  • RQ4一种简单、基于置信度和嵌入的 OOD 检测方法能否超越现有最先进方法?

主要发现

  • OODformer 在 CIFAR-100 上实现了新的最先进 AUROC 94.4,显著优于最佳 ResNet-101 基线(87.8 AUROC)。
  • 轻量级 ViT 变体 DeiT-Tiny-16 在 CIFAR-100 上达到 94.4 AUROC,尽管参数量更少、模型更小,但仍超越了更大的 ResNet 模型。
  • 预训练的 ViT 和 DeiT 变体即使在图像上采样和微调后,也始终优于 ImageNet 预训练的 ResNets,表明 ViT 的归纳偏置在 OOD 检测中更具优势。
  • 马氏距离度量略胜于余弦和欧氏距离,可能是因为其同时利用了类别均值和协方差信息。
  • OODformer 对距离度量选择表现出强鲁棒性,不同度量下性能波动仅在 ±2% 以内,表明其稳定性良好。
  • 随着模型容量增加,ViT 与 ResNet 之间的性能差距进一步扩大,表明 ViT 的注意力机制更能捕捉判别性、上下文感知的表征,适用于 OOD 检测。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。