Abstract
Deep learning algorithm has a wide range of applications and excellent performance in the field of engineering image recognition. At present, the detection and recognition of buried metal pipeline defects still mainly rely on manual work, which is inefficient. In order to realize the intelligent and efficient recognition of pipeline magnetic flux leakage (MFL) inspection images, based on the actual demand of MFL inspection, this paper proposes a new object detection framework based on YOLOv5 and CNN models in deep learning. The framework first uses object detection to classify the targets in MFL images and then inputs the features containing defects into a regression model based on CNN according to the classification results. The framework integrates object detection and image regression model to realize the target classification of MFL pseudo color map and the synchronous recognition of metal loss depth. The results show that the target recognition ability of the model is good, its precision reaches 0.96, and the mean absolute error of the metal loss depth recognition result is 1.14. The framework has more efficient identification ability and adaptability and makes up for the quantification of damage depth, which can be used for further monitoring and maintenance strategies.
1 Introduction
Long distance metal pipelines play an important role in energy transmission fields such as oil and gas. By the end of 2020, the total mileage of global oil and gas pipelines in service is about 201.9 × 104 km, mainly distributed in North America and Eurasia (Li et al. 2021). Among them, most of the existing pipelines have been in operation for a long time and have entered the stage of regular monitoring and maintenance (Thakur et al. 2022). Magnetic flux leakage (MFL) detection technology is the most commonly used method in pipeline safety detection; it is a nondestructive testing technology that uses magnetic sensors to detect the magnetic flux leakage of internal and external surface defects of pipelines (Shi et al. 2015). Through the identification and analysis of magnetic flux leakage images, the size and location information of each feature on the pipeline can be determined (Liu et al. 2017; Peng et al. 2020; Yang et al. 2016). At present, the identification of pipeline magnetic flux leakage signal mostly adopts manual identification and review, which has low efficiency and high requirements for technicians. Therefore, how to identify pipeline magnetic flux leakage signal intelligently and accurately is the key issue concerned by the development of the industry.
In recent years, some scholars have carried out a series of research on how to realize the fast and automatic quantitative identification of magnetic flux leakage detection. Kim and Park (2018) quantized various damage magnetic flux leakage signals by using the relationship between envelope signal and threshold processing; Chen et al. (2018) proposed the adaptive weighting multiclassifier fusion decision algorithm, which can better identify MFL signals of rail cracks and achieve 93 % recognition accuracy on multichannel MFL signals; Kim et al. (2019) analyzed the MFL envelope signal characteristics of wire rope damage and used support vector machine (SVM) to automatically classify the damage types; and Shi et al. (2015) summarized MFL signal processing methods, such as simulation method, mapping method, signal classification method, etc. However, these methods often require signal preprocessing, which directly affects the accuracy of recognition results, resulting in poor stability of recognition results, complex calculation process, and low computational efficiency.
The development of computer technology promotes the intelligent process of traditional engineering field, especially the development of computer vision technology in image processing, brings great convenience to the acquisition and analysis of image information in engineering, and greatly improves the ability of engineering image information processing (Cheng et al. 2019; Masoud et al. 2015; Villalba-Diez et al. 2019). The deep learning model represented by convolutional neural network (CNN) is an important direction in the field of computer vision. The essence of CNN is a multilayer perceptron, which adopts the way of local connection and weight sharing, which greatly reduces the number of weights and reduces the complexity of the model, because it can directly take the image as the network input, CNN has great advantages in two-dimensional image processing (Gu et al. 2018; Lecun et al. 2015). It was applied earlier in the field of medical image recognition and developed rapidly (Esteva1 et al. 2017; Li et al. 2018) and gradually developed in the field of scientific research and engineering (Aguiar et al. 2019; Kaufmann et al. 2020; Samide et al. 2019; Sun et al. 2021). Bastian et al. (2019) uses CNN model to classify the corrosion risk level of the external corrosion image of the pipeline; He et al. (2019) uses the improved CNN model to detect the surface defects of hot rolled steel plate. Object detection is one of the core problems in the field of computer vision; it is a more advanced application developed on the basis of CNN. Its main task is to solve the problem of multiple types of targets in the image. It should not only realize the function of target recognition but also have the ability of target positioning. Therefore, it has a wide application prospect in the fields of unmanned driving, remote sensing image, and industrial detection (Cheng and Han 2016; Gupta et al. 2021; Wang et al. 2021). Object detection is divided into two-stage method and one-stage method. The two-stage method is to form a group of candidate boxes and then classify them into target object categories, such as R–CNN (Girshick et al. 2016), Faster R–CNN (Ren et al. 2017), etc. The one-stage method uses a single preamble convolution network to directly identify the target category and target location, for example, YOLO (Redmon et al. 2016) and SSD (Liu et al. 2016); these methods have achieved excellent performance in the field of defect detection (Cid-Galiot et al. 2022; Li et al. 2022). In the field of magnetic flux leakage testing, the use of depth learning algorithm to classify defects has also been explored; Yang et al. (2019) classifies the images of circumferential weld and spiral weld in magnetic flux leakage detection using the improved CNN network model, and the accuracy rate reached 95 %; Geng et al. (2022) used the deep convolutional generative adversarial network (DCGAN) for data enhancement and then used ResNet-50 network to achieve MFL image classification of pipe girth welds, with accuracy rates exceeding 80 %; Lang and Han (2022) proposed a method based on the multilayer feature fusion multiscale GhostNet to realize the classification of pipeline magnetic flux leakage images, compared with existing lightweight networks, it has better computing power and accuracy; and Yang et al. (2020) used the improved SSD object detection algorithm to automatically identify the location of circumferential weld, spiral weld, and magnetic flux leakage defect data, and the accuracy of defect detection can reach more than 90 %.
The current research shows that deep learning algorithm has excellent performance in target recognition and location. However, the current research focuses more on the classification of magnetic flux leakage images and has not yet paid attention to the damage quantification of magnetic flux leakage defect detection, especially the damage depth in the field of magnetic flux leakage detection of pipelines, which seriously threatens the safe operation of pipelines. The quantification of damage depth is a regression problem, which is different from the classification problem. How to further realize the synchronous quantification of damage depth based on the classification of magnetic flux leakage targets is crucial to solve the actual engineering needs. In addition, in the actual project, there are many target categories, and the requirements for each target information are different. The on-site detection needs to be analyzed quickly and conveniently, so it is necessary to have a more rapid and efficient real-time monitoring. Therefore, based on the actual pipeline detection data, this paper extracts the target image data required for engineering analysis and then proposes a new object detection framework, that is, based on CNN and YOLOv5 model, which has strong ability in both accuracy and speed, through improving the model, adjusting the model structure and parameters, and building a more efficient and applicable network structure, the target classification of magnetic flux leakage pseudo color map and the synchronous recognition of metal loss depth are realized, so as to solve the difficulties faced by data analysis in the actual project and improve the efficiency and accuracy of pipeline detection data analysis, then reduce the cost of data processing and analysis.
2 Principle of magnetic flux leakage detection
Magnetic flux leakage (MFL) detection is a common nondestructive testing method for the safety inspection of metal pipelines. Through this testing technology, high-resolution magnetic flux leakage images of metal pipelines can be obtained, so as to analyze and determine the location, size, and depth of defects and then evaluate the safety of failure risk.
Magnetic flux leakage detector is mainly composed of traction device, permanent magnet device, acquisition device, and power supply device. The complete magnetic circuit generally includes magnetizer, permanent magnet, steel brush, and inspected pipe wall (Feng et al. 2017; Zhang et al. 2021) The schematic diagram of magnetic flux leakage detection process is shown in Figure 1. When the metal pipe is free of defects and abnormal structure, after the pipe wall is magnetized, the magnetic lines of force are almost parallel and the density is evenly distributed; if there are corrosion pits or structural defects on the metal pipe wall, the magnetic line of force will bend and flow out at the defects to form a magnetic leakage field. The magnetic flux leakage signal is captured and analyzed by the sensor loaded on the detection instrument, so as to obtain the abnormal information of metal pipe wall. Magnetic flux leakage detection has significant advantages, such as high detection efficiency, high precision, remarkable characteristics of detection results, convenient for long-term storage, and conducive to regular detection and comparison. Therefore, it is widely used in long-distance pipeline safety detection.

