Computer vision based visual defect inspection has wide applications in industrial manufacturing. The American Society for Quality estimates that for many organizations this cost of quality is as high as 15-20% of annual sales revenue, some going as high as 40% of total operations, or billions of dollars annually for larger manufacturers. However, there are several major challenges using AI for visual inspections in production-scale applications:
1. Cold-start problem: oftentimes only nominal (non-defective) examples are available for training, and anomalous examples, by definition, are very rare. We need the model to determine defects without having seen them, which is essentially an out-of-distribution detection problem .
2. Heterogeneous, sparse and sometimes unknown defect categories: anomalous patterns can range from macro-crack, thin scratch, to large areas of corrosion. Even if we have enough examples per class, it’s difficult to scale (especially on edge hardware) on simultaneous inference of many different tasks.
PatchCore - SOTA Visual Anomaly Detection Method
PatchCore, is currently state-of-the-art anomaly detection method which identifies anomalous images, or anomalous pixel regions as heatmaps in anomalous images. It achieves image-level anomaly detection AUROC score of up to 99.6%, more than halving the error compared to the next best competitor on the challenging, widely used MVTec AD benchmark data. The MVTec AD benchmark gives 15 different anomaly detection tasks, with the final performance as an average across all the tasks. For each of the 15 tasks PatchCore achieves over 90% AUROC with just five images of normal data.
PatchCore also offers competitive inference times while achieving solid performance for both detection performance and even spatial localization of the defects, which is critical for edge implementation on embedded systems.
[Roth et al. 2022 "Towards Total Recall in Industrial Anomaly Detection"]
How PatchCore Works
PatchCore is based on the idea that an image can be classified as anomalous as soon as a single patch is anomalous. It generates a maximally representative memory bank of nominal patch features from different locations. However the memory bank can become very large very quickly, and so subsampling is needed. One of the keys to PatchCore’s performance is classic statistical coreset subsampling technique rather than random subsampling – to trim the memory bank while retaining overall feature space coverage.
Test images are then compared to the feature sets in the trimmed memory bank. If the feature is significantly different from the ones in the memory bank, it’s likely to be a defect.This subset helps reduce the search cost associated with nearest neighbor search.
Clarifai is pleased to announce pre-GA product offering of PatchCore-based visual anomaly detection model, as part of our visual inspection solution package for manufacturing which also consists of various purpose-built visual detection and segmentation models, custom workflows and reference application templates.
Users only need a few hundred images of normal examples for training, and ~10 anomalous examples for each category for calibration & testing only, especially with more homogeneous background and more focused region-of-interest.
Benefit of Clarifai: