Pipeline defect detection method, device and system and storage medium

Through the Faster-RCF network based on the integration of ResNet50 and FPN, the problem of difficult to accurately identify and classify pipeline defects in the prior art is solved, and the accurate detection and classification of internal pipeline defects is achieved, and the safety and reliability of the pipeline system are improved.

CN120147685APending Publication Date: 2025-06-13ZHENGZHOU UNIVERSITY OF LIGHT INDUSTRY
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510113511.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify and classify various defects inside pipelines, resulting in insufficient safety and reliability of pipeline systems.

Method used

Using the Faster-RCF network based on ResNet50 and FPN, the historical pipeline defect image data set is acquired and preprocessed, and annotated and trained to achieve accurate defect detection of the internal images of the pipeline collected in real time.

Benefits of technology

It realizes the accurate identification and classification of various defects inside the pipeline, and improves the safety and reliability of the pipeline system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120147685A_ABST
    Figure CN120147685A_ABST
Patent Text Reader

Abstract

The invention discloses a pipeline defect detection method, device and system and a storage medium. The method comprises the following steps: S1, acquiring a historical pipeline defect image data set; s2, carrying out preprocessing and data expansion processing on the historical pipeline defect image data set; s3, marking the historical pipeline defect image data set after preprocessing and data expansion processing to obtain a historical pipeline defect image data set with marked defect type information and position information; step S4, training a Faster-RCF network based on ResNet50 and FPN fusion according to the historical pipeline defect image data set with marked defect type information and position information; and S5, inputting a pipeline internal image acquired in real time into the trained Faster-RCF network for pipeline defect detection. By adopting the technical scheme of the invention, accurate identification and classification of various defects in the pipeline are realized, and the safety and reliability of a pipeline system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of deep learning, and particularly relates to a pipeline defect detection method, device, system, and storage medium. Background Art

[0002] Pipeline transportation plays a crucial role in modern society. Its convenience, speed, and efficiency have led to a great dependence on it in production and daily life. However, since pipelines are buried underground for a long time, over time, various factors such as soil corrosion, terrain settlement, and collapse may cause various defects in the pipelines, such as deformation, blockage, leakage, and collapse, which may result in serious catastrophic accidents and significant economic losses. Safety incidents due to abnormal pipelines caused by untimely maintenance occur frequently. Approximately three-quarters of the old drainage pipelines in our country have an actual service life of only 15 years. Therefore, reliable detection methods are urgently needed to ensure transportation safety and operational reliability.

[0003] Early pipeline defect detection used stethoscopes or ultrasonic detectors to listen to the sounds inside the pipelines. When there is fluid or gas movement inside the pipelines, specific noises will be generated, and damaged pipelines will emit sounds different from normal ones. By analyzing these sounds, the state of the pipelines and whether there are problems such as leakage can be preliminarily judged. In addition, there are also some pressure test methods, such as airtightness tests and hydraulic tests, for detecting leakage problems inside the pipelines. However, early pipeline defect detection also has some limitations. For example, although stethoscopes and ultrasonic detectors can judge the state of the pipelines, they may not be able to accurately identify some minor defects. And although pressure tests are accurate, they require the pipeline to be closed and high pressure to be applied, which may cause certain damage to the pipelines. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a pipeline defect detection method, device, system, and storage medium to achieve accurate identification and classification of various defects inside the pipelines, thereby improving the safety and reliability of the pipeline system.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] A pipeline defect detection method includes:

[0007] Step S1, obtaining a historical pipeline defect image dataset;

[0008] Step S2, performing preprocessing and data augmentation processing on the historical pipeline defect image dataset;

[0009] Step S3: Label the historical pipeline defect image dataset after preprocessing and data augmentation to obtain a historical pipeline defect image dataset with marked defect type information and location information;

[0010] Step S4: Train a Faster-RCF network based on the fusion of ResNet50 and FPN according to the historical pipeline defect image dataset with marked defect type information and location information;

[0011] Step S5: Input the pipeline internal image collected in real time into the trained Faster-RCF network for pipeline defect detection.

[0012] Preferably, in Step S2, the preprocessing includes grayscale conversion, contrast enhancement, and denoising processing, and the data augmentation includes: randomly cropping, horizontally, vertically, and randomly rotating the historical pipeline defect image dataset.