Schematic diagram of magnetic flux leakage detection process.
The schematic diagram of magnetic flux leakage detect results is shown in Figure 2. Which can be obtained from the diagram, the strength of magnetic flux leakage in the nondefective pipe wall part is weak, and the linear density of magnetic flux is evenly distributed; the leakage magnetic field intensity at the defect location increases significantly, and the magnetic field line is obviously bent. The bending degree of the magnetic field line reflects the depth of the defect. In practical engineering detection, the pipeline length can reach hundreds of kilometers or even thousands of kilometers, and magnetic flux leakage detection will produce a huge amount of data. Therefore, data enhancement and color transformation are often made for magnetic flux leakage detection results, which are converted into pseudo-color map to obtain clearer and intuitive magnetic flux leakage characteristics, so as to have better identification effect and improve identification efficiency (Peng et al. 2015). This paper mainly analyzes and processes the pseudo-color map of magnetic flux leakage detection.

Schematic diagram of magnetic flux leakage detect results: (a) diagram and (b) pseudo-color map.
3 Calculation process and network structure
3.1 Data sets
The data come from the magnetic flux leakage detect results of a pipeline project, and the collected pseudo-color maps of magnetic flux leakage detection are shown in Figure 3. A total of 1000 pictures were collected, including 800 as the training set and 200 as the test set. Make Sense tool is used to mark each target in the picture. The results show that there are 2000 target information in the training set, which consists of 436 girth welds (Weld), 243 girth weld anomalies position (GWA), 405 metal losses (ML), 130 touching metals to metals (TMTM), and 786 spiral welds (SW). Besides that, there are 483 target information in the test set, which consists of 106 girth welds (Weld), 69 girth weld anomalies position (GWA), 81 metal losses (ML), 28 touching metals to metals (TMTM), and 199 spiral welds (SW).

Pseudo-color maps of magnetic flux leakage detection.
The position distribution information of each target center point in the training set and test set are shown in Figure 4. The coordinate positions in the figure are the result of homogenization. From the figure, the target position distribution is relatively scattered, there is no obvious position concentration, and it has good discretization and representativeness.

