arXiv:2610.23172cs.CVOct 2026

Manuscript Offprint

arXiv:2610.23172

Knowledge-Guided Distributional Prompt Learning with Visual Hierarchy for Zero-Shot Anomaly Detection

Jiyul Ham, Seongho Yoon, Yonggon Jung, Sangjae Lee, Jun-Geol Baek

ARTICLE INFO

Keywords:

Distribution-aware prompt modeling

Knowledge-guided contrastive learning

Visual hierarchy

Zero-shot anomaly detection

Vision-language models

ABSTRACT

Zero-shot anomaly detection (ZSAD) performs generalized anomaly detection on previously unseen classes by using auxiliary images. ZSAD plays a vital role as a practical anomaly detection approach in various fields, such as industrial visual inspection and medical imaging, where annotation costs are high and rapid decision-making is essential. Recent vision-language-model-based approaches have substantially improved ZSAD by aligning textual representations with visual features, while more recent distributional prompting methods further model prompt variability to enhance generalization to unseen categories. However, existing methods do not explicitly combine normality-referenced distributional modeling with hierarchy-specific prompt specialization, limiting their ability to represent anomalous semantics relative to normality while simultaneously addressing image-level detection and fine-grained localization. To address this limitation, we propose Hierarchical Knowledge-Guided Distributional Prompt Learning (HiDist), a normality-referenced hierarchical distributional prompt framework for ZSAD. HiDist models each prompt token using a diagonal Gaussian distribution and generates stochastic prompt variations through Monte Carlo sampling. Rather than learning normal and anomalous distributions independently, anomalous prompt distributions are parameterized as deviations from learned normal references, explicitly encoding their statistical dependency. The resulting distributions are specialized into global and local representations for image-level detection and pixel-level localization, respectively. An adapted global visual representation then guides hierarchical alignment, together with complementary regularization objectives. Experiments on seven industrial and medical datasets demonstrate strong cross-dataset performance of HiDist across both anomaly detection and localization tasks. Extensive ablation and representation analyses further support the effectiveness of normality-referenced distributional modeling and hierarchy-specific representation learning.

References (42)