Authors: Aggelos Psiris, Yannis Panagakis, Maria Vakalopoulou, Georgios Th. Papadopoulos
Organizations: Harokopio University of Athens, Athens, Greece · National and Kapodistrian University of Athens, Athens, Greece · Archimedes, Athena Research Center, Athens, Greece · CentraleSupelec, University Paris Saclay, Paris, France
Few-Shot Industrial Visual Anomaly Detection (FS-IVAD) comprises a critical task in modern manufacturing settings, where automated product inspection systems need to identify rare defects using only a handful of normal/defect-free training samples. In this context, the current study introduces a novel reconstruction-based approach termed GATE-AD. In particular, the proposed framework relies on the employment of a masked, representation-aligned Graph Attention Network (GAT) encoding scheme to learn robust appearance patterns of normal samples. By leveraging dense, patch-level, visual feature tokens as graph nodes, the model employs stacked self-attentional layers to adaptively encode complex, irregular, non-Euclidean, local relations. The graph is enhanced with a representation alignment component grounded on a learnable, latent space, where high reconstruction residual areas (i.e., defects) are assessed using a Scaled Cosine Error (SCE) objective function. Extensive comparative evaluation on the MVTec AD, VisA, and MPDD industrial defect detection benchmarks demonstrates that GATE-AD achieves state-of-the-art performance across the 1- to 8-shot settings, combining the highest detection accuracy (increase up to 1.8% in image AUROC in the 8-shot case in MPDD) with the lowest per-image inference latency (at least 25.05% faster), compared to the best-performing literature methods. In order to facilitate reproducibility and further research, the source code of GATE-AD is available at https://github.com/gthpapadopoulos/GATE-AD.
Figures & tables
Figure 1: General architecture of the proposed masked, representation-aligned GAT encoding scheme for FS-IVAD.
Method
MVTec AD
VisA
MPDD
Image
Pixel
Image
Pixel
Image
Pixel
AUROC
mAP
AUROC
PRO
AUROC
mAP
AUROC
PRO
AUROC
mAP
AUROC
PRO
1-shot
SPADE [ 4 ] (arXiv’20)
82.9 ± 2.6
91.7 ± 1.2
92.0 ± 0.3
85.7 ± 0.7
80.7 ± 5.0
82.3 ± 4.3
96.2 ± 0.4
85.7 ± 1.1
-
-
-
-
PatchCore [ 23 ] (CVPR’22)
83.4 ± 3.0
92.2 ± 1.5
92.0 ± 1.0
79.7 ± 2.0
79.9 ± 2.9
82.8 ± 2.3
95.4 ± 0.6
80.5 ± 2.5
-
-
-
-
GraphCore [ 30 ] (ICLR’23)
89.9
-
95.6
-
-
-
-
-
84.7
-
95.2
-
Table 1: FS-IVAD detection results on the MVTec AD, VisA, and MPDD benchmarks. Methods with an asterisk (*) use the standardized sample selection process (Seed: 0 ).
Figure 2: Indicative 1 -shot defect detection results. GATE-AD localizes more accurately and robustly defects, across multiple pose, placement, and abnormality type settings.
MVTec AD
VisA
MPDD
Shot–Method
I-AUROC
P-AUROC
I-AUROC
P-AUROC
I-AUROC
P-AUROC
1-shot
GATE-AD
97.7 ± 0.2
96.3 ± 0.1
93.5 ± 0.2
97.7 ± 0.1
84.3 ± 1.1
97.4 ± 0.2
GATE-AD (GCN)
97.3 ± 0.2
95.9 ± 0.2
92.7 ± 0.4
97.4 ± 0.1
82.1 ± 0.9
95.7 ± 0.1
TE
97.1 ± 0.2
95.7 ± 0.1
93.4 ± 0.2
97.5 ± 0.1
82.4 ± 0.9
96.3 ± 0.1
GATE-AD w/o RA
94.1 ± 0.5
95.1 ± 0.1
80.5 ± 0.3
96.0 ± 0.2
55.7 ± 1.1
94.4 ± 0.4
Table 2: FS-IVAD ablation study on the MVTec AD, VisA, and MPDD benchmarks.
Figure 3: FS-IVAD detection performance (image-level AUROC) versus per-image inference time (ms), under the 1 -shot setting on the MVTec AD benchmark.
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Effect of the input image resolution on the MVTec AD and VisA benchmarks.
Figure 5: Effect of the backbone on the MVTec AD, VisA, and MPDD benchmarks.
Figure 6: Effect of the number of last transformer layers on the MVTec and VisA benchmarks.
Figure 7: Effect of the number of attentional layers on the MVTec AD and VisA benchmarks.
Figure 8: Effect of the cardinality of the GAT layers on the MVTec AD and VisA benchmarks.
Figure 9: Effect of the cardinality of the latent representation on the MVTec AD and VisA benchmarks.
Figure 10: Effect of the objective function on the MVTec AD and VisA benchmarks.
Figure 11: Effect of the masking ratio on the MVTec and VisA benchmarks.
Figure 12: Effect of the dropout rate ablation on the MVTec and VisA benchmarks.
Figure 13: Effect of the anomalous patches ratio on the MVTec AD and VisA benchmarks.
Object
1-shot
2-shot
4-shot
8-shot
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
Image AUROC (%)
Bottle
100.0 ± 0.0
99.7 ± 0.2
99.8 ± 0.1
99.9 ± 0.1
100.0 ± 0.0
99.9 ± 0.1
100.0 ± 0.0
100.0 ± 0.0
Cable
94.7 ± 0.1
92.7 ± 0.8
95.5 ± 0.1
92.4 ± 1.1
94.3 ± 0.1
93.8 ± 0.9
95.0 ± 0.4
95.2 ± 0.3
Capsule
93.1 ± 0.1
90.2 ± 5.5
94.3 ± 0.7
89.2 ± 7.9
95.0 ± 0.9
95.8 ± 0.5
95.8 ± 0.8
95.6 ± 0.5
Carpet
99.8 ± 0.0
100.0 ± 0.0
99.9 ± 0.0
100.0 ± 0.0
99.8 ± 0.0
100.0 ± 0.0
99.9 ± 0.0
100.0 ± 0.0
Appendix
Table 3: FS-IVAD object-level detection results for GATE-AD and AnomalyDINO on the MVTec AD benchmark. Both methods use the standardized sample selection process (Seed: 0 ).
Object
1-shot
2-shot
4-shot
8-shot
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
Image AUROC (%)
Candle
97.8 ± 0.4
87.9 ± 0.3
97.6 ± 0.3
89.4 ± 3.0
97.5 ± 0.3
91.3 ± 2.9
97.7 ± 0.2
93.5 ± 1.2
Capsules
99.3 ± 0.3
98.4 ± 0.5
99.5 ± 0.2
98.9 ± 0.1
99.6 ± 0.2
99.2 ± 0.1
99.6 ± 0.2
99.2 ± 0.1
Cashew
95.5 ± 0.4
86.1 ± 3.6
96.1 ± 0.2
89.4 ± 3.8
98.7 ± 0.2
94.5 ± 0.7
98.6 ± 0.2
95.3 ± 0.6
Chewing gum
98.8 ± 0.2
98.0 ± 0.4
99.1 ± 0.1
98.6 ± 0.4
99.3 ± 0.1
98.8 ± 0.2
99.4 ± 0.1
98.8 ± 0.2
Appendix
Table 4: FS-IVAD object-level detection results for GATE-AD and AnomalyDINO on the VisA benchmark. Both methods use the standardized sample selection process (Seed: 0 ).
Object
1-shot
2-shot
4-shot
8-shot
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
GATE-AD
AnomalyDINO
Image AUROC (%)
Bracket black
83.7 ± 3.0
51.0 ± 6.5
83.4 ± 2.0
59.4 ± 8.0
80.9 ± 2.0
64.2 ± 8.1
85.7 ± 0.6
69.5 ± 2.7
Bracket brown
49.7 ± 1.9
52.0 ± 4.6
51.7 ± 1.3
56.8 ± 4.4
56.1 ± 2.1
58.6 ± 1.2
57.0 ± 2.0
61.3 ± 2.8
Bracket white
80.8 ± 3.3
70.8 ± 2.3
81.1 ± 2.2
72.0 ± 2.8
81.0 ± 1.9
65.7 ± 16.7
93.3 ± 1.7
72.5 ± 20.1
Connector
93.8 ± 1.0
80.6 ± 4.1
91.8 ± 0.8
83.1 ± 3.8
89.4 ± 1.0
83.7 ± 1.7
93.6 ± 1.3
87.9 ± 3.1
Appendix
Table 5: FS-IVAD object-level detection results for GATE-AD and AnomalyDINO on the MPDD benchmark. Both methods use the standardized sample selection process (Seed: 0 ).
Figure 14: Indicative 1 -shot defect detection results on the MVTec AD benchmark.
Figure 15: Indicative 1 -shot defect detection results on the VisA benchmark.
Figure 16: Indicative 1 -shot defect detection results on the MPDD benchmark.
Figure 17: Indicative examples of defect detection failure cases across the MVTec AD, VisA, and MPDD benchmarks.
MVTec AD
VisA
MPDD
Method
Training
Inference
Training
Inference
Training
Inference
GATE-AD
6.7 ± 0.9
0.03 ± 0.00
7.8 ± 0.9
0.04 ± 0.00
4.8 ± 0.6
0.03 ± 0.00
GATE-AD (GCN)
9.0 ± 3.5
0.03 ± 0.00
10.4 ± 3.4
0.04 ± 0.00
4.4 ± 0.3
0.03 ± 0.00
TE
62.9 ± 16.1
0.04 ± 0.00
83.1 ± 23.4
0.06 ± 0.00
46.6 ± 10.0
0.05 ± 0.00
GATE-AD w/o RA
25.4 ± 4.0
0.04 ± 0.00
28.4 ± 3.9
0.05 ± 0.00
14.8 ± 0.3
0.04 ± 0.00
GATE-AD AE
16.1 ± 6.5
0.04 ± 0.00
19.0 ± 6.7
0.05 ± 0.00
18.6 ± 1.3
0.04 ± 0.00
Appendix
Table 6: Per-image training and inference time (ms) on the MVTec AD, VisA, and MPDD benchmarks.
Few-shot industrial anomaly detection (FS-IAD) focuses on detecting and localizing visual defects in industrial inspection during the cold-start phase, where only a limited number of normal training samples are available per category. Recent advances in this field predominantly leverage visual features from foundation-model and have achieved promising performance. Despite the strong representational power of foundation-model features, the model generalization remains fragile due to the extreme scarcity of normal training data.To address this pivotal issue, we propose ConceptADapt, a concept-guided adaptive feature reconstruction model with dynamic attention. Specifically, our model pre-learns a set of fixed normal concepts from the limited support features and leverages them to mine relationships with query features, thereby recalibrating their statistics for improved anomaly detection at test time. To mitigate the prevalent feature shortcut problem, which is particularly severe under low-data regimes, we further develop a dynamic attention mechanism integrated with sparse autoencoders to learn robust normal concepts during training. Moreover, to enable fast adaptation during inference, our model remains lightweight by incorporating LoRA into the attention module, which introduces only minimal updating parameters.Extensive experiments on three widely adopted FS-IAD benchmarks, including MVTec-AD, VisA, and MPDD, demonstrate that our model consistently outperforms state-of-the-art (SOTA) approaches across both detection and localization tasks, achieving significant improvements under various shot settings.
Yufei Li, Yicheng Ruan, Long Tian +2
School of Computer Science and Technology, Xidian University, Xi’an, China
Few-shot anomaly detection (FSAD) has recently benefited from vision-language models such as CLIP, which enable anomaly de?tection by aligning visual features with text descriptions of normal and abnormal states. However, existing methods typically rely on static text prompts that are applied uniformly across the entire feature hierarchy and spatial dimensions. This rigid global-to-local matching fails to capture the highly localized and scale-dependent physical variations of industrial defects. To address this, we propose DriftAD, a FSAD framework built on three key modules. First, an Anomaly Signal Amplification (ASA) module enhances subtle defect signals through spatial and frequency branches before text-visual matching. Second, Visually-Guided Text Drift (VGTD) dynamically transforms frozen CLIP text embeddings, steering them into layer?wise, spatially-adaptive anomaly descriptors conditioned on local visual context at each encoder depth. Third, Drift-Guided Spatial Gating (DGSG) uses the drifted abnormal descriptor as a spatial probe to selectively enhance anomaly-relevant visual features. Addi?tionally, a drift separation loss prevents representational collapse of the drifted descriptors, and a gate supervision loss enforces spatially discriminative gating in DGSG. Extensive experiments on MVTec?AD and VisA demonstrate state-of-the-art performance across all 1-, 2-, and 4-shot settings on both image-level and pixel-level metrics. Code is available at https://github.com/wenyang001/DriftAD.
Wenyang Liu, Tianyi Liu, Dongshuo Zhang +2
Nanyang Technological University Singapore · Huazhong University of Science and Technology, Wuhan, China
Detecting visual anomalies in industrial inspection often requires training with only a few normal images per category. Recent few-shot methods achieve strong results employing foundation-model features, but typically rely on memory banks, auxiliary datasets, or multi-modal tuning of vision-language models. We therefore question whether such complexity is necessary given the feature representations of vision foundation models. To answer this question, we introduce SubspaceAD, a training-free method, that operates in two simple stages. First, patch-level features are extracted from a small set of normal images by a frozen DINOv2 backbone. Second, a Principal Component Analysis (PCA) model is fit to these features to estimate the low-dimensional subspace of normal variations. At inference, anomalies are detected via the reconstruction residual with respect to this subspace, producing interpretable and statistically grounded anomaly scores. Despite its simplicity, SubspaceAD achieves state-of-the-art performance across one-shot and few-shot settings without training, prompt tuning, or memory banks. In the one-shot anomaly detection setting, SubspaceAD achieves image-level and pixel-level AUROC of 97.1% and 97.5% on the MVTec-AD dataset, and 93.2% and 98.2% on the VisA dataset, respectively, surpassing prior state-of-the-art results. Code and demo are available at https://github.com/CLendering/SubspaceAD.
Camile Lendering, Erkut Akdag, Egor Bondarev
AIMS Group, Department of Electrical Engineering, Eindhoven University of Technology