| Welding technology is an important method of joining various metal parts and is widely used in various fields of modern industry.X-ray non-destructive testing technology is widely used in the field of weld defect detection as it can accurately display the shape and location of defects.For the resulting X-ray image using manual identification of defects,inefficient and subjective factors that can easily lead to misdetection and omission;machine vision-based inspection methods require manual selection of features,when the features are not selected properly,the accuracy of the algorithm will be reduced.In recent years,deep learning technology has been rapidly developed and widely used in security,medical,education and other fields,but it is less applied in weld defect detection.This paper is dedicated to the research of weld defect detection system assisted by semantic segmentation model based on the background of weld defect detection and deep learning,and the main research contents are as follows:(1)Weld seam image processing and the establishment of weld defect dataset.First of all,to address the problem that the size of the original weld image is too large and the weld area is small,the OTSU-based weld area extraction algorithm is designed to extract the weld area;then,to address the problem that the image is noisy and the target is not obvious,the median filter is used to filter the noise in the image and the gamma transform is used to enhance the image contrast;the image is flipped and rotated to expand the dataset for the lack of data;finally,the image is Finally,a small semantic segmentation dataset of weld defects is constructed by annotating the images.(2)In the part of weld defect segmentation,the semantic segmentation network U-Net is selected as the base model for this paper,and the semantic segmentation network Weld Seg Net is proposed by adapting it to the characteristics of weld defects.The model firstly adopts the residual network Res Net50 to replace the original backbone network to improve the feature extraction capability of the network;then introduces the multi-attention feature fusion module at the jump connection of U-Net,combining the spatial attention mechanism and the channel attention mechanism,and places them in the low and high dimensional parts of the network feature extraction respectively according to their implementation principles,so as to obtain the rich semantic information at the high level and the bottom rich contour texture information;secondly,to address the problem of inaccurate defect edge segmentation due to the loss of edge features in the downsampling process of the U-Net network,an edge detection sub-network is introduced to learn the edge information of defects to provide fine edges for weld image segmentation and improve the segmentation effect;finally,to alleviate the problem of extreme imbalance between background and defect pixels of weld images,a focal loss function is introduced to replace the original Finally,in order to alleviate the problem of extreme pixel balance between background and defects in weld images,the focal loss function is introduced to replace the original cross-entropy loss function to improve the segmentation performance of the network for small area targets such as circular defects.The experimental results show that the model proposed in this paper has good segmentation performance,with the accuracy of weld defect segmentation reaching90.7% and the average cross-merge ratio reaching 74.9%,which is better than U-Net and most of the networks proposed in recent years in terms of accuracy and average cross-merge ratio in weld defect detection.(3)Weld defect assisted detection system design.According to the proposed semantic segmentation algorithm for weld defects,a weld defect assisted detection system is developed using Open CV and Py Qt,which has functions such as weld region extraction,image noise reduction,image contrast enhancement,and weld defect segmentation,which can help inspectors to better detect defects and achieve detection intelligence. |