A DR pipe defect detection method based on decoupling detection head YOLOv5

By introducing a task-independent decoupled detection head and depthwise separable convolution into the YOLOv5 model, the conflict between classification and regression tasks is resolved, improving the accuracy and speed of DR pipeline defect detection.

CN116993657BActive Publication Date: 2026-02-27XINJIANG UYGUR AUTONOMOUS REGION INSPECTION INST OF SPECIAL EQUIP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310577871.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-22
Publication Date
2026-02-27
Estimated Expiration
2043-05-22

AI Technical Summary

Technical Problem

In pipeline defect detection, the existing YOLOv5 model uses coupled feature maps for classification and regression tasks, which cannot fully meet the different semantic information requirements of classification and regression, resulting in low detection accuracy.

Method used

The design decouples the detection heads for independent tasks, constructing separate feature maps for classification and regression tasks. It provides feature maps with a wider receptive field and richer semantic information for classification, and feature maps with more texture details and edge information for regression. It also uses depthwise separable convolution to reduce the number of parameters.

Benefits of technology

It improves the accuracy and speed of DR pipeline defect detection, enhances classification and location capabilities, and reduces computational load and model parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116993657B_ABST
    Figure CN116993657B_ABST
Patent Text Reader

Abstract

The application discloses a DR pipeline defect detection method based on a decoupling detection head YOLOv5, and comprises the following steps: inputting pipeline surface defect image data set into a backbone network of a single-stage detection model YOLOv5n, and outputting five feature maps of different scales; inputting three intermediate feature maps into a neck network of the single-stage detection model YOLOv5n for feature fusion, and outputting three feature maps; inputting the three feature maps output by the neck network and the remaining two feature maps output by the backbone network into a task-independent decoupling detection head for classification and regression prediction, and obtaining classification and regression prediction results. The task-independent decoupling detection head is introduced into the detection head of YOLOv5n, independent feature maps are constructed for classification and regression tasks respectively, decoupling is realized, and the DR pipeline defect detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision target detection, and particularly relates to a DR pipeline defect detection method based on a decoupled detection head YOLOv5. BACKGROUND

[0002] As a large-scale and long-distance carrier for transmitting gas and liquid, pipelines are often used for transmitting oil and gas resources. Pipeline defect detection, as a branch of industrial defect detection, aims to find the appearance flaws of the pipeline to ensure the safety and reliability of the oil and gas transmission process. In recent years, digital radiography (DR) has become the mainstream imaging method for defect detection due to its directness, effectiveness and convenience for quantitative determination. For the DR images of pipeline defects, the early detection generally adopts the method of manual quality inspection, which is high in cost and low in efficiency, and the detection result is highly dependent on the experience of the quality inspector, and cannot meet the large-scale detection demand. In recent years, with the rapid development of deep learning and computer vision technologies, visual-based pipeline defect detection technology has gradually emerged. Compared with manual quality inspection, visual-based pipeline defect detection method not only has high detection accuracy and good real-time performance, but also provides a safe and convenient operation environment.

[0003] The visual-based defect detection method generally extracts sample features through a CNN network first, and then classifies them by using a classifier. The current popular target detection method is divided into two categories: double-stage and single-stage. The first stage of the double-stage target detection model obtains a proposal box from the input image, and the second stage selects the optimal detection result from the proposal box. This method has high detection accuracy because of the use of a region proposal network (RPN), but has a large amount of calculation. The single-stage target detection model refers to directly obtaining the predicted class and detection box from the input image. This method generally has low calculation amount, but the detection accuracy is not as good as the double-stage model.

[0004] In the single-stage model YOLO series, the YOLOv5 model has become one of the most popular and widely implemented target detection methods in the industry because of its high accuracy, high real-time performance and Pytorch-based framework that is easier to implement. Compared with the previous versions of the YOLO series, YOLOv5 uses the Mosaic data enhancement method, adopts a more advanced and lightweight feature extraction module C3, and uses the FPN+PAN structure to enhance the feature fusion capability. Although YOLOv5 has advantages in detection speed and accuracy, it still uses a coupled detection head in the classification and positioning tasks. In fact, classification and positioning have different requirements for the semantic information of the feature map. Classification usually requires rich semantic features in the image to infer the class of the object, while positioning requires more texture details and edge information to accurately locate the target boundary.