Position distribution of each target center point in the image.
In addition, a total of 300 separate metal loss images were collected from the above images, the metal loss depth values of each image were recorded, and the training set and test set were divided according to the ratio of 250:50.
3.2 Calculation process
In order to improve the accuracy and speed of target classification of magnetic flux leakage detection image, the depth learning method based on YOLOv5 is improved to make it more meet the needs of data analysis in engineering detection. The calculation process mainly includes YOLOv5 object detection model and CNN metal loss depth identification model. The object detection process includes label making, image preprocessing, training model, and validation model. Label making uses Make Sense tool to mark each target. The CNN metal loss depth identification model includes image preprocessing, training model, and validation model. Before the final test, we need to train the two models respectively. Among them, YOLOv5 model uses 1000 pseudo-color images for training and testing, and CNN model uses 300 separately saved metal loss images for training and testing. The model construction and debugging are carried out in Python environment and are implemented on the TensorFlow framework. The structure and parameter settings of the two models will be described in detail in the next part.
The calculation flow of the constructed image recognition model is shown in Figure 5. The process includes (1) transfer a test image into the YOLOv5 test model to classify the targets on the image. (2) After the classification is completed, judge whether each target is a metal loss type, if it is not a metal loss, output the type and its confidence of the target. (3) If it is judged that the target type is metal loss, cut the target detection results and extract the metal loss target features. (4) Transfer the extracted image of metal loss characteristics into the pretrained CNN metal loss depth recognition model to recognize the metal loss depth value. (5) Write the metal loss depth information in the after of metal loss type and confidence identified in part 2 and then output the final identification result.

The calculation flow of the constructed image recognition model.
3.3 Structure of convolutional neural network
Convolutional neural network (CNN) is a kind of feedforward neural network with depth structure including convolution calculation, and it is one of the representative algorithms of deep learning. CNN is a deep neural network composed of convolutional layer, pooling layer, and fully connected layer, which has the ability of local perception and weight sharing.
Based on the structural rules of convolution neural network, a network for identifying metal loss depth is constructed, and its structural model is shown in Figure 6. Through the network structural model, the deep extraction of image information is realized, so as to identify the corrosion pit depth of metal loss type.

The network structure of convolutional neural network.
Before an image is transferred to CNN, it needs to preprocess the image. First, convert the image size into a pixel size of 100 × 100, and data enhancement processing such as rotation and offset are performed to improve the generalization ability of model training, and then transfer the preprocessed image to the model input layer.
Each convolution unit includes a convolutional layer and a pooling layer. Convolutional layer 1 performs convolution operation with the input image through 16 convolution kernel with a pixel size of 5 × 5 and keeps the size of the original image unchanged to obtain 16 characteristic images with a pixel size of 100 × 100, and the activation function is ReLU function. ReLU function is an activation function commonly used in deep learning. The formula is shown as follows:
Among, X represents the original value, which means that when X > 0, the ReLU function outputs the original value X, and when X < 0, ReLU function outputs 0. In neural network, ReLU function is the nonlinear output result of neuron after linear transformation wTx + b, where w, x, and b represent the weight, input vector, and bias of neuron, respectively, and the purpose of ReLU function is to make the network have moderate sparsity.
The pooling layer 1 adopts the max-polling operation with a pooling radius of 2, which mainly completes the feature aggregation and extraction of the convolutional layer. Each neuron is connected through the 2 × 2 region corresponding to the convolution layer 1, and the size of the output feature map after pooling is 50 × 50 pixels.
There are four such convolution units, the number of convolution core is 16, 32, 64, 128, the number of the Kernel_size is 5, 3, 3, 1, respectively, the activation function is ReLU, and the pooling radius is 2. After four rounds of convolution and pooling, a total of 128 feature images with a pixel size of 7 × 7 are finally obtained. Then the flatten layer is used to flatten the image, and the convoluted two-dimensional image is converted into one-dimensional data. The full connection layer consists of 500 neurons connected with flattened one-dimensional data, the dropout layer is set to 0.5, the purpose is that only 50 % of the neurons in the full connection layer participate in the operation, so as to improve the operation ability and reduce over fitting. The last full connection layer (output layer) outputs the calculation result, which is the numerical result of the identified corrosion depth.
3.4 Structure of YOLO
YOLO algorithm is one of the most rapidly developing object detection algorithms; its main purpose is to identify the target in the picture and give its specific location. YOLO is a one-stage algorithm, which uses only one CNN network to directly predict the category and location of different targets (Redmon et al. 2016). Therefore, compared to the two-stage algorithm, this model is more compact, faster in computational speed, and has the potential to be used in online detection scenarios.
The network structure of this paper adopts the latest algorithm YOLOv5 version 5.0 for debugging (Ultralytics 2021); this model demonstrates excellent performance in both recognition accuracy and speed (Shi et al. 2022; Foster et al. 2022). The network model adopts YOLOv5s as the initial training network model, and its main components are Input, Backbone, Neck, and Detect. The network structure is shown in Figure 7. The model has the simplest structure and fast training speed, which is easy to be input as the initial model parameters.

