Pipeline defect detection method based on image processing technology

By performing image filtering, noise reduction, and equalization, a deep learning model was constructed and YOLOv8s was optimized, solving the problems of uneven image brightness and noise caused by the complex pipeline environment, and achieving efficient and accurate pipeline defect detection.

CN121767710APending Publication Date: 2026-03-31KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511744276.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

The complex pipeline environment and different shooting conditions lead to uneven image brightness and noise, which affects defect identification and classification, and reduces detection stability and efficiency.

Method used

By performing image filtering, noise reduction, and equalization, a deep learning model is constructed. Combined with dataset training and GN-Mixup data augmentation, the YOLOv8s model is optimized to improve detection accuracy and efficiency.

Benefits of technology

It significantly improves the accuracy and efficiency of pipeline defect detection, enhances the model's generalization ability and robustness, and improves detection performance in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767710A_ABST
    Figure CN121767710A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of visual identification, and discloses a pipeline defect detection method based on an image processing technology. According to the method, a GN-Mixup technology is introduced to optimize a training data set, a C2PSA attention module is introduced between a trunk and a neck of a YOLOv8s model, the last C2f module of the trunk and the neck of the YOLOv8s model is replaced by a C2fCIB module, and a neck standard convolution Conv of the YOLOv8s model is replaced by GhostConv to improve the YOLOv8s model. The GN-Mixup method can increase the diversity of training data samples, and the generalization ability and robustness of the model are remarkably improved; the C2PSA module enhances the attention capability of the model on defect information and promotes information exchange and connection between the trunk and the neck; the C2f module is replaced by the C2fCIB module, so that the detection precision of the model is improved, and the capability of processing complex input data by the model is enhanced; standard convolution Conv is replaced with GhostConv, so that when the model processes complex image information, the efficient calculation speed can be kept, and deep-level feature information can be captured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual recognition technology, specifically a pipeline defect detection method based on image processing technology. Background Technology

[0002] Due to the complex pipeline environment and varying shooting conditions, the acquired images often exhibit uneven brightness and are accompanied by noise. This reduces the clarity of target features, affecting the identification and classification of defects (such as cracks, holes, and corrosion), thereby increasing the difficulty of analysis and reducing detection stability and efficiency. Therefore, image preprocessing (eliminating noise and brightness differences) is essential before using efficient algorithms to accurately locate and classify defects. These steps are crucial for ensuring detection accuracy and stability. Traditional feature detection includes region selection, feature extraction, and classification. Common methods include Otsu thresholding and edge detection. After image preprocessing, texture and shape features are extracted, and algorithms like SVM are used for classification. However, various details can be intertwined throughout the process, making it sometimes complex to understand. The combination of HOG and SVM is often used for target detection with distinct shape features.

[0003] The pipeline defect detection method based on image processing technology described in this invention first performs image filtering, noise reduction, and equalization to reduce the impact of factors such as lighting differences, improve image clarity and consistency, and ensure high-quality input data. Next, a deep learning model capable of segmenting and recognizing damaged images is constructed, and a training sample set covering diverse scenarios is built. The model is then thoroughly trained, allowing the network to gradually master image features and damage patterns, laying a solid foundation for the detection task. Finally, the preprocessed image is input into the trained model to achieve accurate segmentation of damaged areas and classification of damage types. This process organically combines image preprocessing, deep learning modeling, and image segmentation and classification techniques, effectively improving the accuracy and efficiency of damage detection. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a pipeline defect detection method based on image processing technology, which has the advantages of high detection accuracy and high detection efficiency, thus solving the aforementioned technical problems.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a pipeline defect detection method based on image processing technology, comprising the following steps: S1: Preprocess the acquired images; S2: Optimize the YOLOv8s model to obtain an optimized YOLOv8s pipeline defect detection model; S3: Input preprocessed image samples into the optimized YOLOv8s pipeline defect detection model for model training, add the correct defect category and bounding box to the defect region in each image, and obtain the defect detection and recognition result dataset.

