Manuscript Offprint

arXiv:2609.04775

LUMIN: Lightweight Universal Manufacturing Inspection Network for Anomaly Detection

Pengfei Yang

Pengfei Yang

Intelligent Precision Instrument, Shenzhen, Guangdong, China

pfyangcrc@gmail.com

Abstract— 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.

Index Terms—Industrial Anomaly Detection, Memory Bank Building, Inference Optimization, Lightweight Architecture.

I. INTRODUCTION

Industrial anomaly detection is a core component of quality control in intelligent manufacturing, aiming to automatically identify and localize surface defects. Unlike natural images, industrial deployment demands strict real-time performance (<100 ms per image) and low resource footprint, while extreme sample scarcity exacerbates overfitting risks.

Vision foundation models—CLIP [1] and DINOv3 [2]—provide large-scale pre-trained representations, enabling methods such as WinCLIP [3], AnomalyCLIP [4], VisualAD [5], and UniADet [6]. Despite their accuracy advances, they still face two fundamental engineering bottlenecks:

  • Memory bank construction latency: Memory-bank-based methods (e.g., PatchCore [7], UniADet [6]) rely on nearest-neighbor retrieval, but their sampling algorithms—Farthest Point Sampling (FPS [8]), K-means Cluster Center Sampling (K-Means [9], [10]), Global Statistical Sampling (GSS) and greedy coreset [7]—require numerous backbone forward passes and iterative distance computations, with construction times ranging from minutes to hours, failing rapid product-switching demands.

  • Inference redundancy: Existing methods rely on multi-scale features, cross-attention, or per-image serial similarity computation, leading to low GPU utilization, high memory consumption, and poor batch scalability.

To address these bottlenecks, we propose PSP (Plugin Sampler Pipeline), a sampling algorithm, alongside two inference optimization strategies. As a validation vehicle, we introduce LUMIN (Lightweight Universal Manufacturing Inspection Network) with extreme segmentation-head compression, systematically exploring the accuracy-efficiency frontier.

PSP (Plugin Sampler Pipeline) (Section III-C) is a four-stage adaptive memory bank sampling pipeline based on 18-dimensional pixel metadata and five complementary visual plugins. It completes sampling with zero backbone forward passes: metadata extraction is a one-time offline cost, coarse filtering is sub-second numerical sorting, and plugin layers are activated on demand. PSP supports progressive deployment: a wide-in-strict-out policy covers normal variants during cold start; after stabilization, the coarse-filter ratio tightens, and the memory bank is not rebuilt unless the coarse-filter ranking changes.

Engineering optimizations (Section III-D): (1) parallel memory bank similarity computation replaces per-image serial similarity with matrix multiplication, reducing memory from O(C⋅M⋅D)O(C \cdot M \cdot D) to O(C⋅M)O(C \cdot M), alleviating out-of-memory (OOM) while keeping latency flat under large batches; (2) stratified pixel sampling cuts evaluation time from 20.1 s to 1.0 s (20× speedup) with stable metrics, accelerating iteration on large-scale datasets (e.g., Real-IAD's [15] 129K images).

Lightweight architecture exploration (Sections III-A and III-B): from UniADet [6], through UniADet_seg (halving parameters), to LUMIN's single-head compression (1/8 parameters), we chart the accuracy-efficiency trade-offs of progressive lightweighting.

Systematic experiments on five benchmarks (MVTecAD [11], VisA [12], BTAD [13], KSDD [14], RealIAD [15]) provide a comprehensive comparison of 3 architectures and 11 sampling algorithms, offering reproducible baselines and practical guidelines for industrial deployment. More experimental results are publicly available at

Figure

Fig. 1. Overall architecture of the LUMIN framework, including the training pipeline (left); the memory bank building pipeline (middle); and the inference pipeline (right).

https://github.com/pfyangcrc/LUMIN. The complete source code will be released after the paper is accepted.

References (17)

  • Learning transferable visual models from natural language supervision
  • DINOv3
  • Winclip: Zero-few-shot anomaly classification and segmentation
  • Anomalyclip: Object-agnostic prompt learning for zero-shot anomaly detection
  • VisualAD: Language-Free Zero-Shot Anomaly Detection via Vision Transformer
  • One language-free foundation model is enough for universal vision anomaly detection (opens arXiv in a new tab)
  • Towards total recall in industrial anomaly detection
  • The farthest point strategy for progressive image sampling
  • Some methods of classification and analysis of multi-variate observations
  • k-means++: The advantages of careful seeding
  • MVTec AD—A comprehensive real-world dataset for unsupervised anomaly detection
  • Spot-the-difference self-supervised pre-training for anomaly detection and segmentation
  • VT-ADL: A vision transformer network for image anomaly detection and localization
  • Segmentation-Based Deep-Learning Approach for Surface-Defect Detection (opens the publisher in a new tab)
  • Real-iad: A real-world multi-view dataset for benchmarking versatile industrial anomaly detection
  • Optuna: A next-generation hyperparameter optimization framework
  • Attention is all you need