A method for defect recognition in pipeline magnetic leakage internal inspection based on weakly supervised learning
Through the method of weakly supervised learning and prior knowledge guidance, combined with conditional random fields and morphological dilation operations, the problem of high-cost manual labeling in existing technologies is solved, and efficient and accurate pipeline defect identification is achieved.
Patent Information
- Application Number
- CN202211656554.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-12-22
AI Technical Summary
Existing pipeline magnetic flux leakage detection methods rely on a large amount of precise manually labeled data, resulting in high cost and low efficiency, making it difficult to efficiently identify pipeline defects.
A method based on weakly supervised learning is adopted, using weak labels at the bounding box level combined with the peak and valley prior knowledge of leakage magnetic data and the filling rate guidance loss. The defect recognition model is trained through iterative optimization, and post-processing is combined with conditional random fields and morphological dilation operations to improve the accuracy of defect recognition.
It reduces the reliance on precise labeling, improves the accuracy and efficiency of pipeline defect identification, saves manual labeling costs, and achieves more efficient defect segmentation effects.
Smart Images

Figure CN116012317B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of weakly supervised learning, pipeline magnetic flux leakage detection, defect recognition and semantic segmentation, and in particular to a pipeline magnetic flux leakage internal detection defect recognition method based on weakly supervised learning. Background Art
[0002] Pipeline transportation is the primary method of oil and gas transmission, and its safety has always been a concern. Defects of varying sizes in pipelines can lead to oil and gas leaks, necessitating regular inspections for pipeline defects. Magnetic flux leakage detectors (MFL) are one of the most widely used pipeline defect detection tools. The MFL data collected by these detectors can reveal the extent of pipeline damage.
[0003] Numerous defect segmentation algorithms have been proposed based on pipeline magnetic flux leakage data collected by magnetic flux leakage detectors. Most existing algorithms utilize fully supervised semantic segmentation to identify defects, but their accuracy relies heavily on large amounts of precisely labeled data. However, due to the vast scale of oil and gas pipeline networks, the volume of pipeline data collected by magnetic flux leakage detectors is also enormous. Manually labeling this magnetic flux leakage data at the pixel level requires significant human, material, and time resources. Summary of the Invention
[0004] The purpose of the present invention is to address the shortcomings of existing methods and propose a pipeline magnetic leakage internal detection defect recognition method based on weakly supervised learning. Only weak labels at the bounding box level are needed. Combined with the prior knowledge that magnetic leakage data will have peaks and troughs at abnormal locations, the weak labels are iteratively optimized using a fill rate guidance loss guidance model during the training process. After each round of training, the network generates new labels for the next round of training. The new labels ignore background pixels that are incorrectly marked as defects as much as possible, so that the network can better learn the characteristics of the real defects.
[0005] The technical solutions adopted by the present invention to solve the technical problems are as follows:
[0006] A pipeline magnetic leakage internal detection defect recognition method based on weakly supervised learning includes the following steps:
[0007] (1) Preprocessing the acquired pipeline magnetic flux leakage data;
[0008] (2) Fusing the information of multiple components of magnetic flux leakage data to construct a magnetic flux leakage image dataset;
[0009] (3) Based on the characteristics of magnetic leakage data, a defect semantic segmentation network MFLSegNet is constructed, and the weak labels obtained by filling the bounding box labels are used to train MFLSegNet;
[0010] (4) Combining the prior knowledge that magnetic flux leakage data will have peaks and valleys at abnormal locations, the filling rate guidance loss is used to guide the model to iteratively optimize weak labels during training;
[0011] (5) The conditional random field and morphological dilation operations are used to post-process the model segmentation results to obtain the final defect recognition results.
[0012] In the above technical solution, further, in the step (1), the pipeline magnetic flux leakage data is the pipe wall magnetic flux leakage signal collected by the magnetic flux leakage detector running inside the pipeline; the magnetic flux leakage detector uses the flow of oil, gas and other media in the pipeline as power to move in the pipeline, and magnetizes the ferromagnetic pipeline to saturation magnetic flux density through a permanent magnet; in the normal area of the pipeline, the magnetic flux of the external magnetic field is bound inside the pipe wall, and almost no magnetic flux penetrates the pipe wall surface; at the defective part of the pipeline, the magnetic permeability is smaller than that of the normal area, and the magnetic resistance is larger than that of the normal area, which will cause the magnetic flux to "leak" out from the defect, and the leaked magnetic flux can be detected by the sensor on the magnetic flux leakage detector; the magnetic flux leakage signal collected by the magnetic flux leakage detector is almost unchanged in the normal area of the pipeline, but will fluctuate violently in the defective area and component area, and these fluctuations are greatly different from the surrounding normal signals. Based on this feature, defects on the pipeline can be identified.
[0013] Furthermore, in step (1), data preprocessing refers to sliding window filtering, threshold truncation and normalization of the magnetic flux leakage data; sliding window filtering is to subtract the median of all points within a certain range of the neighborhood from each point on the original magnetic flux leakage data, so that the normal background area can be more uniform and smooth; threshold truncation is to regard points with magnetic flux leakage signal values greater than the threshold as abnormalities and assign the threshold value; normalization is to map all data values to the range of [0, 255] based on the maximum and minimum values of the magnetic flux leakage data.
[0014] Furthermore, in step (2), the magnetic flux leakage detector can measure a three-dimensional magnetic field vector. After vector decomposition, the magnetic field vector can be divided into a radial component of the magnetic field along the pipe diameter direction, an axial component of the magnetic field along the detector running direction, and a circumferential component of the magnetic field along the pipe circumference direction. The three components all contain part of the information of the pipeline. When manually identifying defects, the presence of defects on the pipeline is usually determined based on the curve image of the radial component, and the depth of the defect is measured based on the data of the axial component. The circumferential data is rarely used because its characteristics are not significant enough. Therefore, when constructing a data set, the original radial component data, the original axial component data, and the radial component data after sliding window filtering are used as three channels of the RGB color image after threshold truncation and normalization to construct a magnetic flux leakage image data set. In the data set, the original radial component data provides information on small defects and protruding defects, the original axial component data provides depth information on defects, and the radial component data after sliding window filtering provides information on uniform background areas. The method of fusing multiple components to construct a data set can make full use of the information of each useful component and improve the accuracy of defect identification.
[0015] Furthermore, in step (3), the defect semantic segmentation network MFLSegNet (Magnetic Flux Leakage image Segmentation Network) designed according to the characteristics of magnetic flux leakage data is constructed in the following way:
[0016] (3.1) The overall structure of MFLSegNet can be divided into two parts: encoder and decoder. The encoder uses the first four blocks of VGGNet, which contains 10 3*3 convolutional layers and 4 maximum pooling layers. The decoder contains 5 3*3 convolutional layers, 5 batch normalization layers, 5 random dropout layers and 4 upsampling layers.
[0017] (3.1) MFLSegNet has made certain improvements to the pooling layer in the encoder based on the characteristics of magnetic flux leakage data. Specifically, the axial sampling spacing of the magnetic flux leakage detector is 2 mm, and the circumferential sampling spacing is usually in the range of 8 mm to 17 mm. The axial sampling spacing of the detector is small, and the sampling points are dense, while the circumferential sampling spacing is large, and the sampling points are relatively sparse. Based on this characteristic, the present invention reduces the size of the network's circumferential pooling window and the pooling step size to retain more information in the circumferential direction, thereby improving the network's ability to recognize tiny defects.
[0018] (3.2) The present invention uses annular padding and symmetric padding in the convolutional layer of MFLSegNet to infer the missing contextual information on the image boundary to better predict the pixel points on the boundary. Specifically, since the pipeline is annular, the leakage magnetic data is expanded along the pipeline axis when constructing the leakage magnetic data set to obtain a rectangular leakage magnetic image, and the upper and lower boundaries of the image are connected on the annular pipeline. In convolutional neural networks, zero padding is usually used to fill zeros on the boundary during convolution so that the feature map after convolution is consistent with the size of the original image. However, directly using zero padding on the boundary is not conducive to identifying defects appearing on the boundary. Therefore, according to the characteristics of the leakage magnetic data of the annular pipeline, the present invention uses annular padding to fill the upper and lower boundaries before the convolution layer, and uses symmetric padding to fill the left and right boundaries. This more naturally fills the missing information at the boundary of the leakage magnetic image of the annular pipeline, allowing the network to better identify pipeline defects that may appear on the boundary.
[0019] (3.3) To address the problem of large differences in the scales of different defects on pipelines, the present invention uses Atrous Spatial Pyramid Pooling (ASPP) in MFLSegNet to fuse the multi-scale information of the magnetic leakage image, so that low-resolution, high-semantic information and high-resolution, low-semantic information complement each other. Atrous pyramid pooling samples a given feature map in parallel with dilated convolutions at different sampling rates, which is equivalent to capturing the contextual information of the feature map at multiple scales. Specifically, the spatial pyramid pooling structure adopted by the present invention consists of a 1×1 convolution, three dilated convolution layer pyramids with sampling rates of 6, 12, and 18, and a pooling structure.
[0020] Furthermore, in step (3), the weak labels at the bounding box level are obtained by filling using the bounding box annotation commonly used in target detection. The specific filling method is: all the pixels in each box in the bounding box annotation are filled with the category to which the box belongs, and an inaccurate pixel-by-pixel weak label is obtained. Such a weak label contains some background areas that do not belong to the target.
[0021] Furthermore, in step (4), the prior knowledge of peaks and troughs means that the radial component of the leakage magnetic signal will have a peak and a trough at the abnormal location; specifically, at the defect location, the radial component of the leakage magnetic signal will first be greater than zero, and then reverse to be less than zero, showing the characteristics of a peak and a trough. After the leakage magnetic signal is converted into a leakage magnetic image, the pixel values in the normal area are very flat and have almost no fluctuations, while the pixel values in the defect area are often the maximum or minimum values of the local area where they are located, which is very different from the normal background area. These maximum and minimum values show the characteristics of a peak and a trough on the curve image. Based on this prior knowledge, the difference between the pixel value of each point of the radial component of the leakage magnetic data and the background is calculated to obtain the peak and trough prior knowledge difference map. In the prior knowledge map, the larger the difference, the greater the probability of a defect.
[0022] Furthermore, in the step (4), the filling rate is obtained based on the global statistical information of the magnetic leakage image; specifically, the weak label of the bounding box used in training the network is an imprecise label obtained by filling, and only part of the box is the real target, and the rest is the background area; the filled box label is refined using a conditional random field, which is a probabilistic graph model. It can impose certain penalties on pixels with similar colors and close distances on the filled box label but assigned different labels, so that the background area in the filled box is removed as much as possible, and the area where the real target is located is retained; after processing by the conditional random field, a pseudo-label that is more accurate than the filled box label can be generated; then, the ratio between the refined pseudo-labels and the filled box labels of each category of all samples is calculated, and this ratio is called the filling rate. The filling rate indicates approximately how much of the area in each category filled box is the real target area. Specifically, for a given category c, the i-th filled box label of the category is recorded as P fillbox (i) The pseudo label obtained by refining the filled box with the conditional random field is recorded as P CRFproposal (i), then the fill rate of category c is defined as follows:
[0023]
[0024] In formula (1), N c The number of labeled boxes for category c in all images; depending on the fill rate of each category, pixels with low confidence in the label can be ignored during training.
[0025] The confidence level of an image is determined by the network's predicted output class probability map and the peak-valley prior knowledge difference map. The network's output class probability map reflects the probability that each pixel in the image belongs to a defect class, while the peak-valley prior map reflects the degree of difference between the pixel and the background. Combining the class probability map with the prior map can enhance the network's ability to distinguish between background and target. The confidence map F is calculated as follows:
[0026] FαF priormap +(1α)F netmap (2)
[0027] In formula (2), F priormap is the peak and trough prior map; F netmap is the category probability map output by the network prediction; α is the adjustment coefficient, and its value range is [0,1]. When α is 0, it means that the confidence map is only determined by the category probability output by the network. When α is 1, it means that the confidence map is only determined by the peak and trough prior map.
[0028] According to the filling rate and confidence map of each category, after each round of network training, the filling rate guidance loss is used to guide the model to iteratively optimize the weak labels; first sort the confidence map of the image, and then use the filling rate FR c For reference, keep the confidence of each category in the previous FR c The pixels are used to generate more accurate new labels and sent to the network for the next round of training, helping the network to ignore the background pixels that are wrongly marked as defects as much as possible under weak supervision. The training loss is adjusted according to the filling rate. The filling rate loss of a sample is L fr The calculation is as follows:
[0029]
[0030] In formula (3), L c (i) is the loss of the i-th pixel in category c, top(FR c ) is a hyperparameter determined by the filling rate of category c, N is the number of categories; when the network calculates the loss, it only calculates those confidences in the front FR c The network focuses on the pixels in the filled area and ignores the areas with lower confidence. This can reduce the adverse effects of the background pixels in the filled box labels and allow the network to learn the characteristics of the real defects.
[0031] Furthermore, in step (5), the conditional random field is used to post-process the segmentation results to make the segmentation results more refined; after the conditional random field processing, some isolated areas with similar distances but no connection will appear; in order to reduce the influence of these isolated areas, the morphological expansion method is used to expand the boundary of the segmentation result outward to a certain extent, so that similar objects are connected together.
[0032] Beneficial effects of the present invention:
[0033] 1) Based on the characteristics of pipeline magnetic leakage data, a defect segmentation network MFLSegNet with an improved maximum pooling layer, a filling layer, and a hole pyramid pooling module is designed. MFLSegNet can better identify defects on the boundaries of pipeline magnetic leakage images and defects with large scale differences.
[0034] 2) The semantic segmentation model is trained using weak labels at the bounding box level. Combining prior knowledge of peaks and valleys and global statistical information of fill rate reduces the model's dependence on precise labeling, achieves efficient and accurate segmentation of pipeline defects, and effectively saves the cost of manual labeling.
[0035] 3) After testing on real oil and gas pipeline magnetic leakage data, better defect recognition results were obtained than the mainstream semantic segmentation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a framework flow chart of the method of the present invention.
[0037] Figure 2 It is the network structure diagram of MFLSegNet in the present invention.
[0038] Figure 3 It is a schematic diagram of the weak label iterative optimization process in the present invention.
[0039] Figure 4 This is the segmentation result of MFLSegNet and the mainstream semantic segmentation network under weak supervision in this invention. DETAILED DESCRIPTION
[0040] The technical solution of the present invention is further described below with reference to the accompanying drawings and specific examples.
[0041] like Figure 1 As shown, according to a specific example of the present invention, the pipeline magnetic leakage internal detection defect identification method based on weakly supervised learning of the present invention is implemented as follows:
[0042] 1. Data Preprocessing
[0043] After obtaining the magnetic flux leakage data of the oil and gas pipeline collected by the magnetic flux leakage detector, in order to remove the influence of noise in the pipeline, a sliding window of size 400×1 is used to traverse each row of magnetic flux leakage data. The median of all data in each sliding window is calculated, and the median is subtracted from each point on the original magnetic flux leakage data. This can make the normal background area more uniform and smooth.
[0044] According to statistics, 99.98% of the magnetic flux leakage data values are within the range of [-4500, 4500]. Points with signal values exceeding this range can be regarded as abnormal points and are assigned a value of -4500 or 4500.
[0045] Normalize the data with 4500 and -4500 as the maximum and minimum values, and map the leakage magnetic field value to the range of [0, 255].
[0046] 2. Constructing a multi-component magnetic flux leakage image dataset
[0047] The magnetic flux leakage data contains data from three components: radial, axial, and circumferential. When constructing the dataset, considering that the circumferential component of defects is not obvious, the radial component data, axial component data, and radial component data after sliding window filtering are used to construct multi-component magnetic flux leakage image data. The defect features in the original radial component data are more obvious; the axial component data contains the depth information of the defect; and the radial component data after sliding window filtering can provide information about the normal background area of the pipeline. The final dataset contains a total of 669 images, 80% of which are randomly divided into a training set of 536 images; the other 20% are divided into a test set of 133 images. The pixels in the images are divided into four categories: background, girth weld, spiral weld, and defect.
[0048] 3.MFLSegNet segmentation
[0049] MFLSegNet is trained using weak labels at the bounding box level. The structure of MFLSegNet is as follows: Figure 2 As shown in the figure. After each iteration, the currently trained network is used to predict the training set, and the network prediction results are combined with the peak and valley prior map to form a label confidence map. Then, based on the fill rate of each category, pixels with high confidence are retained, and the remaining pixels are considered background areas and ignored. In the next round of training, these ignored pixels will not be calculated as loss. By continuously iterating in this way, the network will eventually learn features that are more likely to be true defects and ignore those areas in the filled box labels that may be background pixels. The schematic diagram of the iterative optimization process is shown in the figure. Figure 3 shown.
[0050] 4. Conditional Random Field Refinement of Defect Edges
[0051] Since the image is downsampled after being input into the semantic segmentation network, the size of the feature map continues to decrease, resulting in the edges of the target in the final segmentation result not being fine enough. After obtaining the network segmentation result, the present invention uses conditional random fields to optimize the result and refine the target edge.
[0052] 5. Morphological expansion processing
[0053] Considering that there will be many isolated areas after conditional random field processing, a morphological dilation operation is performed after conditional random field processing to connect the isolated segmentation results.
[0054] Example 1
[0055] In order to verify the effectiveness of the present invention, experiments were conducted using magnetic leakage data collected on a real gas pipeline to compare the performance of the present invention with that of the current mainstream semantic segmentation model.
[0056] The evaluation indicators of model performance are mIoU, recall, precision and F2 score. IoU (Intersection over Union) refers to the ratio of the intersection and union of the prediction result of a certain category and the true label, and mIoU is the average of IoU of all categories. Recall and precision refer to the recall rate and precision of defect recognition, which are calculated as follows: search each defect area, calculate the IoU between the network prediction result and the true label of each defect, if IoU>0, the defect prediction result at that location is regarded as TP (True Positive), indicating that the defect at that location is correctly predicted by the model; FP (False Positive) means that there is no defect at that location, but it is predicted as a defect by the model; FN (False Negative) means that there is a defect at that location, but the model did not predict it.
[0057] The F2 score comprehensively measures the recall and precision of defect recognition. In its calculation formula, recall is weighted more highly than precision, which better aligns with the requirement of industrial defect detection, which prioritizes recall. Therefore, the experiment primarily focused on the F2 score. The semantic segmentation networks compared in the experiment include SegNet, UNet, and PSPNet. The results are shown in Table 1.
[0058] Table 1
[0059] Model Defect Recognition Recall Defect Identification Precision Defect recognition F2 score mIoU SegNet 75.44% 45.62% 66.72% 46.74% UNet 97.37% 27.96% 65.07% 2.68% PSPNet 72.81% 34.02% 59.29% 39.26% MFLSegNet-1 59.65% 68.34% 61.21% 48.80% MFLSegNet-2 90.79% 34.39% 68.37% 43.10%
[0060] In Table 1, MFLSegNet-1 is the network trained without using the peak-valley prior and fill-rate guided loss, and MFLSegNet-2 is the network trained with the peak-valley prior and fill-rate guided loss under the peak-valley coefficient α = 0.2.
[0061] From the results in Table 1, we can conclude that compared with the mainstream semantic segmentation networks SegNet, Unet, and PSPNet, MFLSegNet-2 shows the highest F2 score for defect recognition, which proves the effectiveness of MFLSegNet. Compared with MFLSegNet-1, which is not trained with the peak-valley prior and fill-rate guided loss, MFLSegNet-2 has higher F2 scores and mIoU, which proves the effectiveness of the peak-valley prior and fill-rate guided loss. From the actual segmentation results, as shown in the figure, Figure 4 As shown in Figure 3, the segmentation results of the MFLSegNet-2 model are more accurate than those of other networks.
Claims
1. A pipeline magnetic leakage internal detection defect identification method based on weakly supervised learning, characterized in that: The steps include: (1) Preprocessing the acquired pipeline magnetic flux leakage data; (2) Fusing the information of multiple components of magnetic flux leakage data to construct a magnetic flux leakage image dataset; (3) According to the characteristics of magnetic leakage data, a defect semantic segmentation network MFLSegNet is constructed, and the weak labels obtained by filling the bounding box labels are used to train MFLSegNet; the MFLSegNet refers to a magnetic leakage defect segmentation network designed according to the characteristics of magnetic leakage data. The overall structure of MFLSegNet is divided into two parts: encoder and decoder; the encoder adopts the first 4 blocks of VGGNet, which includes 10 3*3 convolution layers and 4 maximum pooling layers, and the decoder includes 5 3*3 convolution layers, 5 batch normalization layers, 5 random inactivation layers and 4 upsampling layers; MFLSegNet includes a maximum pooling layer designed specifically in the encoder, an improved padding layer set before all convolution layers, and a hole pyramid pooling module added between the encoder and decoder; (4) Combining the prior knowledge that magnetic flux leakage data will have peaks and valleys at abnormal locations, the filling rate guidance loss is used to guide the model to iteratively optimize weak labels during training; (5) The conditional random field and morphological dilation operations are used to post-process the model segmentation results to obtain the final defect recognition results.
2. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 1 is characterized in that: When constructing the data set, the original radial component data, the original axial component data, and the radial component data after sliding window filtering in the three-dimensional magnetic field vector measured by the magnetic flux leakage detector are used. After threshold truncation and normalization, they are used as the three channels of the RGB color image to construct the magnetic flux leakage image data set.
3. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 1 is characterized in that: The pooling layer in the network encoder is improved based on the characteristics of magnetic flux leakage data. Specifically, the axial sampling spacing of the magnetic flux leakage detector is 2mm, and the circumferential sampling spacing is usually in the range of 8mm~17mm. The axial sampling spacing of the detector is small and the sampling points are dense, while the circumferential sampling spacing is large and the sampling points are relatively sparse. Based on this characteristic, the size of the network's circumferential pooling window and the pooling step size are reduced to retain more information in the circumferential direction, thereby improving the network's ability to recognize tiny defects.
4. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 1 is characterized in that: Annular padding and symmetric padding are used in the convolutional layer of MFLSegNet to infer missing contextual information on the image boundary to better predict the pixels on the boundary. Specifically, since the pipeline is annular, the magnetic leakage data is expanded along the pipeline axis when constructing the magnetic leakage data set to obtain a rectangular magnetic leakage image. The upper and lower boundaries of the image are connected on the annular pipeline. Based on the characteristics of the magnetic leakage data of the annular pipeline, circular padding is used before the convolution layer to complete the upper and lower boundaries, and symmetric padding is used to complete the left and right boundaries. This more naturally completes the missing information at the boundary of the annular pipeline magnetic leakage image, enabling the network to better identify pipeline defects that may appear on the boundary.
5. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 1 is characterized in that: To address the problem of large differences in the scales of different defects on pipelines, MFLSegNet uses dilated pyramid pooling to fuse the multi-scale information of magnetic flux leakage images, so that low-resolution, high-semantic information and high-resolution, low-semantic information complement each other. Dilated pyramid pooling uses dilated convolutions of different sampling rates in parallel on a given feature map, which is equivalent to capturing the contextual information of the feature map at multiple scales. The specific spatial pyramid pooling structure consists of a The convolution layer consists of three dilated convolution layers with sampling rates of 6, 12, and 18, and a pooling structure.
6. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 1 is characterized in that: The weak labels at the bounding box level in step (3) are obtained by filling the bounding box annotation in the target detection. The specific filling method is: all the pixels in each box in the bounding box annotation are filled with the category to which the box belongs, and an inaccurate pixel-by-pixel weak label is obtained. Such a weak label contains some background areas that do not belong to the target.
7. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 1 is characterized in that: In step (4), the bounding box weak label used in training the network is the padded box label, and the padded box label is refined using the conditional random field to generate a pseudo label that is more accurate than the padded box label; Then, the ratio between the fine pseudo labels and the filled box labels of each category of all samples is calculated, and this ratio is called the filling rate. , the first The fill box label is recorded as , the pseudo label obtained by refining the filling box of the conditional random field is recorded as , then the category The fill rate is defined as follows: , In formula (1), For all images in the category The number of annotation boxes; Confidence Map is calculated as follows: , In formula (2), It is the difference map of the prior knowledge of peaks and troughs; The class probability map output by the network prediction; is the adjustment coefficient, and its value range is [0, 1]; According to the filling rate and confidence map of each category, after each round of network training, the filling rate guidance loss is used to guide the model to iteratively optimize the weak labels; first sort the confidence map of the image, and then sort it by the filling rate. For reference, keep the confidence of each category in the front The pixels are used to generate more accurate new labels and send them to the network for the next round of training, helping the network to ignore background pixels that are incorrectly labeled as defects as much as possible under weak supervision; The training loss is adjusted according to the filling rate, and the filling rate loss of a sample is The calculation is as follows: , In formula (3), For category Middle The loss of pixels, By category The fill rate determines the hyperparameter, N is the number of categories; when the network calculates the loss, it only calculates those confidences that are in the front The network focuses on the pixels in the filled area and ignores the areas with lower confidence. This can reduce the adverse effects of the background pixels in the filled box labels and allow the network to learn the characteristics of the real defects.
8. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 7 is characterized in that: The peak-valley prior knowledge difference map is obtained by calculating the difference between the pixel value at each point of the radial component of the magnetic flux leakage data and the background based on the peak-valley prior knowledge.
9. The pipeline magnetic flux leakage internal detection defect identification method based on weakly supervised learning according to claim 1 is characterized in that: Conditional random fields are used to post-process the segmentation results to make them more refined. After conditional random field processing, some isolated areas with similar distances but no connectivity will appear. In order to reduce the impact of these isolated areas, the morphological dilation method is used to expand the boundaries of the segmentation results outwards to make similar objects connected together.
Citation Information
Patent Citations
Pipeline defect detection method and device based on convolution neural network
CN110108783A
Weak supervision semantic segmentation method based on deep learning
CN113159048A