| As AI-related industries enter the fast lane of development,the metal manufacturing industry still uses the target defect detection method of manual eye inspection to detect defects in rigid metal materials.This traditional target defect detection method has the disadvantages of high production costs,high labour intensity,high false detection rate and poor accuracy.In order to solve the problem of detecting surface defects in the production process of these companies,reduce labour costs and improve inspection accuracy.The paper proposes to improve the accuracy of metal surface defect detection by improving the YOLOv3 algorithm model,which uses the Dark Net-53 network structure of the YOLOv3 algorithm model as the backbone network structure of the algorithm model,improves the feature extraction of the target in the image by adding feature layers to the neural network,and introduces The spatial pyramid pooling module structure is introduced to replace the feature pyramid network structure to normalize the size of various defects,reduce the training time of the model and improve the detection accuracy of small targets and stacked small targets in the image.The K-Means++ clustering algorithm is also used to improve the convergence speed of the neural network,for example.The model was trained using an open source dataset and after comparing the training results of common algorithm models such as YOLOv2,SSD and YOLOv3,it was demonstrated that the improved algorithm model has some improvement in detection accuracy without significantly affecting the detection speed of the algorithm model with an m AP of 75.76% of the model effect and a detection speed of 31 images per second.Finally,an automated metal surface inspection system was designed and built using existing shop floor hardware and tested on a real production line in the hope of helping to reduce the workload of factory staff and at the same time reduce production costs.The main research elements of this paper are as follows.(1)Firstly,given the complex environment inside the factory floor,factors such as dust particles in the air and poor lighting conditions lead to poor imaging of images,which adversely affects the accuracy of defect detection.To solve this problem,the thesis uses photography in an enclosed light box to reduce the impact of environmental factors on image imaging,and then performs image processing,experimenting with grey scale transformation and neighbourhood denoising to reduce noise in the images.(2)Secondly,considering that there may be smaller objects in the image,the thesis chooses to increase the feature scale in the network structure on the output layer of the YOLOv3 algorithm model in order to improve the feature extraction capability of the algorithm model for target features in this practical scenario.(3)Finally,in order to solve the problem of small target objects being occluded in the image,the algorithm model uses a spatial pyramid pooling module to extract shallow and deep features from the image to improve the feature extraction capability of the model for stacked targets generated in the image,so as to improve the detection accuracy of the algorithm model for targets. |