[0006] As a preferred technical solution of the present invention, the pipeline defect detection method based on image processing technology is characterized in that: the preprocessing operation of the acquired image includes dataset cleaning, dataset partitioning, image annotation, image standardization and normalization, and GN-Mixup data augmentation.

[0007] As a preferred technical solution of the present invention, the pipeline defect detection method based on image processing technology is characterized in that: the optimization points of the optimized YOLOv8s pipeline defect detection model include: introducing a C2PSA attention module between the trunk and neck of the YOLOv8s model, replacing the last C2f module in the trunk and neck of the YOLOv8s model with a C2fCIB module, and replacing the standard convolution Conv in the neck of the YOLOv8s model with GhostConv; The C2PSA module contains multiple PSA blocks, each PSA block contains an attention block and a feedforward network, and the feedforward network consists of two consecutive convolutional blocks; The C2fCIB module contains multiple CIB modules, each consisting of three depthwise convolutions and two standard convolutions, with the second depthwise convolution replaced by RepVGGDW. RepVGGDW contains one 3x3 and one 7x7 convolution kernel.

[0008] As a preferred technical solution of the present invention, the pipeline defect detection method based on image processing technology is characterized in that: the defect area in S3 is divided into three defect categories: corrosion, deposition, and penetration.

[0009] Compared with existing technologies, this invention provides a pipeline defect detection method based on image processing technology, which has the following advantages: This invention optimizes the training dataset by introducing GN-Mixup technology. Specifically, it improves the YOLOv8s model by introducing a C2PSA attention module between the backbone and neck of the model, replacing the last C2f module in both the backbone and neck with a C2fCIB module, and replacing the standard convolutional Conv in the neck with GhostConv. The GN-Mixup method effectively expands the training dataset and increases sample diversity, significantly improving the generalization ability and robustness of the pipeline defect detection model in complex environments, without requiring modification of the model structure. The algorithm is restructured or optimized to facilitate integration into existing deep learning frameworks; the C2PSA module enhances the model's ability to focus on defect information and promotes information exchange and connection between the backbone and neck; replacing the C2f module with the C2fCIB module not only improves the model's detection accuracy but also enhances its ability to handle complex input data; replacing the standard convolution Conv with GhostConv enables the model to maintain efficient computational speed while capturing deep feature information when processing complex image information, which not only improves the model's running efficiency but also enhances its performance, making it more robust and stable when handling complex tasks. Attached Figure Description

