SCRA-CLIP: Spherical-Contextual Representation Adaptation for Zero-Shot Anomaly Detection
Organizations: Shenzhen Campus of Sun Yat-sen University · Hunan University
Abstract
Recent advances in vision-language models have facilitated zero-shot anomaly detection (ZSAD) through transferable visual-semantic representations. However, detecting fine-grained anomalies remains challenging due to inadequate modeling of diverse anomaly patterns and their spatial context. To address these challenges, we propose SCRA-CLIP, a Spherical-Contextual Representation Adaptation framework that jointly enhances anomaly-aware textual semantics and context-sensitive visual representations. Specifically, we introduce Spherical Prototype-Conditioned Prompting (SPCP), which employs von Mises--Fisher mixtures to model the directional distributions of normal and abnormal patch features. These state-specific prototypes are incorporated into textual contexts to guide the learning of more discriminative textual representations. Furthermore, we develop Context-Deviation Guided Visual Adaptation (CGVA), which captures local feature deviations relative to multi-scale neighborhood contexts and refines patch representations through adaptive gating. By integrating distribution-aware semantic modeling with context-sensitive visual adaptation, SCRA-CLIP facilitates more discriminative cross-modal matching for fine-grained anomaly detection and localization. Extensive experiments on 11 industrial and medical benchmarks demonstrate the effectiveness and generalization capability of SCRA-CLIP across diverse unseen categories and domains. The code will be publicly available upon publication.
Figures & tables
| Method | Venue | Industrial Defects | Medical Anomalies | ||||||
|---|---|---|---|---|---|---|---|---|---|
| VisA | MVTec-AD | BTAD | DAGM | DTD-Synthetic | ISIC | CVC-ClinicDB | Kvasir | ||
| CLIP [ 26 ] | ICML’21 | 46.6 | 38.4 | 30.6 | 30.6 | 33.9 | 33.1 | 47.5 | 44.6 |
| CoOp [ 37 ] | IJCV’22 | 24.2 | 33.3 | 15.4 | 17.5 | 66.5 | 51.7 | 34.8 | 44.1 |
| WinCLIP [ 16 ] | CVPR’23 | 79.6 | 85.1 | 72.7 | 87.6 | 83.9 | 83.3 | 51.2 | 69.7 |
| CLIP-AD [ 6 ] | IJCAI’24 | 95.0 | 89.8 | 93.1 | 96.5 | 97.1 | 81.6 | 85.8 | 82.5 |
| AnomalyCLIP [ 38 ] | ICLR’24 | 95.5 | 91.1 | 94.2 | 95.6 | 97.9 | 88.4 | 82.9 | 78.9 |
| Method | Venue | Industrial Defects | Medical Anomalies | ||||||
|---|---|---|---|---|---|---|---|---|---|
| VisA | MVTec-AD | BTAD | DAGM | DTD-Synthetic | HeadCT | BrainMRI | Br35H | ||
| CLIP [ 26 ] | ICML’21 | 66.4 | 74.1 | 34.5 | 79.6 | 71.6 | 56.5 | 73.9 | 78.4 |
| CoOp [ 37 ] | IJCV’22 | 62.8 | 88.8 | 66.8 | 87.5 | 63.4 | 78.4 | 61.3 | 86.0 |
| WinCLIP [ 16 ] | CVPR’23 | 78.8 | 91.8 | 68.2 | 91.8 | 93.2 | 83.7 | 86.6 | 80.5 |
| CLIP-AD [ 6 ] | IJCAI’24 | 79.8 | 89.8 | 85.8 | 90.8 | 91.5 | 93.8 | 92.8 | 96.0 |
| AnomalyCLIP [ 38 ] | ICLR’24 | 82.1 | 91.5 | 88.3 | 97.5 | 93.5 | 95.3 | 90.3 | 94.6 |
| SPCP | CGVA | MVTec-AD | VisA | ||
|---|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | ||
| ✗ | ✗ | 89.0 | 90.3 | 84.1 | 94.5 |
| ✓ | ✗ | 91.7 | 90.9 | 86.7 | 94.9 |
| ✗ | ✓ | 90.3 | 91.7 | 85.6 | 95.6 |
| ✓ | ✓ | 92.4 | 92.3 | 87.2 | 96.0 |
| Prototype Modeling | MVTec-AD | VisA | ||
|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | |
| K-means Prototypes | 90.6 | 91.1 | 85.1 | 94.9 |
| Learnable Prototypes | 90.9 | 91.5 | 85.8 | 95.3 |
| Spherical Prototypes | 91.8 | 91.9 | 86.5 | 95.3 |
| vMF Mixture (Ours) | 92.4 | 92.3 | 87.2 | 96.0 |
| MVTec-AD | VisA | |||
|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | |
| 4 | 91.3 | 91.5 | 85.8 | 95.3 |
| 8 | 91.9 | 92.0 | 86.5 | 95.7 |
| 16 | 92.4 | 92.3 | 87.2 | 96.0 |
| 32 | 92.3 | 92.4 | 87.0 | 95.9 |
| 64 | 92.1 | 92.2 | 86.9 | 95.6 |
| MVTec-AD | VisA | ||||
|---|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | ||
| ✗ | ✗ | 91.2 | 91.8 | 86.0 | 95.5 |
| ✗ | ✓ | 91.8 | 91.9 | 86.6 | 95.6 |
| ✓ | ✗ | 91.5 | 92.1 | 86.3 | 95.8 |
| ✓ | ✓ | 92.4 | 92.3 | 87.2 | 96.0 |
Zero-Shot Anomaly Detection
Zero-shot anomaly detection finds unusual patterns in unseen domains without task-specific labeled examples.
See all 93 papers