Introduction
In industrial quality control, detecting defects is a critical yet challenging task. While "normal" samples are abundant, "abnormal" samples (defects) are rare and unpredictable, making it difficult to train robust supervised models. Recent research has turned to Vision-Language Models (VLMs) like CLIP for Few-Shot Anomaly Detection (FAD). However, existing VLM-based methods often rely on "hard prompts"—predefined textual descriptions of specific defects—which are impractical when the nature of future defects is unknown. Furthermore, CLIP's global image understanding often fails to localize small, fine-grained anomalies.
To address these challenges, we present AnoPLe (Anomaly Prompt Learning), a multi-modal framework that achieves near state-of-the-art performance using only normal samples. By bridging the gap between global context and local defect localization through bi-directional prompt coupling and a multi-view aware decoder, AnoPLe eliminates the need for prior knowledge of specific anomalies.
Methodology
AnoPLe introduces three primary technical innovations to improve the sensitivity and localization of anomaly detection:
Bi-directional Prompt Learning
Unlike traditional methods that learn textual and visual prompts independently, AnoPLe employs a bi-directional coupling mechanism. It projects prompts from one modality into the hidden dimensions of the other. This allows the textual prompt for "abnormal" to be conditioned on the actual visual context of the object, transforming the abstract concept of an anomaly into a concrete representation aligned with the specific textures and structures of the sample.
Multi-View Aware Decoder
To overcome CLIP's localization limitations, a lightweight 3-layer CNN decoder is integrated. During training, the model is fed both the full image and various local crops. This multi-scale approach forces the decoder to learn fine-grained local semantics. To manage the distributional shift between training (crops) and testing (global views), a learnable "multi-view signal" token is prepended to the visual prompts, helping the model distinguish between local and global perspectives.
Pseudo-Anomaly Simulation
Since the framework is trained exclusively on normal samples, anomalies are simulated to provide a learning signal. This is achieved through two methods: Perlin noise in the pixel space to mimic physical surface defects, and Gaussian noise in the latent space to represent structural deviations.
Experimental Results
The model was evaluated on the MVTec-AD and VisA benchmarks, representing a wide variety of industrial objects and complex structures.
Quantitative Performance
AnoPLe demonstrates that seeing a real anomaly is not a prerequisite for effective detection. On the MVTec-AD (1-shot) benchmark, it achieved 94.1% Image AUROC. This performance is within 1% of state-of-the-art models like PromptAD, which benefit from prior knowledge of specific defects. When compared against other "blind" methods (those not using prior defect descriptions), AnoPLe outperformed them by over 10% on MVTec-AD and 6% on VisA.
Qualitative Localization
Beyond image-level classification, AnoPLe excels at pinpointing the exact location of defects. Qualitative comparisons show that AnoPLe produces significantly cleaner and more accurate heatmaps than competitors like WinCLIP, which often generate noise in normal regions.
Discussion and Future Work
A key insight from this work is that modality interaction is essential; when the text encoder "sees" visual context, it better aligns abstract concepts with physical reality. Furthermore, the use of generic prompts (e.g., class name + "abnormal") proved more effective than hand-crafted expert descriptions, suggesting that learned multi-modal representations are more robust than manual engineering.
Currently, the model's primary limitation lies in detecting "logical" anomalies—cases where textures are normal but components are misplaced. Future research will focus on developing more sophisticated pseudo-anomaly generators capable of simulating these positional and logical errors to further close the gap with fully supervised methods.
Summary updated