Co-Evolutionary Prompt Optimization with Cross-Category Transfer for Zero-Shot Anomaly Detection
Authors: Sisi Zhu, Changwei Yu, Renshuai Tao, Zhenliang Ni
Organizations: Institute of Information Science, Beijing Jiaotong University, Beijing, China · Institute of Automation, Chinese Academy of Sciences, Beijing, China
Zero-shot anomaly detection (ZSAD) has gained significant attention for its practical value in industrial inspection. Recently, CLIP-based approaches have been widely adopted in ZSAD due to their strong vision-language generalization capabilities. However, existing methods commonly employ continuous prompt embeddings for prompt optimization and encode semantics in latent vectors, which lack interpretability and scalability. To this end, we propose CoEvoAD, a co-evolutionary framework for discrete prompt selection. CoEvoAD performs prompt search in the discrete natural-language space using an evolutionary algorithm. Candidate prompts are iteratively generated, evaluated, and selected throughout population evolution, thus preserving the interpretability and composability of natural language. Furthermore, we introduce a Cross-Category Transfer Objective (CCTO), which treats held-out source categories as proxies for unseen categories and scores prompt rules based on their estimated cross-category transferability, effectively improving cross-category generalization. Extensive experiments are conducted to validate the effectiveness of CoEvoAD, and the results show that it achieves state-of-the-art performance across multiple anomaly detection datasets. The code is available at https://github.com/rstao-bjtu/CoEvoAD.
Figures & tables
Figure 1: Prompt regimes for ZSAD: handcrafted templates, continuous prompts, and CoEvoAD.
Figure 2: Overview of CoEvoAD. A frozen source-trained scorer evaluates role-separated normal and abnormal rule populations; CCTO uses held-out source categories to select rules for unseen-category inference.
Method → Dataset ↓
WinCLIP (CVPR’23)
AnomalyCLIP (ICLR’24)
AdaCLIP (ECCV’24)
Bayes-PFL (CVPR’25)
MRAD (ICLR’26)
CoEvoAD (Ours)
AUROC ↑
AP ↑
AUROC ↑
AP ↑
AUROC ↑
AP ↑
AUROC ↑
AP ↑
AUROC ↑
AP ↑
AUROC ↑
AP ↑
MVTec-AD
91.8
95.1
91.5
96.2
92.0
96.4
92.3
96.7
94.0
97.4
93.4
96.8
VisA
78.1
77.5
82.1
85.4
83.0
84.9
87.0
89.2
85.7
88.3
87.4
89.7
BTAD
83.3
84.1
89.1
91.1
91.6
92.4
93.2
96.5
92.4
94.2
94.4
96.1
KSDD2
93.5
77.9
92.1
77.8
95.9
95.9
97.3
97.9
95.1
88.9
97.4
97.9
DAGM
89.6
90.4
95.6
94.6
96.5
95.7
97.7
97.0
98.4
98.6
98.2
97.6
Table 1: Image-level benchmark comparison (%) across six anomaly detection datasets. Bold/underline denote best/second-best; “–” marks entries not reported by the original paper.
Method → Dataset ↓
WinCLIP (CVPR’23)
AnomalyCLIP (ICLR’24)
AdaCLIP (ECCV’24)
Bayes-PFL (CVPR’25)
MRAD (ICLR’26)
CoEvoAD (Ours)
AUROC ↑
PRO ↑
AUROC ↑
PRO ↑
AUROC ↑
PRO ↑
AUROC ↑
PRO ↑
AUROC ↑
PRO ↑
AUROC ↑
PRO ↑
MVTec-AD
85.1
64.6
91.1
81.4
86.8
33.8
91.8
87.4
93.0
86.8
92.2
87.9
VisA
79.6
56.8
95.5
87.0
95.1
71.3
95.6
88.9
95.9
88.0
95.8
89.4
BTAD
71.4
32.8
93.3
69.3
87.7
17.1
93.9
76.6
95.4
72.8
94.7
81.9
KSDD2
97.9
91.2
99.1
85.6
99.4
92.7
96.1
70.8
98.9
95.6
99.6
98.5
DAGM
83.2
55.4
99.1
93.6
97.0
40.9
99.3
98.0
97.4
90.3
99.5
98.3
Table 2: Pixel-level benchmark comparison (%; AUROC and Per-Region Overlap (PRO)). Bold/underline denote best/second-best across the six datasets; “–” marks entries not reported by the original paper.
Target
Metric
Control
CoEvoAD
Δ
MVTec-AD
Image AUROC ↑
93.01
93.39
+0.38
Pixel AP ↑
47.48
47.72
+0.24
Pixel F1 ↑
47.69
47.96
+0.27
VisA
Image AUROC ↑
87.05
87.43
+0.38
Pixel AP ↑
30.51
31.11
+0.60
Pixel F1 ↑
36.21
36.72
+0.51
Table 3: Matched comparison. Both systems use the same frozen source-trained scorer and protocol; the control uses class-name prompts without rule search. Δ=CoEvoAD−Control . Seed 111; three-seed means and standard deviations for the two primary directions are reported in Table 17 .
Figure 3: Per-image anomaly score distributions on three representative MVTec-AD categories (Pill, Toothbrush, Hazelnut) under the VisA → MVTec-AD matched protocol. Rows compare AnomalyCLIP, Bayes-PFL, and CoEvoAD; blue/red denote normal/abnormal samples; per-cell AUROC is shown.
Dir.
Metric
Mean Δ
Bot- kΔ
Worst Δ
MVTec
Pixel AP ↑
+0.24
+0.51
− 0.48
Pixel F1 ↑
+0.27
+0.45
− 0.41
VisA
Pixel AP ↑
+0.60
+0.78
− 3.27
Pixel F1 ↑
+0.51
+0.77
− 3.37
Table 4: Per-category Δ statistics (mean, bottom- k , worst) vs the matched control.
Figure 4: Qualitative localization examples on MVTec-AD and VisA. Columns show representative target categories; rows compare ground-truth contours and anomaly maps from CLIP-based baselines and CoEvoAD. Green contours denote annotated anomaly regions; warmer colors indicate higher anomaly scores.
Category
Normal rule
Abnormal rule
screw
clean surface screw
broken shape with missing parts
bottle
normal bottle
irregular visible surface bottle
grid
regular standard grid
faulty flawed abnormal grid
toothbrush
a photo of a healthy toothbrush
faulty toothbrush
pcb2
flawless fine pcb2
structural defect like a hole or cut
cashew
a photo of healthy cashew
faulty flawed cashew
Table 6: Representative natural-language rules selected by CoEvoAD (the leading learned soft-context token is omitted for compactness).
Target
Metric
Baseline
CoEvo
CoEvo +CCTO
MVTec-AD
Image AUROC ↑
93.01
93.06
93.39
Pixel AP ↑
47.48
47.52
47.72
Pixel F1 ↑
47.69
47.67
47.96
VisA
Image AUROC ↑
87.05
87.02
87.43
Pixel AP ↑
30.51
30.98
31.11
Pixel F1 ↑
36.21
36.33
36.72
Table 7: Component ablation comparing matched class-name prompt control, role-separated co-evolution (CoEvo), and CoEvoAD (CoEvo + CCTO). Bold marks the best score per row. Seed 111 ( Table 17 reports multi-seed variation).
Method
Backbone / res.
ms/img
Bayes-PFL (reproduced)
ViT-L/14@336px / 518
221.0
AdaCLIP (released ckpt)
ViT-L/14@336px / 518
114.56
MRAD (released ckpt)
ViT-L/14@336px / 518
103.55
AnomalyCLIP (reproduced)
ViT-L/14@336px / 518
75.97
WinCLIP † (training-free)
ViT-B/16+240 / 240
56.08
Class-name control
ViT-L/14@336px / 518
55.00
Table 8: Per-image inference latency (ms, mean over 300 timed images), timed on the VisA → MVTec-AD direction under one protocol. † : WinCLIP runs its native backbone and resolution, disclosed for completeness but not directly comparable.
Appendix figures & tables45 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset
Classes
Normal
Anomalous
MVTec-AD Bergmann et al. (2019)
15
467
1,258
VisA Zou et al. (2022)
12
962
1,200
BTAD Mishra et al. (2021)
3
451
290
KSDD2 Božič et al. (2021)
1
356
356
RSDD Niu et al. (2021)
1
387
387
DAGM (7-class subset) Wieler et al. (2007)
7
1,350
1,350
Appendix
Table 9: Test-set statistics of the evaluation benchmarks. KSDD2 and RSDD are rebuilt from their official splits into balanced test sets following Bayes-PFL Qu et al. (2025) ; the DAGM row refers to the 7-class subset used in our protocol ( Table 20 ).
Component
Setting
Backbone
CLIP ViT-L/14@336px
Input resolution
518×518
Stage 1 epochs / optimiser
30 / AdamW, cosine annealing
Stage 1 learning rates
prompt 1×10−3 , other 1×10−4
Prompt groups M / context Lc / state Ls
3 / 5 / 5
Search population N
16
Appendix
Table 10: Full implementation and hyperparameters.
Variant
AUROC
AP px
Full training setup (control)
93.01
47.48
− mask-guided crop
92.94 ( − 0.07)
46.35 ( − 1.13)
− inter-role margin
92.83 ( − 0.18)
47.04 ( − 0.44)
− agnostic reg.
93.01 ( ± 0.00)
47.09 ( − 0.39)
Appendix
Table 11: Ablation of Stage 1 training components on the class-name control. Each row removes one component from the fixed scorer training.
Dir.
∣Csrc∣
N
G
K
Evals/role
Wall-clock
MVTec (src VisA)
12
16
5
3
960
∼ 3 h 47 m
VisA (src MVTec-AD)
15
16
5
3
1200
∼ 5 h 34 m
Appendix
Table 12: Rule-search cost. ∣Csrc∣ : number of source categories. Evals/role =N×G×∣Csrc∣ ; both roles are scored each generation.
∣Csrc∣
Evals/role
Wall-clock (h)
s/eval
3
240
0.34
5.1
6
480
1.12
8.4
9
720
2.38
11.9
12
960
3.71
13.9
Appendix
Table 13: Measured search-cost scaling with the source-category count (VisA → MVTec-AD configuration, single RTX 4090). Evals/role =N×G×∣Csrc∣ ; s/eval is wall-clock divided by this per-role count.
MVTec-AD
VisA
Method
Role-sep.
CCTO
AUROC img
AP px
AUROC img
AP px
Class-name control (R0)
✗
✗
93.01
47.48
87.05
30.51
Random prompt-pair search
✗
✗
93.09
47.47
86.10
31.03
Random prompt-pair search + CCTO
✗
✓
93.23
47.45
86.90
30.80
Single-population evolutionary algorithm
✗
✗
93.15
47.43
86.81
30.58
Single-population evolutionary algorithm + CCTO
✗
✓
93.24
47.54
86.90
30.62
Appendix
Table 14: Extended same-budget prompt-search control table with CCTO-augmented variants. All search rows use the same frozen scorer and candidate budget; R0 is the non-search class-name reference; seed 111.
AUROC img
AP px
F1 px
Category
C
E
Δ
C
E
Δ
C
E
Δ
bottle
94.76
94.84
+0.08
67.19
66.97
− 0.22
63.09
62.92
− 0.17
cable
82.27
83.36
+1.09
12.49
12.01
− 0.48
20.09
19.98
− 0.11
capsule
94.50
94.30
− 0.20
36.72
36.67
− 0.05
39.85
39.44
− 0.41
carpet
100.00
100.00
+0.00
82.69
82.98
+0.29
74.93
75.22
+0.29
grid
100.00
100.00
+0.00
41.38
40.97
− 0.41
42.70
42.75
+0.05
Appendix
Table 15: Per-category breakdown for the MVTec direction (VisA → MVTec-AD). C: strict class-name control. E: CoEvoAD. Δ= E − C (pp). Image AUROC / pixel AP / pixel F1. Values are single-seed (seed 111); 3-seed means per routed category are reported in Table 24 , and per-category three-seed mean ± std in Table 18 .
AUROC img
AP px
F1 px
Category
C
E
Δ
C
E
Δ
C
E
Δ
candle
90.02
90.67
+0.65
33.69
33.53
− 0.16
44.08
43.55
− 0.53
capsules
92.95
91.95
− 1.00
49.56
52.27
+2.71
54.92
55.78
+0.86
cashew
93.84
93.36
− 0.48
36.35
37.40
+1.05
42.16
42.68
+0.52
chewinggum
97.38
97.00
− 0.38
83.18
83.12
− 0.06
75.45
75.53
+0.08
fryum
90.68
90.92
+0.24
27.95
27.60
− 0.35
33.19
32.92
− 0.27
Appendix
Table 16: Per-category breakdown for the MVTec-AD → VisA direction. C: strict class-name control. E: CoEvoAD (MVTec-AD → VisA main config). Δ= E − C (pp). The MVTec-AD → VisA gain is dominated by a few categories ( pipe_fryum +4.05 AP px , pcb4 − 3.27 AP px ). Values are single-seed (seed 111); 3-seed means per routed category are reported in Table 25 ( pipe_fryum +1.96 , pcb4 −2.18 AP px ), and per-category three-seed mean ± std in Table 18 .
VisA → MVTec-AD
MVTec-AD → VisA
AUROC img
AP px
AUROC img
AP px
Seed 111
93.39
47.72
87.43
31.11
Seed 222
93.13
47.37
87.05
30.79
Seed 333
93.26
47.45
87.46
31.19
Mean ± std
93.26 ± 0.13
47.51 ± 0.18
87.31 ± 0.23
31.03 ± 0.21
Appendix
Table 17: Multi-seed stability over seeds 111, 222, and 333. We report per-seed results together with mean and standard deviation under the matched protocol.
Category
AUROC img
AP px
VisA → MVTec-AD
bottle
94.84 ± 0.00
67.03 ± 0.20
cable
83.55 ± 0.32
12.09 ± 0.20
capsule
94.31 ± 0.02
36.60 ± 0.06
carpet
100.00 ± 0.00
82.77 ± 0.19
grid
100.00 ± 0.00
41.16 ± 0.17
Appendix
Table 18: Per-category three-seed mean ± std of CoEvoAD over the same three independent search runs as Table 17 (deployed configuration per direction). Std is the sample standard deviation over seeds 111/222/333.
Source
Target
AUROC img C → E
Δ AUROC px
Δ AUPRO
Δ AP px
Δ F1 px
MVTec
BTAD
92.81 → 92.68
+0.45
+0.47
+0.61
+1.56
MVTec
DAGM
93.82 → 93.56
− 0.12
− 0.46
+0.81
+0.35
MVTec
DTD
93.77 → 93.99
+0.12
+0.25
+0.04
+0.32
MVTec
KSDD2
96.04 → 95.94
+0.01
+0.09
+0.14
+0.21
MVTec
RSDD
97.69 → 97.62
+0.02
+0.10
+2.91
+0.99
MVTec
Mean
94.83 → 94.76
+0.10
+0.09
+0.90
+0.69
Appendix
Table 19: External industrial benchmarks, all five targets, both source conventions. AUROC img : control → CoEvoAD (%). Δ columns: CoEvoAD − matched strict control (pp).
Method
DAGM
DTD-Synthetic
Same 7-class DAGM subset
AnomalyCLIP †
96.3
94.3
Bayes-PFL †
97.35
96.28
CoEvoAD
98.19
94.25
Original publication reports
WinCLIP
87.6
83.9
Appendix
Table 20: Image-level AUROC (%) on texture-oriented external targets. † denotes evaluation on our 7-class DAGM subset; unmarked DAGM numbers follow the standard 10-class reporting convention.
Category
C (Bayes-PFL)
E (CoEvoAD)
Δ
blotchy
94.06
75.75
−18.31
matted1
88.10
80.95
−7.15
marbled2
99.00
96.50
−2.50
fibrous
99.94
98.69
−1.25
mesh
91.15
92.64
+1.49
perforated
93.00
96.44
+3.44
Appendix
Table 21: Per-class image-level AUROC (%) on DTD-Synthetic. C: Bayes-PFL (matched VisA-source reproduction). E: CoEvoAD. Δ= E − C.
Dir.
Metric
Mean Δ
95% CI
#Up
#Down
#Tie
MVTec
AUROC img
+0.38
[+0.10, +0.66]
8
2
5
AP px
+0.24
[ − 0.03, +0.51]
9
6
0
F1 px
+0.27
[+0.06, +0.47]
11
4
0
VisA
AUROC img
+0.37
[ − 0.19, +0.93]
7
5
0
AP px
+0.60
[ − 0.38, +1.58]
7
5
0
F1 px
+0.51
[ − 0.47, +1.49]
8
4
0
Appendix
Table 22: Paired category-level mean differences with 95% confidence intervals. Δ= CoEvoAD − matched control, averaged over categories ( n=15 for the VisA → MVTec-AD direction, n=12 for the MVTec-AD → VisA direction). CI is the normal-approximation 95% interval of the per-category Δ . Differences of ± 0.01 from Table 3 reflect different rounding paths (aggregate vs per-category).
MVTec-AD
VisA
Route
Sem
Tmpl
AUROC img
AP px
AUROC img
AP px
R0 (control)
✗
✗
93.01
47.48
87.05
30.51
R1 (sem-only)
✓
✗
93.39
47.72
87.21
30.85
R2 (tmpl-only)
✗
✓
93.13
47.49
87.11
31.51
R3 (both)
✓
✓
93.39
47.72
87.21
30.85
Appendix
Table 23: Test-time transfer ablation. R0 is the class-name control; Sem/Tmpl denote nearest-source/template transfer.
Category
Donor
Sim
Δ AUROC img
Δ AP px
Δ F1 px
bottle
candle
0.810
+0.08
− 0.16
− 0.09
cable
macaroni1
0.758
+1.28
− 0.40
+0.01
capsule
capsules
0.903
− 0.19
− 0.12
− 0.34
carpet
fryum
0.799
+0.00
+0.08
+0.07
grid
fryum
0.803
+0.00
− 0.22
+0.11
hazelnut
cashew
0.848
+0.02
+0.90
+0.56
Appendix
Table 24: Per-class routing audit, VisA → MVTec-AD: routed donor, semantic similarity, and deltas vs. the class-name control (pp, 3-seed means; single-seed values in Table 15 , policy tags in Table 31 ). The control is a single run; seed variance is method-side (cf. Table 17 ).
Category
Donor
Sim
Δ AUROC img
Δ AP px
Δ F1 px
candle
bottle
0.810
+0.83
+0.75
− 0.06
capsules
capsule
0.903
− 0.65
+2.95
+1.66
cashew
hazelnut
0.848
− 0.34
+0.04
− 0.15
chewinggum
toothbrush
0.716
− 0.23
+0.03
+0.12
fryum
pill
0.819
+0.21
+0.71
+0.39
macaroni1
pill
0.826
− 0.39
+0.07
+0.88
Appendix
Table 25: Per-class routing audit, MVTec-AD → VisA (pp, 3-seed means; single-seed values in Table 16 , policy tags in Table 32 ).
MVTec
VisA
Forced route
AUROC img / AP px / F1 px
Actual route (anchor, absolute)
93.39 / 47.72 / 47.96
87.43 / 31.11 / 36.72
Random donor (expectation)
− 0.21 / − 0.25 / − 0.28
− 0.25 / − 0.11 / − 0.02
Worst donor (adversarial)
− 0.54 / − 0.95 / − 0.88
− 2.26 / − 2.47 / − 2.35
Oracle donor (not zero-shot)
+0.14 / +0.48 / +0.35
+1.47 / +2.29 / +2.29
Appendix
Table 26: Donor-forced counterfactual aggregates ( Δ vs. the actual route, pp; negative = worse). Anchor row: absolute scores of the actual route under this surface. Oracle uses target labels (not zero-shot; reference only).
AUROC img
AP px
F1 px
Category
Act.
Rand.
Worst
Orac.
Act.
Rand.
Worst
Orac.
Act.
Rand.
Worst
Orac.
bottle
94.84
94.92
94.76
95.16
66.97
67.88
66.79
68.46
62.92
63.62
62.78
64.09
cable
83.36
83.09
82.38
83.85
12.01
12.61
12.01
13.19
19.98
20.36
19.98
20.99
capsule
94.30
94.46
94.14
94.81
36.67
36.89
36.36
37.36
39.44
39.84
39.34
40.40
carpet
100.00
100.00
100.00
100.00
82.98
82.76
82.50
83.03
75.22
74.98
74.76
75.22
grid
100.00
99.99
99.92
100.00
40.97
41.22
40.80
41.63
42.75
42.70
42.11
43.04
Appendix
Table 27: Per-class donor-forced counterfactual envelope, VisA → MVTec-AD (absolute scores under the forced-route surface; in-family comparison only). Act.: actual route; Rand.: uniform-random expectation over donors; Worst/Orac.: per-class minimum/maximum over the donor bank (oracle uses target labels; not zero-shot).
AUROC img
AP px
F1 px
Category
Act.
Rand.
Worst
Orac.
Act.
Rand.
Worst
Orac.
Act.
Rand.
Worst
Orac.
candle
90.67
90.63
89.79
91.75
33.53
33.96
31.99
36.12
43.55
43.94
42.61
45.79
capsules
91.95
92.81
91.60
94.03
52.27
51.45
44.31
55.32
55.78
56.38
49.35
59.93
cashew
93.36
93.33
92.46
94.20
37.40
37.41
35.47
40.90
42.68
43.01
41.50
45.55
chewinggum
97.00
97.15
96.88
97.48
83.12
82.99
81.19
83.82
75.53
75.43
74.35
76.00
fryum
90.92
91.01
90.48
92.36
27.60
28.45
27.06
30.50
32.92
33.64
32.47
35.17
Appendix
Table 28: Per-class donor-forced counterfactual envelope, MVTec-AD → VisA (same protocol and reading as Table 27 ).
Src cat.
Evolved normal rule
Evolved abnormal rule
candle
X clean intact candle
X visible anomaly on object
capsules
X a photo of a capsules
X plain damaged capsules
cashew
X a photo of healthy cashew
X faulty flawed cashew
chewinggum
X typical intact with chewinggum
X anomalous abnormal textural chewinggum
fryum
X a view of pristine good fryum
X item: defect in fryum
macaroni1
X a picture of macaroni1
X defective visible textural macaroni1
Appendix
Table 29: Evolved prompt rules per VisA source category, for the VisA → MVTec-AD direction. Default = X normal/abnormal {cat} .
Src cat.
Evolved normal rule
Evolved abnormal rule
bottle
X normal bottle
X irregular visible surface bottle
cable
X typical cable
X an anomalous cable sample
capsule
X a standard capsule product
X a deformed structure capsule sample
carpet
X pristine surface carpet
X faulty blemished carpet
grid
X regular standard grid
X faulty flawed abnormal grid
hazelnut
X hazelnut
X abnormal faulty flawed hazelnut
Appendix
Table 30: Evolved prompt rules per MVTec-AD source category, for the MVTec-AD → VisA direction. Default = X normal/abnormal {cat} .
Target
Nearest source
Sim
Route tag
bottle
candle
0.810
semantic (abn. fallback)
cable
macaroni1
0.758
semantic transfer
capsule
capsules
0.903
semantic transfer
carpet
fryum
0.799
semantic transfer
grid
fryum
0.804
semantic transfer
hazelnut
cashew
0.848
semantic transfer
Appendix
Table 31: VisA → MVTec-AD transfer policy: MVTec-AD target → VisA source. Sim = cosine similarity; Tag = policy tag.
Target
Nearest source
Sim
Route tag
candle
bottle
0.810
semantic transfer
capsules
capsule
0.903
semantic transfer
cashew
hazelnut
0.848
semantic transfer
chewinggum
toothbrush
0.716
semantic transfer
fryum
pill
0.819
semantic transfer
macaroni1
pill
0.826
semantic transfer
Appendix
Table 32: MVTec-AD → VisA transfer policy: VisA target → MVTec-AD source.
Figure A1: Analysis of selected rule embeddings. We report within-role cosine similarity and cross-role distance for the text embeddings of selected normal and abnormal rules.
Figure A2: Qualitative localization on MVTec-AD bottle . Top: input with ground-truth contours; bottom: CoEvoAD anomaly map.
Figure A3: Qualitative localization on MVTec-AD capsule .
Figure A4: Qualitative localization on MVTec-AD carpet .
Figure A5: Qualitative localization on MVTec-AD grid .
Figure A6: Qualitative localization on MVTec-AD hazelnut .
Figure A7: Qualitative localization on MVTec-AD leather .
Figure A8: Qualitative localization on MVTec-AD screw .
Figure A9: Qualitative localization on MVTec-AD tile .
Figure A10: Qualitative localization on MVTec-AD wood .
Figure A11: Qualitative localization on MVTec-AD zipper .
Figure A12: Qualitative localization on VisA candle .
Figure A13: Qualitative localization on VisA capsules .
Figure A14: Qualitative localization on VisA cashew .
Figure A15: Qualitative localization on VisA chewinggum .
Figure A16: Qualitative localization on VisA macaroni1 .
Figure A17: Qualitative localization on VisA pipe_fryum .
Figure A18: Qualitative localization on BTAD wood .
Figure A19: Qualitative localization on DAGM fabric2 .
Figure A20: Qualitative localization on KSDD2 metal .
Figure A21: Qualitative localization on RSDD metal15 .
Zero-Shot Anomaly Detection (ZSAD) aims to detect anomalies in unseen domains without target-domain adaptation. Recent CLIP-based methods have shown promising performance by leveraging prompt learning and visual-text alignment. However, most existing approaches rely on a single adaptation pathway, which may be insufficient for heterogeneous anomaly patterns across domains. In practice, anomalies exhibit vastly different characteristics, ranging from salient, localized structural disruptions to subtle, diffuse, and irregular variations. To address this challenge, we propose EntroAD, a structural entropy-guided zero-shot anomaly detection framework. Unlike previous methods, EntroAD introduces a dynamic routing mechanism to process different types of anomalies with specialized adaptation strategies. Specifically, we estimate patch-level structural entropy from self-attention-induced patch relations and use it as a proxy for relational uncertainty to guide anomaly-aware token routing. Based on this routing signal, we construct anomaly-aware routed tokens to better capture anomaly cues with different structural characteristics. We further introduce a confidence-aware dual-branch prompt adaptation module to stabilize visual-text alignment while preserving CLIP's transferable prior. Extensive experiments on 10 industrial and medical benchmarks show that EntroAD achieves state-of-the-art performance in challenging cross-dataset ZSAD settings.
Vision-language models have recently shown strong generalization in zero-shot anomaly detection (ZSAD), enabling the detection of unseen anomalies without task-specific supervision. However, existing approaches typically rely on fixed textual prompts, which struggle to capture complex semantics, and focus solely on spatial-domain features, limiting their ability to detect subtle anomalies. To address these challenges, we propose a wavelet-enhanced mixture-of-experts prompt learning method for ZSAD. Specifically, a variational autoencoder is employed to model global semantic representations and integrate them into prompts to enhance adaptability to diverse anomaly patterns. Wavelet decomposition extracts multi-frequency image features that dynamically refine textual embeddings through cross-modal interactions. Furthermore, a semantic-aware mixture-of-experts module is introduced to aggregate contextual information. Extensive experiments on 14 industrial and medical datasets demonstrate the effectiveness of the proposed method.
Peng Chen, Chao Huang
School of Cyber Science and Technology, Shenzhen Campus of Sun Yat-sen University, Shenzhen
Zero-shot anomaly detection (ZSAD) aims to detect and localize anomalies in unseen categories without access to target-specific training data. Although recent CLIP-based methods have demonstrated promising generalization through vision-language alignment, they remain limited in capturing diverse anomaly semantics and subtle local variations. To address these limitations, we propose VFAD, a unified framework that combines variational semantic prompting with frequency-adaptive representation learning. Specifically, we introduce a Variational Semantic Prompt Extractor (VSPE), which adaptively aggregates anomaly-relevant local semantics from dense patch tokens and regularizes them through a variational information bottleneck, thereby incorporating fine-grained visual cues and enabling more precise cross-modal alignment. Furthermore, we develop a Frequency-Adaptive Representation Aggregation (FARA) module that leverages wavelet-based frequency decomposition and frequency-specific expert aggregation to enhance anomaly-discriminative visual representations. By jointly strengthening semantic guidance and visual representation learning, VFAD improves both anomaly discrimination and fine-grained localization. Extensive experiments on 13 industrial and medical benchmarks demonstrate that VFAD consistently outperforms existing state-of-the-art ZSAD methods across diverse anomaly scenarios. The code will be publicly available upon publication.
Peng Chen, Kaige Li, Wei Wang +5
School of Cyber Science and Technology, Shenzhen Campus of Sun Yat-sen University, Shenzhen, China