[0013] Preferably, the Faster R-CNN network includes: a feature extraction module with a residual block structure with a fused CA attention module connected in sequence, an FPN module, an RPN module, and an object detection module; among them, the ResNet50 network is used as the backbone network of the feature extraction module; the output of the residual block in ResNet50 is used as the bottom-up path of the FPN module, a top-down path is constructed, and lateral connections are generated to form a feature pyramid. The top-down path enlarges the high-level feature map to the same resolution as the low-level feature map through upsampling, and the lateral connections fuse the top-down feature map and the bottom-up feature map through element-wise addition or convolution operations.

[0014] The present invention also provides a pipeline defect detection device, including:

[0015] An acquisition module for acquiring a historical pipeline defect image dataset;

[0016] A processing module for preprocessing and data augmentation processing of the historical pipeline defect image dataset;

[0017] A labeling module for labeling the historical pipeline defect image dataset after preprocessing and data augmentation processing to obtain a historical pipeline defect image dataset with marked defect type information and location information;

[0018] A training module for training a Faster-RCF network based on the fusion of ResNet50 and FPN according to the historical pipeline defect image dataset with marked defect type information and location information;

[0019] A detection module for inputting the pipeline internal image collected in real time into the trained Faster-RCF network for pipeline defect detection.

[0020] Preferably, the preprocessing includes grayscale conversion, contrast enhancement, and denoising, and the data augmentation includes randomly cropping, horizontally and vertically flipping, and randomly rotating the historical pipeline defect image dataset.

[0021] Preferably, the Faster R-CNN network includes a feature extraction module with a residual block structure incorporating a fused CA attention module, an FPN module, an RPN module, and an object detection module connected in sequence. Among them, the ResNet50 network is used as the backbone network of the feature extraction module. The output of the residual blocks in ResNet50 is used as the bottom-up path of the FPN module, and a top-down path and lateral connections are constructed to generate a feature pyramid. The top-down path upsamples the high-level feature maps to the same resolution as the low-level feature maps, and the lateral connections fuse the top-down feature maps with the bottom-up feature maps through element-wise addition or convolution operations.

[0022] The present invention also provides a pipeline defect detection system, including a memory and a processor. A computer program is stored on the memory and run by the processor, and the computer program executes the pipeline defect detection method when run by the processor.

[0023] The present invention also provides a storage medium on which a computer program is stored, and the computer program executes the pipeline defect detection method when running.

[0024] The present invention uses the ResNet50 residual network suitable for small object detection as the feature extraction backbone network of the Faster-RCF network. At the same time, by optimizing the ResNet50 structural block, introducing the CA attention mechanism, and integrating the FPN network, the feature extraction and feature fusion capabilities of the model are strengthened. With the technical solution of the present invention,

[0025] accurate identification and classification of various defects inside the pipeline are realized, thereby improving the safety and reliability of the pipeline system. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0027] Figure 1 It is a flowchart of the pipeline defect detection method according to the embodiment of the present invention;

[0028] Figure 2It is a schematic diagram of the Faster-RCF network structure;

[0029] Figure 3 It is a schematic diagram of the feature extraction network structure based on the residual structure;

[0030] Figure 4 It is a schematic diagram of the residual block structure;

[0031] Figure 5 It is a schematic diagram of the improved residual block structure;

[0032] Figure 6 It is a schematic diagram of the residual block structure integrating the CA attention module;

[0033] Figure 7 It is the feature pyramid network structure. Specific implementation manners

[0034] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0035] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0036] Embodiment 1:

[0037] As Figure 1 shown, the embodiment of the present invention provides a pipeline defect detection method, including:

[0038] A pipeline defect detection method, including:

[0039] Step S1, obtaining a historical pipeline defect image data set;

[0040] Step S2, performing preprocessing and data augmentation processing on the historical pipeline defect image data set;

[0041] Step S3, annotating the historical pipeline defect image data set after preprocessing and data augmentation processing to obtain a historical pipeline defect image data set with marked defect type information and position information;

[0042] Step S4, training a Faster-RCF network based on the fusion of ResNet50 and FPN according to the historical pipeline defect image data set with marked defect type information and position information;

[0043] Step S5: Input the internally acquired pipeline image in real time into the trained Faster-RCF network for pipeline defect detection.