[0005] At present, the mainstream detector has adopted a decoupled detection head, but the feature vectors used by the classification and regression tasks still come from the same feature map, and the conflict between the classification and regression tasks cannot be completely solved. In view of such problems, the application proposes a task-independent decoupled detection head applied to YOLOv5n, which designs feature maps meeting the task requirements for classification and regression tasks. For classification, a feature map with wider receptive field and richer semantic information is provided; for regression, a feature map with more texture details and more edge information is provided. SUMMARY

[0006] In view of the conflict between the classification and regression tasks in the target detection network, the application provides a DR pipeline defect detection method based on a decoupled detection head YOLOv5, which designs a task-independent decoupled detection head applied to YOLOv5n to improve the DR pipeline defect detection precision; feature maps meeting the task requirements for classification and regression tasks are designed; for classification, a feature map with wider receptive field and richer semantic information is provided; for regression, a feature map with more texture details and more edge information is provided.

[0007] The application discloses a DR pipeline defect detection method based on a decoupled detection head YOLOv5, comprising:

[0008] S1, inputting a pipeline surface defect image into a backbone network of a single-stage detection model YOLOv5n to output five feature maps of different scales;

[0009] S2, inputting the three intermediate feature maps into a neck network of the single-stage detection model YOLOv5n for feature fusion to output three feature maps;

[0010] S3, inputting the three feature maps output by the neck network and the remaining two feature maps output by the backbone network into a task-independent decoupled detection head for classification and regression prediction to obtain classification and regression prediction results.

[0011] As a further improvement of the application, the S1 specifically comprises:

[0012] S101, performing 2 times down-sampling on the input image of the pipeline surface defect image to obtain a feature map P1, and then performing 2 times down-sampling and a C3 module to obtain a feature map P2;

[0013] S102, performing 2 times down-sampling on the feature map obtained in S101, and then performing 2 C3 modules to obtain a feature map P3;

[0014] S103, performing 2 times down-sampling on the feature map obtained in S102, and then performing 3 C3 modules to obtain a feature map P4;

[0015] S104: The feature map obtained in S103 is down-sampled by 2, and then a C3 module and an SPPF module are used to obtain a feature map P5;

[0016] S105: The feature map obtained in S104 is down-sampled by 2, and then a C3 module is used to obtain a feature map P6.

[0017] As a further improvement of the present application, the down-sampling operation used in S101 is realized by a 3x3 convolution with a step size of 2; the C3 module comprises two branches: the first branch is a ConvBNSiLU module comprising a 1x1 convolution layer, a batch normalization layer BN and an activation function SiLU; the second branch comprises a ConvBNSiLU module and three BottleNeck modules; the output feature maps of the two branches are spliced and then passed through a ConvBNSiLU module to obtain the final output feature map of the C3 module; the down-sampling operations in S102 to S105 and the C3 module are similar to the structure of S101.

[0018] As a further improvement of the present application, the SPPF module in S104 is composed of two ConvBNSiLU modules and three maximum pooling layers with a step size of 1 and a size of 5x5; the input of the SPPF module is first sequentially passed through a ConvBNSiLU module and three maximum pooling layers, then the outputs of each layer of the four layers are all spliced, and finally a ConvBNSiLU module is used to obtain the output feature map of the final SPPF module.

[0019] As a further improvement of the present application, the S2 specifically comprises:

[0020] S201: The high-level feature maps in the feature maps P3, P4 and P5 are spliced and fused with the low-level feature maps through an up-sampling operation to obtain an output feature map;

[0021] S202: The low-level feature maps in the output feature map of S201 are spliced and fused with the high-level feature maps through a down-sampling operation to obtain output feature maps P3', P4' and P5'.

[0022] As a further improvement of the present application, the up-sampling operation in S201 is realized by bilinear interpolation.

[0023] As a further improvement of the present application, the convolution kernel size of the down-sampling operation in S202 is 3x3 and the step size is 2.

[0024] As a further improvement of the present application, the S3 specifically comprises:

[0025] S301: input the output feature maps P3', P4' and P5' obtained in S202 and the output feature maps P2 and P6 of S101 and S105 into a task-independent decoupling detection head for final classification and regression prediction to obtain initial prediction results;

[0026] S302: input the prediction results of S301 into a non-maximum suppression post-processing algorithm to remove redundant prediction results, and then obtain final prediction results.

[0027] As a further improvement of the application, the task-independent decoupling detection head in S301 is composed of two modules, channel encoding and scale encoding, for classification and regression, respectively.

[0028] The input of the channel encoding module is the feature maps P i ′ and P′ i+1 , i∈{3,4,5}, P i After downsampling, they are spliced with P i+1 , and then a depth separable convolution with a convolution kernel size of 3x3 is performed to obtain the classification prediction result.