[0010] Figure 1 For OG-YOLO; Figure 2 This is a diagram of the YOLOv8 network structure. Figure 3 Here is a flowchart of the image preprocessing process; Figure 4 Images of defects on the inner wall of oil and gas pipelines; Figure 5 Annotate the interface for the defect image; Figure 6 Image from a YOLO file; Figure 7 Example graph for enhancing Mixup data; Figure 8 For preprocessing images; Figure 9 The fused image enhanced by GN-Mixup; Figure 10 For preprocessing image grayscale histograms; Figure 11 The grayscale histogram of the fused image enhanced by GN-Mixup; Figure 12 A diagram of the C2PSA attention module; Figure 13 This is a diagram illustrating the replacement of RepVGGDW. Figure 14 Diagram of C2fCIB module; Figure 15 This is a schematic diagram of the GhostConv convolutional structure; Figure 16 This is a diagram of the model structure. Figure 17 This is a diagram of the model training process; Figure 18 To optimize the PR curve of the model; Figure 19 Graphs showing the performance of different strategies on YOLOv8s; Figure 20a This is a partial image of pipeline defect detection results; Figure 20b This is a partial image of pipeline defect detection results; Figure 20c This is a partial image of pipeline defect detection results; Figure 20d This is a partial image of pipeline defect detection results; Figure 21 This is a comparison chart between the algorithm presented in this paper and mainstream algorithms; Figure 22 This is a comparison chart of the algorithm presented in this paper with other algorithms; Detailed Implementation The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0011] Please see Figures 1-22 A pipeline defect detection method based on image processing technology includes the following steps: S1: Preprocess the acquired images, such as... Figure 3 As shown, the operation steps include dataset cleaning, dataset partitioning, image annotation, image standardization and normalization, and data augmentation; S1.1: Dataset Cleaning: To remove low-quality images that do not contribute to model training, this paper uses a publicly available dataset of images of defects in the inner walls of oil and gas pipelines from the Kaggle website. This dataset contains approximately 16,000 images, and a portion of the image samples are shown below. Figure 4As shown, during the cleaning process, the image quality is checked first. To ensure the accuracy of subsequent pipeline defect detection, low-quality images such as blurry images and images with excessive noise need to be removed. This is achieved through multi-dimensional technical means: Clarity assessment uses the Laplacian operator for edge detection, calculating the gray-level gradient values ​​at the image edges. When the average gradient value is lower than a set threshold, it is judged as a blurry image. For example, the average gradient value threshold for pipeline images is set to 20. Noise assessment calculates the variance of image gray-level values ​​and the signal-to-noise ratio (SNR). Images with a variance less than 50 or an SNR less than 30dB are judged as images with excessive noise. Simultaneously, considering the scene characteristics of the pipeline images, additional indicators such as brightness (a gray-level average value in the range of [50, 200] is considered acceptable) and contrast (a contrast threshold is set to 0.3) are detected. After comprehensive screening, unacceptable images are removed, and high-quality, valid images are retained. S1.2: Dataset Partitioning: The cleaned data is distributed into different subsets to provide a suitable foundation for model training and evaluation. Typically, 70%-80% of the dataset is used for training, and 20%-30% for testing. When partitioning, it is necessary to ensure that the data distribution is as uniform as possible, especially in pipeline defect detection, where the proportion of different defect samples in the training and test sets must be consistent. S1.3: Image Annotation: Correct labels and bounding boxes are added to the defect regions in each image. For the dataset of images of defects inside pipes, the paper uses the annotation tool LabelImg. The annotation interface is shown below. Figure 5 As shown, the image annotation files are initially saved in JSON format. This data needs to be converted to the label format required by YOLOv8s as model input. The converted YOLOv8s label format is as follows: Figure 6 As shown; S1.4: Image Standardization and Normalization: Standardization is achieved through zero-mean, unit-variance transformation, which can be done using the transforms.Normalize function in the PyTorch deep learning framework to adjust image pixels to zero mean and unit variance; normalization is used to stretch or compress pixel values ​​to a specific range, achieved through Min-Max normalization, using NumPy array operations or OpenCV's cv2.normalize function. S1.5: Data Augmentation: The training dataset is optimized by introducing GN-Mixup technology; Mixup is a data augmentation method proposed at ICLR in 2018. It expands training data by linearly combining images and their labels, such as... Figure 7As shown, in pipeline defect detection research, the quantity and quality of data samples have a significant impact on model performance. However, obtaining a large amount of high-quality pipeline defect data in practice is very difficult. Therefore, this paper proposes a data augmentation method combining Gaussian noise with Mixup (denoted as GN-Mixup). Specifically, this paper first randomly selects four samples from the training data and uses the Mixup method to mix them to generate new samples. Then, Gaussian noise is added to the new samples to further increase data diversity. This method not only generates new samples not present in the original training data, thus enhancing the model's generalization ability, but also, through the introduction of noise, enables the model to better cope with various perturbations in real-world applications. It is important to note that different types of pipeline defects may require different data augmentation strategies. Therefore, the mixing ratio of Mixup and the intensity of Gaussian noise should be adjusted according to the type and characteristics of the defect to achieve a more optimized data augmentation effect. A comparison is made between the acquired images after conventional processing and before and after optimization processing using GN-Mixup, as shown in the figure. Figure 8 The image shown consists of four images after the original image has undergone standard processing. Figure 9 The image shows the fused data of four datasets enhanced and optimized using GN-Mixup. Next, grayscale histogram analysis was performed on the images before and after GN-Mixup enhancement. Figure 10 As shown, the vertical axis of these graphs represents the number of pixels (i.e., frequency) for each grayscale value in the image. It can be seen that the grayscale values ​​of the original image show a strong concentration in the low grayscale (close to 0) portion, and a small number of pixels exist in the higher grayscale (close to 255) portion. This indicates that in the original image, areas with lower grayscale values ​​(such as the background or dark areas) occupy most of the pixels, and the overall grayscale distribution is relatively concentrated. Figure 11 As shown, the vertical axis of this image displays the normalized frequency (i.e., the probability of each grayscale value), which differs from the absolute frequencies of the previous four images. This indicates that the grayscale distribution has significantly changed after the image enhancement operation. The enhanced image exhibits a significantly expanded grayscale value distribution range, particularly with a decrease in the number of pixels in the lower grayscale areas (areas close to 0) and an increase in the number of pixels with higher grayscale values, resulting in a more uniform overall grayscale distribution. This change indicates that the image's detail and contrast have been improved after GN-Mixup enhancement.

