Agentic Ensemble with Vision-Language Models for Visual Anomaly Detection
Organizations: College of Computing and Data Science, Nanyang Technological University, Singapore. · Manufacturing Engineering, Hyundai Motor Company.
Abstract
Visual anomaly detection aims to detect abnormal objects, while anomaly samples are often scarce during model training. Assembling multiple pretrained detectors can help by leveraging their transferable image scores and anomaly maps. However, most existing ensemble methods apply fixed fusion rules over saved predictions which struggle when pretrained detectors clearly disagree due to different training objectives, priors, and visual representations. To this end, we design AnomalyAgent, a post-training fusion framework for accurate visual anomaly detection. AnomalyAgent aligns heterogeneous scores and maps, summarizes score- and region-level disagreement, and treats fusion as a finite action-selection problem. It implements two types of actions: 1) score actions that determine how to fuse image-level detector confidence via consensus, robust aggregation, detector weighting, or score-map consistency; 2) map actions that fuse dense anomaly responses via consensus, detector weighting, geometric aggregation, or disagreement correction. A constrained vision-language model (VLM) is introduced to inspect high-conflict samples and select valid score action and map action to produce the final prediction. We evaluate AnomalyAgent on MVTec AD and VisA as primary benchmarks, together with seven additional public anomaly benchmarks and Real-IAD for large-scale score-level evaluation. Across these benchmarks, AnomalyAgent consistently improves over equal-weight fusion and achieves the best mean image AUROC and pixel AP among the compared fusion methods on MVTec AD and VisA, while demonstrating robust transfer across additional anomaly domains.
Figures & tables
| Family | Image-score operator | Pixel-map operator |
|---|---|---|
| Consensus | ||
| Robust consensus | ||
| Detector weighting | ||
| Score–map consistency | – | |
| Disagreement correction | – | or |
| Geometric consensus | – |
| Image-level | Pixel-level | |||||
| Method | AUROC | AP | F1 | AUROC | AP | F1 |
| CLIP-based detector pool | ||||||
| AdaCLIP [ 45 ] | 99.17 | 99.66 | 98.34 | 98.99 | 72.31 | 71.47 |
| AnomalyCLIP [ 2 ] | 91.56 | 96.36 | 92.75 | 91.05 | 31.28 | 38.37 |
| WinCLIP [ 1 ] | 93.56 | 96.86 | 93.52 | 96.40 | 49.74 | 54.21 |
| Equal-weight [ 12 ] | 98.80 | 99.50 | 97.95 | 97.83 | 64.43 | 64.87 |
| Image-level | Pixel-level | |||||
| Method | AUROC | AP | F1 | AUROC | AP | F1 |
| CLIP-based detector pool | ||||||
| AdaCLIP [ 45 ] | 93.75 | 94.35 | 89.78 | 95.79 | 28.38 | 38.39 |
| AnomalyCLIP [ 2 ] | 81.97 | 85.34 | 80.44 | 95.43 | 14.14 | 23.12 |
| WinCLIP [ 1 ] | 81.67 | 83.68 | 81.44 | 88.77 | 15.26 | 22.41 |
| Equal-weight [ 12 ] | 91.19 | 92.26 | 87.38 | 97.90 | 30.06 | 38.56 |
| Metric | AdaCLIP [ 45 ] | AnomalyCLIP [ 2 ] | WinCLIP [ 1 ] | Equal [ 12 ] | InvDist [ 61 ] | Voting [ 13 , 14 , 15 ] | Stacking [ 16 ] | AnomalyAgent |
| BTAD | ||||||||
| Image AUROC | 91.32 | 89.12 | 75.55 | 94.22 | 93.80 | 91.15 | 94.21 | 95.31 |
| Image AP | 94.46 | 91.05 | 68.09 | 95.19 | 94.70 | 93.79 | 95.01 | 96.08 |
| Image F1 | 88.92 | 85.99 | 67.22 | 89.78 | 90.49 | 88.44 | 90.12 | 92.96 |
| Pixel AUROC | 93.64 | 93.25 | 95.81 | 97.25 | 96.95 | 92.96 | 96.45 | 97.30 |
| Pixel AP | 41.32 | 35.59 | 34.46 | 49.29 | 47.93 | 31.69 | 47.25 | 49.87 |
| Method | AUROC | AP | F1 |
|---|---|---|---|
| AdaCLIP [ 45 ] | 74.15 | 61.44 | 60.88 |
| AnomalyCLIP [ 2 ] | 68.60 | 53.28 | 56.32 |
| WinCLIP [ 1 ] | 63.45 | 45.88 | 57.25 |
| Equal-weight [ 12 ] | 72.47 | 58.85 | 59.66 |
| AnomalyAgent | 75.53 | 62.54 | 62.49 |
| Dataset | Detector Pair | Score Spearman | Top-response IoU |
|---|---|---|---|
| MVTec AD | AdaCLIP–AnomalyCLIP | 0.615 | 0.160 |
| AdaCLIP–WinCLIP | 0.502 | 0.163 | |
| AnomalyCLIP–WinCLIP | 0.511 | 0.114 | |
| VisA | AdaCLIP–AnomalyCLIP | 0.761 | 0.182 |
| AdaCLIP–WinCLIP | 0.472 | 0.048 | |
| AnomalyCLIP–WinCLIP | 0.436 | 0.042 |
| Dataset | Calibration | Image AUROC | Pixel AP |
|---|---|---|---|
| MVTec AD | Transductive | 98.84 | 64.42 |
| Fixed prefix (64) | 98.75 | 64.71 | |
| VisA | Transductive | 88.19 | 30.14 |
| Fixed prefix (64) | 89.16 | 32.86 |
| Size | Im. AUROC | Im. AP | Im. F1 | Pix. AUROC | Pix. AP | Pix. F1 |
|---|---|---|---|---|---|---|
| 16 | 97.77 | 98.97 | 96.81 | 97.98 | 63.90 | 65.44 |
| 32 | 98.28 | 99.22 | 97.20 | 97.92 | 64.24 | 65.26 |
| 64 | 98.75 | 99.48 | 97.80 | 98.05 | 64.71 | 65.62 |
| 128 | 98.80 | 99.49 | 97.90 | 97.84 | 64.24 | 65.27 |
| Action Bank | Pixel AP | Pixel F1 | Newly Used Action |
|---|---|---|---|
| A1: Equal + Median | 64.433 | 64.867 | – |
| A2: + Detector Weighting | 64.471 | 64.905 | Weighting |
| A3: + Geometric/Consistency | 64.471 | 64.905 | None |
| A4: Full Bank | 64.485 | 64.918 | Disagreement correction |
| Selector | Image AUROC | Image AP | Image F1 | Pixel AUROC | Pixel AP | Pixel F1 |
|---|---|---|---|---|---|---|
| Fallback only | 91.26 | 92.41 | 87.34 | 97.84 | 30.22 | 38.45 |
| Random action selector | 91.24 0.04 | 92.37 0.02 | 87.21 0.05 | 97.75 0.14 | 30.09 0.15 | 38.34 0.12 |
| Deterministic rule selector | 92.72 | 93.01 | 89.84 | 97.90 | 30.91 | 39.21 |
| Historical VLM result | 93.88 | 94.43 | 90.07 | 97.95 | 31.62 | 40.54 |
| Comparison | Image AUROC | Image AP | Pixel AUROC | Pixel AP | Pixel F1 |
|---|---|---|---|---|---|
| Direct VLM Equal | +0.627 [+0.135, +1.489] | +0.447 [+0.033, +1.160] | +0.244 [+0.040, +0.592] | +1.981 [+0.548, +4.175] | +1.793 [+0.607, +3.568] |
| Baseline | Image AUROC | Image AP | Image F1 | Pixel AUROC | Pixel AP | Pixel F1 |
|---|---|---|---|---|---|---|
| WBF | -6.556 | -5.488 | -4.861 | -2.789 | -23.498 | -17.579 |
| Vote-NMS | -16.447 | -14.258 | -8.519 | -3.817 | -30.400 | -24.512 |
| Experiment | Scope | VLM calls |
|---|---|---|
| Main Direct VLM-Agent | MVTec AD / VisA primary settings | 489 |
| Transfer Direct VLM-Agent | 7 additional settings | 1286 |
Anomaly Detection
Anomaly detection finds rare or unexpected patterns in data, from defective products and system faults to fraud and security threats.
See all 657 papers