Efficient Visual Anomaly Detection at the Edge: Enabling Real-Time Industrial Inspection on Resource-Constrained Devices

Arianna Stropeni, Fabrizio Genilotti, Francesco Borsatti, Manuel Barusco, Davide Dalle Pezze, Gian Antonio SustoarXiv 2026

TL;DR

This paper introduces PatchCore-Lite and PaDiM-Lite, two edge-optimized variants of popular visual anomaly detection (VAD) models designed for resource-constrained industrial inspection. By leveraging product quantization and diagonal covariance approximations, these methods achieve up to a 79% reduction in total memory footprint while preserving high pixel-level defect localization accuracy.

What Problem Does This Paper Address?

In modern manufacturing, Visual Anomaly Detection (VAD) systems automatically scan production lines to identify defects. While traditional VAD models rely on high-performance, centralized cloud servers, real-world deployment demands a shift to the "edge" (local devices near the production line). Edge deployment ensures low latency for fast-moving assembly lines and protects data privacy by keeping sensitive manufacturing images local.

However, edge hardware is severely constrained in memory and computational power. State-of-the-art VAD models are notoriously heavy:

  • PaDiM requires computationally expensive multivariate Gaussian estimations and full covariance matrix inversions ($O(d^3)$ complexity).
  • PatchCore relies on a massive "memory bank" of nominal feature vectors that quickly overwhelms the storage capacity of tiny edge devices.

The authors tackle this gap by redesigning these two algorithms from the ground up for resource-constrained environments.

Methods

The authors build upon a lightweight baseline architecture that swaps out heavy backbones (like WideResNet50) for a frozen MobileNetV2 feature extractor. From there, they introduce two distinct methodological innovations:

1. PaDiM-Lite: Diagonal Covariance Approximation

Standard PaDiM models patch descriptors using a full covariance matrix to capture feature correlations. PaDiM-Lite simplifies this by assuming independence between feature dimensions, substituting the full covariance matrix with a diagonal variance vector.

This mathematical simplification transforms the complex Mahalanobis distance calculation into a lightweight, element-wise operation. It drastically reduces training and inference complexity from $O(d^2)$ or $O(d^3)$ down to linear complexity, $O(d)$.

To shrink PatchCore’s memory bank, the authors apply Product Quantization (PQ) post-training. The high-dimensional feature space is split into $m$ lower-dimensional subspaces, and each subspace is clustered into a small set of centroids (a codebook). Instead of storing raw 32-bit floating-point vectors, the memory bank only stores compact quantization indices.

At inference time, PatchCore-Lite utilizes a Two-Stage Nearest Neighbor Search:

  1. Coarse Search: An asymmetric distance is computed between the query feature and the compressed memory bank using fast table lookups, identifying the top $k$ candidate neighbors.
  2. Fine Search: Only these $k$ selected candidates are dequantized back to their approximate original dimensions to perform an exact Euclidean distance calculation for final anomaly scoring.

Datasets

The methods were evaluated on two standard industrial VAD benchmarks:

  • MVTec AD: 15 categories consisting of 10 object types (e.g., bottle, hazelnut) and 5 texture types (e.g., grid, tile) containing high-resolution images of defect-free training data and anomalous test data.
  • VisA: A complex dataset comprising 10,821 high-resolution color images across 12 objects in 3 domains.
Examples of anomalous images and ground-truth masks from the MVTec AD dataset.

Key Insights and Ideas

  • Correlations vs. Localization: The success of PaDiM-Lite reveals that while cross-dimensional feature correlations help determine if an image contains an anomaly, they are largely redundant for determining where the anomaly is located (pixel-level localization).
  • The Memory-Latency Trade-off: Compressing PatchCore's memory bank via product quantization yields massive storage savings but introduces a computational penalty. Dequantizing candidate vectors on-the-fly during the fine search stage makes PatchCore-Lite slower than its uncompressed edge counterpart, highlighting a classic hardware trade-off.
Fig. 1. VAD models for the edge comparing Memory (log-scale), performance (I-AUC).

Key Results

The proposed "Lite" models achieve massive efficiency gains over standard and baseline "Edge" models while maintaining competitive pixel-level localization (P-ROC):

  • PaDiM-Lite reduces additional memory requirements by 97% (from 3.75 MB to 0.13 MB) and cuts total memory consumption by 77%. It also speeds up inference time by 31% (from 35 ms to 24 ms per image) while maintaining a high P-ROC of 0.94 on MVTec AD.
  • PatchCore-Lite achieves a 12× reduction in memory bank storage (shrinking additional memory to just 0.54 MB). Total memory footprint drops by 79% compared to PatchCore-Edge.

However, both models experience a noticeable drop in image-level classification performance (I-ROC), falling to around 0.85–0.86 on MVTec AD, indicating that global anomaly detection is more sensitive to quantization and correlation loss than local pixel segmentation.

Limitations and Future Work

The primary limitation of PatchCore-Lite is its inference latency: it is roughly 4× slower than PatchCore-Edge (130 ms vs. 30 ms) due to the overhead of the online dequantization step. Additionally, both Lite models sacrifice image-level classification accuracy (I-ROC) for memory efficiency.

Future research directions include optimizing the hyperparameters of product quantization (such as the number of subspaces $m$ and candidate neighbors $k$) to find the optimal sweet spot between performance, memory, and inference speed for specific target hardware architectures.

Summary updated

BibTeX
@misc{stropeni2026efficient,
  author = {Arianna Stropeni and Fabrizio Genilotti and Francesco Borsatti and Manuel Barusco and Davide Dalle Pezze and Gian Antonio Susto},
  title = {{Efficient Visual Anomaly Detection at the Edge: Enabling Real-Time Industrial Inspection on Resource-Constrained Devices}},
  year = {2026},
  eprint = {2603.20288},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.20288},
}
Figure