[0029] The input of the scale encoding module is the feature maps P′ i-1 , P′ i and P′ i+1 , i∈{3,4,5}, P′ i-1 , P′ i and P′ i+1 are respectively subjected to downsampling, 1x1 convolution and upsampling, then spliced, and then a depth separable convolution with a convolution kernel size of 3x3 is performed to obtain the regression prediction result; wherein the depth separable convolution is composed of a 3x3 channel-by-channel convolution and a 1x1 point-by-point convolution.

[0030] As a further improvement of the application, it also includes:

[0031] S4, select appropriate hyperparameters to train the neural network and save the model, and test the average accuracy.

[0032] Compared with the prior art, the application has the following beneficial effects:

[0033] The application introduces a task-independent decoupling detection head in the detection head of YOLOv5n, and independently constructs feature maps for classification and regression tasks to realize decoupling (i.e. for classification, provide feature maps with wider receptive field and richer semantic information; for regression, provide feature maps with more texture details and more edge information) to improve the defect detection accuracy of the DR pipeline.

[0034] The application uses a depth separable convolution instead of a general convolution in a task-independent decoupling detection head to reduce the parameter quantity and the calculation quantity, so that the trained deep convolutional neural network model is more accurate and faster, thereby improving the classification and positioning ability of the network model on the DR pipeline defects. BRIEF DESCRIPTION OF DRAWINGS

[0035] Figure 1 A flowchart of the DR pipeline defect detection method based on the decoupling detection head YOLOv5 is disclosed in the application;

[0036] Figure 2 A design diagram of the overall network architecture is disclosed in the application;

[0037] Figure 3 A structure diagram of the channel encoding module in the task-independent decoupling detection head is disclosed in the application;

[0038] Figure 4 A structure diagram of the scale encoding module in the task-independent decoupling detection head is disclosed in the application;

[0039] Figure 5 A structure diagram of the depth separable convolution in the channel encoding module and the scale encoding module is disclosed in the application. DETAILED DESCRIPTION

[0040] To make the purposes, technical solutions and advantages of the embodiments of the application clearer, the technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the application.

[0041] The application provides a DR pipeline defect detection method based on a decoupling detection head YOLOv5, which is an improved YOLOv5n pipeline defect detection method. The method designs a task-independent decoupling detection head to realize decoupling by constructing independent feature maps for the two tasks of classification and regression in the target detection network. Meanwhile, in order to alleviate the problem of increased parameter quantity caused by the decoupling detection head module, the method introduces a depth separable convolution to replace the standard convolution, thereby reducing the model parameter quantity while ensuring the accuracy.

[0042] The application will be described in further detail below with reference to the drawings:

[0043] As shown in Figure 1 The application provides a DR pipeline defect detection method based on a decoupling detection head YOLOv5, which includes:

[0044] S1, input the pipeline surface defect image dataset into the backbone network of the single-stage detection model YOLOv5n, and output five feature maps of different scales; wherein,

[0045] The pipeline surface defect dataset contains 20 defect categories, a total of 6010 samples and corresponding labels, wherein the training set accounts for 4866 samples, the verification set accounts for 542 samples, and the test set accounts for 602 samples;

[0046] The network structure of the single-stage detection model YOLOv5n is as shown in Figure 2 S1 specifically comprises:

[0047] S101: 2 times down-sampling is performed on the input image of the pipeline surface defect dataset to obtain a feature map P1, and then 2 times down-sampling and a C3 module are performed to obtain a feature map P2;

[0048] S102: the feature map obtained in S101 is 2 times down-sampled, and then 2 C3 modules are passed to obtain a feature map P3;

[0049] S103: the feature map obtained in S102 is 2 times down-sampled, and then 3 C3 modules are passed to obtain a feature map P4;

[0050] S104: the feature map obtained in S103 is 2 times down-sampled, and then a C3 module and a SPPF module are passed to obtain a feature map P5;

[0051] S105: the feature map obtained in S104 is 2 times down-sampled, and then a C3 module is passed to obtain a feature map P6.

[0052] Further, the down-sampling operation used in S101 is realized by a 3x3 convolution with a step of 2; the C3 module contains two branches: the first branch is a ConvBNSiLU module containing a 1x1 convolution layer, a batch normalization layer BN and an activation function SiLU; the second branch contains a ConvBNSiLU module and three BottleNeck modules; the output feature maps of the two branches are spliced and then passed through a ConvBNSiLU module to obtain the final output feature map of the C3 module; the down-sampling operations in S102 to S105 and the C3 module are similar to the structure of S101.

