Abstract:
To address the issues of small weld seam proportions, blurred details, uneven brightness, and various complex noises in X-ray images, a method combining deep learning models and image processing was proposed for X-ray image optimization. First, the YOLOv5s deep learning model was used to automatically locate and extract weld seam regions, thereby achieving image reconstruction. Then, the particle swarm optimization algorithm was employed to dynamically adjust the parameters of non-local means denoising and adaptive histogram equalization, performing batch noise removal and contrast adjustment on the reconstructed images. Meanwhile, a convolutional kernel sharpening algorithm was applied for detail enhancement, ultimately realizing the optimization of X-ray images. Test results showed that the YOLOv5 model achieved an average precision of 95.62% and an average recall rate of 98.82% in detecting key weld seams and reference areas. Based on automatic positioning, the developed image enhancement algorithm not only effectively reduced image noise but also preserved the edge details of weld defects well, significantly improving the X-ray image quality of pipeline circumferential welds.