Technical dry goods|How to solve the problem of small samples in industrial defect detection?

Original | Wen BFT robot 

In industrial production and manufacturing, since the production process is a complex process coupled with multiple factors, any abnormality in the production process will lead to product defects. Timely identification of defect modes of abnormal products is an effective way to improve production quality and production efficiency, so defect Detection has very important research significance.

Early product defect pattern recognition was mainly carried out through machine learning methods, such as support vector machines, backpropagation networks, and so on. Compared with directly identifying product defects with the naked eye, these methods greatly reduce the workload. However, these early methods have the following disadvantages: the recognition accuracy is low and a large amount of labeled data is required to train the model.

In recent years, with the development of deep learning, a large number of algorithms based on convolutional neural networks have shined in vision tasks. Convolutional neural networks have been widely used in defect detection tasks due to their very powerful feature extraction capabilities.

Compared with traditional machine learning methods, deep learning methods based on convolutional neural networks have higher recognition accuracy and work efficiency in the field of defect recognition. However, this method has the same disadvantages as the machine learning method. First, model training requires a large amount of labeled data, and images with defect pattern labels are not easy to obtain, because obtaining images with product defect pattern labels requires manual supervision. That is, manual annotation by a large number of experienced professionals is required, which is very expensive and time-consuming.

In addition, in some highly automated production scenarios, the yield rate of products is particularly high, and collecting defect samples is very time-consuming. However, most of the current deep learning methods for defect detection are based on a large number of defect samples to build models. The lack of defect samples leads to Models are difficult to get online.

For some industries, such as the automotive industry, the multi-model small-batch production scenario (each model product is only produced for a few days), and a certain model product is no longer produced before the collection of defect samples is completed. In this scenario, a large number of defect samples are collected. impossible. In addition, since defects are produced by uncontrolled factors in the production process, the forms of defects are various, and it is difficult to collect complete samples of various forms, which also limits the application of deep learning in the field of industrial inspection.

01

Small Sample Detection Algorithm

In order to expand the application range of deep learning in the field of industrial inspection and improve the ease of use, the research of small sample detection algorithm has become inevitable.

There are two paths to solve the problem of small samples in industrial testing, the first is the engineering path, and the second is the algorithm path. Among them, there are two common methods for the engineering path. The first is to manually manufacture defects based on real products, and the second is to manually simulate defects based on real images.

The advantages of these two methods are that the operation is simple and the defects generated are relatively close to the real defects, but the disadvantages are also obvious. Manually manufacturing defects based on real products will cause irreversible damage to the product, and the cost of damage to high-value products is relatively high. Moreover, because the defects are all caused by uncontrolled factors, the manually manufactured defects may not necessarily match the actual defects. some differences. However, manual defect simulation based on images has the problems of high requirements for operators and slow production speed.

Therefore, using the engineering path to solve the small sample problem can be used in some more urgent situations, such as when the project needs to be launched urgently in the early stage.

02

Basic idea of ​​algorithm path

There are two basic ideas to solve the small sample problem from the algorithm path, the first is to increase the sample, and the second is to reduce the dependence of the algorithm on the sample.

1. Increase samples

Algorithm research directions based on the first idea include data augmentation and defect generation. Data augmentation has become a standard method to prevent overfitting during deep network training. From the perspective of industrial inspection, data augmentation is A relatively cost-effective means of amplifying samples, but because most of the current data augmentation methods are based on some traditional image processing methods, it can simulate the position of defects and some simple texture changes, but cannot simulate the shape and complex texture of defects , so data augmentation is generally used as a basic method, which can solve some small sample problems, and is helpful for some simple scenarios. To solve the problem of sample generation in more complex scenes, defect generation algorithms are needed.

We divide the research on defect generation algorithm into three stages: the first stage is single product single model defect generation; the second stage is single product multi-model defect generation; the third stage is to realize cross-product defect generation.

The current defect generation algorithms can be roughly divided into two types: one is an automatic generation algorithm, and the entire generation process does not require human intervention at all, and the second is a semi-automatic generation algorithm, which requires some simple human interaction.

