用伪异常训练视觉变压器,提升异常检测的抗攻击能力。
PatchGuard: Adversarially Robust Anomaly Detection and Localization through Vision Transformers and Pseudo Anomalies
- 在视觉变压器中引入带定位掩码的伪异常样本。
- 对抗攻击下检测准确率提升53.2%,定位准确率提升68.5%。
- 适合医疗和工业监控等高可靠性场景使用。
异常检测(AD)和异常定位(AL)在医疗影像与工业监控等高可靠性领域至关重要。然而,现有方法因训练数据仅含正常样本而易受对抗攻击影响。本文提出PatchGuard,一种基于视觉变压器(ViT)的鲁棒异常检测与定位方法,通过引入带有定位掩码的伪异常样本增强模型鲁棒性。研究分析了伪异常的关键特性,并从理论上揭示了提升鲁棒性的注意力机制需求。提出前景感知伪异常生成策略,结合新型损失函数进行对抗训练。在多个工业与医学数据集上的实验表明,该方法在对抗环境下显著优于已有方法:AD性能提升53.2%,AL性能提升68.5%,同时保持非对抗场景下的竞争力。代码已开源。
原文摘要 · Abstract (English)
Anomaly Detection (AD) and Anomaly Localization (AL) are crucial in fields that demand high reliability, such as medical imaging and industrial monitoring. However, current AD and AL approaches are often susceptible to adversarial attacks due to limitations in training data, which typically include only normal, unlabeled samples. This study introduces PatchGuard, an adversarially robust AD and AL method that incorporates pseudo anomalies with localization masks within a Vision Transformer (ViT)-based architecture to address these vulnerabilities. We begin by examining the essential properties of pseudo anomalies, and follow it by providing theoretical insights into the attention mechanisms required to enhance the adversarial robustness of AD and AL systems. We then present our approach, which leverages Foreground-Aware Pseudo-Anomalies to overcome the deficiencies of previous anomaly-aware methods. Our method incorporates these crafted pseudo-anomaly samples into a ViT-based framework, with adversarial training guided by a novel loss function designed to improve model robustness, as supported by our theoretical analysis. Experimental results on well-established industrial and medical datasets demonstrate that PatchGuard significantly outperforms previous methods in adversarial settings, achieving performance gains of $53.2\%$ in AD and $68.5\%$ in AL, while also maintaining competitive accuracy in non-adversarial settings. The code repository is available at https://github.com/rohban-lab/PatchGuard .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。