[0012] S2: Optimize the YOLOv8s model. The YOLOv8s model network structure diagram is as follows: Figure 2 The optimized YOLOv8s pipeline defect detection model is shown in the figure. Figure 1As shown, the optimization points of the optimized YOLOv8s pipeline defect detection model include: introducing a C2PSA attention module between the trunk and neck of the YOLOv8s model, replacing the last C2f module in the trunk and neck of the YOLOv8s model with a C2fCIB module, and replacing the standard convolution Conv in the neck of the YOLOv8s model with GhostConv. The C2PSA attention module plays a crucial role in image or video frame processing, determining the relationships between pixels in an image. Each pixel consists of three parameters: query, key, and value. When a query is performed on a specific pixel, a dot product operation is performed using the keys of other pixels, and the resulting probabilities are used to determine which pixels need attention. In other words, the pixels of attention have similar characteristics to the query pixels. To better focus on defect information in pipeline images, this paper introduces a C2PSA attention module between the backbone and neck of the YOLOv8s model, such as... Figure 12 As shown, this module enhances the model's ability to focus on defect information and promotes information exchange and connection between the main body and the neck. Specifically, PSABlock contains an attention block and a feedforward network (FFN), with the FFN consisting of two consecutive convolutional blocks. C2PSA is a high-level module composed of multiple PSA blocks. By repeatedly performing PSA operations, this module can capture deeper feature relationships without additional time overhead. Its design splits the input into two paths through the initial segmentation output convolution: a fast path and a deep processing path. This design allows the model to maintain efficient computational speed while capturing deep feature information when processing complex image information. In summary, with the help of the C2PSA attention module, the model in this paper can pay more attention to key features and better understand and process complex image information when processing defect information in pipeline images, thereby effectively improving the model's performance and efficiency. The C2f module in the YOLOv8 model is a key feature extraction component and an efficient solution to the CSP bottleneck. It contains two convolutional layers. This module is used for feature extraction at various stages of the model, and its design goal is to successfully learn and extract multi-scale features through feature vector switching and multi-layer convolution. Furthermore, the C2f module enhances the model's understanding and parsing of input data by expanding the receptive field.

[0013] Large kernel convolution is a special type of convolution method that expands the input region that influences the output of neurons in a convolutional layer. This method is primarily used in deeper layers of the model to improve performance and efficiency. In implementing large kernel convolution, this paper replaces the second depthwise convolution in CIB with RepVGGDW, as follows: Figure 13As shown, RepVGGDW contains two depthwise convolutional blocks, using 3x3 and 7x7 kernels respectively. This design allows the model to acquire more contextual information while performing efficient computation, thereby improving detection accuracy. To further enhance the model's receptive field in defect detection and acquire richer contextual information, this paper improves the last C2f module in the YOLOv8s backbone and neck. This module is replaced with C2fCIB, a novel module that combines the advantages of C2f and RepVGGDW's large-kernel convolutional modules, such as... Figure 14 As shown, this improvement not only enhances the model's detection accuracy but also strengthens its ability to handle complex input data.

