| Machine vision technology is widely used in the field of workpiece surface detection.The use of image processing-related algorithms to achieve defect detection and identification of workpiece surfaces in production effectively solves the problem of relying on manual offline operations,saves labor costs,and improves production efficiency.Aiming at the detection of surface defects of metal milling workpieces,this paper proposes an automatic detection and identification method of workpiece surface defects,and carries out the following researches:1.Image collection and sample library construction of milling workpiece surfaces.Design milling experiments to obtain the surface images of milled workpieces with different defects.An image acquisition experiment platform was set up to collect processed surface images of milled workpieces,and a sample database of milled workpiece surface images was established.At the same time,in order to further expand the sample database,based on the existing sample database,the open source Severstal data set of the kaggle platform is referenced.2.Using improved FCM to implement defect clustering segmentation.The preprocessing work is performed on the collected images,and each image is denoised and the feature structure is enhanced to improve the image quality of the original milled workpiece surface.At the same time,the traditional fuzzy C-means(FCM)algorithm does not consider the relationship between pixels during image segmentation,and does not give the initial clustering center in advance.This paper proposes a FCM clustering segmentation considering the relationship between pixels algorithm.The algorithm is based on the data field principle.First,the correlation between pixels is used to calculate the potential value of each pixel to form an image data field.Then the image data field potential center is used to determine the initial clustering center of the FCM algorithm.Based on the data field,FCM algorithm is used to realize clustering segmentation of defect images.Experimental results show that the algorithm has good segmentation effect,and the accuracy rate of different noise image segmentation for multiple defects is more than 93%,and it has a high average structural similarity.3.Detection and recognition of workpiece surface defects based on Dense Net.Using mirror symmetry,random cropping,image noise,and PCA-based image color intensity transformation to enhance the original data and expand the data volume.After analyzing the image recognition requirements of workpiece surface defects,the output structure of the network was determined.Using transfer learning,based on Dense Net121,the overall network structure is established,and the sample database is divided into training set,validation set,and development set according to 60%,20%,and 20%.It is trained on the training set to achieve the purpose of detecting and identifying the surface defects of the workpiece.Finally,the test set data is used to verify the effectiveness of the network model.Theoretical analysis and experimental results show that the automatic detection and identification method of workpiece surface defects proposed in this paper has a good detection effect and can solve the problem of traditional workpiece surface defect detection relying on manual detection to a certain extent.The trained model has better robustness and accuracy for defect detection of milled workpiece surface images,and can identify detailed information of defect images. |