| Defect detection of industrial products(such as electronic tube welding image,cable cross-section image,etc.)is an important part in the production quality control process.The traditional manual detection method is closely related to the experience level and actual performance of workers,which is easy to lead to false detection and missed detection.In recent years,machine vision has gradually replaced the traditional manual detection methods.With the development of deep learning technology,machine learning models have achieved good performance in large-scale data sets and parameter quantities.However,in the field of industrial image detection,after the improvement of production technology,the sampling samples of industrial defect images are often insufficient.The target detection or segmentation task of defect samples is usually a small sample learning task,and the common supervised learning training is more difficult.To solve the above problems,this paper designs two related task models based on generative neural network theory: unsupervised single sample generation neural network combined with attention mechanism and industrial sample semi-supervised image defect segmentation model based on pretrained models.The main work includes:(1)Aiming at the problem that the sample number of industrial product defect images is often insufficient,and the neural network needs a large number of effective samples for training,this paper designs a single sample industrial image generation network CBAM model based on ConSinGAN model and attention mechanism.The network model enhances the feature learning ability of the target region of weak and small defects through the dual channel attention mechanism,and enhances the learning ability of the background texture by designing a composite function with structural similarity.The experimental results show that the improved network can stably and effectively generate a large number of industrial defect sample images with the same style under the condition of a very small number of sample input.This work can provide an effective experimental sample source for defect target segmentation.(2)Aiming at the problems of irregular defects and fuzzy edges in industrial defect samples,which make it difficult to carry out image pixel level annotation,and the problem that certain guidance information is still needed to determine the abnormal region representation after the convolution auto-encoder(AE)model learns the effective distribution representation of the feature space of defect free samples,this paper designs an auto-coding model,inception AE,after unsupervised pre-training,A few defect images with segmentation marks and most defect images without segmentation marks are mixed for semi supervised learning,and the designed composite loss function is added to fine tune the parameters of the model to select the effective segmentation threshold.The designed model can only get the basic training model through the pre-training of normal industrial samples,and then get the parameter fine-tuning learning on a small number of different labeled defect images.In this paper,the concept convolution block is integrated into the convolution auto-encoder neural network.Compared with the original AE network,it has better multi-scale feature extraction effect,and the parameters and operation scale of the model are reduced to a certain extent.The experimental results show that the quantitative index score is close to that of the fully supervised segmentation network model,and the proportion of false positive in the segmentation image is reduced by 20.3% compared with the unsupervised segmentation model.Based on Ubuntu 20.04 system platform and Python language,this paper uses two commonly used deep learning frameworks Tensor Flow and Py Torch to train and test the model based on the open data set of Mevtec industrial products,and verifies the model design effect of this design module in combination with the training of other open data sets(cifar-10 and MNIST data sets).The two generative neural network models designed in this paper can effectively solve the urgent problems in industrial product images.Compared with the unsupervised segmentation model,the best segmentation accuracy of the final segmentation network is improved by 9.3%,which is close to the supervised segmentation level,and has better practical significance. |