GenCLIP: Generalizing CLIP Prompts for Zero-shot Anomaly Detection

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Kim, Donghyeong, Park, Chaewon, Cho, Suhwan, Lim, Hyeonjeong, Kang, Minseok, Lee, Jungho, Lee, Sangyoun
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912946613911552
author Kim, Donghyeong
Park, Chaewon
Cho, Suhwan
Lim, Hyeonjeong
Kang, Minseok
Lee, Jungho
Lee, Sangyoun
author_facet Kim, Donghyeong
Park, Chaewon
Cho, Suhwan
Lim, Hyeonjeong
Kang, Minseok
Lee, Jungho
Lee, Sangyoun
contents Zero-shot anomaly detection (ZSAD) aims to identify anomalies in unseen categories by leveraging CLIP's zero-shot capabilities to match text prompts with visual features. A key challenge in ZSAD is learning general prompts stably and utilizing them effectively, while maintaining both generalizability and category specificity. Although general prompts have been explored in prior works, achieving their stable optimization and effective deployment remains a significant challenge. In this work, we propose GenCLIP, a novel framework that learns and leverages general prompts more effectively through multi-layer prompting and dual-branch inference. Multi-layer prompting integrates category-specific visual cues from different CLIP layers, enriching general prompts with more comprehensive and robust feature representations. By combining general prompts with multi-layer visual features, our method further enhances its generalization capability. To balance specificity and generalization, we introduce a dual-branch inference strategy, where a vision-enhanced branch captures fine-grained category-specific features, while a query-only branch prioritizes generalization. The complementary outputs from both branches improve the stability and reliability of anomaly detection across unseen categories. Additionally, we propose an adaptive text prompt filtering mechanism, which removes irrelevant or atypical class names not encountered during CLIP's training, ensuring that only meaningful textual inputs contribute to the final vision-language alignment.
format Preprint
id arxiv_https___arxiv_org_abs_2504_14919
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle GenCLIP: Generalizing CLIP Prompts for Zero-shot Anomaly Detection
Kim, Donghyeong
Park, Chaewon
Cho, Suhwan
Lim, Hyeonjeong
Kang, Minseok
Lee, Jungho
Lee, Sangyoun
Computer Vision and Pattern Recognition
Zero-shot anomaly detection (ZSAD) aims to identify anomalies in unseen categories by leveraging CLIP's zero-shot capabilities to match text prompts with visual features. A key challenge in ZSAD is learning general prompts stably and utilizing them effectively, while maintaining both generalizability and category specificity. Although general prompts have been explored in prior works, achieving their stable optimization and effective deployment remains a significant challenge. In this work, we propose GenCLIP, a novel framework that learns and leverages general prompts more effectively through multi-layer prompting and dual-branch inference. Multi-layer prompting integrates category-specific visual cues from different CLIP layers, enriching general prompts with more comprehensive and robust feature representations. By combining general prompts with multi-layer visual features, our method further enhances its generalization capability. To balance specificity and generalization, we introduce a dual-branch inference strategy, where a vision-enhanced branch captures fine-grained category-specific features, while a query-only branch prioritizes generalization. The complementary outputs from both branches improve the stability and reliability of anomaly detection across unseen categories. Additionally, we propose an adaptive text prompt filtering mechanism, which removes irrelevant or atypical class names not encountered during CLIP's training, ensuring that only meaningful textual inputs contribute to the final vision-language alignment.
title GenCLIP: Generalizing CLIP Prompts for Zero-shot Anomaly Detection
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2504.14919