With the development of deep learning and machine vision,convolutional neural networks(CNN)have been applied to the fields of image segmentation and image object detection in addition to image classification due to its automatic extraction of image features.In this paper,workpiece surface defect detection is the main research content,steel plates and aluminum castings are taken as the research object.The research mainly starts from three aspects:workpiece surface defect classification,workpiece surface defect detection and the detection of small defects on the workpiece surface.Combined with related theories,the corresponding methods in these three scenarios are proposed.Main tasks as follows:(1)Aiming at the problem that the extracted features of classic convolutional neural network classification model are not accurate enough and its defect classification accuracy rate is low,a new classification network(SCN)with symmetric modules is proposed.The proposed network SCN is based on the residual network,and the Batch Normalization layer is used to accelerate loss convergence.Different from other networks,the SCN uses two-step convolutional layer instead of pooling layer to achieve downsampling.The symmetric module includes a contracting path for capturing context and a symmetrical expanding path for precise defect localization,which can realize pixel level classification on the feature map.The strip steel surface defect classification dataset published by Northeastern University(NEU-CLS)and self-made casting surface defect classification dataset(CAT-CLS)are used in the classification experiments to evaluate the proposed method.The experimental results show that the classification accuracy of SCN is higher than Res Net-101 and Dark Net-53.It is found that the characteristics of defects are accurately extracted by comparing the feature maps of the networks.In general,SCN has superior defect classification performance and the separability of its extracted features is strong;(2)Aiming at the problems that the defect detection performance of current target detection networks is poor and its defect location is inaccurate.Combined with FPN and SCN,a defect detection network(SYOLOv3)is designed,and an intersection over union indicator(XIo U)is proposed to define its loss function due to its focus on the location of the defects.SYOLOv3 is based on the SCN and uses three detection branches with FPN structure to perform multiplescale defect detection.The initial candidate bounding boxes of SYOLOv3 are determined by the k-means++ clustering method,and the loss function is defined by Label-Smoothing and XIo U.Adam optimization algorithm is used to train the network and non-maximum suppression algorithm(NMS)is used to select the best result from the output of SYOLOv3.The experiments are conducted on the steel plate surface defect detection dataset(NEU-DET)and the casting surface defect detection dataset(CAT-DET).The results show that the detection performance and positioning performance of SYOLOv3 is better than common target detection networks,YOLOv3 series and Faster-RCNN series and its speed has the potential for real-time detection,which shows that SYOLOv3 is valuable in the field of real-time detection of workpiece surface defects;(3)Aiming at the problems of the detection network’s poor performance in small defect detection,which is caused by the uneven distribution and unobvious features of small defects,a method whose name is CSYOLOv3 is proposed for small defect detection.CSYOLOv3 uses BMosaic to expand small defect samples which is based on the Mosaic and optimized by the beta distribution.and the SYOLOv3’s attention to small defects is improved by feature reusing and loss weighting.Experiments on NEU-DET and CAT-DET show that the sample enhancement performance of BMosaic is better than Mosaic,and the small defect detection performance of CSYOLOv3 is better than SYOLOv3,which illustrates the effectiveness of the proposed BMosaic and the attention mechanism of CSYOLOv3 for small defects. |