Industrial anomaly detection faces two engineering bottlenecks: memory bank construction latency and inference efficiency. Traditional sampling algorithms (Farthest Point Sampling, K-Means, etc.) rely on numerous backbone forward passes and iterative distance computations, with construction times ranging from minutes to hours; heavy computation components such as multi-scale feature extraction struggle to meet the millisecond-level real-time requirements of production lines. This paper focuses on sampling efficiency and inference optimization for industrial deployment with two core contributions: (1) PSP (Plugin Sampler Pipeline)---a four-stage adaptive memory bank sampling pipeline based on 18-dimensional pixel metadata and five complementary visual plugins. PSP completes all sampling with zero backbone forward passes; coarse filtering is sub-second numerical sorting, and metadata extraction is a one-time offline cost. PSP supports progressive deployment and incremental updates. (2) Two engineering optimization strategies---parallel memory bank similarity computation (reducing inference memory and latency by over 95%) and stratified pixel sampling for large-scale evaluation (reducing computation time by 20× while keeping metrics stable). As a vehicle for validation, we introduce LUMIN (Lightweight Universal Manufacturing Inspection Network) with extreme segmentation-head compression, systematically exploring the accuracy-efficiency frontier against strong baselines. Experiments on five benchmarks demonstrate that PSP matches state-of-the-art sampling accuracy at near-random construction cost (341× faster than FPS), while inference optimizations reduce evaluation time by 20× with negligible accuracy loss.
Figures & tables
Fig. 1: Overall architecture of the LUMIN framework, including the training pipeline (left); the memory bank building pipeline (middle); and the inference pipeline (right).
Fig. 2: Detection head evolution. UniADet (left): dual-branch with classification and segmentation; UniADet_seg (middle): single-branch with classification head removed; LUMIN (right): single-layer segmentation head with cross-layer FeatFusion.
Component
UniADet
UniADet_seg
LUMIN
Fusion
(Post-) Scores
(Post-) Scores
(Pre-) Features
Segmentation Head
Multiple
Multiple
Single
Trainable Parameters
∼ 16K ( 4LD )
∼ 8K ( 2LD )
∼ 2K ( 2D )
Size of .pth File
∼ 72KB
∼ 37KB
∼ 11KB
TABLE I: Architecture evolution: comparison of UniADet, UniADet_seg, and LUMIN with L=4
Fig. 3: PSP four-stage pipeline.
Category
D
Description
Basic attributes
3
width, height, aspect ratio
Color statistics
6
mean and standard deviation of RGB three channels
Gradient magnitude
3
Sobel gradient mean, standard deviation, P90 quantile
Local entropy
2
mean and standard deviation over 5 × 5 window
Frequency-domain energy
3
FFT low/mid/high-frequency energy ratios
Global contrast
1
RMS mean of RGB channel variances
TABLE II: Composition of the 18-dimensional (D) pixel metadata.
Rule
If
Then
R1
High RGB variance
↑ ColorPlugin
R2
High gradient variance
↑ TexturePlugin (HOG)
R3
High local entropy variance
↑ TexturePlugin (LBP)
R4
High scale/contrast variance
↑ ResizePatchPlugin
R5
High high-frequency energy
↑ FrequencyPlugin
R6
High brightness dynamic range
↑ ContrastPlugin
TABLE III: Adaptive decision rules for dynamic plugin weighting ( ↑ denotes increasing the corresponding plugin weight).
Parameter
Default
Stage
Description
work_size
256
Stage 1
Image resize resolution for metadata extraction. The 16–512 range has minimal impact on P-AUPR (fluctuation < 0.2%); 256 balances efficiency and statistical stability.
coarse_keep_ratio
5.0
Stage 2
Retention ratio for coarse filtering: Kcoarse=keep_ratio×K . At K=20 , retains 100 candidates. Setting to 1.0 enables zero-overhead minimal sampling.
prior_strength
0.3
Stage 3
Fusion ratio between dataset prior and adaptive score; constrains adaptive weight fluctuation and improves cross-scenario stability.
n_clusters
0
Stage 4
Number of clustering constraints after fusion scoring. 0 disables clustering, selecting Top- K directly by composite score for stable industrial scenarios.
manual_weights
None
Stage 3/4
Manually specified five-plugin fusion weights. If not None, overrides adaptive weights for on-demand plugin priority customization.
TABLE IV: Key hyperparameters of the PSP pipeline: default values, associated stages, and functional descriptions.
Datasets
Metrics
Anomaly -CLIP
VisualAD (CLIP)
UniADet (CLIP)
UniADet (DINOv3)
LUMIN (CLIP)
LUMIN (DINOv3)
MVTec
AUROC
72.6/78.0
88.1/89.8
89.7 / 90.0
91.6 / 90.4
56.3/78.6
87.4/89.3
MVTec
AUPR
86.8/ 77.8
94.8/40.1
95.2 /43.5
96.2 /46.7
79.0/12.2
94.2/ 47.7
MVTec
F1max
87.8/18.3
91.4/42.6
91.6 /44.8
93.3 / 47.2
84.6/18.0
88.8/ 47.7
VisA
AUROC
40.4/83.6
47.7/83.9
86.9 /94.2
89.8 / 95.6
58.4/80.5
79.8/ 95.6
VisA
AUPR
11.2/ 84.0
17.0/2.8
61.3 /21.9
69.6 / 25.1
21.5/0.9
53.6/22.2
VisA
F1max
22.1/2.5
25.8/4.2
58.9 /26.4
66.9 / 30.1
28.5/2.0
52.6/ 27.0
TABLE V: Zero-shot cross-domain results on five benchmarks. Values are image-level / pixel-level. Best values are marked in red, second-best values are marked in blue.
Datasets
Shots
Metrics
UniADet (CLIP)
UniADet (DINOv3)
LUMIN (CLIP)
LUMIN (DINOv3)
MVTec
1
AUROC
93.2 /94.8
93.5 / 96.6
91.9/92.0
93.1/ 96.2
AUPR
96.9 /52.1
97.1 / 56.9
95.8/48.7
96.3/ 57.1
F1max
92.8/53.0
93.0 / 56.6
94.0 /52.0
92.3/ 55.6
2
AUROC
93.4/95.2
93.8 / 96.9
95.0 /92.3
93.3/ 96.5
AUPR
97.1 / 53.5
97.3 / 57.6
97.0/52.0
96.4/ 57.6
F1max
92.9/54.5
93.4 / 57.4
94.7 /54.3
92.4/ 55.9
TABLE VI: Few-shot results on five benchmarks. Values are image-level/pixel-level. Best values are marked in red, second-best values are marked in blue.
Fig. 4: Segmentation visualization comparison across methods on cable, hazelnut, screw, and transistor. Green: ground truth; red: predictions.
shot
Metrics
Anomaly -CLIP
VisualAD
UniADet (CLIP)
UniADet (DINOv3)
LUMIN (CLIP)
LUMIN (DINOv3)
model_mem
1.64/1.64
1.59/1.59
1.60/1.60
1.14/1.14
1.60/1.60
1.14/1.14
0
infer_mem
0.39/3.20
1.98/2.00
0.11/0.83
0.14/1.09
0.10/0.78
0.14/1.09
1
infer_mem
—
—
0.16/0.87
0.17/1.12
0.15/0.83
0.17/1.12
2
infer_mem
—
—
0.20/0.92
0.20/1.15
0.19/0.87
0.20/1.15
4
infer_mem
—
—
0.29/1.00
0.26/1.22
0.28/0.96
0.26/1.22
0
time/img
927/894
129/115
93/88
77/74
92/88
75/75
TABLE VII: Inference memory (GB) and per-image time (ms) on MVTec with batch size 1/8 and num_workers 0. Smaller is better.
max_pixel
ratio
time
I-AUROC
P-AUROC
P-AUPR
P-F1max
50,000
0.23%
1.0
98.65
97.75
76.33
69.31
100,000
0.46%
1.0
98.65
97.78
76.61
69.49
200,000
0.92%
1.1
98.65
97.71
75.69
68.70
2,000,000
9.19%
2.3
98.65
97.71
75.71
68.66
21,800,000
100%
20.1
98.65
97.70
75.71
68.66
TABLE VIII: Stratified pixel sampling: effect of sampling ratio on computation time and evaluation metrics.
Fig. 5: Sampling algorithm comparison on speed vs. accuracy. Prefix “S” denotes streaming methods; suffixes “FF” (full feature map) and “MF” (mean-pooled to 1D vector) indicate feature representations. Note that sum_time = 175.4 s (meta) + 26.79 s (mem_build) = 202.1 s. Meta is extracted only once for all experiments.
work_size
meta_time
mem_build_time
total_time
P-AUPR
512
175.2
24.1
199.3
57.99
256
126.7
23.9
150.6
57.95
128
120.4
24.6
145.0
57.91
64
114.5
23.5
138.0
58.09
32
113.3
23.5
136.8
57.99
16
113.1
23.9
137.0
58.04
TABLE IX: PSP hyperparameter ablation: effect of work_size (metadata extraction resolution) on time (s) and P-AUPR.
ratio
meta_time
feat_extract _time
filter_time
mem_build _time
total_time
P-AUPR
1.0
114.6
0
0
3.12
117.7
58.24
2.0
114.6
7.63
2.43
13.31
127.9
58.01
3.0
114.3
11.35
2.06
16.71
131.2
58.02
5.0
114.5
18.26
2.19
23.50
138.0
58.09
8.0
115.6
30.00
2.32
35.70
151.3
58.15
10.0
114.6
37.32
2.23
42.91
157.5
58.05
TABLE X: PSP hyperparameter ablation: effect of coarse_keep_ratio on time (s) and P-AUPR.
Category
5-plugin
2-plugin
Δ
bottle
77.67
77.75
+0.08
cable
27.21
27.05
-0.16
capsule
51.23
51.23
+0.00
carpet
80.68
80.71
+0.03
grid
56.22
56.25
+0.03
hazelnut
64.64
64.41
-0.23
TABLE XI: Plugin ablation: P-AUPR comparison between 5-plugin and 2-plugin (Color+Texture) configurations at k=20 . Δ denotes the P-AUPR difference of 2-plugin minus 5-plugin.
Category
ratio=1
ratio=5
ratio=10
max-min
bottle
77.66
77.67
77.67
0.01
cable
27.07
27.21
27.25
0.18
capsule
51.07
51.23
51.40
0.33
carpet
80.64
80.68
80.61
0.07
grid
56.17
56.22
56.32
0.15
hazelnut
64.22
64.64
64.25
0.42
TABLE XII: Per-category effect of coarse_keep_ratio on P-AUPR at k=20 . Column max-min denotes the range of P-AUPR across three ratio settings.
k
Metric
CLIP 2L
CLIP 4L
CLIP 5L
DINOv3 2L
DINOv3 4L
DINOv3 5L
0
I-AUROC
53.7 / 85.4
54.4 / 87.0
51.9 / 87.6
81.6 / 86.0
82.2 / 85.0
81.4 / 86.2
0
I-AUPR
51.3 / 82.6
51.2 / 82.6
49.9 / 82.5
71.1 / 81.1
71.6 / 76.9
70.7 / 77.6
0
I-F1max
58.5 / 80.3
58.3 / 80.9
57.6 / 80.3
71.0 / 78.2
71.6 / 76.8
71.0 / 77.2
0
P-AUROC
79.8 / 94.5
79.1 / 94.3
78.4 / 94.7
94.9 / 95.4
94.5 / 95.3
94.9 / 96.0
0
P-AUPR
4.4 / 31.8
4.2 / 32.0
4.0 / 32.9
34.5 / 35.9
34.8 / 35.5
34.5 / 37.8
0
P-F1max
8.2 / 36.3
7.6 / 36.8
7.5 / 37.5
38.5 / 39.3
39.0 / 39.1
38.6 / 41.1
TABLE XIII: Mean results over five benchmarks. Values are of LUMIN/UniADet. 2L, 4L and 5L means training and inference with features (from vision backbone layers) {12,24} , {6,12,18,24} and {12,15,18,21,24} . Best values are marked in red, second-best values are marked in blue.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Methods
k =0
k =1
k =4
k =10
k =20
mean_aupr / sum_time
RS (seed 0)
48.56/0
56.73/1.10
57.94/3.06
58.48/7.55
58.64/14.96
57.95/26.67
RS (seed 42)
48.56/0
56.60/1.11
57.85/3.05
58.24/7.48
58.48/15.21
57.79/26.85
FPS_FF
48.56/0
56.71/2.1
57.90/745.3
58.23/2300.5
58.34/5112.8
57.80/8160.6
FPS_MF
48.56/0
56.71/2.1
57.86/712.5
58.08/2110.9
58.33/4367.7
57.74/7193.2
SFPS_FF
48.56/0
56.75/246.2
58.02/275.5
58.24/512.1
58.46/1436.7
57.87/2470.5
SFPS_MF
48.56/0
56.75/242.3
57.93/242.0
58.33/246.7
58.57/251.5
57.90/982.5
Appendix
TABLE XIV: Sampling algorithm comparison: P-AUPR / memory bank build time (s) across k=0,1,4,10,20 . The last column reports the average P-AUPR and total memory bank building time over all shot settings. Note that sum_time = 175.4 s (meta) + 26.79 s (mem_build) = 202.1 s. Meta is extracted only once for all experiments.
Abbreviation
# feature extractions
Filtering computation complexity
Storage overhead
Core description
RS
0
O(N) shuffle
None
No selection logic, lowest cost
FPS_FF
N
O(K ⋅ N ⋅ H ⋅ W ⋅ D)
O(N ⋅ H ⋅ W ⋅ D)
High accuracy but poor deployability
FPS_MF
N
O(K ⋅ N ⋅ D)
O(N ⋅ D)
Mean pooling reduces complexity
SFPS_FF
∼ K ⋅ N
O(K 2 ⋅ N ⋅ H ⋅ W ⋅ D)
O(K ⋅ H ⋅ W ⋅ D)
Streaming avoids storage, sacrifices time
SFPS_MF
∼ K ⋅ N
O(K 2 ⋅ N ⋅ D)
O(K ⋅ D)
Streaming with mean pooling
KM_FF
N
O(K ⋅ N ⋅ I)
O(N ⋅ H ⋅ W ⋅ D)
High-dimensional clustering, high cost
Appendix
TABLE XV: Theoretical complexity and characteristic comparison of sampling algorithms.
In modern high-throughput industrial production lines, product configurations and visual characteristics frequently change, making it impractical to collect and annotate data for every new scenario. This dynamic setting makes Zero-Shot Anomaly Detection (ZSAD) particularly suitable, as it enables defect detection without requiring training on target-specific samples. Although recent ZSAD approaches show promising results, they are computationally intensive and thus unsuitable for deployment on resource-constrained devices. We propose LiZAD: a lightweight framework designed for real-time ZSAD specifically tailored for use on edge devices. The proposed approach pairs the dense and spatially aware visual features of DINOv3, crucial for precise pixel-level localization, with the highly computationally efficient text embeddings of MobileCLIP2. These features are then mapped into a shared latent space via low-memory trainable projection heads. Compared to six state-of-the-art ZSAD models, LiZAD achieves an average memory reduction of 61.5%, a parameter reduction of 74.6%, and a speedup of 3.02x in terms of latency. Despite substantial reductions in computational and memory costs, our approach maintains competitive anomaly detection performance, dropping the average P-AUROC by just 6.4% relative to the best state-of-the-art model across the VisA, BTAD, MPDD, and MVTec-AD datasets. Finally, it is successfully deployed on the NVIDIA Jetson NX and Jetson AGX edge devices and tested on the real production line of the Industrial Computer Engineering Laboratory (ICE Lab) at the University of Verona. The code is available at https://github.com/intelligolabs/LiZAD.
Uzair Khan, Luigi Capogrosso, Muhammad Aqeel +3
University of Verona · Interdisciplinary Transformation University of Austria · ETH Zurich
Industrial anomaly detection (IAD) is evolving beyond conventional detection and localization toward multimodal inspection systems that can describe, explain, and reason about fine-grained defects. Although recent multimodal large language model (MLLM)-based methods improve anomaly understanding through textual reasoning and visual guidance, they face two limitations in fine-grained inspection. First, their visual refinement often requires iteratively revisiting local image regions or augmenting with additional tools. Second, the resulting local defect evidence may not be reliably preserved throughout subsequent reasoning. To address these, we propose Anomaly-LR, a defect-grounded latent reasoning framework that first forms a global understanding of the input and then progressively refines anomaly-relevant representations directly in the visual latent space. We further construct IAD-LR-22K, the first IAD instruction dataset designed for latent reasoning, containing 22,228 image-question instances from 4,523 industrial images, with global textual reasoning traces and region-level visual annotations. Extensive experiments show that Anomaly-LR achieves state-of-the-art performance among comparable-scale methods across multiple IAD benchmarks, without requiring external references or tools. The code and data will be released at https://github.com/Yen666/Anomaly-LR.
Industrial anomaly detection is a critical component of modern manufacturing. Most traditional unsupervised methods rely on modelling normal feature distributions, inherently limiting generalization to unknown categories. To improve generalizability, some recent methods incorporate vision-language models (VLMs) for zero-shot detection via text prompts. However, we observe that reasoning-oriented post-training can cause anomaly discrimination to collapse, with some fine-tuned models performing worse than their base VLMs. Existing methods also provide only textual decisions or coarse boxes, without pixel-level segmentation. A more explicit detection principle comes from human inspection: anomalies are identified by comparing a query image with a defect-free reference. Inspired by this, we propose InspectorGPT, a VLM framework centered on comparative reasoning. Given a normal reference and a query image, InspectorGPT compares them to identify discrepancies and perform multiple inspection tasks with detailed reasoning. We internalize this capability through Chain-of-Thought (CoT) fine-tuning and Group Relative Policy Optimization (GRPO) with tailored, verifiable rewards. We further introduce InspectorGPT-Seg for pixel-level anomaly masks. Segmentation supervision improves anomaly discrimination but weakens semantic reasoning, while joint training fails to balance them. We therefore train the two branches separately and combine them through task-vector fusion. Extensive experiments demonstrate superior multi-dimensional performance and generalization to unseen benchmarks, validating comparative reasoning for comprehensive industrial inspection.
Weifei Chen, Honghao Zhang, Zhiyuan You +1
Shanghai Jiao Tong University · The Chinese University of Hong Kong