[0044] As an implementation manner of the embodiment of the present invention, in step S2, the preprocessing includes grayscale conversion, contrast enhancement, and denoising processing, and the data augmentation includes: randomly cropping, horizontally and vertically flipping, and randomly rotating the historical pipeline defect image dataset.

[0045] As an implementation manner of the embodiment of the present invention, as Figure 2 shown, the Faster R-CNN network includes: a feature extraction module with a residual block structure having a fused CA attention module, a Feature Pyramid Network (FPN) module, a Region Proposal Network (RPN) module, and an object detection module connected in sequence; among them, the ResNet50 network is used as the backbone network of the feature extraction module; the output of the residual block in ResNet50 is used as the bottom-up path of the FPN module, and a top-down path and lateral connections are constructed to generate a feature pyramid. The top-down path upsamples the high-level feature map to the same resolution as the low-level feature map, and the lateral connections fuse the top-down feature map and the bottom-up feature map through element-wise addition or convolution operations.

[0046] Furthermore, the ResNet50 network contains 49 convolutional layers and the last fully connected layer. The first part is a conventional convolutional network structure without residual blocks, and its main task is to process the input image. Through convolution, regularization operations, combined with activation functions and max pooling techniques, the extraction and transformation of image features are achieved. The remaining four structural units all adopt the residual block design. The feature extraction network structure based on the residual structure is as Figure 3 shown.

[0047] The basic concept of ResNet is to introduce an identity shortcut connection that skips one or more layers. It adopts skip connection technology, which skips connections over two or three layers that contain ReLU and batch normalization between the architectures. ResNet allows the network to match the residual mapping instead of having the network learn the underlying mapping. The advantage of using skip links is that any layer that degrades the design performance will be regularly skipped. Therefore, the training of very deep neural networks is not hindered by gradient vanishing like traditional convolutional neural network models. The identity links between non-adjacent layers do not affect the ideal mapping that the application task wants to generate, which is why ResNet works. Due to the identity connection, the gradient can use an additional shortcut channel, so backpropagation is smoother.

[0048] In the construction of convolutional neural networks, the size of the convolutional kernel plays a crucial role in the accuracy of feature extraction and the overall performance of the model. In the traditional ResNet50 model, at the starting layer of its network structure, a relatively large-sized convolutional kernel was deliberately selected, and this design aimed to more effectively capture the relatively broad information in the input image. However, with the continuous exploration and progress in the field of deep learning, experimental data has gradually revealed an interesting phenomenon: by combining multiple smaller-sized convolutional kernels, not only can a receptive field similar to that of a single large-sized convolutional kernel be achieved, but there may also be some additional performance advantages.

[0049] In a convolutional neural network, the neurons in each layer only process the local area of the previous layer. As the number of network layers deepens, the receptive field of the input image that each neuron can see will gradually expand, and the formula for calculating the receptive field is:

[0050]

[0051] where, R Fi represents the receptive field of the current layer, represents the receptive field of the previous layer, k represents the size of the convolutional kernel, and this formula can be used to calculate the receptive field size corresponding to each pixel point of the feature map in each layer. Generally, both the convolutional layer and the pooling layer may affect the size of the receptive field of the current layer, but the activation function layer does not change the size of the receptive field. In the experiments in this paper, all strides were set to 1, and the receptive field of the input was k, with a size of 1.

[0052] The receptive field of a 7×7 convolutional kernel after passing through the convolutional layer is 7. When it is replaced by 3 small 3×3 convolutional kernels, the receptive field R F3 after convolution is also 7. The specific calculation process is as follows:

[0053]

[0054] It can be seen that although using 3 small 3×3 convolutional kernels to replace a single k convolutional kernel will increase the number of convolutional layers, the 3 small convolutional kernels can still cover the same receptive field as a single large convolutional kernel. However, using 1 7×7 convolutional kernel will generate relatively more parameters, while using 3 3×3 convolutional kernels only has a total of 27 output channel numbers of parameters. At the same time, usually an activation function will follow each 3×3 convolutional kernel. Therefore, this operation not only reduces the number of parameters of the model and improves the model performance, but also increases the non-linearity of the network, which helps the model better fit the complex data distribution. The network configuration of the improved ResNet50 is shown in Table 1.

[0055] Table 1

[0056]

[0057]

[0058] In addition, in the residual network, batch normalization is mainly used to normalize the input data of each layer, ensuring the stability of the input distribution, thereby helping to solve the problems of gradient explosion and gradient disappearance that may occur during training. For each feature in a batch, there are n training samples and k dimensions. The formula for batch normalization that normalizes the current k-th dimension is:

