用进化算法选自然语言提示,提升零样本异常检测的泛化能力
Co-Evolutionary Prompt Optimization with Cross-Category Transfer for Zero-Shot Anomaly Detection

- 采用进化算法在自然语言空间中搜索离散提示,保持可解释性
- 跨类别迁移目标使模型在未见类别上表现更优,准确率显著提升
- 适合需要高可解释性和强泛化能力的工业异常检测场景
零样本异常检测(ZSAD)因其在工业检测中的实用价值受到广泛关注。近期基于CLIP的方法因具备强大的视觉-语言泛化能力而被广泛采用。然而,现有方法通常使用连续提示嵌入进行优化,并将语义编码在潜在向量中,缺乏可解释性和可扩展性。为此,我们提出CoEvoAD,一种用于离散提示选择的共进化框架。CoEvoAD利用进化算法在离散的自然语言空间中进行提示搜索,候选提示通过迭代生成、评估和选择,在种群演化中不断优化,从而保持自然语言的可解释性和可组合性。此外,我们引入跨类别迁移目标(CCTO),将已有的源类别视为未见类别的代理,根据提示规则的估计跨类别迁移能力进行评分,有效提升了跨类别泛化性能。大量实验验证了CoEvoAD的有效性,结果表明其在多个异常检测数据集上达到领先水平。代码已公开于https://github.com/rstao-bjtu/CoEvoAD。
原文摘要 · Abstract (English)
Zero-shot anomaly detection (ZSAD) has gained significant attention for its practical value in industrial inspection. Recently, CLIP-based approaches have been widely adopted in ZSAD due to their strong vision-language generalization capabilities. However, existing methods commonly employ continuous prompt embeddings for prompt optimization and encode semantics in latent vectors, which lack interpretability and scalability. To this end, we propose CoEvoAD, a co-evolutionary framework for discrete prompt selection. CoEvoAD performs prompt search in the discrete natural-language space using an evolutionary algorithm. Candidate prompts are iteratively generated, evaluated, and selected throughout population evolution, thus preserving the interpretability and composability of natural language. Furthermore, we introduce a Cross-Category Transfer Objective (CCTO), which treats held-out source categories as proxies for unseen categories and scores prompt rules based on their estimated cross-category transferability, effectively improving cross-category generalization. Extensive experiments are conducted to validate the effectiveness of CoEvoAD, and the results show that it achieves state-of-the-art performance across multiple anomaly detection datasets. The code is available at https://github.com/rstao-bjtu/CoEvoAD.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。