Metal is an indispensable raw material in the field of industrial manufacturing,and metal products are also widely used in various aspects of daily life.Due to the influence of various factors during the processing and production of metal products or the daily operation of metal equipment,it is inevitable that some damage will be caused to the surface.The metal surface defects caused by these damages may affect the appearance of the product,reduce the strength of the material,and even shorten the life of the workpiece in severe cases,resulting in potential safety hazards.Therefore,the detection of metal surface defects is very important.Due to the subjective factors of the inspectors,the traditional manual visual inspection method is time-consuming and labor-intensive and the detection efficiency is not high.In recent years,the rapid development of deep learning technology has greatly improved the detection efficiency of metal surface defects,and the cost has also been reduced.This progress is attributed to the application of deep learning technology.In this paper,aiming at the problems of blurred and complex defect images in the detection of metal surface defects,SRGAN and YOLOv3 are respectively selected as the basic algorithms,and targeted improvements are made to complete super-resolution reconstruction and metal surface defect detection,and finally complete the metal surface defect Detection system design and application.The specific research work of this paper is as follows:(1)A super-resolution reconstruction method for metal surface defect images based on SRGAN is proposed,which solves the problem of blurred defect images in the detected data set.In view of the fact that the defect size in the image is generally small,an upsampling structure is introduced into the generator of the original SRGAN network for feature transfer,which further enhances the utilization of feature information of each residual block in the original network.In order to ensure the calculation speed and reconstruction effect of the network,depth separable convolution is introduced into the residual block and the batch normalization BN layer is removed to accelerate the network reasoning speed and improve the super-resolution reconstruction effect of the model.(2)A metal surface defect image detection method based on YOLOv3 is proposed,which solves the problems of missed detection during the detection process.Aiming at the problem that the target features of metal surface defects are not clear,it is proposed to replace the activation functions in all residual blocks in the backbone feature extraction network with dynamic activation functions,and introduce a mixed attention mechanism module to enhance the feature extraction ability of the backbone feature extraction network;for defects For the problem of small target size,it is proposed to add a 104×104 scale feature layer in the feature pyramid network part and perform cross-layer dense connection to enhance the sensitivity of the network to small defect target detection,and use K-Means++ to re-optimize the prior The size of the box makes the defect target location more accurate.(3)A metal surface defect detection system is designed.Analyze and select image acquisition hardware such as industrial cameras,lenses,light sources,etc.,and complete the acquisition of defect images;use python third-party library Py Qt5 to design software solutions,and complete visual output of defect prediction results;use self-collected metal The guide rail surface defect data set is actually detected systematically,and the super-resolution reconstruction and detection of defect images are completed.The results show that the detection system in this paper has good practicability. |