用记忆检索替代参数拟合,实现零样本异常检测新范式
MRAD: Zero-Shot Anomaly Detection with Memory-Driven Retrieval
- 用图像和像素级记忆库直接存储特征标签对,推理时通过相似度检索得分
- 在16个工业与医疗数据集上均优于现有方法,尤其在跨域场景表现稳定
- 无需训练即可部署,适合资源受限或快速响应的异常检测场景
零样本异常检测常依赖预训练视觉或视觉语言模型,但现有方法多采用提示学习或复杂建模来拟合数据分布,导致训练或推理成本高,跨域稳定性差。为此,本文提出记忆检索异常检测框架MRAD,以非参数化记忆检索替代传统参数拟合。基础模型MRAD-TF冻结CLIP图像编码器,利用辅助数据构建图像级与像素级双层记忆库,将特征-标签对作为键值显式存储。推理时通过直接相似度检索获得异常分数。在此基础上,进一步提出两种轻量级增强:(i) MRAD-FT使用两个线性层微调检索度量,提升正常与异常间的判别力;(ii) MRAD-CLIP将MRAD-FT中提取的正常与异常区域先验作为动态偏置注入CLIP可学习文本提示,强化对未见类别的泛化能力。在16个工业与医疗数据集上,MRAD框架在无训练和有训练设置下均展现出优越的异常分类与分割性能。结果表明,充分挖掘原始数据的经验分布,而非仅依赖模型拟合,可实现更强的异常检测效果。
原文摘要 · Abstract (English)
Zero-shot anomaly detection (ZSAD) often leverages pretrained vision or vision-language models, but many existing methods use prompt learning or complex modeling to fit the data distribution, resulting in high training or inference cost and limited cross-domain stability. To address these limitations, we propose Memory-Retrieval Anomaly Detection method (MRAD), a unified framework that replaces parametric fitting with a direct memory retrieval. The train-free base model, MRAD-TF, freezes the CLIP image encoder and constructs a two-level memory bank (image-level and pixel-level) from auxiliary data, where feature-label pairs are explicitly stored as keys and values. During inference, anomaly scores are obtained directly by similarity retrieval over the memory bank. Based on the MRAD-TF, we further propose two lightweight variants as enhancements: (i) MRAD-FT fine-tunes the retrieval metric with two linear layers to enhance the discriminability between normal and anomaly; (ii) MRAD-CLIP injects the normal and anomalous region priors from the MRAD-FT as dynamic biases into CLIP's learnable text prompts, strengthening generalization to unseen categories. Across 16 industrial and medical datasets, the MRAD framework consistently demonstrates superior performance in anomaly classification and segmentation, under both train-free and training-based settings. Our work shows that fully leveraging the empirical distribution of raw data, rather than relying only on model fitting, can achieve stronger anomaly detection performance. The code will be publicly released at https://github.com/CROVO1026/MRAD.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。