arXiv:2609.07229cs.CVSep 2026

Manuscript Offprint

arXiv:2609.07229

Proximity-CLIP: Text-Guided Semantic Proximity Learning for Zero-Shot Anomaly Detection

Manwen Yang, Leqian Ding, Yu Guo, Fei Wang

Manwen Yang¹,², Leqian Ding², Yu Guo²*, and Fei Wang²

¹ School of Software Engineering, Xi'an Jiaotong University ² State Key Laboratory of Human-Machine Hybrid Augmented Intelligence, Institute of Artificial Intelligence and Robotics, Xi'an Jiaotong University

Abstract. Vision-language models offer a promising approach for zero-shot anomaly detection (ZSAD). However, due to object-centric bias, normal and anomalous text prototypes exhibit a high semantic overlap. While enforcing strict orthogonality between them improves discriminability, mapping highly contiguous visual inputs onto drastically orthogonal prototypes introduces a geometric dilemma, disrupting the pre-trained structural continuity. To address this problem, we propose Proximity-CLIP, a framework that visually calibrates the semantic margin to guide visual adaptation. First, we introduce a visually-calibrated semantic proximity learning mechanism that uses a bounded dynamic regularization to learn an appropriate semantic margin, ensuring discriminative separation while preserving structural alignment. Second, we design an Anomaly Query Module (AQM) driven by these text priors. Using the calibrated anomalous prototype as a semantic query, the AQM actively retrieves localized defect cues from contextual visual patches, mitigating the dilution of subtle anomalies during global pooling. Extensive experiments demonstrate that Proximity-CLIP outperforms current state-of-the-art methods across multiple ZSAD benchmarks with minimal architectural modifications.

Keywords: Anomaly detection · CLIP · Zero-shot Learning

1 Introduction

Zero-shot anomaly detection, or ZSAD, localizes anomalous image regions without relying on closed-set normal training samples. Traditional methods that rely on category-specific data for feature reconstruction lack scalability to open-world scenarios. Large-scale vision-language models, such as CLIP, offer a new zero-shot perception approach by aligning image and text representations. However, because these models are pre-trained primarily for instance-level object recognition, they lack the fine-grained sensitivity required for localized structural variations. This deficiency renders the adaptation of CLIP for ZSAD highly challenging.

M. Yang et al.

Figure

Fig. 1: Visually-calibrated semantic proximity shaping for anomaly detection. (A): In the pre-trained CLIP space, normal and anomalous text prototypes μn\mu_n and μa\mu_a exhibit high semantic overlap due to object-centric bias. (B): Our method explicitly calibrates this proximity, adapting textual distributions to a realistic boundary. (C): This calibrated space mirrors the inherently bounded visual separation between real-world normal and anomalous images InI_n and IaI_a.

To stimulate the anomaly perception capabilities of CLIP, recent approaches [3, 20,35] rely on parameter-efficient fine-tuning, which primarily encompasses prompt tuning and adapter tuning, to construct semantic prototypes for normal and abnormal states. Adapter-based methods [20] enforce strict orthogonality between text prototypes to maximize classification margins. While this discrete semantic isolation enhances mathematical discriminability, mapping highly contiguous visual inputs, where anomalies are merely minor localized perturbations on intact backgrounds, onto drastically orthogonal semantic prototypes inevitably introduces a geometric dilemma. This strict regularization disrupts the continuous feature structure of the pre-trained metric space, potentially compromising generalization capabilities on unseen categories.

To address this structural dilemma, we propose Proximity-CLIP, a framework that visually calibrates the semantic margin to guide visual adaptation. By modeling an anomaly as a proximate semantic shift structurally bounded by the normal feature distribution (see Fig. 1), we introduce a coherent two-stage strategy. In the first stage, we propose a visually-calibrated semantic proximity learning mechanism to preserve structural alignment. By formulating the generation of text prototypes as a continuity-constrained optimization problem, we introduce bounded dynamic proximity regularization. Driven entirely by the actual visual variance, this mechanism dynamically learns an appropriate semantic margin to relax rigid angular constraints. Consequently, the model autonomously establishes a calibrated semantic margin that ensures discriminative separation while preserving the pre-trained structural integrity.

These semantically calibrated prototypes provide explicit inductive biases for subsequent visual adaptation. In the second stage, we design an Anomaly Query Module (AQM) driven by these text priors. Standard visual adaptation typically processes image patches uniformly, which often causes subtle localized defects to be overshadowed by dominant normal backgrounds during global pooling. To bridge this semantic gap, we introduce a semantic-guided querying mechanism. By using the calibrated anomalous prototype as a driving semantic query, the AQM actively retrieves localized defect cues from the contextual visual patches. This module acts as an explicit top-down spotlight, effectively aggregating fine-grained anomalous responses across multi-level visual hierarchies, thereby shifting the process from passive global matching to active, target-aware anomaly retrieval.

The main contributions of this paper are summarized as follows:

We propose Proximity-CLIP, a framework that reformulates ZSAD through text-guided semantic proximity learning, which addresses the geometric dilemma introduced by strict discrete semantic isolation.

We design two synergistic components, including a visually-calibrated semantic proximity learning mechanism that introduces a bounded dynamic regularization to learn an appropriate semantic margin, and an Anomaly Query Module that uses the calibrated anomalous prototype as a semantic query to actively retrieve localized defect cues.

Extensive experiments demonstrate that Proximity-CLIP outperforms current state-of-the-art methods across multiple zero-shot anomaly detection benchmarks while requiring minimal architectural modifications.

References (38)