Unsupervised Anomaly Detection (UAD) with incremental training is crucial in industrial manufacturing, as unpredictable defects make obtaining sufficient labeled data infeasible. However, continual learning methods primarily rely on supervised annotations, while the application in UAD is limited due to the absence of supervision. Current UAD methods train separate models for different classes sequentially, leading to catastrophic forgetting and a heavy computational burden. To address this issue, we introduce a novel Unsupervised Continual Anomaly Detection framework called UCAD, which equips the UAD with continual learning capability through contrastively-learned prompts. In the proposed UCAD, we design a Continual Prompting Module (CPM) by utilizing a concise key-prompt-knowledge memory bank to guide task-invariant `anomaly' model predictions using task-specific `normal' knowledge. Moreover, Structure-based Contrastive Learning (SCL) is designed with the Segment Anything Model (SAM) to improve prompt learning and anomaly segmentation results. Specifically, by treating SAM's masks as structure, we draw features within the same mask closer and push others apart for general feature representations. We conduct comprehensive experiments and set the benchmark on unsupervised continual anomaly detection and segmentation, demonstrating that our method is significantly better than anomaly detection methods, even with rehearsal training. The code will be available at https://github.com/shirowalker/UCAD.
翻译:无监督异常检测(UAD)结合增量训练在工业制造中至关重要,因为不可预测的缺陷使得获取充足的标注数据变得不可行。然而,持续学习方法主要依赖监督标注,而在UAD中的应用因缺乏监督而受限。当前的UAD方法按序为不同类别训练独立模型,导致灾难性遗忘和沉重的计算负担。为解决这一问题,我们提出一种新颖的无监督持续异常检测框架UCAD,通过对比学习提示为UAD赋予持续学习能力。在所提出的UCAD中,我们设计了一个持续提示模块(CPM),利用简洁的键-提示-知识记忆库,引导任务无关的“异常”模型利用任务特定的“正常”知识进行预测。此外,结构对比学习(SCL)与分割一切模型(SAM)相结合,用于改善提示学习与异常分割结果。具体而言,通过将SAM的分割掩码视为结构,我们拉近同一掩码内的特征距离,并推远不同掩码间的特征,从而获得通用特征表示。我们进行了全面实验,并构建了无监督持续异常检测与分割的基准,证明我们的方法显著优于异常检测方法,即使结合重训练方法。代码将发布于 https://github.com/shirowalker/UCAD。