Abstract:Pipeline defect detection is a crucial component of pipeline safety management and plays a key role in ensuring pipeline safety. Ultrasonic testing technology can be used to identify and assess internal defects in pipelines. To address issues such as low execution efficiency and false or missed detections in manual analysis of testing data, this paper proposes a defect recognition method for pipeline ultrasonic images based on an improved YOLOv8n model. The dynamic serpentine convolution is introduced into the C2f module of YOLOv8 to enhance feature extraction capabilities for defects. Dilated convolutions are integrated into the SPPF module to reduce defect information loss, while a shared group convolution detection head is used to lower the model complexity while improving defect localization accuracy. Experimental results demonstrate that the improved YOLOv8n algorithm enables automatic defect detection in pipeline ultrasonic images. Compared to the original model, the improved model achieved a 2.1% increase in mAP50, with reductions in computational load and parameter count by 15% and 7%, respectively. The improved model outperforms other mainstream detection algorithms in overall performance.