Aiming at the problem that there are few data sets of casting weld surface defects in the mechan-ical manufacturing industry,and the detected objects are in a complex environment,resulting in difficult tar-get detection and low recognition accuracy,an improved YOLOv3 algorithm is proposed.The effective data enhancement technology is used to improve the robustness of the model and make it more suitable for the real environment.The lightweight network GhostNet is introduced to replace the original backbone network to reduce the number of model parameters and training time.The spatial pyramid pooling structure is added to the output end of the last layer of the backbone network to improve the receptive field of the model and enhance the anti-interference ability of the model.In FPN(feature pyramid network),1×1 convolution and channel attention mechanism are introduced to prevent dimension loss and improve the attention to important features,and enhance the feature extraction of small targets.In the training process,Focal Loss is introduced to improve the prediction accuracy of the model for positive samples.The experimental results show that compared with the original YOLOv3,the improved model improves the mAP by 1.55%and the small target pore AP by 4%on the casting weld defect dataset,which increases the recognition accuracy of small targets.
surface defectscasting weldYOLOv3pyramid pooling of spaceGhostNet