CoPS: Conditional Prompt Synthesis for Zero-Shot Anomaly Detection

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Chen, Qiyu, Qu, Zhen, Luo, Wei, Yao, Haiming, Cao, Yunkang, Jiang, Yuxin, Duan, Yinan, Luo, Huiyuan, Lv, Chengkan, Zhang, Zhengtao
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911585574846464
author Chen, Qiyu
Qu, Zhen
Luo, Wei
Yao, Haiming
Cao, Yunkang
Jiang, Yuxin
Duan, Yinan
Luo, Huiyuan
Lv, Chengkan
Zhang, Zhengtao
author_facet Chen, Qiyu
Qu, Zhen
Luo, Wei
Yao, Haiming
Cao, Yunkang
Jiang, Yuxin
Duan, Yinan
Luo, Huiyuan
Lv, Chengkan
Zhang, Zhengtao
contents Recently, large pre-trained vision-language models have shown remarkable performance in zero-shot anomaly detection (ZSAD). With fine-tuning on a single auxiliary dataset, the model enables cross-category anomaly detection on diverse datasets covering industrial defects and medical lesions. Compared to manually designed prompts, prompt learning eliminates the need for expert knowledge and trial-and-error. However, it still faces the following challenges: (i) static learnable tokens struggle to capture the continuous and diverse patterns of normal and anomalous states, limiting generalization to unseen categories; (ii) fixed textual labels provide overly sparse category information, making the model prone to overfitting to a specific semantic subspace. To address these issues, we propose Conditional Prompt Synthesis (CoPS), a novel framework that synthesizes dynamic prompts conditioned on visual features to enhance ZSAD performance. Specifically, we extract representative normal and anomaly prototypes from fine-grained patch features and explicitly inject them into prompts, enabling adaptive state modeling. Given the sparsity of class labels, we leverage a variational autoencoder to model semantic image features and implicitly fuse varied class tokens into prompts. Additionally, integrated with our spatially-aware alignment mechanism, extensive experiments demonstrate that CoPS surpasses state-of-the-art methods by 1.4% in classification AUROC and 1.9% in segmentation AUROC across 13 industrial and medical datasets. The code is available at https://github.com/cqylunlun/CoPS.
format Preprint
id arxiv_https___arxiv_org_abs_2508_03447
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle CoPS: Conditional Prompt Synthesis for Zero-Shot Anomaly Detection
Chen, Qiyu
Qu, Zhen
Luo, Wei
Yao, Haiming
Cao, Yunkang
Jiang, Yuxin
Duan, Yinan
Luo, Huiyuan
Lv, Chengkan
Zhang, Zhengtao
Computer Vision and Pattern Recognition
Recently, large pre-trained vision-language models have shown remarkable performance in zero-shot anomaly detection (ZSAD). With fine-tuning on a single auxiliary dataset, the model enables cross-category anomaly detection on diverse datasets covering industrial defects and medical lesions. Compared to manually designed prompts, prompt learning eliminates the need for expert knowledge and trial-and-error. However, it still faces the following challenges: (i) static learnable tokens struggle to capture the continuous and diverse patterns of normal and anomalous states, limiting generalization to unseen categories; (ii) fixed textual labels provide overly sparse category information, making the model prone to overfitting to a specific semantic subspace. To address these issues, we propose Conditional Prompt Synthesis (CoPS), a novel framework that synthesizes dynamic prompts conditioned on visual features to enhance ZSAD performance. Specifically, we extract representative normal and anomaly prototypes from fine-grained patch features and explicitly inject them into prompts, enabling adaptive state modeling. Given the sparsity of class labels, we leverage a variational autoencoder to model semantic image features and implicitly fuse varied class tokens into prompts. Additionally, integrated with our spatially-aware alignment mechanism, extensive experiments demonstrate that CoPS surpasses state-of-the-art methods by 1.4% in classification AUROC and 1.9% in segmentation AUROC across 13 industrial and medical datasets. The code is available at https://github.com/cqylunlun/CoPS.
title CoPS: Conditional Prompt Synthesis for Zero-Shot Anomaly Detection
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2508.03447