1. Introduction
Metal pipelines are essential transportation tools to convey petroleum, natural gas, chemicals, and water in modern industries [
1,
2]. Pipeline transportation offers higher efficiency, lower operational costs, and less environmental pollution than road and rail systems [
3]. However, the long-term deployment of pipelines may lead to critical defects, which commonly arise from changes in the surrounding environment or corrosion caused by the substances transported in the pipelines [
4,
5]. These defects jeopardize normal functionality and pose serious risks to public safety [
6]. Thus, it is paramount to timely detect these defects [
7]. Numerous techniques have emerged to detect surface defects of pipelines with the continuous advancement of sensor and computing technologies, including closed-circuit television (CCTV) [
8], Non-Destructive Testing (NDT) [
9], and Ground-Penetrating Radar (GPR) [
10], etc. Commonly, NDT encompasses visual inspection, magnetic flux leakage testing [
11,
12], sonar testing [
13], laser projection imaging, and pulsed eddy current testing [
14].
Traditional detection techniques often compromise detection effectiveness due to the inherent properties of metal pipelines. CCTV remains the most widely applied detection technology because of its low cost. It involves operators maneuvering robots into pipelines to capture inspection videos, which are then interpreted and recorded by specialized operators to offer accurate assessments. This technique eliminates the laborers entering the pipelines during inspections. However, it still requires skilled professionals to operate equipment and interpret video footage. The involvement of humans introduces a substantial degree of subjectivity in defect assessment and may result in relatively low efficiency.
Recently, automated analysis has become a prevailing trend due to the limitations of manual interpretation of defect videos. Traditional computer vision techniques primarily include threshold segmentation [
15] and edge detection [
16]. Both approaches aim to extract significant features from images for subsequent processing, employ preprocessing methods to highlight critical information, and utilize variations in pixel grayscale values to identify image characteristics [
17]. However, these techniques face considerable challenges in extracting defects in real-world scenarios, especially in some complex backgrounds of pipelines.
Convolutional neural network (CNN)-based technologies have been developed rapidly to detect defects [
18] with the rapid advancement of artificial intelligence (AI). Currently, CNN-based algorithms are categorized into one-stage and two-stage detection algorithms. One-stage algorithms include SSD [
19] and YOLO [
20] series models, while two-stage algorithms encompass RCNN [
21], Fast R-CNN [
22], Faster R-CNN [
23], and Mask R-CNN [
24]. One-stage algorithms offer higher speed but lower accuracy in detecting defects. Conversely, two-stage algorithms achieve higher precision but lower speed. The internal defect requires a high level of real-time detection in pipelines, which is also a huge challenge to the present detection methods [
25]. Therefore, this study improves the YOLO model, one of the single-stage detection algorithms, to balance the precision and speed in the detection of the pipelines.
Numerous studies have modified one-stage and/or two-stage detection algorithms to identify specific types of defects. Zhao et al. [
26] accurately extracted defect features from images by introducing an iRMB module to their detection network based on YOLOv8. Xu et al. [
27] incorporated a CA attention mechanism into the original YOLOv5 model and improved the loss function, achieving effective recognition of pipeline weld seams. Klusek et al. [
28] utilized YOLOv2 as their detection network deployed on embedded devices. This network covered both the classification and detection of pipeline defects. Wang et al. [
29] employed Faster R-CNN for defect detection and proposed an algorithm for tracking defect identification in continuous CCTV video tasks, achieving an Identity F1-Score (IDF1) of 57.4%. However, there remains room for improvement in precision. Yin et al. [
30] developed a video interpretation algorithm for sewer pipelines (VIASP) based on the YOLOv3 model that extracts key information from videos and enables automatic defect labeling, ultimately outputting evaluation reports in tabular text format. However, the processing speed is slow and the results are unsatisfactory. Chen et al. [
31] integrated EfficientVit as a feature extraction network for defects in the original YOLOv8 model, which significantly reduces the number of parameters and effectively improves the detection accuracy of defects. Lv et al. proposed an adaptive multi-scale detection transformer (AM-DETR) to effectively identify surface defects against complex backgrounds. In the specific field of pipeline inspections, researchers are actively exploring hybrid models and attention mechanisms. Furthermore, another study by Chen et al. designed a cascaded deep learning approach combining YOLOv5 and Vision Transformer (ViT) to accurately detect and classify pipeline defects from magnetic flux leakage (MFL) data. Additionally, recognizing the computational and environmental constraints of practical pipeline inspections, lightweight models have garnered considerable attention. Li et al. developed a lightweight YOLOv8-based model incorporating Squeeze-and-Excitation Version 2 (SEV2) and GhostConv modules, which successfully enhanced feature extraction and crack detection accuracy in low-light and complex pipeline backgrounds. While these studies have made substantial progress, accurately detecting small-sized defects in noisy, low-contrast CCTV images while maintaining real-time inference speed remains a challenging task.
This study modifies the YOLOv8 framework to effectively recognize defects in pipelines. Experimental results indicate that the improved model substantially enhances the performance in automatically detecting internal defects (e.g., corrosion, deposition, oxide shedding, and penetration) in metal pipelines. The main contributions of this study are below:
- (1)
A novel YOLOv8n-LskBlock-SlideLoss-SCSA model is proposed and public datasets, which contain defect samples under extreme low-light conditions and complex environments, are utilized to accurately detect defects in metal pipes.
- (2)
Compared to existing defect detection algorithms in the pipeline, the proposed method is capable of simultaneously achieving high accuracy and real-time detection of various defects in the pipeline. Additionally, the model is lightweight, facilitating deployment on terminal devices and adequately addressing practical operational requirements to a certain extent.
- (3)
Extensive experiments were conducted and the superiority of the proposed model was verified by comparing it with the current mainstream models.
The remainder of this paper is organized as follows:
Section 2 offers a detailed introduction to the architecture of the proposed YOLO-LSS model.
Section 3 outlines the comprehensive experimental setup, encompassing dataset preparation, image augmentation techniques, experimental equipment, and model evaluation metrics.
Section 4 presents a detailed analysis of the comparative and ablation experimental results. Finally,
Section 5 summarizes the entire work and discusses potential directions for future study.
5. Conclusions
The ability to identify multiple defects in complex environments is crucial for the sustainable development of the metal pipeline industry. This study proposes an improved model based on the original YOLOv8n architecture to detect defects in buried pipelines. Based on the extensive investigations, the main conclusions are drawn below:
- (1)
The SCSA module is incorporated to identify defects in complex environments.
- (2)
The neck structure, LskBlock, improves the detection accuracy by dynamically adjusting the receptive field for each target.
- (3)
Experimental results indicate that the proposed model achieves an mAP50:95 of 53.7%, representing an improvement of 7.19% over the original model.
- (4)
This study provides efficient new algorithms for detecting internal defects of pipelines in complex and low-light environments.
Furthermore, to address the model’s current weakness in detecting small-sized targets, future studies will explore the integration of advanced techniques such as super-resolution, feature pyramid enhancement, or segmentation-assisted detection approaches to further improve the detection accuracy for minor defects. Additionally, there are some limitations in the current evaluation regarding dataset diversity and independent robustness testing. Although the images were collected directly from actual pipeline engineering environments and already contain common inspection conditions, the model was primarily validated on a single dataset. Therefore, conclusions regarding its broad generalization capability and robustness in entirely unseen or highly distinct pipeline environments remain preliminary. Due to time constraints in the current research phase, further dataset expansion and testing across varying, incremental noise levels were not performed at this stage. Future work will focus on collecting a more comprehensive dataset under extreme conditions and designing a systematic robust evaluation framework to further optimize the model’s practical performance.