改进工业缺陷检测,用协方差感知方法降低内存占用。
Mahalanobis PatchCore: Covariance-Aware and Streaming-Compatible Industrial Anomaly Detection

- 引入马氏距离感知的特征变换,提升异常检测精度。
- 峰值内存从5.41GB降至2.78GB,性能基本保持不变。
- 适合实际工业场景中内存受限的在线检测应用。
工业视觉异常检测通常为单类问题:正常图像丰富,缺陷稀少、多样且设计阶段难以获取。基于块(PatchCore)的检索方法适用于此场景,通过正常块特征记忆库对测试图像评分,但标准欧氏距离忽略特征相关性,且离线构建需一次性存储全部块。本文提出马氏距离感知的流式兼容扩展——马氏距离块核心(Mahalanobis PatchCore),其核心是通过在低维空间估计正则化协方差模型并白化嵌入,使变换后欧氏最近邻搜索等效于马氏距离检索。采用有限内存、可重迭代训练流程,通过增量降维、在线协方差估计和流式聚合构建记忆库,无需一次性存储所有正常块。在公开15类工业异常检测基准及三个工业数据集(包括吹填封条-安瓿瓶弯月面、琥珀玻璃安瓿瓶底、冻干粉针剂西林瓶)上评估,该方法在保持离线版PatchCore图像级性能的同时,将峰值内存从5.41GB降至2.78GB,且在选定工业数据集上的受试者工作特征曲线下面积(AUC)均值从0.981提升至0.986。
原文摘要 · Abstract (English)
Industrial visual anomaly detection is usually one-class: normal images are abundant, while defects are rare, heterogeneous, and often unavailable during system design. PatchCore-style retrieval suits this setting because it scores test images from a memory bank of normal patch features, but the standard Euclidean geometry ignores feature correlations and its offline construction materialises the full patch pool before subsampling. We introduce Mahalanobis PatchCore, a covariance-aware, streaming-compatible extension of PatchCore. Its artificial intelligence contribution is a retrieval detector that estimates a regularised covariance model in reduced feature space and whitens embeddings, so Euclidean nearest-neighbour search after transformation implements Mahalanobis retrieval. A bounded-memory, re-iterable training pipeline builds the memory bank without storing all normal patches at once, using incremental dimensionality reduction, online covariance estimation, and streaming aggregation. The engineering application is automated industrial inspection, where visual anomaly detection must remain accurate under practical memory limits. We evaluate the method on a public 15-category industrial anomaly-detection benchmark and three industrial datasets covering blow-fill-seal strip-ampoule meniscus inspection, amber-glass-ampoule bottom inspection, and lyophilised-cake vial inspection. Mahalanobis PatchCore preserves most offline PatchCore image-level performance on the public benchmark while reducing peak memory from 5.41 to 2.78 GB, and improves the selected industrial mean image area under the receiver operating characteristic curve from 0.981 to 0.986.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。