| Product appearance inspection is an essential step in production.At present,most factories adopt the form of manual inspection,which not only increases the cost of products,but also has the problems of low inspection efficiency and accuracy limited by manual experience.In order to solve the above problems,this paper proposes an industrial product appearance detection algorithm based on deep learning.The research work of this topic is as follows:(1)Make data sets.First of all,the valve with defective appearance was photographed and collected manually.Due to the limited number of photos taken,the images are preprocessed and then enhanced according to the changing factors in the actual production environment,such as the influence of illumination.Finally,the image annotation platform of Tianjin Huada Technology Co.,Ltd.is used to mark the defects in the sample data,and XML information corresponding to the image will be generated directly after saving.The construction of image data set is completed.(2)Analyze the feature extraction network.In order to obtain higher detection accuracy,Resnet series of deep residual networks,which are relatively new,with larger model complexity and deeper layers,are selected to explore and study.Taking Faster-RCNN as the starting point,the backbone network was changed to Resnet_50and Resnet_101 respectively for experiment,and the network model was optimized and modified.The experimental results show that the training accuracy of the model using Resnet_50 as the backbone network is slightly higher than that of the second model.Therefore,the Faster-RCNN network model using Resnet_50 as the backbone network is selected to continue the improvement test.Its training accuracy is 99.5%,which is higher than the improved Faster-RCNN network based on Resnet_101.(3)Due to the limitations of Faster-RCNN network itself,this paper proposes an algorithm to nest the attention mechanism plate with the convolutional neural network.The purpose is to increase the correlation between internal feature points and external long distance and enhance the characterization ability of feature maps and the ability of image feature capture.By embedding channel attention plate in the backbone network(feature extraction network),the correlation parameters of feature points in each part of the feature graph of each level of image are calculated.(4)The strategy used in the golden tower structure of feature network within the Faster-RCNN algorithm is original feature fusion.That is,the image of the deep infographic gradually and shallow infographic blending.The disadvantage of this method is that the features of all levels of picture information are not fully integrated.In order to solve this problem,the feature fusion algorithm is improved in this paper.The first step is to correct the feature information of different scales to one size by fusing the feature information.Then the output feature map is combined with the attention mechanism,and the attention module will process the information map internally.Since the output is a feature graph of the same scale,it needs to be processed back to the multi-scale feature graph,so as to achieve a more sufficient and effective fusion of multi-scale information for the continued use of the following network.Finally,the self-made data set was used to verify the effectiveness of the algorithm.The detection rate of scratch defect was 95.8%,the error rate was 0.59%,and the over-detection rate was 0.The detection rate of labels was 100%.Experimental results show that the average accuracy of the proposed algorithm is3.7% higher than that before the improvement. |