[0014] GhostConv, also known as Ghost convolution, such as Figure 15 As shown, GhostConv is a deep learning technique designed to reduce computational complexity and improve efficiency. First proposed in the GhostNet network architecture, its core idea is to generate more feature maps (i.e., "ghost" feature maps) without incurring additional computational overhead. GhostConv generates a portion of the feature maps using fewer convolutional kernels, then performs linear transformations (such as pixel shifting using depthwise convolution) to generate the remaining feature maps. In this way, GhostConv can generate as many feature maps as traditional convolutions, but at a significantly lower computational cost. The main advantage of GhostConv is its significant reduction in the number of model parameters and computational complexity, thereby improving running speed and efficiency while maintaining similar performance. In the YOLOv8s model, this paper replaces the standard neck convolution with GhostConv to generate feature maps and introduces a 5×5 depthwise separable convolution to expand the receptive field, generating more feature maps and thus reducing model complexity. This improvement allows the model to maintain high computational speed while capturing deep feature information when processing complex image information. This not only improves the model's running efficiency but also enhances its performance, making it more robust and stable when handling complex tasks.

[0015] S3: Input preprocessed image samples into the optimized YOLOv8s pipeline defect detection model for model training. Add the correct defect category and bounding box to the defect region in each image to obtain the defect detection and recognition result dataset. The defect regions are divided into three defect categories: corrosion, deposition, and seepage.

[0016] The comparative experiment is as follows: The training environment for the model in this paper is shown in Table 1. After preparing the image samples, the YOLOv8s algorithm was used for model training. Precision and recall are commonly used evaluation metrics. Precision is the ratio of the number of correctly predicted boxes to the total number of predicted boxes, while recall is the proportion of actual positive samples that are successfully identified as positive. When the IoU threshold is set to 0.5, mAP@0.5 represents the average precision. mAP@0.5-0.95 covers several different IoU thresholds, that is, it is measured every 0.05 from 0.5 to 0.95, providing a more comprehensive evaluation of model performance. Generally speaking, mAP@0.5-0.95 reflects the overall performance of the model better than mAP@0.5. The experiment yielded the following results: (1) P: 0.956 (precision), which means that the model is correct in 95.6% of all instances where it is predicted as defective.

[0017] (2) R: 0.930 (recall rate), which means that the model correctly identified 93.0% of all real defects.

[0018] (3) mAP@0.5: 0.963, which means that the average accuracy of the model is 96.3%.

[0019] (4) mAP@0.5-0.95: 0.820, which means that the average accuracy is 82.0% when the step size is 0.05 in the range of IoU from 0.5 to 0.95.

[0020] Table 1 Training Environment The optimization strategies for the YOLOv8s pipeline defect detection algorithm include: introducing GN-Mixup technology, introducing a C2PSA attention module between the backbone and neck of the YOLOv8s model, replacing the last C2f module in the backbone and neck of the YOLOv8s model with a C2fCIB module, and replacing the standard convolution Conv in the neck of the YOLOv8s model with GhostConv.

[0021] The optimized YOLOv8s architecture diagram is as follows: Figure 1 As shown, it is named OG-YOLO, where OG stands for Oil and Gas. Next, we will conduct experimental analysis and comparisons based on four optimized algorithms, as follows: Figure 16 As shown, the YOLOv8s model training start interface displays information such as hyperparameters and network structure. The training process can be found in [link to training instructions]. Figure 17The training results with four optimization strategies are as follows: P: 0.959, R: 0.934, mAP@0.5: 0.975, mAP@0.5-0.95: 0.868. Subsequently, the PR curve was plotted to obtain the training results: the model's average accuracy for pipeline defect identification at mAP@0.5 is 0.975, as shown below. Figure 18 As shown, the results are analyzed by comparing them with the original YOLOv8s model: (1) Improvement in accuracy (P): It increased from 0.956 to 0.959, an improvement of 0.003, indicating that after the four strategies were used together, the model reduced false positives (FP) in instances predicted as defects and improved accuracy.

