Introduction
Industrial Anomaly Detection (AD) is fundamentally a "one-class classification" (OCC) challenge. In real-world production environments, "normal" samples are abundant, while "anomalous" instances—such as cracks, stains, or structural defects—are rare and often unavailable during the training phase. Recent advancements in Vision-Language Models (VLMs), particularly CLIP, have shown promise in this domain. However, these models typically rely on extensive manual "Prompt Engineering" or supervised "Prompt Learning" that requires both positive and negative examples.
In industrial AD, the absence of negative (anomalous) samples makes standard prompt learning difficult. Without a negative signal, models struggle to define a clear decision boundary. This paper introduces PromptAD, a framework designed to automate prompt learning using only normal samples by leveraging the latent semantic knowledge within pre-trained VLMs.
Methodology
PromptAD addresses the "missing negative" problem through two core innovations: Semantic Concatenation and an Explicit Anomaly Margin, supported by a specialized vision backbone.
Semantic Concatenation (SC)
Rather than requiring physical images of defects, PromptAD utilizes the linguistic understanding inherent in CLIP. The framework employs Semantic Concatenation, which pairs a learnable "normal" prompt prefix with various "anomaly suffixes." These suffixes can be manually defined (e.g., "with damage") or consist of learnable tokens. By concatenating these, the model "hallucinates" anomaly prompts in the text domain. This process effectively transposes the normal prompt into an anomalous context, providing the necessary negative text prototypes to guide the model without the need for actual defective images.
Explicit Anomaly Margin (EAM)
To prevent feature collapse in the absence of real anomaly data, the authors introduce the Explicit Anomaly Margin (EAM). This regularization loss forces a distinct mathematical distance between the features of the learned normal prompts and the hallucinated anomaly prompts. By enforcing this margin, the model maintains a discriminative boundary in the high-dimensional feature space, ensuring that "normal" and "anomalous" representations do not overlap.
VV-CLIP Backbone
Standard CLIP architectures are optimized for global image classification but often fail at fine-grained pixel localization. PromptAD utilizes VV-CLIP (derived from "CLIP Surgery"), which replaces standard self-attention with Value-Value (V-V) attention. This modification preserves local feature maps more effectively, allowing the model to pinpoint the exact spatial location of defects on an object.
Experimental Setup and Results
The researchers evaluated PromptAD on the primary benchmarks for industrial anomaly detection: MVTec AD (15 categories) and VisA (12 categories). Additional testing was conducted on the MPDD and LOCO datasets to verify the model's versatility.
Performance Metrics
PromptAD achieved state-of-the-art results, securing the top performance in 11 out of 12 few-shot configurations across the tested benchmarks. In 1-shot settings on the MVTec AD dataset, the model reached:
- 94.6% Image-level AUROC
- 95.9% Pixel-level AUROC
When compared to the previous leading method, WinCLIP+, PromptAD demonstrated a 1.2% improvement in image-level detection and a significant 7.7% increase in pixel-level localization accuracy. These results highlight the efficiency of learned prompts; while WinCLIP+ utilized an ensemble of approximately 1,000 manual prompts, PromptAD achieved superior results using only 10–20 learned prompts.
Discussion and Insights
The success of PromptAD underscores the potential of using language as a proxy for vision. Because pre-trained VLMs already possess a semantic understanding of concepts like "scratches" or "flaws," researchers can define the "negative space" of anomalies through text rather than visual data. Furthermore, the Explicit Anomaly Margin acts as a critical "safety rail," enabling contrastive learning to function effectively in a one-class setting.
Limitations and Future Work
Despite its performance, PromptAD faces challenges with logical anomalies. These occur when individual components of an object are normal, but their spatial arrangement is incorrect (e.g., a component installed backwards). Such defects require a deeper structural understanding than current VLMs typically provide. Additionally, detecting extremely small defects—those only a few pixels wide—remains a technical hurdle. Future research may focus on integrating structural priors or more advanced vision-language architectures to bridge these gaps.
Summary updated