[0059]

[0060] where μ k is the mean of the k-th dimension, is the variance, and Z k is the input of the k-th dimension to the BN layer. The purpose of adding θ is to avoid a variance of 0. To restore the original feature expression ability of the data, the model structure in this experiment introduced learnable parameters α and β in the batch normalization layer. The output C k of the batch normalization layer is calculated as:

[0061]

[0062] where α is the scale factor and β is the translation factor, and the eigenvalue can be adjusted and scaled by linearly transforming and translating the original input features. When α = σ and β = μ, the distribution information of the original input features is not lost. In addition, combining the batch normalization layer with the Dropout technique during model training can avoid the overfitting trend of the network model.

[0063] The structure of the residual block realizes the extraction of deep features and residual learning of the input data by combining convolution operations, skip connections, and activation functions. The structure of the residual block can be decomposed into the following steps:

[0064] (1) The input data x undergoes a convolution operation through the first convolutional layer combination to obtain an intermediate result f(x). In this process, batch normalization and activation function operations are usually performed to normalize the data distribution and increase non-linearity.

[0065] (2) The skip connection passes the input data x to the output end of the residual block and adds it to the intermediate result f(x) after the convolution operation. This addition operation is the core of the residual connection, which allows the gradient to directly flow back to the earlier layers and solves the problem of gradient disappearance in deep neural networks.

[0066] (3) Pass the result after addition through the activation function again to obtain the final output {4, 8, 16, 32} of the residual block. This output contains both the information of the input data x and the feature information extracted through the convolution operation, enabling the network to better learn the complex mapping relationship between the input and the output. The structure of the residual block is as shown in Figure 4 shown.

[0067] To maximize the role of the batch normalization layer while preserving the identity mapping relationship in the original model structure, this paper adjusts the structure of the residual block. First, perform batch normalization, then the activation function, and finally convolution. The adjusted structure of the residual block is as follows: First, to standardize the data distribution and make the input of each layer have an appropriate scale, batch normalization is performed on the input data. Second, to enhance the network's ability to learn more complex feature representations, after batch normalization, an activation function is applied to increase the non-linearity of the network. Finally, to extract the features of the input data, a convolution operation is performed. In addition, the skip connection remains unchanged and is used to directly connect the input to the output of the residual block.

[0068] Through this adjustment, the batch normalization layer is placed before the activation function, which helps reduce the problem of internal covariate shift and makes the input distribution of each layer more stable. At the same time, since both batch normalization and the activation function are before the convolution operation, they can more directly affect the input of the convolution layer, thus more effectively optimizing the network's feature extraction ability. The improved structure of the residual block is as shown in Figure 5 shown.

[0069] To enable the network to adaptively adjust the weights of channels and coordinates and pay more attention to the features that can highlight small-size defects, a CA attention mechanism is introduced into the residual block. In addition, ResNet50 itself solves the problem of gradient disappearance in deep neural networks through residual connections, enabling the network to be deeper. The introduction of the CA attention mechanism is a supplement to the residual connection, further enhancing the network's representation ability by providing additional feature weight information.

[0070] Therefore, a CA attention mechanism is introduced into the ResNet50 network to help ResNet50 better capture the key information in the input pipeline images, optimize the model performance, especially showing excellent performance in small target detection.

[0071] To ensure that the CA module processes the complete feature map after residual learning, the CA module is placed at the output end of the residual module; to enable the CA module to adjust the weights in the channel dimension of the feature map, effectively emphasizing or suppressing certain channels while keeping the gradient flow smooth, the CA module is arranged before the activation function layer activates the features; at the same time, such a design also follows the principle of modular design, making the network structure clearer and easier to expand.

[0072] The residual module and the attention module can be regarded as independent components, and the connections and interactions between them are clear and controllable. Therefore, the CA attention module is arranged at the end of the processing flow of the residual block, that is, before the activation function layer activates the features. The structure of the residual block integrating the CA attention module is as Figure 6 shown.

