arXiv:2608.03681cs.CV2026-08

提出一种保留异常特征的高效剪枝方法,让模型更快检测工业与医疗图像中的微小缺陷。

Keep the Needle, Prune the Haystack: Defect-Preserving Token Pruning for Efficient Zero-Shot Anomaly Detection

论文配图:Keep the Needle, Prune the Haystack: Defect-Preserving Token Pruning for Efficient Zero-Shot Anomaly Detection
图 1 · 摘自论文原文
  • 通过局部覆盖与异常救赎策略,防止早期层误删细微异常
  • 将令牌保留率降至20%以下,性能损失不超过2.7个百分点
  • 适合需要快速推理的工业质检和医学影像分析场景

零样本视觉异常检测取得显著进展,现有纯视觉方法在简化推理流程的同时提升了性能。然而,多数方法对所有图像和空间令牌进行密集计算,而现实中正常样本占主导,异常通常仅存在于小区域。令牌剪枝虽具潜力,但存在不对称风险:保留正常令牌仅导致冗余计算,而移除异常令牌可能彻底丢失检测证据。该风险在浅层尤为严重,此时剪枝收益最大,但异常语义仍不可靠。本文提出KeepAD,一种缺陷保留型令牌剪枝框架,将令牌选择建模为高召回率、异常感知的路由机制。在浅层,结合局部$2\times2$补丁邻域的覆盖保持选择与确定性异常救赎,降低误删细微缺陷的风险;在深层,利用冻结的正常与异常原型,在图像自适应的令牌预算下指导剪枝,激进地移除低风险正常令牌,同时保留局部异常证据。密集到稀疏的自蒸馏进一步监督早期令牌路由,不增加推理开销。在六个工业与七个医学零样本异常检测基准上,KeepAD将令牌保留率降至20%以下,图像级与像素级AUROC平均下降不超过2.7个百分点。在最激进设置下,相较最强的CLIP基线实现7.9倍加速。

原文摘要 · Abstract (English)

Zero-shot visual anomaly detection has achieved remarkable progress, with recent vision-only approaches further improving performance while simplifying the inference pipeline. However, existing methods typically perform dense computation over all images and spatial tokens, despite the fact that normal samples dominate real-world scenarios and anomalies usually occupy only small regions. Token pruning offers a promising solution, but introduces an asymmetric pruning risk in anomaly detection: retaining normal tokens mainly incurs redundant computation, whereas removing anomalous tokens may eliminate the only evidence for detection and localization. This risk is particularly severe in early layers, where pruning provides the greatest computational benefit but anomaly semantics remain unreliable. We propose KeepAD, a defect-preserving token pruning framework that formulates token selection as high-recall, anomaly-aware routing. In shallow layers, KeepAD combines coverage-preserving selection over local $2\times2$ patch neighborhoods with deterministic anomaly rescue to reduce the risk of discarding subtle defects. In deeper layers, frozen normal and abnormal prototypes guide pruning under an image-adaptive token budget, aggressively removing low-risk normal tokens while preserving local anomaly evidence. Dense-to-sparse self-distillation further supervises early token routing without introducing additional inference overhead. Experiments on six industrial and seven medical zero-shot anomaly detection benchmarks show that KeepAD reduces the token retention ratio to below $20\%$, while limiting the average degradation in image-level and pixel-level AUROC to within $2.7$ percentage points. At the most aggressive operating point, KeepAD achieves a $7.9\times$ speedup over the strongest CLIP-based baseline.

异常检测令牌剪枝工业质检医疗影像

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。