Typical algorithms for automatic generation algorithms include DCGAN[1] and WGAN[2]. Inputting one defect image can directly generate multiple real defect images. Typical algorithms for semi-automatic generation algorithms include CGAN[3], CVAE[4], and Pix2Pix[5], which require manual interaction to generate the category or shape of a given defect, and then generate a specified type of defect based on the given information. However, whether it is an automatic generation algorithm or a semi-automatic generation algorithm, although the demand for training samples is less than that of the supervised algorithm, there are still certain requirements, and there is no general solution that can be used on all data. Different scenarios formulate different algorithm versions. A general defect generation algorithm will be the focus of the next step in this research direction.

2. Reduce the dependence of the algorithm on samples

The second idea of ​​the algorithm path to solve the small sample problem is to reduce the dependence of the algorithm on the sample. Based on this idea, two algorithm paths are derived:

  • The first route is an unsupervised learning algorithm that does not require defect samples at all. When training a model based on an unsupervised algorithm, only OK images are required to participate in the training.

  • The second route is still based on a supervised algorithm, and the demand for defective samples is greatly reduced.

The ideas of unsupervised algorithm implementation can be roughly divided into two types:

  • One is based on the generative model. The basic idea is to train a generative network that can only generate OK images. During inference, for the input NG image, find an OK image that is closest to the NG image, and then find the difference between the two images. According to the difference Whether the size is judged as NG or not, typical algorithms include AE, VAE[6], Ano-GAN[7], etc.

  • Another way of thinking is based on feature representation. The basic idea is to find a better feature representation, map the OK graph and the NG graph to the high-dimensional feature space, and the intra-class distance of the feature points corresponding to the OK graph is very small. If the distance between the corresponding feature point and the center of the OK graph feature cluster is very far, it can be judged as NG. Typical algorithms include SVDD[8], OCSVM, DeepSVDD[9], etc.

There are two ways to reduce sample dependence based on supervised algorithms:

  • One is to normalize the input data to reduce the difference between different defect samples. The normalization algorithm is based on the traditional image processing algorithm, which requires different algorithm designs for different scenarios. It is difficult to be universal, so it is only used as Some temporary means of treatment.

  • Another way of thinking is based on transfer learning. Typical algorithm research and development directions are domain adaptation (Domain Adaptation, DA) and domain generalization (Domain Generation, DG).

The problem dealt with by DA requires that images of a part of the target domain can be obtained, and cross-category migration cannot be achieved, so it is suitable for dealing with cross-product model problems. On the basis of DA, DG relaxes the requirements for target domain data, does not need target domain data, and can realize cross-category migration, so cross-product, cross-model, and cross-defect category migration can be realized.

There are three basic ideas for the current research of DA algorithm. One is based on the difference measurement. The core idea is to find a difference measurement function, so that the characteristics of the source domain and the target domain samples are the smallest under this measurement function. The representative algorithm is MMD[10]; It is based on confrontation. The core idea is to construct a confrontational network and train a classifier so that the discriminator cannot distinguish whether the data comes from the source domain or the target domain. In this way, the fusion of the source domain and the target domain is realized. The representative algorithm is Dom Confusion[11] ; The third is based on reconstruction, the core idea is to construct the common features of the source domain and the target domain, and only use the common features to perform corresponding tasks. The representative algorithm is Domain Separation Networks[12].

The current research ideas of the DG algorithm are also divided into three types. The first one is to select a model with the closest distribution of the source domain for direct use during reasoning. The second one is to disassemble and combine domain-related and domain-independent components to achieve For the processing of target domain data, the third is to train domain-invariant features [13].

03

Summarize

The current supervised defect detection algorithm has been gradually implemented in scenarios with sufficient data, but industrial scenarios have a certain degree of discreteness, and most application scenarios are small-sample detection scenarios. The solution to the small-sample problem will help AI technology is applied to thousands of factories.

Although there are some preliminary solutions to the small sample problem, a thorough solution to the problem requires more in-depth research and greater investment. Aqiu Technology regards AI For Every Factory as its mission, and will continue to study the small sample problem unswervingly. It also hopes to communicate and progress with industrial people who are interested in researching industrial AI detection problems, and promote the complete solution of the small sample problem.

For more exciting content, please pay attention to the official account: BFT Robot
This article is an original article, and the copyright belongs to BFT Robot. If you need to reprint, please contact us. If you have any questions about the content of this article, please contact us and we will respond promptly.

Guess you like

Origin blog.csdn.net/Hinyeung2021/article/details/131229927