[0073] Furthermore, the Feature Pyramid Network combines high-level semantic information with low-level spatial details through a top-down path and lateral connections. Specifically, the Feature Pyramid Network first constructs a bottom-up path, that is, the forward propagation process of a traditional convolutional neural network, to obtain feature maps of different scales. Then, through a top-down path, the deep feature maps are upsampled and fused with the shallow feature maps of the corresponding scales. This fusion is usually achieved by element-wise addition or concatenation. The structure of the Feature Pyramid Network is as Figure 7 shown.

[0074] Through the Feature Pyramid Network, the network can utilize the feature information of both shallow and deep layers simultaneously, thereby improving the performance of tasks such as object detection. The spatial details of the shallow feature maps help to accurately locate the objects, while the semantic information of the deep feature maps helps to accurately identify the objects. Therefore, the design of the Feature Pyramid Network enables the network to better handle problems such as scale changes and occlusions, improving the robustness and accuracy of the algorithm. The construction process of the Feature Pyramid Network can be summarized into two steps:

[0075] (1) Bottom-up feature extraction. Feature maps are gradually generated through the forward propagation of the convolutional neural network, and then the architecture of the feature map pyramid is formed. In actual operation, to simplify the processing and facilitate the construction of the feature map pyramid, the network layers that generate feature maps of the same size are usually grouped into one layer. Subsequently, the output feature maps are selected from the last layer of each layer, and these feature maps will serve as the basis for constructing the feature map pyramid. For the ResNet50 network, it selects the output feature maps of the last residual block of each layer, that is, the outputs of the last residual blocks of conv2, conv3, conv4, and conv5. These feature maps are respectively labeled as {C 2 , C 3 , C 4 , C 5}, and their strides relative to the original input image are {4, 8, 16, 32}. Such a design aims to reduce the number of channels of the feature maps, thereby reducing the computational load of the network and improving the processing efficiency.

