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 97.1% and 97.5% on the MVTec-AD dataset, and 93.4% and 98.2% on the VisA dataset, respectively, surpassing prior state-of-the-art results. Code and demo are available at https://github.com/CLendering/SubspaceAD.
翻译:工业检测中的视觉异常检测通常需要每类仅用少量正常图像进行训练。近期少样本方法通过使用基础模型特征取得了显著成果,但这些方法通常依赖存储库、辅助数据集或视觉-语言模型的多模态调优。我们因此质疑:在视觉基础模型的特征表征条件下,这种复杂性是否必要?为回答该问题,我们提出SubspaceAD——一种无需训练的方法,其运行仅包含两个简单阶段。首先,通过冻结的DINOv2骨干网络从少量正常图像中提取块级特征;其次,对这些特征执行主成分分析(PCA)建模,以估计正常变化所处的低维子空间。推理时,通过计算相对于该子空间的重建残差来检测异常,生成具有可解释性和统计基础的异常分数。尽管方法简单,SubspaceAD在单样本和少样本场景下无需训练、提示调优或存储库,即达到了当前最优性能。在单样本异常检测任务中,SubspaceAD在MVTec-AD数据集上分别实现了97.1%的图像级AUROC和97.5%的像素级AUROC,在VisA数据集上分别达到93.4%和98.2%,均超越此前最优结果。代码与演示见:https://github.com/CLendering/SubspaceAD。