| Pipeline transportation can transport a large amount of fuel in a short period of time,reduce energy waste,and ensure the safety of regional energy supply.Therefore,pipeline transportation is the most effective way to solve the imbalance of oil and gas resource production and demand between regions.Therefore,oil and gas pipelines play a crucial role in modern industry and economy,and pipeline safety is an indispensable part of the energy transportation field,playing an important role in national energy security,economic stability,and environmental protection.As a common connection method in oil and gas pipeline systems,the quality of pipeline welding is an important factor to ensure pipeline safety.Oil and gas pipeline accidents caused by weld defects occur from time to time.Based on deep learning and image processing technology,this thesis improves the Faster R-CNN algorithm is used in the pipeline weld image detection task.The main work of this thesis is as follows:(1)We provide an overview of the welding process for circumferential welds and analyze the defects present in the welds.Convert the collected DICOM format images into PNG format images that support deep learning training;Label all images with defects,count the number of various defects,and select circular defects,incomplete fusion,and strip defects as the research objects of this thesis.Use horizontal flipping,vertical flipping,diagonal flipping,gamma transformation,and linear transformation to expand the data for the relatively small number of strip defects,overcome data imbalance,and complete the preparation of the weld X-ray image dataset.(2)We analyze the characteristics of X-ray images of welds and design algorithms to remove white edges around the image.The weld bead only accounts for a small part of the weld seam image.To reduce interference,an image processing algorithm is designed for image segmentation.Firstly,after completing image denoising,enhancement,and other operations,the Otsu method is used for image segmentation;Afterwards,a welding seam image segmentation algorithm based on grayscale curves was designed.This method first extracts the grayscale curves in the direction of the image column,performs noise reduction on the curves,and then develops a strategy to determine the center of the weld bead.Then,a sliding window is established from the center to both sides to search for the weld bead boundary,completing the segmentation of the weld bead area.Compare the Otsu method with the grayscale curve based seam image segmentation method,and select the seam image segmentation method based on grayscale direction that has a good effect.Complete the seam segmentation and training dataset production.(3)We study the network structure of Faster R-CNN object detection algorithm,and select ResNet50 as the backbone feature extraction network of the algorithm to address the problem of deep network model degradation.Using the Python deep learning framework to build a Faster R-CNN model and conducting experiments,the average detection accuracy(mAP)obtained was 0.801.(4)In order to improve the detection accuracy of the Faster R-CNN model,it is improved in many aspects.Firstly,the RoI Align algorithm is used to replace the RoI pooling algorithm in the original model to solve the feature error caused by RoI pooling rounding the anchor frame.Secondly,FPN is added to improve the feature extraction ability of the model,and the feature map generated by FPN is post-processed with the attention mechanism module to reduce the feature fusion error.Finally,the anchor generated by the Anchor K-means algorithm is used to optimize the model,and the final optimization of the model is completed,and the mAP of the three types of defects of the improved model is 0.869. |