[0053] Further, the SPPF module in S104 is composed of 2 ConvBNSiLU modules and 3 max pooling layers with a step size of 1 and a size of 5*5; the input of the SPPF module is first sequentially subjected to 1 ConvBNSiLU module and 3 max pooling layers, then the outputs of all the 4 layers are spliced, and finally the output feature map of the final SPPF module is obtained through 1 ConvBNSiLU module.

[0054] S2, input the three intermediate feature maps into the neck network of the single-stage detection model YOLOv5n for feature fusion, and output three feature maps;

[0055] S2 specifically comprises:

[0056] S201: splice and fuse the high-level feature maps in the feature maps P3, P4 and P5 with the low-level feature maps through an upsampling operation to obtain output feature maps; wherein the upsampling operation is realized by bilinear interpolation.

[0057] S202: splice and fuse the low-level feature maps in the output feature maps of S201 with the high-level feature maps through a downsampling operation to obtain output feature maps P3', P4' and P5'; wherein the convolution kernel size of the downsampling operation is 3*3 and the step size is 2.

[0058] S3, input the three feature maps output by the neck network and the remaining two feature maps output by the backbone network into a task-independent decoupled detection head for classification and regression prediction to obtain classification and regression prediction results;

[0059] S3 specifically comprises:

[0060] S301: input the output feature maps P3', P4' and P5' obtained in S202 and the output feature maps P2 and P6 of S101 and S105 into the task-independent decoupled detection head for final classification and regression prediction to obtain initial prediction results; wherein the task-independent decoupled detection head is composed of two modules of channel encoding and scale encoding, which are respectively used for classification and regression, and the structures of the channel encoding and scale encoding of the task-independent decoupled detection head are shown in Figure 3 and Figure 4 ; the input of the channel encoding module is the feature maps P i and P i+1 , i∈{3,4,5}, P i is spliced with P i+1 after downsampling, and then a depth separable convolution with a convolution kernel size of 3*3 is performed to obtain the classification prediction result; the input of the scale encoding module is the feature maps P' i-1 , P' i and P' i+1 , i∈{3,4,5}, P' i-1, P i ′ and P′ i+1 After down-sampling, 1'1 convolution and up-sampling respectively, splicing is performed, and then a deep separable convolution with a convolution kernel size of 3'3 is performed to obtain a regression prediction result; wherein the deep separable convolution is composed of a 3x3 channel-by-channel convolution and a 1x1 point-by-point convolution, and the structure is as shown in Figure 5

[0061] S302: input the prediction result of S301 into a non-maximum suppression post-processing algorithm to remove redundant prediction results, and then obtain a final prediction result.

[0062] S4, select appropriate hyperparameters to train the neural network and save the model, and test the average accuracy.

[0063] Embodiment:

[0064] The parameters of the experiment are as follows:

[0065] Training set: pipeline surface defect data set;

[0066] Training parameters: linear adjustment is adopted for the learning rate, which decreases from 0.01 to 0.0001. The optimizer uses the SGD algorithm, the momentum coefficient is set to 0.937, the weight decay is 0.0005, and the batch-size is set to 32;

[0067] Table 1 is the mean average precision mAP of the improved and unimproved YOLOv5n model on the test set;

[0068] Table 1 is the test result of different models

[0069] Model Mean accuracy (%) FLOPs / G Parameter quantity / M YOLOv5n 92.3 4.2 1.79 Improved YOLOv5n 93.2 6.9 4.73

[0070] As shown in Table 1, the mean average precision mAP of the unimproved YOLOv5n model is 92.3%; the mean average precision mAP of the improved YOLOv5n model is 93.2%, with an accuracy improvement of 1%;

[0071] The advantages of the present application are:

[0072] The present application introduces a task-independent decoupling detection head in the detection head of YOLOv5n, and constructs independent feature maps for classification and regression tasks to realize decoupling (that is, for classification, a feature map with wider receptive field and richer semantic information is provided; for regression, a feature map with more texture details and more edge information is provided), to improve the detection accuracy of DR pipeline defects;

[0073] ​The application uses a depth separable convolution instead of a common convolution in a task-independent decoupling detection head to reduce the parameter quantity and the calculation quantity, so that the trained deep convolutional neural network model is higher in accuracy and faster in speed, thereby improving the classification and positioning capability of the network model on the DR pipeline defects.