[0022] (2) Improved recall (R): increased from 0.930 to 0.934, an improvement of 0.004, indicating that the four strategies enhanced the model's ability to identify real defects and reduced false negatives (FN). By combining GN-Mixup and the attention module, the model became more sensitive to edge or hard-to-detect defects.

[0023] (3) mAP@0.5 improvement: from 0.963 to 0.975, an improvement of 0.012, indicating that the four strategies improved the localization accuracy of the model under low overlap (IoU=0.5) conditions. This may be due to the improvement of feature extraction by GN-Mixup data augmentation and GhostConv convolution module, which makes the model more accurate in locating low contrast or small defects.

[0024] (4) mAP@0.5-0.95 significantly improved: from 0.820 to 0.868, an improvement of 0.048, indicating that the four strategies significantly improved the model's accuracy under higher IoU conditions, especially under more stringent detection requirements, the model's performance was significantly optimized. This improvement may be attributed to the introduction of C2PSA and C2fCIB attention modules, which help the model better capture and focus on key regions in complex environments, thereby improving overall detection accuracy.

[0025] In pipeline defect detection tasks, to further improve model performance, this paper explores various data augmentation and model optimization strategies. To this end, the following optimization strategies were adopted: introducing a C2PSA attention module between the backbone and neck of the YOLOv8s model; replacing the last C2f module in the backbone and neck of the YOLOv8s model with a C2fCIB module; and replacing the standard convolution Conv in the neck of the YOLOv8s model with GhostConv. These four strategies were then applied to the YOLOv8s model for comparative experiments. Table 2 shows the specific performance of these strategies on YOLOv8s, including accuracy (P), recall (R), mean precision (Map@0.5), and overall mean precision (Map@0.5-0.95).

[0026] Table 2 shows the performance of different strategies on YOLOv8s. By converting the table data into a line chart for analysis, we can gain a deeper understanding of the specific impact of different strategies on model performance. Figure 19 As shown in the figure, the line chart visually illustrates the impact trends of different strategies on various indicators. The chart reveals that different strategies have varying degrees of impact on model performance, exhibiting differences across different evaluation metrics. A detailed analysis follows: (1) GN-Mixup data augmentation: The GN-Mixup algorithm, which introduces Gaussian noise, helps the model augment data during training, thereby improving recall and slightly improving accuracy. (2) C2PSA Attention Module: The attention module helps the model automatically focus on important defect areas, improving the model's accuracy, especially in the detection of small or low-contrast defects.

[0027] (3) C2fCIB module: This module enhances the model’s ability to process contextual information and improves the model’s ability to perceive and locate details, especially under high overlap IoU conditions.

[0028] (4) GhostConv convolution: GhostConv replaces standard convolution, which improves the computational efficiency and feature extraction capability of the model, especially for the recognition of details and edges, and further improves the accuracy and localization performance of the model.

[0029] In summary, by combining these four strategies, the overall performance of the YOLOv8s model in pipeline defect detection was significantly improved, particularly in accuracy, recall, mAP@0.5, and mAP@0.5-0.95. The four strategies jointly optimized the model's localization accuracy, defect identification capability, and computational efficiency, making the model more robust and efficient in practical applications. This demonstrates that a reasonable combination of strategies can significantly improve the overall performance of YOLOv8s in pipeline defect detection.

[0030] The test set contains 4800 defect images. A trained network model was used to detect and identify them. The detection results are as follows: Figure 20a , Figure 20b , Figure 20c and Figure 20d As shown.