[0076] (2) Top-down feature fusion. After obtaining the feature maps, first for C 5A 1×1 convolution operation is performed to adjust the number of channels to 256, and then the nearest neighbor interpolation method is used to double upsample the width and height to C 4 However, C 4 The number of channels of C is not consistent with the upsampled feature map. 4 Perform a 1×1 convolution operation, adjust the number of channels to 256, and then add the two elements one by one. This process is carried out in sequence, so that the feature map is continuously enhanced in the layer-by-layer fusion. 5 , C 4 , C 3 , C 2 All of them need to go through a horizontal 1×1 convolution operation, the purpose of which is to unify the depth of the feature map to 256, and these 1×1 convolutions do not need to add activation functions. Next, the fused multi-layer feature maps are subjected to a 3×3 convolution operation, and finally a feature pyramid {P 2 ,P 3 ,P 4 ,P 5 Predictions are made based on these feature pyramids to improve the network's ability to learn and process multi-scale features.

[0077] Therefore, based on the improvement of the feature extraction network, the feature pyramid network is integrated to enhance the model's ability to process multi-scale features. The feature pyramid network generates a series of feature maps with different resolutions and semantic information through bottom-up feature extraction and top-down feature fusion, thereby achieving the purpose of capturing both the local details and the global structure of the pipeline.

[0078] The outputs of different layers of ResNet50 are used as the input of the feature pyramid network. Specifically, the output of the residual block in ResNet50 is used as the bottom-up path of the feature pyramid network, and then the top-down path and lateral connection are constructed to generate the feature pyramid. In this process, the top-down path can enlarge the high-level feature map to the same resolution as the low-level feature map through upsampling, while the lateral connection can fuse the top-down feature map with the bottom-up feature map through element-level addition or convolution operations.

[0079] Furthermore, the loss function is an indicator used to measure the degree of difference between the model's prediction results and the true label. In ResNet50, the purpose of the loss function is to optimize the model parameters by minimizing the difference, thereby improving the model's prediction performance. ResNet50 usually uses the cross entropy loss function, which is a common loss function for classification tasks in deep learning. The smaller the value of the cross entropy loss, the closer the probability distribution predicted by the model is to the one-hot encoding of the true category, and the better the performance of the model.

[0080] Since the two types of prediction tasks, namely object recognition classification and bounding box prediction, have different natures and require different types of loss functions to effectively guide the training of the model, different loss functions are usually adopted for object recognition classification and bounding box prediction.

[0081] To address the class imbalance problem in pipeline images and improve the recognition rate of similar samples, the focal loss function is adopted to replace the traditional cross-entropy loss function. The focal loss function proposes to use a weight-based method to balance positive and negative samples, combining two methods to achieve balance: controlling the weights of positive and negative sample losses and controlling the weights of easy-to-classify and difficult-to-classify samples. Therefore, the focal loss can be used to replace the classification loss in the original loss function.

[0082] To control the weights of positive and negative sample losses, taking binary classification as an example, the following is the most commonly used cross-entropy loss:

[0083]

[0084] Among them, y represents the actual label and p represents the predicted value. The cross-entropy loss can be simplified using the following formula:

[0085]

[0086] CE(p,y) = CE(p t ) = -log(p t ) (6)

[0087] To reduce the impact of positive and negative sample imbalance, a coefficient can be added. When label = 1, α t = α; otherwise, α t = 1 - α. The value range of α is from 0 to 1, and at this time:

[0088] CE(p t ) = -α t log(p t ) (7)

[0089]

[0090] When the value of α is between 0 and 0.5, the weight of the positive sample loss can be reduced, and the weight of the negative sample loss can be increased; when the value of α is between 0.5 and 1, the weight of the positive sample loss can be increased, and the weight of the negative sample loss can be reduced.

[0091] Controlling the weights of easy-to-classify and difficult-to-classify samples: In the classification task, the larger the predicted probability value p t of a sample belonging to a certain class, the easier it is to classify. Therefore, 1 - p t, it can be calculated whether it belongs to the easy or difficult classification. The specific implementation is as follows:

[0092] FL(p t ) = -(1 - p t ) γ log(p t ) (10)

[0093] The modulation coefficient (1 - p t ) γ is used to determine whether a sample is easy or difficult to classify in a classification task. The specific implementation method is as follows: When γ = 0, the focal loss is equivalent to the standard cross-entropy function. When γ > 0, when the value of 1 - p t is between 0 and 1, since p t tends to 0, the modulation coefficient tends to 1, which contributes greatly to the total loss. When p t tends to 1, the modulation coefficient tends to 0, which means its contribution to the total loss is very small.

[0094] Suppose there are two samples with y = 1, and their classification confidences are 0.9 and 0.6 respectively. If γ = 2 is taken and their losses are calculated according to the formula, the obtained losses are respectively expressed as -(0.1) 2 log(0.9) and -(0.4) 2 log(0.6). If their weights are separated, that is, 0.16 / 0.01 = 16, it can be seen that the loss of the sample with a classification confidence of 0.6 increases greatly, and the loss of the sample with a classification confidence of 0.9 is greatly suppressed. Thus, the loss function is more sensitive to the loss of difficult samples. Therefore, the focal loss function is:

[0095] FL(p t ) = -α t (1 - p t ) γ log(p t ) (11)

[0096] For bounding box prediction, the SmoothL1 loss function is adopted. The SmoothL1 loss function is:

[0097]

[0098] Example 2:

[0099] This embodiment of the present invention also provides a pipeline defect detection device, including:

[0100] An acquisition module, configured to acquire a historical pipeline defect image dataset;

[0101] A processing module for preprocessing and data augmentation of the historical pipeline defect image dataset;

[0102] An annotation module for annotating the historical pipeline defect image dataset after preprocessing and data augmentation to obtain a historical pipeline defect image dataset with marked defect type information and location information;

[0103] A training module for training a Faster-RCF network based on the fusion of ResNet50 and FPN according to the historical pipeline defect image dataset with marked defect type information and location information;

[0104] A detection module for inputting the pipeline internal image collected in real time into the trained Faster-RCF network for pipeline defect detection.

[0105] As an implementation manner of an embodiment of the present invention, the preprocessing includes grayscale conversion, contrast enhancement, and denoising processing, and the data augmentation includes: randomly cropping, horizontally, vertically, and randomly rotating the historical pipeline defect image dataset.

[0106] As an implementation manner of an embodiment of the present invention, the Faster R-CNN network includes: a feature extraction module with a residual block structure having a fused CA attention module, an FPN module, an RPN module, and an object detection module connected in sequence; wherein, the ResNet50 network is used as the backbone network of the feature extraction module; the output of the residual block in ResNet50 is used as the bottom-up path of the FPN module, a top-down path is constructed and lateral connections are generated to form a feature pyramid, and the top-down path enlarges the high-level feature map to the same resolution as the low-level feature map through upsampling, and the lateral connections fuse the top-down feature map and the bottom-up feature map through element-wise addition or convolution operations.

[0107] Embodiment 3:

[0108] An embodiment of the present invention further provides a pipeline defect detection system, including: a memory and a processor, wherein a computer program is stored on the memory and run by the processor, and the computer program executes the pipeline defect detection method when run by the processor.

[0109] Embodiment 4:

[0110] An embodiment of the present invention further provides a storage medium, on which a computer program is stored, and the computer program executes the pipeline defect detection method when running.

[0111] The embodiments described above are only descriptions of the preferred embodiments of the present invention, and do not limit the scope of the present invention. Without departing from the design spirit of the present invention, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope determined by the claims of the present invention.

Claims

1. A pipeline defect detection method, characterized in that: include: Step S1, obtaining a historical pipeline defect image dataset; Step S2, preprocessing and data expansion processing of the historical pipeline defect image dataset; Step S3, annotating the historical pipeline defect image dataset after preprocessing and data expansion processing to obtain a historical pipeline defect image dataset with marked defect type information and location information; Step S4, training a Faster-RCF network based on the fusion of ResNet50 and FPN according to a historical pipeline defect image dataset with marked defect type information and location information; Step S5: input the real-time collected internal image of the pipeline into the trained Faster-RCF network for pipeline defect detection.

2. The pipeline defect detection method according to claim 1, characterized in that: In step S2, preprocessing includes graying, contrast enhancement and denoising, and data expansion includes: random cropping, horizontal, vertical and random rotation of the historical pipeline defect image dataset.

3. The pipeline defect detection method according to claim 2, characterized in that: The Faster R-CNN network includes: a feature extraction module with a residual block structure fused with a CA attention module, an FPN module, an RPN module and a target detection module connected in sequence; wherein, the ResNet50 network is used as the backbone network of the feature extraction module; the output of the residual block in ResNet50 is used as the bottom-up path of the FPN module, and a top-down path and lateral connections are constructed to generate a feature pyramid. The top-down path enlarges the high-level feature map to the same resolution as the low-level feature map through upsampling, and the lateral connection fuses the top-down feature map with the bottom-up feature map through element-level addition or convolution operations.

4. A pipeline defect detection device, characterized in that: include: An acquisition module, used to acquire historical pipeline defect image datasets; A processing module is used to preprocess and expand the historical pipeline defect image data set; A labeling module is used to label the historical pipeline defect image dataset after preprocessing and data expansion processing to obtain a historical pipeline defect image dataset with marked defect type information and location information; A training module, used to train a Faster-RCF network based on the fusion of ResNet50 and FPN according to a historical pipeline defect image dataset with marked defect type information and location information; The detection module is used to input the real-time collected internal images of the pipeline into the trained Faster-RCF network for pipeline defect detection.

5. The pipeline defect detection device according to claim 4, characterized in that: Preprocessing includes grayscale, contrast enhancement and denoising, and data expansion includes random cropping, horizontal, vertical and random rotation of the historical pipeline defect image dataset.

6. The pipeline defect detection device according to claim 5, characterized in that: The Faster R-CNN network includes: a feature extraction module with a residual block structure fused with a CA attention module, an FPN module, an RPN module and a target detection module connected in sequence; wherein, the ResNet50 network is used as the backbone network of the feature extraction module; the output of the residual block in ResNet50 is used as the bottom-up path of the FPN module, and a top-down path and lateral connections are constructed to generate a feature pyramid. The top-down path enlarges the high-level feature map to the same resolution as the low-level feature map through upsampling, and the lateral connection fuses the top-down feature map with the bottom-up feature map through element-level addition or convolution operations.

7. A pipeline defect detection system, characterized in that: include: A memory and a processor, wherein the memory stores a computer program executed by the processor, and when the computer program is executed by the processor, the pipeline defect detection method according to any one of claims 1 to 3 is executed.

8. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program executes the pipeline defect detection method according to any one of claims 1 to 3 when running.

Citation Information

Patent Citations

  • Defect detection method and system for pipeline magnetic flux leakage signal

    CN115713486A

  • Defect detection method, system and equipment for silicon-based photovoltaic cell based on deep neural network, and storage medium

    CN117333482A

  • Pipeline defect detection system and method

    CN118628473A

  • Information processing device, determination method and determination program

    JP2022158647A

  • Method and apparatus for inspecting corrosion defect of ladle

    US20190362490A1