The network structure of YOLOv5s.
In the network structure of YOLOv5s, the function of focus is to slice the feature map. The Conv unit includes Convolution, BatchNormalization, and SiLU activation functions. The formula of SiLU activation function is shown as follows:
The C3 unit is a CSPNet network structure, which is composed of three Conv units and residual module Concat. The SPP unit adopts the max-pooling operation, with the pooling radius of 5, 9, and 10, respectively, and carries out multiscale fusion. The Upsample multiple is 2; the main purpose is to enlarge the size of the feature map. The network finally outputs three feature images for prediction.
4 Results and analysis
4.1 Identification results of CNN metal loss depth identification model
In the calculation of convolutional neural network, Adam optimizer is used. Adam is a random optimization method with adaptive momentum and an extension of random gradient descent algorithm. It is often used as the optimizer algorithm in deep learning. The learning rate is set to 1 × 10−4, and the loss function in the calculation process adopts mean-square error (MSE), which is the most commonly used loss function in solving regression problems. In addition, batch_size is 8, which means the number of samples selected in each training is 8, and the epochs is 200, which means a total of 200 training times.
Based on the self-built convolution neural network model, the metal loss image data set of pipeline magnetic flux leakage detection is trained. Taking the metal loss depth of 20 % as an example, the convolution process is visualized, and the pictures in each convolutional layer under a certain parameter are shown in Figure 8. It can be found that in the first and two convolutional layers, there is an obvious filtering effect, and the main function is edge detection. In the third and fourth convolution layers, there is obvious color detection, that is, the color of the characteristic part is obviously brightened. With the deepening of the number of layers, the extracted features become more and more abstract, and the extracted features become more and more representative.

Visualization of convolution process.
The Conv4 layer images with different metal loss depths are shown in Figure 9. It can be clearly found from the figure that the brightness of the feature area of the image with shallow metal loss depth is smaller after CNN high-dimensional convolution feature extraction, while the brightness of the feature area of the metal loss image with 20 % metal loss depth is significantly stronger than that of the 10 % metal loss depth after CNN feature extraction and abstraction. It is by virtue of the different regional morphology and color features after feature abstraction that the difference of metal loss depth is recognized.

Convolution visualization of Conv4 layer with different metal loss depth.
The training results use loss value and coefficient of determination (R2) to evaluate the fitting effect of the model. In deep learning, the loss function is defined as the error between the training result and the expectation of the neural network. The smaller its loss value is, the higher the calculation accuracy is. R2 reflects the accuracy of the model, and its formula is as follows:
where,
The variation trend of loss value during training and test result are shown in Figure 10. With the increase of training times, the loss values of training set and test set tend to be stable. After 200 cycles of training, R2 value reaches 0.95. The prediction results show that the mean absolute error (MAE) value is 1.14, the error fluctuation is less than 3 % of wall thickness, and the training effect is excellent.

Results of CNN model: (a) variation of loss value during training; (b) correlation of test results and real values.
Part of the test results are shown in Figure 11. The representation method of the label is set as follows: the real value of metal loss depth => the predicted value. The label can intuitively display the comparison between the prediction results and the real data. The results show that the metal loss images achieve better depth prediction.

Image results of test set.
4.2 Identification results of YOLO object detection model
In the training of YOLOv5 object detection model, the initial model structure and model parameters use YOLOv5s, the optimizer uses Adam optimizer, and the image size is set to [640, 640]. In addition, batch_size is 16, which means the number of samples selected in each training are 16, and the epochs is 300, indicating a total of 300 training cycles.
The ability of YOLO model to classify and recognize different targets is evaluated by precision and recall. Precision and recall are calculated through the confusion matrix of the prediction results, which is shown in Table 1. The positioning accuracy of the bounding box is evaluated through Intersection over Union (IoU). IoU calculates the ratio of intersection and union of predicted box and real box. IoU is a very important function to evaluate the performance of object detection algorithm. It can be inferred from this definition that when the value of IoU is closer to 1, the higher the coincidence between the prediction box and the real box. In the YOLOv5 object detection model, the accuracy of prediction box are evaluated by the mAP@0.5 and mAP@0.5: 0.95, where mAP@0.5 means that the mean average precision (mAP) of all categories when the IoU is set to 0.5, mAP@0.5: 0.95 represents the average mAP over different IoU thresholds (from 0.5 to 0.95, in steps of 0.05).
Confusion matrix of the prediction results.
| Predicted actual | + | − | Formula |
|---|---|---|---|
| + | True positive (TP) | False positive (FP) | Precision = TP/(TP + FP) |
| − | False negative (FN) | True negative (TN) | Recall = TP/(TP + FN) |
Based on the YOLOv5 object detection model, the image data set of pipeline magnetic flux leakage detection is trained for 300 cycles. The change processes of precision, recall, mAP@0.5, mAP@0.5:0.95, and loss value in the training process are shown in Figure 12. It can be seen from the figure that the loss value gradually decreases and finally tends to be stable with the increase of training times; the evaluation parameters gradually increase with the increase of training times and finally tend to be stable. After stabilization, the precision, recall, mAP@0.5, and mAP@0.5:0.95 values are 0.96, 0.92, 0.94, and 0.62, respectively, which show good performance of target recognition and positioning.

Change of evaluation parameters of YOLOv5 object detection model during training.
The test set images are introduced into the trained object detection model to verify the generalization ability of the model. The test results show that the target information in the image is accurately recognized. Some test results are shown in Figure 13. The output format of target detection is object class, confidence. The results show that all types of targets in the image are well recognized, and the target has high reliability and excellent effect.

