PC-Reg: Modeling Spatial Dependencies for Logical Anomaly Detection
Detecting logical anomalies in industrial visual inspection often requires capturing relationships between components, not just local appearance [1]. In manufacturing settings, defects such as missing parts, incorrect counts, or misplaced components cannot be identified by examining individual regions in isolation, which limits patch-independent methods such as PatchCore [2]. Recent vision-language-model pipelines [3] can address such cases, but they typically rely on multi-model systems that are costly to run and harder to deploy on production lines.We introduce PC-Reg (Positional Contextual Regression), a training-free method that predicts each patch feature from its spatial neighborhood using closed-form ridge regression, and scores anomalies through the Mahalanobis distance of the prediction residual.We also introduce two complementary extensions: CLS-attention gating, which leverages the global saliency encoded in the CLS token to weight spatial neighbors, and a compositional branch that captures image-level distributional shifts through global average pooling. The two branches are fused via 𝑧-score normalization into a dual score (PC-RegDual).Evaluated on 32 categories across three benchmarks with a DINOv3-ViT-H+/16 backbone, PC-RegDual achieves 87.5% AUROC on MVTec LOCO AD, 98.6% on MVTec AD, and 92.4% on VisA, with statistically significant improvements over the patch-independent baseline. With the lighter ViT-L/16 backbone, the entire pipeline fits in about two minutes per category on CPU and runs inference at ∼41 ms per image on a consumer GPU, over 700× faster than VLM-based alternatives, making it suitable for inline industrial inspection without specialized hardware.
Authors
- Manuel A. Sánchez-Montañés (ORCID: https://orcid.org/0000-0002-5944-0532)
- Emilio Soria‐Olivas (ORCID: https://orcid.org/0000-0002-9148-8405)
- Sergio Villanueva López (ORCID: https://orcid.org/0009-0003-2721-9272)
Publication Details
- Journal
- Electronics
- Published
- 2026-11-04
- DOI
- https://doi.org/10.3390/electronics15215109
- Primary Topic
- Industrial Vision Systems and Defect Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00