[0031] Table 2 Performance of different strategies on YOLOv8s Table 3 presents the comparative results of different algorithms in pipeline defect detection tasks, namely, a comparative analysis of the proposed algorithm and mainstream algorithms. The table lists the performance of several YOLO models (YOLOv8s, YOLOv9s, YOLOv10s) and the method combining the four optimization strategies proposed in this paper, in terms of precision (P), recall (R), mAP@0.5, and mAP@0.5-0.95. Converting the table data into line graphs allows for a more intuitive comparison of the performance of different methods, highlighting the advantages of the proposed method in various metrics. Figure 21 As shown, the line graph clearly displays the trend of changes with the method, making it easy to observe the fluctuations of different methods on various indicators. The graph shows the differences between different algorithms on different evaluation indicators, as analyzed in detail below: YOLOv8s model (P: 0.956, R: 0.930, mAP@0.5: 0.963, mAP@0.5-0.95: 0.820): This model has a high balance between recall and precision, but the mAP (0.820) under high IoU conditions is relatively low, indicating that there is still room for improvement in its ability to meet strict positioning accuracy requirements.

[0032] The YOLOv9s model (P: 0.948, R: 0.938, mAP@0.5: 0.964, mAP@0.5-0.95: 0.836) showed an improved recall of 0.938, slightly higher than YOLOv8s, indicating that the YOLOv9s model has an advantage in identifying more defects (reducing false negatives). Precision decreased slightly (0.948), indicating an increase in false positives (FPs). The mAP (0.836) under high IoU conditions was significantly improved compared to YOLOv8s, suggesting that YOLOv9s has better localization capabilities under high overlap conditions.

[0033] The YOLOv10s model (P: 0.916, R: 0.901, mAP@0.5: 0.947, mAP@0.5-0.95: 0.750) showed a significant drop in precision to 0.916, indicating a noticeable problem with false positives. The recall also decreased to 0.901, slightly higher than YOLOv8s and YOLOv9s, but still weaker overall. The model's low mAP@0.5 (0.947) and mAP@0.5-0.95 (0.750) indicate that its performance is inferior to YOLOv8s and YOLOv9s in terms of localization accuracy and high IoU conditions.

[0034] Ours (YOLOv8s model with four combined strategies) (P: 0.959, R: 0.934, mAP@0.5: 0.975, mAP@0.5-0.95: 0.868): Precision (P) slightly improved to 0.959, performing very close to YOLOv8s, but significantly reducing false positives compared to YOLOv9s and YOLOv10s. Recall (R) improved to 0.934, indicating that the model's ability to detect real defects was further improved, reducing false negatives. mAP@0.5 improved to 0.975, higher than YOLOv8s, YOLOv9s, and YOLOv10s, indicating that the model's localization accuracy under low overlap conditions was significantly improved. The mAP@0.5-0.95 was significantly improved to 0.868, surpassing the other three models, indicating that the four strategies effectively improved the detection accuracy of the model under high IoU (high overlap) conditions, and further enhanced the overall performance of the model.

[0035] In summary, by combining four optimization strategies (GN-Mixup, C2PSA attention module, C2fCIB module, and GhostConv convolution), the Ours model achieved significant improvements in precision, recall, and mAP, especially in mAP performance within the 0.5-0.95 range, where it showed a marked improvement compared to other models. This indicates that the fusion of these strategies optimized the overall performance of the YOLOv8s model, particularly in balancing high precision and high recall while improving localization accuracy. Compared to other YOLO models, the Ours model demonstrated significant advantages in recall, mAP under low IoU conditions, and mAP under high IoU conditions, proving the effectiveness and complementarity of these four strategies.

