VisualAD:基于视觉 Transformer 的无语言零样本异常检测
VisualAD: Language-Free Zero-Shot Anomaly Detection via Vision Transformer
去掉文本分支、只用冻结 ViT 骨干加两个可学习 token 来编码正常/异常语义,为视觉研究者提供了一个可复用的纯视觉零样本判别范式,可直接替换 CLIP 文本提示词方案并适配 DINOv2 等骨干。
原文依据 This work revisits the necessity of the text branch in ZSAD and presents VisualAD, a purely visual framework built on Vision Transformers.
摘要译文
由模型翻译 · 术语统一 · 请对照原文核对关键结论零样本异常检测(ZSAD)要求在无法获取目标类异常样本的情况下检测并定位异常。主流方法依赖 CLIP 等视觉语言模型:它们为正常与异常语义构建手工设计或可学习的提示词集合,再计算图像-文本相似度以进行开放集判别。这类方法虽然有效,却依赖文本编码器与跨模态对齐,可能带来训练不稳定与参数冗余。本文重新审视 ZSAD 中文本分支的必要性,并提出 VisualAD——一个基于视觉 Transformer 的纯视觉框架。我们在冻结的骨干网络中引入两个可学习 token,直接编码正常性与异常性。通过多层自注意力,这些 token 与图像块 token 交互,逐步获得对正常与异常的高层概念,同时引导图像块突出与异常相关的线索。此外,我们引入空间感知交叉注意力(SCA)模块与轻量级自对齐函数(SAF):SCA 将细粒度空间信息注入 token,SAF 在异常打分前重新校准图像块特征。VisualAD 在涵盖工业与医学领域的 13 个零样本异常检测基准上取得最优性能,并可无缝适配 CLIP 图像编码器、DINOv2 等预训练视觉骨干网络。代码已公开于 https://github.com/7HHHHH/VisualAD。
英文原文摘要 1480 字符
Zero-shot anomaly detection (ZSAD) requires detecting and localizing anomalies without access to target-class anomaly samples. Mainstream methods rely on vision-language models (VLMs) such as CLIP: they build hand-crafted or learned prompt sets for normal and abnormal semantics, then compute image-text similarities for open-set discrimination. While effective, this paradigm depends on a text encoder and cross-modal alignment, which can lead to training instability and parameter redundancy. This work revisits the necessity of the text branch in ZSAD and presents VisualAD, a purely visual framework built on Vision Transformers. We introduce two learnable tokens within a frozen backbone to directly encode normality and abnormality. Through multi-layer self-attention, these tokens interact with patch tokens, gradually acquiring high-level notions of normality and anomaly while guiding patches to highlight anomaly-related cues. Additionally, we incorporate a Spatial-Aware Cross-Attention (SCA) module and a lightweight Self-Alignment Function (SAF): SCA injects fine-grained spatial information into the tokens, and SAF recalibrates patch features before anomaly scoring. VisualAD achieves state-of-the-art performance on 13 zero-shot anomaly detection benchmarks spanning industrial and medical domains, and adapts seamlessly to pretrained vision backbones such as the CLIP image encoder and DINOv2. Our code is publicly available at https://github.com/7HHHHH/VisualAD.