Visual defect detection plays an important role in intelligent industry.
Patch based methods consider visual images as a collection of image patches
according to positions, which have stronger discriminative ability for small
defects in products, e.g. scratches on pills. However, the nearest neighbor
search for the query image and the stored patches will occupy $O(n)$ complexity
in terms of time and space requirements, posing strict challenges for
deployment in edge environments. In this paper, we propose an alternative
approach to the distance calculation of image patches via collaborative
representation models. Starting from the nearest neighbor distance with $L_0$
constraint, we relax the constraint to $L_2$ constraint and solve the distance
quickly in close-formed without actually accessing the original stored
collection of image patches. Furthermore, we point out that the main
computational burden of this close-formed solution can be pre-computed by
high-performance server before deployment. Consequently, the distance
calculation on edge devices only requires a simple matrix multiplication, which
is extremely lightweight and GPU-friendly. Performance on real industrial
scenarios demonstrates that compared to the existing state-of-the-art methods,
this distance achieves several hundred times improvement in computational
efficiency with slight performance drop, while greatly reducing memory
overhead.

Visual defect detection plays a crucial role in intelligent industries, and patch-based methods are often used to identify small defects in products, such as scratches on pills. These methods treat visual images as collections of image patches, which are more effective in capturing the discriminative details of small defects. However, these methods face challenges when it comes to deployment in edge environments due to the high time and space requirements for nearest neighbor search between the query image and stored patches, resulting in complex computations.

In this paper, the authors propose an alternative approach to distance calculation in patch-based defect detection using collaborative representation models. Instead of relying on nearest neighbor search, they start with the nearest neighbor distance under an $L_0$ constraint and then relax it to an $L_2$ constraint. By solving the distance calculation using a closed-formed solution, they avoid the need to access the original collection of stored patches, significantly reducing computational complexity.

The authors also emphasize that the main computational burden of this closed-formed solution can be pre-computed by a high-performance server before deployment. Consequently, the distance calculation on edge devices only requires a simple matrix multiplication, making it extremely lightweight and GPU-friendly. This approach improves computational efficiency by several hundred times compared to existing state-of-the-art methods, with only a slight drop in performance. Additionally, it greatly reduces memory overhead.

This research highlights the multi-disciplinary nature of visual defect detection in intelligent industry applications. It combines concepts from computer vision, machine learning, and optimization to develop an efficient and lightweight solution for defect detection. The use of collaborative representation models and closed-formed solutions demonstrates the integration of mathematical and computational techniques to enhance real-world applications.

Read the original article