[0036] Table 3 Comparison of the algorithm in this paper with mainstream algorithms Table 4 presents the comparative analysis results of the proposed algorithm with other non-mainstream algorithms. To further verify the algorithm's performance, several existing object detection methods were selected for comparative experiments, including YOLOv3-New Anchor Box-Glou, YOLO-X-Attention, YOLOv5, YOLOv5s, and YOLOv8n-GVC-MLCA. Common metrics among these methods were selected for comparison: precision (P) and mean average precision (mAP@0.5). Data not found is indicated by -. The results are shown in Table 4. The data in the table is then converted into a bar chart for analysis. Figure 22 As shown, the bar chart provides a clear comparison of the performance of different algorithms on P and mAP@0.5 metrics, highlighting the advantages of the proposed method across various indicators. The chart also reveals the differences between the algorithms on different evaluation metrics, as detailed below: The accuracy (P) values ​​for YOLOv5s, YOLOv8n-GVC-MLCA, and our proposed algorithm (Ours) are given. YOLOv5s has a P value of 0.712, YOLOv8n-GVC-MLCA has a P value of 0.951, while our proposed algorithm (Ours) has a P value of 0.959. It can be seen that YOLOv8n-GVC-MLCA and our proposed algorithm are significantly more accurate than YOLOv5s, while our proposed algorithm has the highest accuracy, indicating that it can more effectively reduce false positives when identifying targets.

[0037] The mAP@0.5 values ​​for YOLOv3-New Anchor Box-Glou, YOLO-X-Attention, YOLOv5, and our proposed algorithm are 0.877, 0.97, 0.957, and 0.975, respectively. While YOLOv5s and YOLOv8n-GVC-MLCA do not provide mAP@0.5 data, their p-values ​​indicate a high level of accuracy. In comparison, YOLO-X-Attention's mAP is quite close to that of YOLOv5, but our proposed algorithm, with 0.975, is slightly higher, demonstrating better detection performance in terms of average precision.

[0038] Analysis of the two indicators, P and mAP@0.5, reveals that the algorithm of this invention maintains a leading position in both accuracy and average precision, demonstrating better overall detection performance.

[0039] In summary, the analysis of the two indicators, P and mAP@0.5, shows that the algorithm in this paper maintains a leading position in both accuracy and average precision, and has better overall detection performance.

[0040] Table 4 Comparison of the algorithm presented in this paper with other algorithms Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A pipeline defect detection method based on image processing technology, comprising a YOLOv8s model, characterized in that: The method comprises the following steps: S1: preprocessing the collected images; S2: optimizing the YOLOv8s model to obtain an optimized YOLOv8s pipeline defect detection model; S3: inputting the preprocessed image samples into the optimized YOLOv8s pipeline defect detection model for model training, adding correct defect categories and bounding boxes to the defect areas in each image, and obtaining a defect detection and recognition result data set.

2. The method for detecting defects in a pipeline based on image processing technology according to claim 1, characterized in that: The preprocessing of the collected images comprises data set cleaning, data set division, picture labeling, standardized and normalized images, and GN-Mixup data enhancement.

3. The method for detecting defects in a pipeline based on image processing techniques according to claim 1, characterized in that: The optimization points of the optimized YOLOv8s pipeline defect detection model comprise: introducing a C2PSA attention module between the backbone and the neck of the YOLOv8s model, replacing the last C2f module of the backbone and the neck of the YOLOv8s model with a C2fCIB module, and replacing the standard convolution Conv of the neck of the YOLOv8s model with a GhostConv; The C2PSA module comprises a plurality of PSA blocks, each PSA block comprises an attention block and a feedforward network, and the feedforward network is composed of two consecutive convolution blocks; The C2fCIB module comprises a plurality of CIB modules, wherein the CIB module is composed of three deep convolutions and two standard convolutions in alternation, the second deep convolution is replaced with a RepVGGDW; and the RepVGGDW comprises a 3x3 and a 7x7 convolution kernel respectively.

4. The method for detecting defects in a pipeline based on image processing technology according to claim 1, characterized in that: The defect areas in S3 are divided into three defect categories: corrosion, deposition and penetration.