CN117274192A - Pipeline magnetic flux leakage defect detection method based on improved YOLOv5 - Google Patents
Pipeline magnetic flux leakage defect detection method based on improved YOLOv5 Download PDFInfo
- Publication number
- CN117274192A CN117274192A CN202311214990.4A CN202311214990A CN117274192A CN 117274192 A CN117274192 A CN 117274192A CN 202311214990 A CN202311214990 A CN 202311214990A CN 117274192 A CN117274192 A CN 117274192A
- Authority
- CN
- China
- Prior art keywords
- network
- size
- feature map
- multiplied
- improved
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 65
- 230000007547 defect Effects 0.000 title claims abstract description 45
- 230000004907 flux Effects 0.000 title claims abstract description 30
- 238000000034 method Methods 0.000 claims abstract description 23
- 238000012549 training Methods 0.000 claims abstract description 10
- 238000005520 cutting process Methods 0.000 claims abstract description 4
- 238000007781 pre-processing Methods 0.000 claims abstract description 4
- 230000004927 fusion Effects 0.000 claims description 20
- 238000005070 sampling Methods 0.000 claims description 13
- 238000000605 extraction Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 4
- 230000009467 reduction Effects 0.000 abstract description 2
- 238000013135 deep learning Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- VNWKTOKETHGBQD-UHFFFAOYSA-N methane Chemical compound C VNWKTOKETHGBQD-UHFFFAOYSA-N 0.000 description 4
- 230000006378 damage Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000011176 pooling Methods 0.000 description 3
- 101150064138 MAP1 gene Proteins 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000003345 natural gas Substances 0.000 description 2
- 238000009659 non-destructive testing Methods 0.000 description 2
- 239000003208 petroleum Substances 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000000446 fuel Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 230000005389 magnetism Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 239000003209 petroleum derivative Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- F—MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
- F17—STORING OR DISTRIBUTING GASES OR LIQUIDS
- F17D—PIPE-LINE SYSTEMS; PIPE-LINES
- F17D5/00—Protection or supervision of installations
- F17D5/02—Preventing, monitoring, or locating loss
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
- G06V10/443—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
- G06V10/449—Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
- G06V10/451—Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
- G06V10/454—Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/52—Scale-space analysis, e.g. wavelet analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
- G06V10/806—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/06—Recognition of objects for industrial automation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Multimedia (AREA)
- Data Mining & Analysis (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Biodiversity & Conservation Biology (AREA)
- Mechanical Engineering (AREA)
- Investigating Or Analyzing Materials By The Use Of Magnetic Means (AREA)
Abstract
The invention belongs to the field of pipeline leakage detection, and particularly relates to a pipeline magnetic leakage defect detection method based on improved YOLOv5, which comprises the following steps: acquiring pipeline magnetic flux leakage image data, carrying out data enhancement on the acquired pipeline magnetic flux leakage image data, and cutting the enhanced image; constructing an improved YOLOv5 network model, and inputting the cut image data into the improved YOLOv5 network model to train the model; and inputting the image to be detected into an improved YOLOv5 network model after training after image preprocessing, and outputting the defects and the defect positions in the image. According to the invention, an RA automatic data enhancement method is adopted, so that the network obtains more fine-grained information, a data set is expanded, the problem of insufficient magnetic flux leakage defect data is solved, and the robustness of a model is improved; the improved backbone network is adopted, so that the capability of extracting the model features is improved, and meanwhile, the detection speed is increased due to the reduction of the calculated amount.
Description
Technical Field
The invention belongs to the field of pipeline leakage detection, and particularly relates to a pipeline magnetic leakage defect detection method based on improved YOLOv 5.
Background
The fuel such as petroleum, natural gas is the most important energy in daily life, account for more than half of the total consumption of global primary energy, the pipeline is one of the most important transportation modes of petroleum and natural gas because of its large transportation capacity, advantages such as with low costs, but the pipeline is very easy to cause damage because of various reasons for long-time operation, such as corrosion, artificial destruction, etc., once the pipeline has leaked, can cause huge loss to economy, can also cause harm to the local environment, people's life and property safety simultaneously, so the periodic detection of pipeline is very important. The nondestructive testing technology is used for measuring and analyzing the change of the detected object in physical fields such as sound, light, electricity, magnetism, heat and the like on the premise of keeping the integrity of the detected object, so that the material performance or defect information of the detected object is evaluated, and the magnetic leakage detection is used as a common electromagnetic nondestructive testing technology, has strong adaptability to the environment, high detection speed and high sensitivity, and is suitable for detecting the defects of pipelines.
Because the long pipeline has longer conveying distance, the magnetic flux leakage detection data volume is huge, if the traditional magnetic flux leakage data identification and analysis method is used, the result is not only influenced by the professional level of a nondestructive inspector, but also consumes a great deal of manpower and time, so that the quick and efficient automatic identification method is particularly important. In recent years, a great deal of study is carried out by a plurality of students in the field of deep learning, and a deep learning algorithm is also applied to the field of magnetic flux leakage detection, so that the cost of defect detection is greatly reduced. In the current study, joulina a, et al combines self-supervision with deep learning to enable self-supervision to learn good features. And L.Yang et al introduces a cavity convolution and residual error attention network into the SSD, improves the receptive field of the model, simultaneously enables the model to pay more attention to the target, and finally fuses the high semantic features and the high resolution features to improve the detail features of the small target. And B, su et al introduces a complementary attention network into the network, skillfully fuses channel characteristics and space characteristics, can adaptively inhibit noise, and highlights the defect characteristics. The method has good effect in defect detection, but the effect of improving the characteristic multi-scale fusion and small target defect detection is not obvious, and meanwhile, too many parameters are introduced into the research model, so that the calculated amount is greatly improved, and the detection speed is influenced.
Disclosure of Invention
In order to solve the technical problems, the invention provides a pipeline magnetic flux leakage defect detection method based on improved YOLOv5, which comprises the following steps:
s1: acquiring pipeline magnetic flux leakage image data, performing data enhancement on the acquired pipeline magnetic flux leakage image data by using a RandAugment method, and cutting the enhanced image into image data with 640X 3;
s2: constructing an improved YOLOv5 network model, and inputting the cut image data into the improved YOLOv5 network model to train the model;
the improved YOLOv5 network model comprises: a backbone network, a feature fusion network, and a detection head network;
s21: inputting the cut image into a backbone network for feature extraction to obtain feature images with different sizes;
s22: inputting the feature map with the minimum size output by the main network into a feature fusion network for up-sampling for a plurality of times, and carrying out multi-scale feature fusion on the feature map after up-sampling for a plurality of times and the feature map with the same size output by the main network;
s23: sending the fused feature images with different sizes into a detection head network for defect detection and defect position marking;
s3: and inputting the image to be detected into an improved YOLOv5 network model after training after image preprocessing, and outputting the defects and the defect positions in the image.
The invention has the beneficial effects that:
the invention provides a magnetic flux leakage small defect detection method based on improved YOLOv5, which adopts an RA automatic data enhancement method, so that a network obtains more fine granularity information, a data set is expanded, the problem of insufficient magnetic flux leakage defect data is solved, and the robustness of a model is improved; the Repvgg module and the structural heavy parameterization are adopted, so that the network is faster, more memory is saved and more flexible; the G-GhostNet lightweight network is adopted, so that the capability of model feature extraction is improved, and meanwhile, the detection speed is increased due to the reduction of calculated amount; through the improvement, the method can realize high precision and high detection speed on the detection of the small magnetic leakage defect, and meets the actual detection requirement.
Drawings
FIG. 1 is a flow chart of an RA data enhancement method in the present invention;
FIG. 2 is a flow chart of the Repvgg module of the present invention;
fig. 3 is a diagram of the improved YOLOv5 network structure of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
A pipeline magnetic flux leakage defect detection method based on improved YOLOv5 comprises the following steps:
s1: acquiring pipeline magnetic flux leakage image data, performing data enhancement on the acquired pipeline magnetic flux leakage image data by using a RandAugment method, and cutting the enhanced image into image data with 640X 3;
s2: constructing an improved YOLOv5 network model, and inputting the cut image data into the improved YOLOv5 network model to train the model;
the improved YOLOv5 network model comprises: a backbone network, a feature fusion network, and a detection head network;
s21: inputting the cut image into a backbone network for feature extraction to obtain feature images with different sizes;
s22: inputting the feature map with the minimum size output by the main network into a feature fusion network for up-sampling for a plurality of times, and carrying out multi-scale feature fusion on the feature map after up-sampling for a plurality of times and the feature map with the same size output by the main network;
s23: sending the fused feature images with different sizes into a detection head network for defect detection and defect position marking;
s3: and inputting the image to be detected into an improved YOLOv5 network model after training after image preprocessing, and outputting the defects and the defect positions in the image.
101. The method comprises the steps of collecting an actual pipeline magnetic flux leakage image, and carrying out data enhancement on the pipeline magnetic flux leakage image by using a RandAugment (automatic search data enhancement) method while obtaining a characteristic diagram I with the size of 640 multiplied by 3.
In this embodiment, the data enhancement is implemented by using an effective enhancement policy (RA) randomly found by an automatic search method to an actually collected pipeline magnetic flux leakage defect image of a petroleum company, as shown in fig. 1, the specific method is to set an operation set consisting of 14 kinds of image enhancement operations, where 4 kinds of operations having negative effects on the embodiment are eliminated, and the rest 10 kinds of operations are respectively: automatic Contrast (AutoContrast), equalization (Equalite), rotation (Rotate), hue separation (Posterize), contrast (Contrast), sharpening (Sharpness), miscut along the X-axis (Shaar-X), miscut along the Y-axis (Shaar-Y), shift along the X-axis (Transate-X), shift along the Y-axis (Transate-Y), and RandAugment have only two parameters: n and M. Where N is N operations used in each enhancement (the N operations used are all extracted from the operation set with equal probability, for example, 14 operations are in the operation set, the probability of each operation being selected is 1/14, the selected operations may be the same in N enhancements of each image), M is a positive integer, meaning that all operations have amplitudes M when applied, using a grid search, experiments are performed on the complete data set and the complete network to find the most suitable N and M, the regularization intensity in training can be controlled by changing N, M values, the greater N, M is, the higher the regularization intensity is, n=3, m=10 is set, the data set image can be automatically enhanced by python3.7, thereby expanding the data set, and simultaneously the data set image size is set to 640×640×3, thereby obtaining the first feature map.
102. And (3) sending the feature map I obtained in the step (101) into a main network part of the improved network for feature extraction, and obtaining feature maps with different sizes.
In this embodiment, a feature map 1 with a size of 640×640×3 obtained in 101 is input to a backbone network part of an improved YOLOv5 (a single-stage object detection algorithm) network, the improved YOLOv5 network includes a backbone network, a feature fusion network, and a detection head network, the backbone network part is composed of 4 Repvgg (respectively denoted as R1, R2, R3, R4) layers, 4C 3 layers, and 3G-GhostNet layers, the feature extraction is performed on the input feature map 1, a Repvgg module is adopted to replace original 3*3 convolution, and a ReLU activation function is adopted to replace a lu activation function.
The Repvgg module is a structural re-parameterized vgg (a classical convolutional neural network) module, a multi-branch model similar to ResNet (residual error structure) is used during training, and the multi-branch model is converted into a vgg single-path model during reasoning, so that the structure can achieve rapider, more memory-saving and more flexible.
Specifically, the Repvgg module adopts structural reparameterization to optimize the model, and the original 3*3 convolution layer is parallel to two branches during training: one is a shortcut branch with the convolution kernel size of 1x1 and a shortcut branch connected with BN only, the characterization capability of the model is increased, and the model returns to a one-way structure in an inference stage, as shown in figure 2;
further, the structure re-parameterization mainly comprises two steps, wherein the first step mainly comprises the steps of fusing Conv operators and BN operators and converting branches with only BN into a Conv operator, the second step comprises the step of fusing 3x3 convolution layers on each branch into a convolution layer, the Conv operators and the BN operators are fused in a reasoning mode, for the convolution layers, the number of channels of each convolution kernel is the same as the number of channels of an input feature map, and the number of the convolution kernels determines the number of channels of an output feature map; for BN layer, mainly 4 parameters are contained: mu (mean value), sigma 2 (variance), γ and β, where μ and σ 2 The calculation formula of the ith channel BN of the feature map is as follows, wherein epsilon is a very small constant, and denominator is prevented from being zero:
the conversion formula for channel i is:
wherein M represents the characteristic diagram of the input BN layer, and E is ignored here, and a new convolution layer weight calculation formula after conversion is obtained:
for converting the branch with only 1x1 convolution into 3x3 convolution, setting padding to 1, and fusing the convolution layer and the BN layer according to the above; for the branch with BN, a convolution layer with 3x3 is constructed, the convolution layer only carries out identity mapping, namely the input and output characteristic diagram is unchanged, and then the convolution layer and the BN layer are fused according to the above.
Specifically, G-GhostNet is divided into two parts, "completed" and "ghost", the former requiring extensive block operations, denoted asThe latter is obtained by a simple linear operation, denoted asEach of the following is generated by:
wherein L' 2 ,L′ 3 …L′ n Representing n convolutions layers, C representing the Cheap operation, which may be a 1x1 or 3x3 convolution, and finally performing a Concat operation on the features of the two parts to output the features as:
the above method can greatly reduce the computational complexity of the model, butLack of deep information, thus introducing mix operation in G-GhostNet, compensating +.>Is missing. The feature collected from the completed branch isThese features compensate->Is missing.
First Z-transforming the fused featuresAnd (3) in the same domain, then carrying out feature fusion, wherein the expression is as follows:
where τ represents the transformation function, in order to reduce the computational effort, we use global average pooling of Z to get the aggregate feature, which is then transformed into the same domain using the full join layer.
τ(Z)=WPooling(Z)+b
Where Pooling represents global average Pooling and W, b represents weight and bias, respectively.
The block module of the G-GhostNet adopts a common residual module, the trunk part of the residual module is composed of three layers of convolution layers, convolution kernels are respectively 1 multiplied by 1,3 multiplied by 3 and 1 multiplied by 1, a complex branch is formed by stacking the residual modules for feature extraction, then a Ghost branch is formed by Cheap operation and mix information fusion, and finally the information of the two branches is fused to form the G-GhostNet lightweight network.
Specifically, the feature map with the size of 640×640×3 is subjected to 6×6 convolution on the convbnrele layer to obtain a feature map with the size of 320×320×64, the feature map with the size of 160×160×128 is obtained after passing through the R1, the feature map with the size of 80×80×256 is obtained after passing through the C3, the R2 and the G-G hostnet layer, the feature map with the size of 40×40×512 is obtained after passing through the C3, the R3 and the G-G hostnet layer, the feature map with the size of 20×20×1024 is obtained after passing through the C3, the R4 and the G-G hostnet layer, the feature map with the size of 20×20×1024 is obtained after passing through the C3 layer, and the specific structure flow is shown in fig. 3.
103. And (3) sending the feature images with the sizes of 20×20×1024 in 102 into a feature fusion network part for up-sampling and 1*1 convolution, expanding the width and height of the feature images by 2 times after each up-sampling, respectively obtaining feature images with the sizes of 40×40×512, 80×80×256 and 160×160×128, respectively obtaining feature images five and four in 102, and sending the feature images with the sizes of 20×20×1024 after Concat stitching and 1*1 convolution in a detection head network for detection.
In this embodiment, as shown in fig. 3, three feature maps of 80×80×256, 40×40×512 and 20×20×1024 are adopted in the neg portion, and the three feature maps are fused by using the FPN structure (feature map pyramid network), so that the network has information of different scales. In order to improve the effect of small target detection, a small target detection head is added, three feature images with the sizes of 80×80×256, 40×40×512 and 20×20×1024 are subjected to G-Ghost feature extraction, the number of channels is changed through 1×1 convolution, up-sampling is carried out, and feature fusion is carried out on the three feature images with the sizes of 160×160×128 in a back bone, so that a fourth detection head is obtained.
Specifically, in industrial production, the CPU of the computer is i7-12500H, the display card is RTX3070, the running memory is 8G, the language is python3.9, the deep learning framework is pytorch1.8, the pipeline magnetic flux leakage image with the size of 640 x3 is input into the improved YOLOv5 network for detection, a total of 16922 images are used, the training set is 13690 images, and the verification set is 3232 images. The parameters of the modified YOLOv5 network are set as follows: training 100 epochs by using SGD as a model optimizer, and setting the batch size to 8; the initial learning rate is set to be 0.01, and reaches 0.002 after 100 epochs; momentum 0.937; weight decay (decay set to 5e-4, NMS threshold set to 0.5. Specific parameters are as in Table one.
List one
After the characteristics of the main network part are extracted and the characteristics are enhanced by the characteristic fusion network, the detected result can be marked on the image through the detection head, small target defects of the pipeline can be accurately marked on the image, the probability that the target is the defect is represented, and the accuracy reaches more than eighty percent.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
Claims (9)
1. The pipeline magnetic flux leakage defect detection method based on the improved YOLOv5 is characterized by comprising the following steps of:
s1: acquiring pipeline magnetic flux leakage image data, performing data enhancement on the acquired pipeline magnetic flux leakage image data by using a RandAugment method, and cutting the enhanced image into image data with 640X 3;
s2: constructing an improved YOLOv5 network model, and inputting the cut image data into the improved YOLOv5 network model to train the model;
the improved YOLOv5 network model comprises: a backbone network, a feature fusion network, and a detection head network;
s21: inputting the cut image into a backbone network for downsampling to obtain feature images with different sizes;
s22: inputting the feature map with the minimum size output by the main network into a feature fusion network for up-sampling for a plurality of times, and carrying out multi-scale feature fusion on the feature map after up-sampling for a plurality of times and the feature map with the same size output by the main network;
s23: sending the fused feature images with different sizes into a detection head network for defect detection and defect position marking;
s3: and inputting the image to be detected into an improved YOLOv5 network model after training after image preprocessing, and outputting the defects and the defect positions in the image.
2. The improved YOLOv 5-based pipeline leakage defect detection method of claim 1, wherein the data enhancement of the acquired pipeline leakage image data using the randagment method comprises:
the RA method is used to randomly find a valid enhancement strategy for the pipeline magnetic flux leakage image by an automatic search method, thereby expanding a dataset and setting the image size in the dataset to 640×640×3.
3. The improved YOLOv 5-based pipeline magnetic flux leakage defect detection method of claim 1, wherein the backbone network comprises:
the Repvgg module is adopted to replace a 3*3 convolution layer of a main network in an original YOLOv5 model, a G-GhostNet lightweight network is added after each downsampling operation to reduce feature redundancy, and a ReLU activation function is adopted to replace a SiLU activation function, so that the main network of the improved YOLOv5 network model formed by 4 Repvgg layers, 4C 3 layers and 3G-GhostNet layers is obtained.
4. The improved YOLOv 5-based pipe leakage defect detection method of claim 3, wherein the Repvgg module comprises:
the Repvgg module adopts structural heavy parameterization to optimize the model, and the original 3*3 convolution layer is parallel to two branches during training, so as to increase the representation capability of the model: one is the shortcut branch with convolution kernel size 1x1 and one is the shortcut branch with BN only, which in the inference phase returns to the one-way structure.
5. A pipeline magnetic flux leakage defect detection method based on improved YOLOv5 of claim 3, wherein the G-GhostNet lightweight network comprises: a completed branch and a Ghost branch;
the completed branch performs feature extraction on the input feature map through a stacked residual error module; the Ghost branch performs Cheap operation on the input feature map and fuses mix information; and finally, fusing the information of the completed branch and the Ghost branch to form the G-Ghost Net network.
6. The improved YOLOv 5-based pipe leakage defect detection method of claim 1, wherein the detection head network comprises: a large target detection head, a medium target detection head, a small target detection head, and a minimum target detection head;
the large target detection head is used for detecting a characteristic diagram with the size of 20 multiplied by 1024; the middle target detection head is used for detecting a characteristic diagram with the size of 40 multiplied by 512; the small target detection head is used for detecting a characteristic diagram with the size of 80 multiplied by 256; the minimum target detection head is used for detecting a characteristic map with the size of 160×160×128.
7. The method for detecting the pipeline magnetic flux leakage defect based on the improved YOLOv5 according to claim 1, wherein the step of inputting the cut image into a backbone network for downsampling to obtain feature images with different sizes comprises the following steps:
the cut feature map with the size of 640 multiplied by 3 is subjected to 6 multiplied by 6 convolution ConvBNRELU layer to obtain a feature map II with the size of 320 multiplied by 64, the cut feature map III with the size of 160 multiplied by 128 is subjected to R1, the cut feature map IV with the size of 80 multiplied by 256 is subjected to C3, R2 and G-GhostNet layer, the cut feature map V with the size of 40 multiplied by 512 is subjected to C3, R3 and G-GhostNet layer, the cut feature map V with the size of 20 multiplied by 1024 is subjected to C3, R4 and G-GhostNet layer, and the cut feature map V with the size of 20 multiplied by 1024 is obtained through one C3 layer.
8. The method for detecting the magnetic flux leakage defect of the pipeline based on the improved YOLOv5 of claim 1, wherein the method for detecting the magnetic flux leakage defect of the pipeline based on the improved YOLOv5 is characterized in that a feature map with the minimum size output by a main network is input into a feature fusion network for up-sampling for a plurality of times, and the feature map after up-sampling for a plurality of times is subjected to multi-scale feature fusion with the feature map with the same size output by the main network, and the method comprises the following steps:
the feature map with the output size of 20 multiplied by 1024 in the backbone network is sent to a feature fusion network part for up-sampling and 1*1 convolution, the width and height of the feature map after each up-sampling are enlarged by 2 times, the sizes are 40 multiplied by 512, 80 multiplied by 256, 160 multiplied by 128 respectively, and the feature map with the size of 40 multiplied by 512, the feature map with the size of 80 multiplied by 256 and the feature map with the size of 160 multiplied by 128, which are output by the main network, are respectively sent into a detection head network for detection after Concat splicing and 1*1 convolution.
9. The method for detecting the magnetic flux leakage defect of the pipeline based on the improved YOLOv5 according to claim 1, wherein the method for sending the fused feature images with different sizes into a detection head network for defect detection and defect position marking comprises the following steps:
and respectively inputting the sizes 20×20×1024, 40×40×512, 80×80×256 and 160×160×128 output by the feature fusion network into a detection head network, respectively carrying out center point prediction and width-height prediction on the prior frame by using regression prediction through a large target detection head, a middle target detection head, a small target detection head and a minimum target detection head, and finally marking the prediction result on the feature map.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311214990.4A CN117274192A (en) | 2023-09-20 | 2023-09-20 | Pipeline magnetic flux leakage defect detection method based on improved YOLOv5 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311214990.4A CN117274192A (en) | 2023-09-20 | 2023-09-20 | Pipeline magnetic flux leakage defect detection method based on improved YOLOv5 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117274192A true CN117274192A (en) | 2023-12-22 |
Family
ID=89215456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311214990.4A Pending CN117274192A (en) | 2023-09-20 | 2023-09-20 | Pipeline magnetic flux leakage defect detection method based on improved YOLOv5 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117274192A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117876848A (en) * | 2024-03-13 | 2024-04-12 | 成都理工大学 | Complex environment falling stone detection method based on improved yolov5 |
CN118279308A (en) * | 2024-06-03 | 2024-07-02 | 山东中发新材料科技有限公司 | Pipeline defect detection method and system based on multi-source data fusion |
CN118644797A (en) * | 2024-08-14 | 2024-09-13 | 江苏省计量科学研究院(江苏省能源计量数据中心) | YOLOv7-OBB model-based intelligent tour inspection method and related system for high-voltage transformer substation |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220207693A1 (en) * | 2020-12-31 | 2022-06-30 | Infrastructure Dl, Llc | Systems, Methods and Apparatuses for Detecting Defects in Underground Infrastructure Systems |
CN114897887A (en) * | 2022-06-21 | 2022-08-12 | 重庆邮电大学 | X-ray security inspection image contraband detection method based on improved YOLOv5s |
CN115063665A (en) * | 2022-07-05 | 2022-09-16 | 西安邮电大学 | Lightweight fire detection method based on weighted bidirectional feature pyramid network |
CN115205667A (en) * | 2022-08-02 | 2022-10-18 | 江苏大学 | Dense target detection method based on YOLOv5s |
CN115294089A (en) * | 2022-08-18 | 2022-11-04 | 陕西科技大学 | Steel surface defect detection method based on improved YOLOv5 |
CN115457391A (en) * | 2022-09-15 | 2022-12-09 | 中国石油大学(北京) | Magnetic flux leakage internal detection method and system for pipeline and related components |
CN115760833A (en) * | 2022-11-30 | 2023-03-07 | 辽宁石油化工大学 | Rapid magnetic flux leakage small defect detection method |
CN115937651A (en) * | 2022-12-16 | 2023-04-07 | 浙江工业大学 | Cylindrical roller surface detection method and system based on improved yolov5s network model |
CN115978466A (en) * | 2022-12-27 | 2023-04-18 | 重庆市荣冠科技有限公司 | Fluid pipeline leakage detection method based on class imbalance improved twin support vector machine |
CN116168270A (en) * | 2023-02-21 | 2023-05-26 | 安徽理工大学 | Light gangue detection model and method based on parallel depth residual error network |
KR102540208B1 (en) * | 2022-10-31 | 2023-06-07 | (주)에리 | Fire detection method using deep learning |
CN116343045A (en) * | 2023-03-30 | 2023-06-27 | 南京理工大学 | Lightweight SAR image ship target detection method based on YOLO v5 |
CN116468684A (en) * | 2023-04-12 | 2023-07-21 | 西南石油大学 | Pipeline weld defect detection method based on improved yolo network |
-
2023
- 2023-09-20 CN CN202311214990.4A patent/CN117274192A/en active Pending
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220207693A1 (en) * | 2020-12-31 | 2022-06-30 | Infrastructure Dl, Llc | Systems, Methods and Apparatuses for Detecting Defects in Underground Infrastructure Systems |
CN114897887A (en) * | 2022-06-21 | 2022-08-12 | 重庆邮电大学 | X-ray security inspection image contraband detection method based on improved YOLOv5s |
CN115063665A (en) * | 2022-07-05 | 2022-09-16 | 西安邮电大学 | Lightweight fire detection method based on weighted bidirectional feature pyramid network |
CN115205667A (en) * | 2022-08-02 | 2022-10-18 | 江苏大学 | Dense target detection method based on YOLOv5s |
CN115294089A (en) * | 2022-08-18 | 2022-11-04 | 陕西科技大学 | Steel surface defect detection method based on improved YOLOv5 |
CN115457391A (en) * | 2022-09-15 | 2022-12-09 | 中国石油大学(北京) | Magnetic flux leakage internal detection method and system for pipeline and related components |
KR102540208B1 (en) * | 2022-10-31 | 2023-06-07 | (주)에리 | Fire detection method using deep learning |
CN115760833A (en) * | 2022-11-30 | 2023-03-07 | 辽宁石油化工大学 | Rapid magnetic flux leakage small defect detection method |
CN115937651A (en) * | 2022-12-16 | 2023-04-07 | 浙江工业大学 | Cylindrical roller surface detection method and system based on improved yolov5s network model |
CN115978466A (en) * | 2022-12-27 | 2023-04-18 | 重庆市荣冠科技有限公司 | Fluid pipeline leakage detection method based on class imbalance improved twin support vector machine |
CN116168270A (en) * | 2023-02-21 | 2023-05-26 | 安徽理工大学 | Light gangue detection model and method based on parallel depth residual error network |
CN116343045A (en) * | 2023-03-30 | 2023-06-27 | 南京理工大学 | Lightweight SAR image ship target detection method based on YOLO v5 |
CN116468684A (en) * | 2023-04-12 | 2023-07-21 | 西南石油大学 | Pipeline weld defect detection method based on improved yolo network |
Non-Patent Citations (1)
Title |
---|
朱理清: "改进YOLOv5算法的遥感图像车辆检测", 《计算机与现代化》, no. 5, 31 May 2023 (2023-05-31), pages 117 - 121 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117876848A (en) * | 2024-03-13 | 2024-04-12 | 成都理工大学 | Complex environment falling stone detection method based on improved yolov5 |
CN117876848B (en) * | 2024-03-13 | 2024-05-07 | 成都理工大学 | Complex environment falling stone detection method based on improvement yolov5 |
CN118279308A (en) * | 2024-06-03 | 2024-07-02 | 山东中发新材料科技有限公司 | Pipeline defect detection method and system based on multi-source data fusion |
CN118644797A (en) * | 2024-08-14 | 2024-09-13 | 江苏省计量科学研究院(江苏省能源计量数据中心) | YOLOv7-OBB model-based intelligent tour inspection method and related system for high-voltage transformer substation |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117274192A (en) | Pipeline magnetic flux leakage defect detection method based on improved YOLOv5 | |
CN110555399B (en) | Finger vein identification method and device, computer equipment and readable storage medium | |
CN110555841B (en) | SAR image change detection method based on self-attention image fusion and DEC | |
CN112801169B (en) | Camouflage target detection method, system, device and storage medium based on improved YOLO algorithm | |
Li et al. | IncepTCN: A new deep temporal convolutional network combined with dictionary learning for strong cultural noise elimination of controlled-source electromagnetic data | |
Shao et al. | Pixel-wise semisupervised fabric defect detection method combined with multitask mean teacher | |
CN114913379B (en) | Remote sensing image small sample scene classification method based on multitasking dynamic contrast learning | |
CN109543693A (en) | Weak labeling data noise reduction method based on regularization label propagation | |
CN114611617A (en) | Depth field self-adaptive image classification method based on prototype network | |
CN115309931A (en) | Paper text classification method and system based on graph neural network | |
CN111680755A (en) | Medical image recognition model construction method, medical image recognition device, medical image recognition medium and medical image recognition terminal | |
CN115512169B (en) | Weak supervision semantic segmentation method and device based on gradient and region affinity optimization | |
CN115393289A (en) | Tumor image semi-supervised segmentation method based on integrated cross pseudo label | |
Li et al. | DCI-PGCN: dual-channel interaction portable graph convolutional network for landslide detection | |
Zhou et al. | MSAR‐DefogNet: Lightweight cloud removal network for high resolution remote sensing images based on multi scale convolution | |
CN116580243A (en) | Cross-domain remote sensing scene classification method for mask image modeling guide domain adaptation | |
Hu et al. | A deep feature extraction approach for bearing fault diagnosis based on multi-scale convolutional autoencoder and generative adversarial networks | |
CN116071352A (en) | Method for generating surface defect image of electric power safety tool | |
CN115601572A (en) | Ultrasonic phased array image optimization reconstruction method and system based on semi-supervised CycleGan network | |
CN116311462A (en) | Facial image restoration and recognition method combining context information and VGG19 | |
CN115147727A (en) | Method and system for extracting impervious surface of remote sensing image | |
Yu et al. | Remote sensing image classification based on RBF neural network based on fuzzy C-means clustering algorithm | |
CN112529057A (en) | Graph similarity calculation method and device based on graph convolution network | |
Guo et al. | Land type authenticity check of vector patches using a self-trained deep learning model | |
CN117011219A (en) | Method, apparatus, device, storage medium and program product for detecting quality of article |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |