SubspaceAD: Training-Free Few-Shot Anomaly Detection via Subspace Modeling
作者: Camile Lendering, Erkut Akdag, Egor Bondarev
分类: cs.CV, cs.LG
发布日期: 2026-02-26
备注: Accepted to CVPR 2026
🔗 代码/项目: GITHUB
💡 一句话要点
SubspaceAD:基于子空间建模的免训练少样本异常检测方法
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 异常检测 少样本学习 免训练 子空间建模 主成分分析
📋 核心要点
- 现有少样本异常检测方法依赖记忆库、辅助数据集或视觉-语言模型的多模态调整,复杂度较高。
- SubspaceAD利用预训练视觉基础模型DINOv2提取特征,通过PCA建模正常样本的低维子空间,实现免训练异常检测。
- 实验表明,SubspaceAD在MVTec-AD和VisA数据集上取得了优异的单样本和少样本异常检测性能,超越现有SOTA方法。
📝 摘要(中文)
本文提出了一种名为SubspaceAD的免训练少样本异常检测方法,用于解决工业检测中视觉异常检测问题,该问题通常需要在每个类别中仅使用少量正常图像进行训练。SubspaceAD方法无需训练,包含两个简单阶段。首先,使用冻结的DINOv2骨干网络从少量正常图像中提取patch级别的特征。其次,将主成分分析(PCA)模型拟合到这些特征,以估计正常变化的低维子空间。在推理时,通过相对于该子空间的重建残差来检测异常,从而产生可解释且具有统计基础的异常分数。实验表明,SubspaceAD在单样本和少样本设置中实现了最先进的性能,无需训练、提示调整或记忆库。在单样本异常检测设置中,SubspaceAD在MVTec-AD数据集上实现了98.0%的图像级AUROC和97.6%的像素级AUROC,在VisA数据集上分别实现了93.3%和98.3%的AUROC,超过了先前的最先进结果。代码和演示可在https://github.com/CLendering/SubspaceAD 获取。
🔬 方法详解
问题定义:论文旨在解决工业检测中少样本异常检测问题。现有方法通常需要复杂的训练流程,例如依赖记忆库、辅助数据集或对视觉-语言模型进行多模态微调,这增加了计算成本和部署难度。此外,这些方法的可解释性也相对较差。
核心思路:论文的核心思路是利用预训练的视觉基础模型(DINOv2)提取图像特征,并假设正常样本的特征位于一个低维子空间中。通过PCA对正常样本的特征进行建模,得到该子空间。异常样本的特征与该子空间的重建误差会较大,因此可以通过重建误差来检测异常。
技术框架:SubspaceAD方法包含两个主要阶段:特征提取和异常检测。 1. 特征提取:使用预训练的DINOv2模型提取正常图像的patch级别特征。DINOv2模型参数固定,无需训练。 2. 异常检测:使用PCA对提取的正常特征进行建模,得到正常样本的低维子空间。在推理阶段,对于待检测图像,首先提取其patch级别特征,然后将其投影到正常样本的低维子空间中,计算重建误差。根据重建误差的大小判断是否为异常。
关键创新:SubspaceAD的关键创新在于其免训练的特性。它充分利用了预训练视觉基础模型的强大特征提取能力,避免了复杂的训练过程。此外,通过PCA建模正常样本的低维子空间,使得异常检测过程具有较好的可解释性。
关键设计: 1. DINOv2 backbone:使用预训练的DINOv2模型作为特征提取器。DINOv2模型在大量图像数据上进行预训练,具有强大的特征表示能力。 2. PCA子空间建模:使用PCA对正常样本的特征进行降维,并构建正常样本的低维子空间。PCA可以有效地提取数据的主要成分,并降低数据的维度。 3. 重建误差:使用重建误差作为异常分数。重建误差越大,表示样本与正常样本的差异越大,越有可能是异常样本。
🖼️ 关键图片
📊 实验亮点
SubspaceAD在MVTec-AD数据集上取得了98.0%的图像级AUROC和97.6%的像素级AUROC,在VisA数据集上分别取得了93.3%和98.3%的AUROC,显著优于现有的最先进方法。值得注意的是,SubspaceAD无需任何训练,即可达到如此高的性能,体现了预训练视觉基础模型的强大能力。
🎯 应用场景
SubspaceAD方法可应用于工业产品质量检测、医疗图像分析、安全监控等领域。例如,在工业生产线上,可以利用该方法检测产品表面的缺陷,提高产品质量。在医疗图像分析中,可以用于检测病灶,辅助医生进行诊断。该方法无需训练,易于部署,具有广泛的应用前景。
📄 摘要(原文)
Detecting visual anomalies in industrial inspection often requires training with only a few normal images per category. Recent few-shot methods achieve strong results employing foundation-model features, but typically rely on memory banks, auxiliary datasets, or multi-modal tuning of vision-language models. We therefore question whether such complexity is necessary given the feature representations of vision foundation models. To answer this question, we introduce SubspaceAD, a training-free method, that operates in two simple stages. First, patch-level features are extracted from a small set of normal images by a frozen DINOv2 backbone. Second, a Principal Component Analysis (PCA) model is fit to these features to estimate the low-dimensional subspace of normal variations. At inference, anomalies are detected via the reconstruction residual with respect to this subspace, producing interpretable and statistically grounded anomaly scores. Despite its simplicity, SubspaceAD achieves state-of-the-art performance across one-shot and few-shot settings without training, prompt tuning, or memory banks. In the one-shot anomaly detection setting, SubspaceAD achieves image-level and pixel-level AUROC of 98.0% and 97.6% on the MVTec-AD dataset, and 93.3% and 98.3% on the VisA dataset, respectively, surpassing prior state-of-the-art results. Code and demo are available at https://github.com/CLendering/SubspaceAD.