Object detection results.
4.3 Identification results of improved model
In the actual detection process, the object detection and metal loss depth identification are not separated, so a more unified and convenient method is needed to realize the target classification of magnetic flux leakage pseudo color map and the synchronous prediction of metal loss depth. In Sections 4.1 and 4.2, the YOLOv5 object detection model and CNN metal loss depth identification model have been trained. On this basis, the model is improved according to the calculation process set in Section 3.2 to obtain a better image recognition method for MFL detection.
The improved object detection and recognition results are shown in Figure 14. In this model, the target classification and corrosion depth recognition of magnetic flux leakage pseudo-color map are unified. The main method is to distinguish the classification results after object detection and cut the image of the part with metal loss type as the discrimination result, so as to obtain the image of metal loss type. Then, it is introduced into CNN metal loss depth identification model to determine its metal loss depth value, and the corrosion depth value is written in the original format and output together, which the format of metal loss type is object class, confidence + metal loss depth value.

Improved object detection test results.
In addition, in order to obtain the size information of each target more intuitively, a new parameter ratio is added to the model, which means the actual length corresponding to the unit pixel. The purpose is to output and display the actual size value of each type of target in real time after adding the ruler. The default value is 1, which means that the pixel sizes of the target are displayed.
5 Opportunities and challenges
In this paper, we utilize a deep learning object detection algorithm to systematically analyze magnetic flux leakage detection images. This method demonstrates outstanding performance by leveraging the convenience, efficiency, and robustness, which makes it highly suitable for practical applications. Moreover, this approach is easy to set up, offers rapid training speed, and features a lightweight model size that enhances deployment and usage. Furthermore, the method provides high degree of flexibility to facilitate further data expansion, training, maintenance, and improvement. By utilizing deep model algorithms for defect detection, we can quickly obtain geometric information about defects, which leads to significant improvements in defect evaluation efficiency.
In the field of online monitoring, deep learning models have demonstrated significant potential for application. The YOLOv5 object detection algorithm is equipped with robust functions, capable of detecting not only images, but also supporting local video and camera video source acquisition. Enhanced with these capabilities, the object detection model based on YOLOv5 has demonstrated excellent object recognition capabilities, enabling efficient, real-time detection, and rapid information retrieval. The development of monitoring and early warning models grounded in deep learning principles will bring immense convenience to the safe operation of engineering fields, especially in the area of online monitoring.
In the field of pipeline integrity management, this approach holds significant advantages in forecasting pipeline longevity and determining maintenance procedures. Specifically, within the purview of pipeline integrity operation management, pipeline in-section inspections are regularly conducted using magnetic flux leakage techniques. Given its robust target positioning and fast identification capabilities, this method can be leveraged to analyze the development and evolution of metal losses within the same target and thus construct a comprehensive data management system, which affords pipeline operations and management personnel with invaluable reference data, streamlining decision-making and management processes.
Although deep learning object detection algorithms exhibit strong advantages and application potential, they still encounter significant challenges when it truly applied in engineering scenarios. Firstly, the accuracy of model training depends on a complete database. The more comprehensive and informative the training set data is, the greater the model’s ability to generalize, which poses challenges in terms of accumulating and managing vast amounts of data.
Secondly, this method faces the challenge of multiphysical integrated detection. Although the results presented in this article demonstrate excellent performance of the model for magnetic flux leakage detection images, it should be noted that detecting magnetic flux leakage has its own limitations. Singh et al. (2023) results show that the orientation of defects has an impact on the sensitivity of magnetic flux leakage detection. Feng et al. (2017) summarized the insufficient ability of magnetic flux leakage detection in detecting abnormal circumferential welds. A single detection technology is difficult to achieve high-quality detection results. Instead, multiple detection methods are often integrated and complementary for high-risk areas, such as ultrasonic inspection, eddy current inspection, and radiography testing, etc. (Ma et al. 2021). This makes it difficult to handle complex data types and sources in practical engineering applications, thus posing higher requirements on deep learning algorithms.
In the future, it is necessary to develop more comprehensive model methods to improve the quantification ability and positioning accuracy of the model, thereby increasing the accuracy and robustness of the model in complex environments. It can be accomplished by enhancing the algorithm’s ability to process multiple physical detection data and constructing an efficient fusion mechanism, which will increase the recognition accuracy of the algorithm in multisource data. It should be noted that small corrosion defects account for a significant proportion of pipeline detection results, with noise signals affecting the recognition of small defects. Improving the accuracy of small target detection in the algorithm could enhance its application value. Furthermore, with the development of cloud technology, integrating detection information and environmental data in the cloud; developing online monitoring, management, and early warning platforms; and promoting the intelligent process of pipeline defect detection would all be viable options.
6 Conclusions
Based on CNN and YOLOv5 models, this paper proposes a new object detection framework by improving the model, adjusting the model structure and parameters, in order to realize the target classification of magnetic flux leakage pseudo-color map and the synchronous recognition of metal loss depth. The calculation results show that the error range of metal loss depth is within 3 % of pipe wall thickness; the precision, recall, and mAP@0.5 of target classification reach 0.96, 0.92, and 0.94, respectively, which verify its effectiveness and feasibility, and help to improve the image recognition efficiency of pipeline detection. The method has more efficient identification ability and adaptability and makes up for the quantification of damage depth, which can be used for further monitoring and maintenance strategies.
The evaluation of metal pipeline defects is also the key issue for the safe operation of pipeline. Integrating a variety of detection images to make a more comprehensive discrimination of defects and realizing corrosion prediction according to multiple detection images are also the development direction of image recognition technology. Deep learning technology shows great potential in industrial image recognition. This paper tries to apply deep learning to the pipeline detection industry, and the results show that it has a relatively excellent effect. It is undeniable that the model framework based on deep learning still has further optimization space; with the addition of more data results and more professional researchers, the accuracy and practicability of using image recognition technology to identify the detection signal in the pipeline will be effectively improved.
Funding source: National Key R&D Program of China
Award Identifier / Grant number: 2021YFB3702200
Funding source: National Natural Science Foundation of China
Award Identifier / Grant number: 51971034, 52271001
-
Research ethics: All procedures were performed in compliance with relevant laws and institutional guideline, and do not violate any ethical standards.
-
Author contributions: All the authors have accepted responsibility for the entire content of this submitted manuscript and approved submission.
-
Competing interests: The authors declare no conflicts of interest regarding this article.
-
Research funding: This work was supported by the National Key R&D Program of China (2021YFB3702200) and the National Natural Science Foundation of China (nos. 51971034, 52271001).
-
Data availability: The data that support the findings of this study are available from the corresponding author upon reasonable request.
References
Aguiar, J.A., Gong, M., Unocic, R.R., Tasdizen, T., and Miller, B.D. (2019). Decoding crystallography from high-resolution electron imaging and diffraction datasets with deep learning. Sci. Adv. 5: eaaw1949, https://doi.org/10.1126/sciadv.aaw1949.Search in Google Scholar PubMed PubMed Central
Bastian, B.T., Jaspreeth, N., Ranjith, S.K., and Jiji, C.V. (2019). Visual inspection and characterization of external corrosion in pipelines using deep neural network. NDT & E Int. 107: 102134, https://doi.org/10.1016/j.ndteint.2019.102134.Search in Google Scholar
Chen, W., Liu, W., Li, K., Wang, P., Zhu, H., Zhang, Y., and Hang, C. (2018). Rail crack recognition based on adaptive weighting multi-classifier fusion decision. Measurement 123: 102–114, https://doi.org/10.1016/j.measurement.2018.03.059.Search in Google Scholar
Cheng, G. and Han, J. (2016). A survey on object detection in optical remote sensing images. Isprs J. Photogramm. 117: 11–28, https://doi.org/10.1016/j.isprsjprs.2016.03.014.Search in Google Scholar
Cheng, Y., Li, C., and Chen, Y. (2019). Apply computer vision in GUI automation for industrial applications. Math. Biosci. Eng. 16: 7526–7545, https://doi.org/10.3934/mbe.2019378.Search in Google Scholar PubMed
Cid-Galiot, J.J., Aguilar-Lasserre, A.A., Grande-Ramirez, J.R., Meza-Palacios, R., and Rodriguez-Jarquin, J.P. (2022). Decision support system to evaluate a vandalized and deteriorated oil pipeline transportation system using artificial intelligence techniques. Part 1: modeling. Corros. Rev. 40: 453–473, https://doi.org/10.1515/corrrev-2021-0080.Search in Google Scholar
Esteva, A., Kuprel, B., Novoa, R.A., Ko, J., Swetter, S.M., Blau, H.M., and Thrun, S. (2017). Dermatologist-level classification of skin cancer with deep neural networks. Nature 542: 115–118, https://doi.org/10.1038/nature21056.Search in Google Scholar PubMed PubMed Central
Feng, J., Li, F., Lu, S., Liu, J., and Ma, D. (2017). Injurious or noninjurious defect identification from MFL images in pipeline inspection using convolutional neural network. IEEE Trans. Instrum. Meas. 66: 1883–1892, https://doi.org/10.1109/tim.2017.2673024.Search in Google Scholar
Feng, Q., Li, R., ie, B., Liu, S., Zhao, L., and Zhang, H. (2017). Literature review: theory and application of in-line inspection technologies for oil and gas pipeline girth weld defection. Sensors 17: 1–24, https://doi.org/10.3390/s17010050.Search in Google Scholar PubMed PubMed Central
Foster, A., Best, O., Gianni, M., Khan, A., Collins, K., and Sharma, S. (2022). IEEE 14th image, video, and multidimensional signal processing workshop (IVMSP), June 26–29, 2022. Drone Footage Wind Turbine Surface Damage Detection, Nafplio, Greece.10.1109/IVMSP54334.2022.9816220Search in Google Scholar
Geng, L., Dong, S., Qian, W., and Peng, D. (2022). Image classification method based on improved deep convolutional neural networks for the magnetic flux leakage (MFL) signal of girth welds in long-distance pipelines. Sustainability 14: 12102, https://doi.org/10.3390/su141912102.Search in Google Scholar
Girshick, R., Donahue, J., Darrell, T., and Malik, J. (2016). Region-based convolutional networks for accurate object detection and segmentation. IEEE Trans. Pattern Anal. 38: 142–158, https://doi.org/10.1109/tpami.2015.2437384.Search in Google Scholar PubMed
Gu, J., Wang, Z., Kuen, J., Ma, L., Shahroudy, A., Shuai, B., Liu, T., Wang, X., Wang, G., Cai, J., et al.. (2018). Recent advances in convolutional neural networks. Pattern Recogn 77: 354–377, https://doi.org/10.1016/j.patcog.2017.10.013.Search in Google Scholar
Gupta, A., Anpalagan, A., Guan, L., and Khwaja, A.S. (2021). Deep learning for object detection and scene perception in self-driving cars: survey, challenges, and open issues. Array 10: 100057, https://doi.org/10.1016/j.array.2021.100057.Search in Google Scholar
He, D., Xu, K., and Zhou, P. (2019). Defect detection of hot rolled steels with a new object detection framework called classification priority network. Comput. Ind. Eng. 128: 290–297, https://doi.org/10.1016/j.cie.2018.12.043.Search in Google Scholar
Kaufmann, K., Zhu, C., Rosengarten, A.S., Maryanovsky, D., Harrington, T.J., Marin, E., and Vecchio, K.S. (2020). Crystal symmetry determination in electron diffraction using machine learning. Science 367: 564–568, https://doi.org/10.1126/science.aay3062.Search in Google Scholar PubMed
Kim, J.W. and Park, S. (2018). Magnetic flux leakage–based local damage detection and quantification for steel wire rope non-destructive evaluation. J. Intel. Mat. Syst. Str. 29: 3396–3410, https://doi.org/10.1177/1045389x17721038.Search in Google Scholar
Kim, J.W., Tola, K.D., Tran, D.Q., and Park, S. (2019). MFL-based local damage diagnosis and SVM-based damage type classification for wire rope NDE. Materials 12: 2894, https://doi.org/10.3390/ma12182894.Search in Google Scholar PubMed PubMed Central
Lang, X. and Han, F. (2022). MFL image recognition method of pipeline corrosion defects based on multilayer feature fusion multiscale GhostNet. IEEE Trans. Instrum. Meas. 71: 5020108, https://doi.org/10.1109/tim.2022.3199247.Search in Google Scholar
Lecun, Y., Bengio, Y., and Hinton, G. (2015). Deep learning. Nature 52: 436–444, https://doi.org/10.1038/nature14539.Search in Google Scholar PubMed
Li, M., Wang, H., and Wan, Z. (2022). Surface defect detection of steel strips based on improved YOLOv4. Comput. Electr. Eng. 102: 108208, https://doi.org/10.1016/j.compeleceng.2022.108208.Search in Google Scholar
Li, Q., Zhao, M., Zhang, B., Wen, W., Wang, L., Zhang, X., and Chen, L. (2021). Current construction status and development trend of global oil and gas pipelines in 2020. Oil Gas Storage Transp. 40: 1330–1337+1348.Search in Google Scholar
Li, X., Chen, H., Qi, X., Dou, Q., Fu, C., and Heng, P. (2018). H-DenseUNet: hybrid densely connected unet for liver and tumor segmentation from CT volumes. IEEE Trans. Med. Imaging 37: 2663–2674, https://doi.org/10.1109/tmi.2018.2845918.Search in Google Scholar
Liu, B., He, L., Zhang, H., Cao, Y., and Fernandes, H. (2017). The axial crack testing model for long distance oil – gas pipeline based on magnetic flux leakage internal inspection method. Measurement 103: 275–282, https://doi.org/10.1016/j.measurement.2017.02.051.Search in Google Scholar
Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C., and Berg, A.C. (2016). SSD: single shot multibox detector. In: 14th European Conference on Computer Vision (ECCV), October 8–10, 2016, Amsterdam, Netherlands.10.1007/978-3-319-46448-0_2Search in Google Scholar
Ma, Q., Tian, G., Zeng, Y., Li, R., Song, H., Wang, Z., Gao, B., and Zeng, K. (2021). Pipeline in-line inspection method, instrumentation and data management. Sensors 21: 3862, https://doi.org/10.3390/s21113862.Search in Google Scholar PubMed PubMed Central
Masoud, O., Papanikolopoulos, N.P., and Kwon, E. (2015). The use of computer vision in monitoring weaving sections. IEEE Trans. Intell. Transp. 2: 18–25, https://doi.org/10.1109/6979.911082.Search in Google Scholar
Peng, L., Wang, S., Liu, H., Huang, S., and Zhao, W. (2015). Improved gray-color transform method for MFL images. J. Tsinghua Uni. Sci. Technol. 55: 592–596.Search in Google Scholar
Peng, X., Anyaoha, U., Liu, Z., and Tsukada, K. (2020). Analysis of magnetic flux leakage (MFL) data for pipeline corrosion assessment. IEEE Trans. Magn. 56: 6200315, https://doi.org/10.1109/tmag.2020.2981450.Search in Google Scholar
Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016). You only look once: unified, real-time object detection. In: 2016 IEEE conference on computer vision and pattern recognition (CVPR), June 27–30, 2016, Las Vegas, NV, USA.10.1109/CVPR.2016.91Search in Google Scholar
Ren, S., He, K., Girshick, R., and Sun, J. (2017). Faster R-CNN: towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. 39: 1137–1149, https://doi.org/10.1109/tpami.2016.2577031.Search in Google Scholar PubMed
Samide, A., Stoean, C., and Stoean, R. (2019). Surface study of inhibitor films formed by polyvinyl alcohol and silver nanoparticles on stainless steel in hydrochloric acid solution using convolutional neural networks. Appl. Surf. Sci. 475: 1–5, https://doi.org/10.1016/j.apsusc.2018.12.255.Search in Google Scholar
Shi, X., Zhou, S., Tai, Y., Wang, J., Wu, S., Liu, J., Xu, K., Peng, T., and Zhang, Z. (2022). An improved faster R-CNN for steel surface defect detection. In: IEEE 24th international workshop on multimedia signal processing (MMSP), September 26–28, 2022, Shanghai, China.10.1109/MMSP55362.2022.9949350Search in Google Scholar
Shi, Y., Zhang, C., Li, R., Cai, M., and Jia, G. (2015). Theory and application of magnetic flux leakage pipeline detection. Sensors 15: 31036–31055, https://doi.org/10.3390/s151229845.Search in Google Scholar PubMed PubMed Central
Singh, W.S., Thirunavukkarasu, S., and Kumar, A. (2023). Effect of flaw orientation on magnetic flux leakage and remote field eddy current inspection of small diameter steel tubes. Nondestruct. Test. Evaluation 38: 553–571, https://doi.org/10.1080/10589759.2022.2137508.Search in Google Scholar
Sun, W., Gao, H., Tan, S., Wang, Z., and Duan, L. (2021). Wear detection of WC-Cu based impregnated diamond bit matrix based on SEM image and deep learning. Int. J. Refract. Met. H. 98: 105530, https://doi.org/10.1016/j.ijrmhm.2021.105530.Search in Google Scholar
Thakur, A.K., Arya, A.K., and Sharma, P. (2022). Prediction and mitigation of AC interference on the pipeline system. Corros. Rev. 40: 149–157, https://doi.org/10.1515/corrrev-2021-0061.Search in Google Scholar
Ultralytics (2021). YOLOv5, Available at: https://github.com/ultralytics/yolov5.Search in Google Scholar
Villalba-Diez, J., Schmidt, D., Gevers, R., Ordieres-Mere, J., Buchwitz, M., and Wellbrock, W. (2019). Deep learning for industrial computer vision quality control in the printing industry 4.0. Sensors 19: 3987, https://doi.org/10.3390/s19183987.Search in Google Scholar PubMed PubMed Central
Wang, D., Wang, J., and Xu, K. (2021). Deep learning for object detection, classification and tracking in industry applications. Sensors 21: 7349, https://doi.org/10.3390/s21217349.Search in Google Scholar PubMed PubMed Central
Yang, L., Geng, H., and Gao, S. (2016). Magnetic flux leakage internal detection technology of the long distance oil pipeline. Chin. J. Sci. Instrum. 37: 1736–1746.Search in Google Scholar
Yang, L., Wang, Z., and Gao, S. (2020). Pipeline magnetic flux leakage image detection algorithm based on multiscale SSD network. IEEE Trans. Ind. Inform. 16: 501–509, https://doi.org/10.1109/tii.2019.2926283.Search in Google Scholar
Yang, L., Wang, Z., Gao, S., Shi, M., and Liu, B. (2019). Magnetic flux leakage image classification method for pipeline weld based on optimized convolution kernel. Neurocomputing 365: 229–238, https://doi.org/10.1016/j.neucom.2019.07.083.Search in Google Scholar
Zhang, P., Wei, M., Guo, Z., and Liu, Z. (2021). Advances in magnetic flux leakage testing technology. J. Meas. Sci. Instrum. 12: 1–11.Search in Google Scholar
© 2023 Walter de Gruyter GmbH, Berlin/Boston
Articles in the same Issue
- Frontmatter
- Reviews
- Organic compounds as corrosion inhibitors for reinforced concrete: a review
- The role of microbes in the inhibition of the atmospheric corrosion of steel caused by air pollutants
- A review on corrosion and corrosion inhibition behaviors of magnesium alloy in ethylene glycol aqueous solution
- Original Articles
- Study of the corrosion mechanism of Mg–Gd based soluble magnesium alloys with different initial texture states
- Determination of corrosion product film on pure Mg in Cl− environment using XPS etching
- High-temperature corrosion behavior of S30432 in high-efficiency ultra-supercritical boiler burning low-alkali and high-sulfur coal
- Image recognition model of pipeline magnetic flux leakage detection based on deep learning
- Quantum chemical analysis of amino acids as anti-corrosion agents
Articles in the same Issue
- Frontmatter
- Reviews
- Organic compounds as corrosion inhibitors for reinforced concrete: a review
- The role of microbes in the inhibition of the atmospheric corrosion of steel caused by air pollutants
- A review on corrosion and corrosion inhibition behaviors of magnesium alloy in ethylene glycol aqueous solution
- Original Articles
- Study of the corrosion mechanism of Mg–Gd based soluble magnesium alloys with different initial texture states
- Determination of corrosion product film on pure Mg in Cl− environment using XPS etching
- High-temperature corrosion behavior of S30432 in high-efficiency ultra-supercritical boiler burning low-alkali and high-sulfur coal
- Image recognition model of pipeline magnetic flux leakage detection based on deep learning
- Quantum chemical analysis of amino acids as anti-corrosion agents