[0074] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. The present application can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A DR pipe defect detection method based on a decoupled detection head YOLOv5, characterized in that, The method comprises the following steps: S1, inputting a pipeline surface defect image into a backbone network of a single-stage detection model YOLOv5n to output five feature maps P2-P6 of different scales; Specifically, the method comprises the following steps: S101, performing 2 times down-sampling on an input image of the pipeline surface defect image to obtain a feature map P1, and then performing 2 times down-sampling and a C3 module to obtain a feature map P2; S102, performing 2 times down-sampling on the feature map obtained in S101, and then performing two C3 modules to obtain a feature map P3; S103, performing 2 times down-sampling on the feature map obtained in S102, and then performing three C3 modules to obtain a feature map P4; S104, performing 2 times down-sampling on the feature map obtained in S103, and then performing a C3 module and an SPPF module to obtain a feature map P5; S105, performing 2 times down-sampling on the feature map obtained in S104, and then performing a C3 module to obtain a feature map P6; S2, inputting three intermediate feature maps P3-P5 into a neck network of the single-stage detection model YOLOv5n to perform feature fusion and output three feature maps P3'-P5'; Specifically, the method comprises the following steps: S201, splicing and fusing high-level feature maps in the feature maps P3, P4 and P5 with low-level feature maps through an up-sampling operation to obtain output feature maps; S202, splicing and fusing low-level feature maps in the output feature maps of S201 with high-level feature maps through a down-sampling operation to obtain output feature maps P3', P4' and P5'; S3, inputting the three feature maps P3'-P5' output by the neck network and the remaining two feature maps P2 and P6 output by the backbone network into a task-independent decoupling detection head to perform classification and regression prediction to obtain classification and regression prediction results; specifically, the method comprises the following steps: S301: input the output feature maps P3', P4' and P5' obtained in S202 and the output feature maps P2 and P6 of S101 and S105 to a task-independent decoupled detection head for final classification and regression prediction to obtain initial prediction results; wherein the task-independent decoupled detection head in S301 is composed of two modules of channel encoding and scale encoding, which are respectively used for classification and regression; the input of the channel encoding module is the feature maps P i ' and P i+1 , i∈{3,4,5}, P i is down-sampled and spliced with P i+1 , and then a deep separable convolution with a convolution kernel size of 3×3 is performed to obtain the classification prediction result; the input of the scale encoding module is the feature maps P i-1 , P i ' and P i+1 , i∈{3,4,5}, P i-1 , P i ' and P i+1 are respectively down-sampled, 1×1-convoluted and up-sampled, spliced, and then a deep separable convolution with a convolution kernel size of 3×3 is performed to obtain the regression prediction result; wherein the deep separable convolution is composed of a 3×3 channel-by-channel convolution and a 1×1 point-by-point convolution; S302, inputting the prediction results of S301 into a non-maximum suppression post-processing algorithm to remove redundant prediction results, and then obtaining final prediction results.

2. The DR pipe line defect detection method based on the decoupling detection head YOLOv5 according to claim 1, wherein, The down-sampling operation used in S101 is realized by a 3x3 convolution with a step of 2; the C3 module comprises two branches: the first branch is a ConvBNSiLU module comprising a 1x1 convolution layer, a batch normalization layer BN and an activation function SiLU; the second branch comprises a ConvBNSiLU module and three BottleNeck modules; the output feature maps of the two branches are spliced and then input into a ConvBNSiLU module to obtain the final output feature map of the C3 module; the down-sampling operation and the C3 module in S102-S105 are similar to those in S101.

3. The DR pipe line defect detection method based on decoupled detection head YOLOv5 according to claim 1, wherein, The SPPF module in S104 is composed of two ConvBNSiLU modules and three maximum pooling layers with a step of 1 and a size of 5x5; the input of the SPPF module is first sequentially input into a ConvBNSiLU module and three maximum pooling layers, then the outputs of all the four layers are spliced, and finally the output feature map of the SPPF module is obtained by inputting the spliced output into a ConvBNSiLU module.

4. The DR pipe line defect detection method based on decoupled detection head YOLOv5 according to claim 1, wherein, The up-sampling operation in S201 is realized by bilinear interpolation.

5. The DR pipe line defect detection method based on decoupled detection head YOLOv5 according to claim 1, wherein, The convolution kernel size of the downsampling operation in S202 is 3*3, and the step is 2.

6. The DR pipe line defect detection method based on the decoupling detection head YOLOv5 according to any one of claims 1-5, wherein, Also included are: S4, select appropriate hyperparameters to train the neural network and save the model, test the average accuracy.

Citation Information

Patent Citations

  • Middle school physics experiment apparatus detection method based on improved YOLOv5

    CN115937674A