A classification and recognition algorithm for defect signal images of pipe circumferential welds
By establishing a magnetization model and using Alexnet neural network to automatically identify the defect signal image of pipeline ring welds, the uncertainty problem of manual interpretation in existing magnetic leakage detection is solved, efficient defect detection and recognition is achieved, and the pipeline ring is improved Automated classification and identification capabilities of weld defects.
Patent Information
- Application Number
- CN202410146768.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-02
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-02-02
AI Technical Summary
The post-processing and analysis of existing magnetic leakage detection data relies on manual interpretation, and there are large labeling errors, low efficiency and large differences in personnel experience, resulting in high uncertainty in the image recognition of pipeline ring weld defects, making it difficult to achieve automated classification recognition.
A classification recognition algorithm for pipeline ring weld defect signal images is adopted. By establishing four magnetization models, calculating magnetic field distribution, extracting signal curves, building data sets, and using Alexnet neural network for training and verification, combining data hybrid enhancement and model Improved to achieve automatic identification.
It improves the accuracy and recognition rate of defect detection, reduces labeling errors, improves data processing efficiency, and provides new methods and theoretical basis for intelligent pipeline detection.
Smart Images

Figure CN117934959B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of magnetic flux leakage nondestructive testing, and in particular relates to a classification and recognition algorithm for pipeline girth weld defect signal images. Background Art
[0002] Long-distance oil and gas pipelines are important energy infrastructure in my country and have very important applications in the modern energy industry. The length of oil and gas pipelines is increasing with the increase in transportation mileage, and reliable girth welds are required between pipelines to ensure the transportation safety of pipelines. However, due to the complex service environment and harsh working conditions of oil and gas pipelines, corrosion pits, cracks and other defects will occur on the pipelines and girth welds, seriously affecting the safe operation and service life of the pipelines. Therefore, discovering and repairing defects through various detection technologies and means is the main means to improve the level of safe operation of pipelines.
[0003] As one of the common methods in pipeline nondestructive testing, magnetic flux leakage testing has great advantages such as low requirements for the environment inside the pipeline, wide application range, and low price. However, in the current post-processing analysis of magnetic flux leakage testing data, manual interpretation of pipeline girth weld defect signal images has the disadvantages of large labeling errors, low efficiency, and large differences in personnel experience, which brings great uncertainty to the interpretation of magnetic flux leakage data. The automatic recognition method of pipeline girth weld defect signal images can effectively classify and identify pipeline girth weld defect signal images, greatly improving the efficiency and accuracy of data processing, and providing a method and theoretical basis for the actual detection of automatic classification and identification of related defects. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a classification and recognition algorithm for pipeline girth weld defect signal images to solve the problems in the prior art. The technical solution adopted by the present invention is:
[0005] A classification and recognition algorithm for pipeline girth weld defect signal images includes the following steps:
[0006] Step 1: Establish the magnetization model of four pipeline girth weld defects;
[0007] Step 2: Calculate the magnetic field distribution of four pipeline girth weld defects, extract the magnetic field signals of four pipeline girth weld defects and draw signal curves;
[0008] Step 3: Output the corresponding curve signal image according to the size parameters of the pipeline girth weld defect, and construct a dataset for classification and identification of pipeline girth weld defects;
[0009] Step 4: Establish the classification recognition model code, including the deletion module, data set division module, image data enhancement module, and training, verification, and testing modules;
[0010] Step 5: Conduct model training and verification on the pipeline girth weld defect dataset;
[0011] Step 6: Select the training model with the highest accuracy in the validation set to test the test set and finally obtain the test set accuracy.
[0012] Furthermore, in step 1, the four pipeline girth weld defect models are pits, axial grooves, circumferential grooves, and pinholes.
[0013] Furthermore, the variable parameters of the pit include relative depth, weld outer excess height, pit diameter, wall thickness, defect inner excess height; the variable parameters of the axial groove include relative depth, weld outer excess height, defect length, wall thickness, defect inner excess height, defect width;
[0014] The variable parameters of the circumferential groove include relative depth, weld outer excess height, defect length, wall thickness, defect inner excess height, and defect width;
[0015] The variable parameters of pinholes include relative depth, weld excess height, defect length, wall thickness, defect inner excess height, and defect width.
[0016] Furthermore, in step 2, when extracting the magnetic field signal and drawing the signal curve, the signal on the three-dimensional cross-section extraction path above the weld center and away from the inner surface of the pipeline is used.
[0017] Furthermore, in step 3, the output of the corresponding curve signal image is output based on the variable parameters of the four magnetization models, and the total number of each defect image output is the product of the number of variable values of the corresponding variable parameters.
[0018] Furthermore, in step 4, the image data enhancement module in the classification recognition model code uses color transformation to transform the original curve image into a grayscale curve image.
[0019] Furthermore, in step 4, the training, verification and testing modules use the classification and recognition neural network Alexnet.
[0020] Furthermore, in step 5, model training and verification are performed on the pipeline girth weld defect dataset, wherein a verification is performed once a set of training is completed and the accuracy of the verification set is recorded.
[0021] The invention discloses an automatic identification method for defects of a long-distance oil and gas pipeline. The automatic identification method is applied to automatically identifying four pipeline girth weld defects, metal loss, straight weld anomaly or spiral weld anomaly on the long-distance oil and gas pipeline.
[0022] The present invention has the following beneficial effects: different distribution characteristics of curve images are generated according to the leakage magnetic signals of whether the actual pipeline girth weld contains defects or not, data mixing enhancement and model improvement are adopted, and the defect detection accuracy and defect recognition rate are greatly improved through the deep learning target detection method, which provides new ideas and methods for actual leakage magnetic signal recognition and pipeline intelligent detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flow chart of the invention;
[0024] Figure 2 It is a schematic diagram of the weld defect (pit) model;
[0025] Figure 3 It is a schematic diagram of the weld defect (pinhole) model;
[0026] Figure 4 It is a schematic diagram of the weld defect (circumferential groove) model;
[0027] Figure 5 It is a schematic diagram of the weld defect (axial groove) model;
[0028] Figure 6 It is a schematic diagram (part) of the weld defect (pit) model image;
[0029] Figure 7 This is a diagram of the training results of the simulated magnetic leakage signal radial component (Bx) curve image.
[0030] Figure 8 This is a diagram showing the curve of the highest accuracy of the validation set changing with epochs;
[0031] Fig. 9 This is a graph showing the test set accuracy-average loss changing with epochs.
[0032] Fig.10 It is a diagram showing the curve of test set accuracy-average accuracy changing with epochs;
[0033] Fig.11 This is a diagram of the curve of the highest accuracy of the validation set changing with batch-size;
[0034] Fig.12 It is a curve diagram of the test set accuracy-average loss changing with batch-size;
[0035] Fig.13 It is a curve diagram of the test set accuracy-average accuracy changing with batch-size;
[0036] Fig.14 It is the table of magnetization equations of the simulation model;
[0037] Fig.15 is a partition table of the original image sample set of the axial component (By) of the magnetic flux leakage signal;
[0038] Fig.16 It is the sample set result table after the image data enhancement of the axial component (By) of the magnetic flux leakage signal;
[0039] Fig.17 It is a reference value table of pit component parameters;
[0040] Fig.18 It is a table of variation values of pit component parameters. DETAILED DESCRIPTION
[0041] The following will be combined with the embodiments of the present invention Figure 1-Figure 18 , the technical solutions in the embodiments of the present invention are described clearly and completely. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Unless otherwise specified, the technical means used in the embodiments are conventional means well known to those skilled in the art.
[0042] like Figure 1 As shown, a classification and recognition algorithm for pipeline girth weld defect signal images includes:
[0043] Step 1: Use parametric modeling to establish the magnetization model of four pipeline girth weld defects; for step 1, during parametric modeling, the parameter or modeling variable name set should correspond to the variable parameter name of each defect; the simulation software used this time is COMSOL Multiphysics. When performing local three-dimensional modeling of the pipeline defect girth weld, only the most core part of the leakage magnetic detection equipment is retained to simplify the device and pipeline, ensuring effective detection while greatly reducing the complexity of the model.
[0044] The x-axis direction of the model coordinate is specified as the radial direction, that is, perpendicular to the pipe wall and pointing to the center of the pipe; the y-axis direction is the axial direction, that is, along the length of the pipe; the z-axis direction is the circumferential direction, that is, along the direction of the pipe ring around the pipe; a three-dimensional model of pipeline ring weld leakage magnetic detection is constructed in COMSOL. The simplified model has several key components such as permanent magnet, armature, pole shoe, pipe wall, or weld. The model changes along the circumferential direction for one circle to correspond to the actual detection device. The image is drawn based on the data conversion of the actual leakage magnetic detection data signal.
[0045] In order to facilitate calculation analysis and signal extraction, the defects involved in the present invention are all located at the center of the weld, that is, the position where the magnetic leakage signal is most significant.
[0046] Step 2: Calculate the magnetic field distribution of four pipeline girth weld defects. After the calculation is completed, extract the magnetic field signals obtained after the simulation calculation of the corresponding models of the four pipeline girth weld defects at 30 mm on both sides of the weld center in the simulation model with a lift value of 1 mm;
[0047] The constitutive relationship that needs to be satisfied for the finite element analysis of static magnetic fields is the calculation equations of magnetic flux density and magnetic field intensity. According to the material parameters of each component, their specific magnetization equations are as follows: Fig.14 shown.
[0048] Different parameters are added to different materials according to the actual material properties and environmental conditions. According to the model, parameters need to be added to the pipe wall, permanent magnet, pole shoe, armature, and outer air cover respectively; an air cover is established around the model to simulate the magnetic field distribution in the air around the excitation source, and magnetic insulation instructions are applied to the surface of the air cover to make the magnetic flux lines parallel to the surface of the air cover. The size can be established using the predefined regular size in COMSOL; the weld signal area uses a free tetrahedron mesh, and the unit size uses a custom size to make the unit size as small as possible; the weld area uses a slightly larger unit size than the weld signal area; for the armature, pole shoe, and permanent magnet, their shapes are regular, and sweeping fast meshing is used; other parts of the pipeline can be quickly established using free tetrahedrons, and the unit size can also be larger;
[0049] The steady-state solver and the parameterized solver are selected for solving. At the same time, for the termination technology of the solver, the iteration and iteration or tolerance method is adopted, that is, when the iteration exceeds a certain number of times or the relative error is less than the relative tolerance, the calculation is completed.
[0050] Step 3: Use the magnetic signal data obtained by the simulation model to draw a curve graph to construct a data set for classification and identification of pipeline girth weld defects; use Origin software to draw a curve image of the simulated magnetic signal calculated by the finite element model of different defects.
[0051] Step 4: Establish the classification and recognition model code, including the deletion module, data set division module, image data enhancement module, and training, verification, and testing modules; analyze and study the radial component (Bx) and axial component (By) of the magnetic flux density, and take the ring weld pit defect model as an example to simply compare the simulated results with the actual results.
[0052] Step 5: Perform model training and verification on the pipeline girth weld defect dataset; according to the distribution size of the radial signal, adjust the curves of different ranges of the original coordinate system of all images to a unified range, that is, adjust the coordinate axes of the curves of each defect to a unified range, realize the normalization of the curves, and realize the differentiation of the curves under the unified standard;
[0053] The magnetic flux leakage signal curve image dataset of different types of weld defects in the simulation database that has been calculated is used, and the convolutional neural network algorithm AlexNet is used to realize the effective classification and identification of weld defects such as pits, pinholes, axial grooves, and circumferential grooves;
[0054] When dividing the data set, the ratio used is training set: validation set: test set = 70:15:15. Fig.15 It is the division of the original sample set of the image of the axial component (By) of the magnetic flux leakage signal.
[0055] The detection results of the circumferential weld defect images are obtained. The main performance evaluation indicators of the model training effect include but are not limited to: validation set loss, training set loss, validation set loss, validation set accuracy, and the final test set accuracy-average loss, test set accuracy-average accuracy and other important parameters. By exploring these model indicators, we can find the impact of different training parameters of the Alexnet model on the image classification effect.
[0056] When training and verifying the model of pipeline girth weld defect dataset, after each round of training, the verification module is called to evaluate the training model and record relevant performance indicators. Then continue to train and optimize the next round of models. After the training is completed, the model is verified and relevant performance indicators are recorded until all rounds are completed.
[0057] The image is enhanced by data mixing. According to the RGB channels of the original image, the original color (0, 0, 255), i.e. pure blue, is enhanced and changed to add a set of grayscale images to adapt to more color curves. Fig.16 It is the sample set result after the image data enhancement of the axial component (By) of the magnetic flux leakage signal.
[0058] Step 6: Select the training model with the highest accuracy in the validation set to test the test set and finally obtain the test set accuracy.
[0059] The main geometric parameters of the pit are the diameter of the pit and the relative depth of the pit. The present invention uses the research method of controlling variables, changes the values of the corresponding parameters through control experiments, sets reference values for each parameter, that is, when one of the parameters is changed, the values of other parameters are fixed as reference values, and explores the influence of different parameter changes on the pit.
[0060] A specific embodiment is given below:
[0061] Step 1: Figure 2 As shown, the magnetization model of the pit is established and the magnetic field distribution of the defect is simulated to explore the influence of defects and different parameter changes on the leakage magnetic field intensity; Fig.17 is the reference value of the pit component parameter;
[0062] Step 2: Define the material properties and boundary conditions of the model, and divide the model into appropriate meshes. Use COMSOL software to solve the problem and compare the simulated signal with the actual signal. Figure 6 As shown, the feasibility and accuracy of the simulated magnetic flux leakage detection experiment are determined.
[0063] Step 3: Change the parameters related to weld defects (pits) for simulation analysis to obtain various corresponding data and results, extract and process the data, use the signal on the three-dimensional cross-section at the same position as the signal extraction path for extraction and analysis, so as to achieve relative uniformity between various experimental simulations; use COMSOL Multiphysics software to draw the leakage magnetic signal curve image, and sort out the original sample set of the curve image of the simulated leakage magnetic detection signal of pit defects of different sizes. Fig.18 is the change value of the pit component parameter;
[0064] Step 4: Based on the RGB channels of the original image, the original color (0, 0, 255), i.e. pure blue, is enhanced and changed to add a set of grayscale images to accommodate more color curves. The improved training set obtained through data enhancement can obtain twice the data, which can further reduce the mutation caused by data differences and improve the stability of the model.
[0065] Step 5: After hybrid enhancement of the image data, there are a total of 1008 files. The data is converted and divided into training set, validation set, and test set. After the data set conversion and the division of training set, validation set, and test set are completed, the corresponding training set has a total of 830 files, the validation set has a total of 89 files, and the test set has a total of 89 files.
[0066] Step 6: Set up a control experiment to explore the impact of different variable changes on the actual classification effect. The control experiment uses 300 epochs, a batch-size of 128 images loaded at a time, and an image loading size of 227×227. Data augmentation is used for data preprocessing.
[0067] In terms of hardware parameters, the CPU is Intel(R) Xeon(R) Gold 6130CPU@2.10GHz (dual-way processor), the memory is 256GB, the core computing resource GPU model is NVIDIA Quadro P5000, and the video memory is 16GB. In terms of software parameters, python is 3.9.13, pytorch is 1.12.1, and cudatoolkit is 11.3.1. The operating environment uses Windows 10, and the python editor uses Pycharm 2022.3.3. Model training and verification are carried out, that is, based on the convolutional neural network AlexNet, the pytorch framework is used to use the AlexNet algorithm to classify and identify the pit defects in the pipeline girth weld, and the influence of the parameter training rounds (epochs) and the number of single images (batch-size) on the training effect are analyzed to obtain appropriate parameters and final results. Figure 7 Shown is a schematic diagram of the training results of the radial component (Bx) curve image of the magnetic flux leakage detection signal.
[0068] The training set verification results after three kinds of image mixed enhancement were obtained. The important model evaluation indicators mainly include verification set loss, training set loss, validation set loss, validation set accuracy and the final test set accuracy-average loss, test set accuracy-average accuracy and other important parameters. By exploring these parameters, we can find the impact of different parameters on image classification effects.
[0069] Figure 8 This is a diagram showing the curve of the highest accuracy of the validation set changing with epochs. Fig. 9 This is a diagram showing the curve of test set accuracy-average loss changing with epochs. Fig.10 It is a diagram of the curve of test set accuracy-average accuracy changing with epochs. The impact of epochs changes on the results is mainly reflected in the following aspects: the axial component of the highest accuracy of the validation set gradually increases with the increase of the number of training rounds, and the fluctuation is weaker than that of the radial component, and the overall trend is steadily upward. The number of training rounds of the radial component has little effect on the highest accuracy, and the fluctuation is more obvious, and the overall regularity is not strong. At the same time, the classification effect of the radial component is stronger than that of the axial component. The test set loss of the test set accuracy-average loss fluctuates greatly, and even with the increase of the number of training rounds, the loss does not decrease but increases. At the same time, the loss of the axial component is generally higher than that of the radial component, and the training effect of the radial component is better than that of the axial component. The overall fluctuation of the test set accuracy-average accuracy is not large, and the effect of the axial component is somewhat lower than that of the radial component.
[0070] Fig.11 This is a diagram of the curve of the highest accuracy of the validation set changing with batch-size; Fig.12 It is a curve diagram of the test set accuracy-average loss changing with batch-size; Fig.13 It is a curve diagram of the test set accuracy-average accuracy changing with batch-size. The impact of batch-size changes on the results is mainly reflected in the following aspects: with the increase of batch-size, the highest accuracy first increases, then decreases, and then increases. The radial component and the axial component both have the lowest value at 128. Batch-size of 32 or 256 can achieve better training results. Overall, the classification effect of the radial component is higher than that of the axial component, and the fluctuation is also lower than that of the axial component to a certain extent. The test set accuracy-average loss of radial component and axial component images gradually decreases with the increase of batch-size, indicating that the larger the batch-size, the better the overall training effect of the model. At the same time, after the batch-size reaches a certain value, the loss of the radial component tends to stabilize. For the axial component, the loss is gradually decreasing, but has not yet stabilized. Setting a larger batch-size will have better results. With the increase of batch-size, the test set accuracy-average accuracy gradually decreases. The axial component shows a trend of first increasing, then decreasing, and then increasing with the increase of batch-size. Overall, the results are not very regular. In general, setting batch-size to 256 is a more appropriate parameter.
[0071] analyze Figure 8 , Fig. 9 and Fig.10 It can be seen that as the number of training rounds increases, the loss of the training set of the radial component curve image of the magnetic flux leakage signal gradually decreases and eventually approaches 0. The loss of the validation set is similar to that of the training set. As the number of training rounds increases, the accuracy of the validation set also gradually increases and reaches stability around 50 rounds of training. The accuracy of the validation set fluctuates slightly afterwards, but is relatively stable overall. Analysis Fig.11 , Fig.12 and Fig.13, the highest accuracy of the radial component validation set is 94.81%, the accuracy of the test set - the average loss is 0.0032%, and the accuracy of the test set - the average accuracy is 93.18%. The classification of the radial component has achieved relatively good results. The classification effect of the axial component image is similar to that of the radial component, but the validation set loss of the axial component is larger, and its fluctuation is also more intense. From the final results, the highest accuracy of the axial component validation set is 91.23%, the accuracy of the test set - the average loss is 0.0040%, and the accuracy of the test set - the average accuracy is 91.56%, which is also relatively low compared with the radial component. In summary, for the radial component and axial component images of the leakage magnetic signal, the classification effect of the radial component is higher than that of the axial component, and the training effect of the network is also better than that of the axial component, which shows that the radial component image has a better classification effect.
[0072] The embodiments described above are only descriptions of the preferred modes of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various deformations, modifications, and substitutions made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A classification and recognition algorithm for pipeline girth weld defect signal images, characterized in that: The following steps are involved: Step 1: Establish the magnetization model of four pipeline girth weld defects; Step 2: Calculate the magnetic field distribution of four pipeline girth weld defects, extract the magnetic field signals of four pipeline girth weld defects and draw signal curves; The constitutive relationship that needs to be satisfied for the finite element analysis of static magnetic fields is the calculation equation of magnetic flux density and magnetic field intensity. According to the material parameters of each component, the magnetization equation is as follows: For the pole piece, armature and air cover, the constitutive relationship is the relative magnetic permeability, and the expression of the magnetization equation is as follows: B=μ0μ r H For magnets, the constitutive relation is a nonlinear permanent magnet, and the magnetization equation is expressed as follows: For the pipeline, its constitutive relationship is the BH curve, and the expression of the magnetization equation is as follows: According to the model, parameters need to be added to the pipe wall, permanent magnet, pole shoe, armature, and outer air cover respectively; an air cover is established around the model to simulate the magnetic field distribution in the air around the excitation source, and magnetic insulation instructions are applied to the surface of the air cover to make the magnetic flux lines parallel to the surface of the air cover; free tetrahedron mesh is used in the weld signal area; sweep fast meshing is used for the armature, pole shoe, and permanent magnet; free tetrahedron is used to quickly establish the rest of the pipeline; Select steady-state solver and parameterized solver for solving; for the termination technology of the solver, the iteration or tolerance method is adopted, that is, the calculation is completed when the iteration exceeds a certain number of times or the relative error is less than the relative tolerance; Step 3: Output the corresponding curve signal image according to the size parameters of the pipeline girth weld defect, and construct a dataset for classification and identification of pipeline girth weld defects; Step 4: Establish the classification recognition model code, including the deletion module, data set division module, image data enhancement module, and training, verification, and testing modules; Step 5: Conduct model training and verification on the pipeline girth weld defect dataset; Step 6: Select the training model with the highest accuracy in the validation set to test the test set and finally obtain the test set accuracy.
2. The classification and recognition algorithm for pipeline girth weld defect signal images according to claim 1 is characterized in that: In step 1, the four pipeline girth weld defect models are pits, axial grooves, circumferential grooves, and pinholes.
3. The classification and recognition algorithm for pipeline girth weld defect signal images according to claim 2 is characterized in that: The variable parameters of the pit include relative depth, weld outer excess height, pit diameter, wall thickness, defect inner excess height; the variable parameters of the axial groove include relative depth, weld outer excess height, defect length, wall thickness, defect inner excess height, defect width; The variable parameters of the circumferential groove include relative depth, weld outer excess height, defect length, wall thickness, defect inner excess height, and defect width; The variable parameters of pinholes include relative depth, weld excess height, defect length, wall thickness, defect inner excess height, and defect width.
4. The classification and recognition algorithm for pipeline girth weld defect signal images according to claim 1 is characterized in that: In step 2, when extracting the magnetic field signal and drawing the signal curve, the signal on the three-dimensional cross-section extraction path above the weld center and away from the inner surface of the pipeline is used.
5. The classification and recognition algorithm for pipeline girth weld defect signal images according to claim 3 is characterized in that: In step 3, the output of the corresponding curve signal image is based on the variable parameters of the four magnetization models, and the total number of each defect image output is the product of the number of variable values of the corresponding variable parameters.
6. The classification and recognition algorithm for pipeline girth weld defect signal images according to claim 1 is characterized in that: In step 4, the image data enhancement module in the classification recognition model code uses color transformation to transform the original curve image into a grayscale curve image.
7. The classification and recognition algorithm for pipeline girth weld defect signal images according to claim 1 is characterized in that: In step 4, the training, verification and testing modules use the classification and recognition neural network Alexnet.
8. The classification and recognition algorithm for pipeline girth weld defect signal images according to claim 1 is characterized in that: In step 5, the model is trained and verified on the pipeline girth weld defect dataset, wherein a set of training is verified once and the accuracy of the verification set is recorded.
9. A method for automatically identifying defects in long-distance oil and gas pipelines, using the classification and recognition algorithm according to any one of claims 1 to 8, characterized in that: The automatic recognition method is applied to automatically recognize four pipeline girth weld defects, metal loss, straight weld anomalies or spiral weld anomalies on long-distance oil and gas pipelines.
Citation Information
Patent Citations
Pipeline defect identification method, processor and pipeline defect identification device
CN114926707A
Cited By
Small sample image classification method combining SHAP interpretability analysis and channel dynamic regulation and control
CN121053434A