A pipeline defect type identification method based on GA deep optimization machine learning
Through a machine learning method based on deep optimization of genetic algorithms, the characteristic parameters of the three-axis magnetic leakage signal of pipeline defects are extracted and a neural network is constructed, which solves the problem that traditional magnetic leakage detection technology cannot identify the type of pipeline defects and achieves efficient and accurate identification of pipeline defect types.
Patent Information
- Application Number
- CN202210729035.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-06-24
AI Technical Summary
Traditional magnetic flux leakage detection technology cannot accurately identify pipeline defect types, resulting in high pipeline maintenance costs and low efficiency.
A machine learning method based on deep optimization of genetic algorithm is adopted. By extracting the characteristic parameters of the three-axis magnetic leakage signal of pipeline defects, a neural network is constructed to identify the defect type. The genetic algorithm is used to optimize the topological structure and weight bias of the BP neural network to achieve accurate identification of pipeline defect types.
It achieves accurate identification of pipeline defect types, reduces pipeline maintenance costs, improves detection efficiency and accuracy, and is suitable for different work scenarios and equipment.
Smart Images

Figure CN115130343B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pipeline defect detection, and in particular to a pipeline defect type identification method based on GA deep optimization machine learning. Background Art
[0002] In pipeline safety engineering, pipeline inspection is a fundamental method for ensuring pipeline safety. Among various pipeline inspection technologies, magnetic flux leakage (MFL) inspection is the most widely used and mature magnetic pipeline defect detection technology. However, traditional MFL inspection cannot accurately identify pipeline defect types during operation; it can only determine the defect's size and location based on the MFL signal.
[0003] However, identifying pipeline defect types is of great engineering significance. For example, different pipeline defect types cause different damage to the pipeline and require different corresponding pipeline maintenance methods. Identifying pipeline defect types can reduce pipeline maintenance costs to a certain extent. Summary of the Invention
[0004] In order to overcome the defects in the above-mentioned prior art, the present invention provides a pipeline defect type identification method based on GA deep optimization machine learning, which can accurately identify pipeline defect types and has great engineering significance and good application prospects.
[0005] To achieve the above object, the present invention adopts the following technical solutions, including:
[0006] A pipeline defect type identification method based on GA deep optimization machine learning includes the following steps:
[0007] S1, obtain the three-axis magnetic flux leakage signal of the defect under different defect types;
[0008] The three-axis magnetic flux leakage signal of the defect refers to: the axial magnetic flux leakage signal, i.e., the axial component; the radial magnetic flux leakage signal, i.e., the radial component; and the circumferential magnetic flux leakage signal, i.e., the circumferential component;
[0009] The axial direction is the direction along the length of the pipe, the radial direction is the direction perpendicular to the inner wall of the pipe, and the circumferential direction is the direction along the circumference of the pipe.
[0010] The circumferential component is selected by determining the peak position of the radial component on the axial path, and selecting the value of the radial component on the circumferential path where the peak position is located as the value of the circumferential component;
[0011] S2, extract signal characteristic parameters for the three-axis magnetic leakage signal of the defect, including: axial component differential signal peak-to-valley distance DS xp-p , axial component waveform area S x , circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value Bzp-p , radial component peak-to-valley spacing S zp-p ;
[0012] Among them, the peak-to-valley distance DS of the axial component differential signal xp-p The extraction method is: take the differential of the axial component to obtain the axial component differential signal, and extract the peak-to-valley spacing DS of the axial component differential signal xp-p ;
[0013] Circumferential component peak-to-valley median spacing S y-50% The extraction method is: extract the peaks and valleys of the circumferential component, calculate the middle value of the peaks and valleys, that is, 50% of the difference between the peaks and valleys as the peak-valley median, and the spacing between the peak-valley medians on the circumferential component is the circumferential component peak-valley median spacing S y-50% ;
[0014] S3, the peak-to-valley distance DS of the axial component differential signal xp-p , circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value B zp-p , radial component peak-to-valley spacing S zp-p , axial component waveform area S x , and the number N of sensors that collect defect magnetic leakage signals on the magnetic leakage sensor is used as the identification parameter of the defect type to construct a sample set;
[0015] The sample data in the sample set includes: each identification parameter value of the defect and the corresponding defect type;
[0016] S4, constructing a neural network, wherein the input of the neural network is the various identification parameter values of the defect, and the output is the defect type; using the sample set to train and generate the neural network;
[0017] S5, identify the type of unknown defects. The process is as follows:
[0018] S51, extracting various signal characteristic parameters based on the three-axis magnetic flux leakage signal of the unknown defect, and obtaining the number N of magnetic flux leakage sensors that have collected the magnetic flux leakage signal of the unknown defect, to obtain various identification parameter values of the unknown defect;
[0019] S52, inputting each identification parameter value of the unknown defect into the neural network obtained in step S4 for prediction, and predicting and outputting the defect type of the unknown defect.
[0020] Preferably, in step S4, during the training process of the neural network, the neural network is deeply optimized based on a genetic algorithm; the process of deep optimization of the BP neural network by the genetic algorithm and the training of the BP neural network is specifically as follows:
[0021] S41, initializing the relevant parameters of the neural network, including: the number of hidden layer nodes, hyperparameters, initial weights, and initial biases;
[0022] S42, within the set range of the hyperparameters and the empirical formula of the hidden layer nodes, first using a genetic algorithm to iteratively optimize the number of hidden layer nodes and the hyperparameters, and then importing the optimal values of the number of hidden layer nodes and the hyperparameters into the neural network model to determine the topological structure of the neural network;
[0023] S43, iteratively optimizing the initial weights and initial biases using a genetic algorithm, and importing the initial weights and initial biases obtained after the iterative optimization into the neural network model;
[0024] S44, using the sample set to train the neural network, calculate the error between the predicted value and the true value of the defect type, and determine whether the error between the predicted value and the true value meets the conditions. If not, update the weights and biases; if the conditions are met, output the training results to obtain the trained neural network.
[0025] Preferably, in step S42, the empirical formula of the hidden layer node is:
[0026]
[0027] Among them, m and n are the number of nodes in the input layer and output layer respectively, m=6, n=1; a is a tuning constant ranging from 1 to 10; h is the number of nodes in the hidden layer, and the number of hidden layer nodes h is optimized in the range of 3 to 20.
[0028] Preferably, in step S42, the algorithm parameters of the neural network, i.e., the hyperparameters, include sigma and lambda; the two hyperparameters sigma and lambda are set in the range of 0 to 1 to seek an optimization.
[0029] Preferably, in step S42, the objective function for iteratively optimizing the number of hidden layer nodes and hyperparameters using a genetic algorithm is the mean square error (MSE) between the predicted output value of the neural network and the true value, and the formula is as follows:
[0030]
[0031] Among them, Z is the number of sample data, p z is the true value, is the predicted output value.
[0032] Preferably, in step S43, the objective function for iteratively optimizing the initial weights and initial biases using a genetic algorithm is also the mean square error (MSE) between the predicted output value of the neural network and the true value, wherein the relationship between the independent variables of the objective function for optimizing the initial weights and initial biases and the initial weights and initial biases is as follows:
[0033] Num=w1+b1+w2+b2
[0034] w1=m*h
[0035] b1=h
[0036] w2=h*n
[0037] b2=n
[0038] Where Num is the total number of independent variables, w1 is the number of weights from the input layer to the hidden layer, b1 is the number of biases in the hidden layer, w2 is the number of weights from the hidden layer to the output layer, b2 is the number of biases in the output layer, h is the number of nodes in the hidden layer, m and n are the number of nodes in the input layer and output layer respectively; the optimization intervals for the initial weights and initial biases are both set to -2 to 2.
[0039] Preferably, in step S1, the defect types include: cracks, surface peeling, pits, and pores.
[0040] Preferably, the classification information of each defect type is as follows:
[0041] The length of the crack is 5 to 30 mm, the width is 0.3 to 1 mm, and the depth is 1 to 8 mm;
[0042] The length of the surface layer peeling is 20-50 mm, the width is 20-50 mm, and the depth is 1-3 mm;
[0043] The length of the pit is 5 to 15 mm, the width is 5 to 30 mm, and the depth is 2 to 9 mm.
[0044] The radius of the air hole is 1 to 3 mm, and the depth from the inner wall of the pipe is 2 to 10 mm.
[0045] Preferably, in step S1, a three-dimensional finite element model of the pipeline defect is established. In the three-dimensional finite element model, ANSYS Maxwell is used to perform magnetic flux leakage simulation on the pipeline defect to obtain a corresponding magnetic flux leakage signal, and obtain three-axis magnetic flux leakage signals of defects under different defect types.
[0046] The advantages of the present invention are:
[0047] (1) The present invention provides a pipeline defect type identification method based on GA deep optimization machine learning, which can accurately identify the pipeline defect type according to the leakage magnetic signal of the defect. The leakage magnetic detection technology can accurately identify the pipeline defect type during operation, which has great engineering significance and good application prospects.
[0048] (2) The present invention analyzes the relationship between the leakage magnetic signal and the defect size, extracts the corresponding identification parameters, and analyzes the effectiveness of different identification parameters for the inversion of different defect sizes. This can greatly reduce the workload and improve the accuracy of pipeline defect identification and quantification, which is of great significance for defect detection.
[0049] (3) The present invention uses a genetic algorithm to deeply optimize the BP neural network, and optimizes the relevant parameters through the genetic algorithm. The optimization ability of the genetic algorithm is still relatively advantageous among the mainstream optimization algorithms currently used. In addition, the greedy algorithm is used to iteratively optimize the number of hidden layer nodes within the range set by the hyperparameters and the empirical formula, and then iteratively optimize the initial weights and biases, so that the training ability of the neural network can achieve the best effect. The purpose of using the greedy algorithm is to divide the overall optimization problem of the BP neural network into two sub-problems, solve each sub-problem, obtain the local optimal solution of the sub-problem, and then synthesize the optimal solution of each sub-problem into the overall solution of the original problem. Because the number of independent variables in the overall optimization is huge and the computational requirements are high, the greedy algorithm saves a lot of time that must be spent on exhausting all possibilities to find the overall optimal solution in one step, and can also obtain a relatively good optimization effect.
[0050] (4) The BP neural network algorithm model after deep optimization by GA in the present invention has a very significant classification effect on sample data, and can effectively distinguish the defect type. The recognition accuracy of the optimized BP neural network can reach 100%. At the same time, the deep optimization of the BP neural network by genetic algorithm also verifies the effectiveness of the selected recognition parameters for identifying defect types.
[0051] (5) According to the actual situation of the pipeline, the present invention uses the different sizes and relative position information of pipeline defects to uniformly define and classify defects, and divides pipeline defects into four types: cracks, surface peeling, pits and pores.
[0052] (6) The present invention establishes a three-dimensional finite element model of pipeline defects. In the three-dimensional finite element model, each type of defect is evenly arranged within a defined size range and relative position. ANSYS Maxwell is used to perform magnetic flux leakage simulation on the pipeline defects to obtain corresponding magnetic flux leakage signals, thereby obtaining three-axis magnetic flux leakage signals of defects under different defect types.
[0053] (7) The present invention extracts 6 identification parameters that express defect types, and in the embodiment, the genetic algorithm is first used to optimize the K-means clustering method to realize the visualization of the unsupervised clustering results of multidimensional data. This method uses the principal component analysis technology to reduce the dimensionality of the data, which can test and predict the effectiveness of defect type identification. Finally, the genetic algorithm is used to deeply optimize the BP neural network method to verify the effectiveness of the selected feature parameters in identifying defect types.
[0054] (8) The sample data collected by the method of the present invention in different working scenarios, different equipment, different materials, different magnetization conditions, etc. will be different, but the overall type prediction method is applicable in all occasions. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is a flow chart of a pipeline defect type identification method based on GA deep optimization machine learning.
[0056] Figure 2 It is the leakage magnetic field curve of the axial component differential signal.
[0057] Figure 3 is the magnetic flux leakage curve of the circumferential component.
[0058] Figure 4 is the magnetic flux leakage curve of the radial component.
[0059] Figure 5 is the magnetic flux leakage curve of the axial component.
[0060] Figure 6 Visualize the clustering results as a 2D scatter plot.
[0061] Figure 7 This is the flow chart of the GA_BP algorithm.
[0062] Figure 8 This is the effect diagram of defect type recognition by BP neural network before optimization.
[0063] Figure 9 This is the effect diagram of defect type recognition by the optimized BP neural network. DETAILED DESCRIPTION
[0064] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0065] Depend on Figure 1 As shown, a pipeline defect type identification method based on GA deep optimization machine learning is characterized by comprising the following steps:
[0066] S1, obtain the three-axis magnetic flux leakage signal of the defect under different defect types.
[0067] The defect types include: cracks, surface shedding, pits, and pores;
[0068] The three-axis magnetic flux leakage signal of the defect refers to: the axial magnetic flux leakage signal, i.e., the axial component; the radial magnetic flux leakage signal, i.e., the radial component; and the circumferential magnetic flux leakage signal, i.e., the circumferential component;
[0069] The axial direction is the direction along the length of the pipe, the radial direction is the direction perpendicular to the inner wall of the pipe, and the circumferential direction is the direction along the circumference of the pipe.
[0070] The circumferential component is constructed by selecting the value of the radial component on the circumferential path of the pipeline. The specific selection method is: determine the peak position of the radial component on the axial path, and select the value of the radial component on the circumferential path where the peak position is located as the value of the circumferential component.
[0071] In step S1, a three-dimensional finite element model of the pipeline defect is established. In the three-dimensional finite element model, ANSYS Maxwell is used to perform magnetic flux leakage simulation on the pipeline defect to obtain the corresponding magnetic flux leakage signal, and the three-axis magnetic flux leakage signal of the defect under different defect types is obtained.
[0072] S2, extract signal characteristic parameters for the three-axis magnetic leakage signal of the defect, including: axial component differential signal peak-to-valley distance DS xp-p , axial component waveform area S x , circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value B zp-p , radial component peak-to-valley spacing S zp-p .
[0073] Among them, the peak-to-valley distance DS of the axial component differential signal xp-p The extraction method is: take the differential of the axial component to obtain the axial component differential signal, and extract the peak-to-valley spacing DS of the axial component differential signal xp-p ;
[0074] Circumferential component peak-to-valley median spacing S y-50% The extraction method is: extract the peaks and troughs of the circumferential component, calculate the middle value of the peaks and troughs, that is, the difference between the peaks and troughs S max 50% of the peak-to-valley median is taken as the peak-to-valley median, and the spacing between the peak-to-valley medians on the circumferential component is the circumferential component peak-to-valley median spacing S y-50% .
[0075] Axial component differential signal peak-to-valley distance DS xp-p , axial component waveform area S x , circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value B zp-p , radial component peak-to-valley spacing S zp-p Specific as Figure 2-5 shown.
[0076] S3, the peak-to-valley distance DS of the axial component differential signal xp-p, circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value B zp-p , radial component peak-to-valley spacing S zp-p , axial component waveform area S x , and the number N of sensors that collect defect magnetic leakage signals on the magnetic leakage sensor is used as the identification parameter of the defect type to construct a sample set; the sample data includes: each identification parameter value of the defect and the corresponding defect type.
[0077] S4, constructing a neural network, wherein the input of the neural network is the identification parameter of the defect type, and the output is the defect type; using the sample set to train and generate the neural network.
[0078] In step S4, Figure 7 As shown in the figure, during the training process of the neural network, the neural network is deeply optimized based on the genetic algorithm; the process of deep optimization of the BP neural network by the genetic algorithm and the training of the BP neural network is specifically as follows:
[0079] S41, initialize the relevant parameters of the neural network, including: the number of hidden layer nodes, hyperparameters, initial weights, and initial biases.
[0080] S42, within the set range of the hyperparameters and the empirical formula of the hidden layer nodes, first use the genetic algorithm to iteratively optimize the number of hidden layer nodes and the hyperparameters, determine the optimal values of the number of hidden layer nodes and the hyperparameters, and then import them into the neural network model to determine the topological structure of the neural network.
[0081] In step S42, the empirical formula of the hidden layer node is:
[0082]
[0083] Where m and n are the number of nodes in the input layer and output layer respectively, m = 6, n = 1; a is a tuning constant with a value between 1 and 10; h is the number of nodes in the hidden layer, and the optimal number of nodes h in the hidden layer is in the range of 3 to 20;
[0084] The algorithm parameters of the neural network, i.e., the hyperparameters, include sigma and lambda. Optimization is performed by setting these two hyperparameters in the range of 0 to 1.
[0085] The objective function for iteratively optimizing the number of hidden layer nodes and hyperparameters using the genetic algorithm is the mean square error (MSE) between the predicted output value of the neural network and the true value. The formula is as follows:
[0086]
[0087] Among them, Z is the number of sample data, p z is the true value, is the predicted output value.
[0088] S43, then using a genetic algorithm to iteratively optimize the initial weights and initial biases, and importing the initial weights and initial biases obtained after the iterative optimization into the neural network model.
[0089] In step S43, the objective function for iteratively optimizing the initial weights and initial biases using the genetic algorithm is also the mean square error (MSE) between the predicted output value of the neural network and the true value. The relationship between the independent variables of the objective function for optimizing the initial weights and initial biases and the initial weights and initial biases is as follows:
[0090] Num=w1+b1+w2+b2
[0091] w1=m*h
[0092] b1=h
[0093] w2=h*n
[0094] b2=n
[0095] Where Num is the total number of independent variables, w1 is the number of weights from the input layer to the hidden layer, b1 is the number of biases in the hidden layer, w2 is the number of weights from the hidden layer to the output layer, b2 is the number of biases in the output layer, h is the number of nodes in the hidden layer, m and n are the number of nodes in the input layer and output layer respectively; the optimization intervals for the initial weights and initial biases are both set to -2 to 2.
[0096] S44, using the sample set to train the neural network, calculate the error between the predicted value and the true value of the defect type, and determine whether the error between the predicted value and the true value meets the conditions. If not, update the weights and biases; if the conditions are met, output the training results to obtain the trained neural network.
[0097] S5, identify the type of unknown defects. The process is as follows:
[0098] S51, extracting various signal characteristic parameters based on the three-axis magnetic flux leakage signal of the unknown defect, and obtaining the number N of magnetic flux leakage sensors that have collected the magnetic flux leakage signal of the unknown defect, that is, obtaining identification parameters of the unknown defect;
[0099] S52, inputting the identification parameters of the unknown defect into the neural network obtained in step S4 for prediction, and predicting and outputting the defect type of the unknown defect.
[0100] In this example, to address the difficulty in identifying defect types during magnetic flux leakage testing of oil and gas pipelines, common pipeline defects were first classified into four categories: cracks, surface delamination, pits, and pores. A three-dimensional finite element model for pipeline defect magnetic flux leakage simulation was established, and magnetic flux leakage simulation was performed on 400 groups of defects of different sizes and types using Maxwell electromagnetic simulation, resulting in magnetic flux leakage signals for different defect types and sizes. The relationship between different defect types and sizes and magnetic flux leakage signals was then analyzed. By comparing the characteristic parameters of different signals, six identification parameters expressing defect types were extracted. A genetic algorithm was first used to optimize K-means clustering to visualize the unsupervised clustering results of multidimensional data. This method uses principal component analysis to reduce the dimensionality of the data and can test and predict the effectiveness of defect type identification. Finally, a genetic algorithm was used to deeply optimize the BP neural network to verify the effectiveness of the selected characteristic parameters in identifying defect types.
[0101] In this embodiment, defects are uniformly defined and classified based on their size and relative position information. Pipeline defects are divided into four types: cracks, surface peeling, pits, and pores. The size and relative position information of the defect classifications are shown in Table 1 below:
[0102] Table 1
[0103] Defect Type crack Surface shedding pits pores Length / mm 5~30 20~50 5~15 — Width / mm 0.3~1 20~50 5~15 — Depth / mm 1~8 1~3 2~9 — Radius / mm — — — 1~3 Depth from pipe inner wall — — — 2~10 Number of groups 100 100 100 100
[0104] A three-dimensional finite element model of pipeline defects was established. In this model, each defect type was evenly distributed within a defined size range and relative position. Magnetic flux leakage simulation of the pipeline defects was performed using ANSYS Maxwell, generating corresponding magnetic flux leakage signals: an axial magnetic flux leakage signal (i.e., the axial component), a radial magnetic flux leakage signal (i.e., the radial component), and a circumferential magnetic flux leakage signal (i.e., the circumferential component). A sample set was constructed, containing the values of the various defect identification parameters and the corresponding defect type. The axial direction refers to the direction along the length of the pipeline, the radial direction refers to the direction perpendicular to the inner wall of the pipeline, and the circumferential direction refers to the direction along the circumference of the pipeline. The circumferential component was constructed by selecting the value of the radial component along the circumferential path of the pipeline. Specifically, the peak position of the radial component along the axial path was determined, and the value of the radial component along the circumferential path where the peak position occurred was selected as the value of the circumferential component.
[0105] By analyzing the relationship between the magnetic flux leakage signal and the defect size and extracting the corresponding signal characteristic parameters, this embodiment analyzes the effectiveness of different signal characteristic parameters for inversion of different defect sizes, which can greatly reduce the workload and improve the accuracy of pipeline defect identification and quantification, which is of great significance for defect detection.
[0106] The specific analysis is as follows:
[0107] Among them, the peak-to-valley spacing S of the radial component of the leakage magnetic signal zp-p The peak-to-valley distance DS of the differential signal of the axial component xp-p The peak-to-valley distance DS of the axial component differential signal is proportional to the defect length and is suitable for evaluating the characteristic quantity of the defect length. xp-p The extraction method is: take the differential of the axial component to obtain the axial component differential signal, and extract the peak-to-valley spacing DS of the axial component differential signal xp-p In addition, the peak-to-valley distance DS of the differential signal of the axial component of the leakage magnetic signal xp-p It is not affected by factors such as defect width, depth, and sensor lift-off value changes, and has strong stability. That is, when the interference amount changes, the peak-to-valley distance DS of the axial component differential signal xp-p It will not change with the change of the defect length, it only changes with the change of the defect length, and it has been verified in the finite element simulation that the signal fluctuation error is within 10%. Therefore, the peak-to-valley spacing DS of the axial component differential signal xp-p It is a typical signal feature that characterizes the defect length. The peak-to-valley distance DS of the axial component differential signal xp-p like Figure 2 shown.
[0108] When a magnetic flux leakage detector is axially excited, the sensors detecting the magnetic flux leakage signal are arranged circumferentially. The circumferential distance over which the sensors detect the magnetic flux leakage signal is roughly the width of the defect. Therefore, the number of sensors N receiving the magnetic flux leakage signal from the defect is approximately proportional to the defect width. Therefore, the number of sensors N receiving the magnetic flux leakage signal from the defect can be used as an important indicator to quantify the defect width. Because of this special property, the median spacing S of the circumferential component peaks and valleys is also generated. y-50% The extraction of the circumferential component of this signal characteristic parameter is to first determine the maximum position of the radial component on the axial path, that is, the peak position, and then extract the radial component on the circumferential path where the peak position is located as the circumferential component; the circumferential component peak-to-valley median spacing S y-50% The extraction method is: extract the peaks and valleys of the circumferential component, calculate the middle value of the peaks and valleys, that is, 50% of the difference between the peaks and valleys as the peak-valley median, and the spacing between the peak-valley medians on the circumferential component is the circumferential component peak-valley median spacing S y-50% Circumferential component peak-to-valley median spacing S y-50% The peak-to-valley distance DS of the differential signal of the axial component xp-p It has the same signal stability, which does not change with the change of defect depth and lift-off distance, and is verified in finite element simulation. The median spacing S of the circumferential component peak to valley is y-50% The fluctuation error is small, and the median distance between the peak and valley of the circumferential component is S y-50% like Figure 3 shown.
[0109] The peak-to-valley spacing S of the radial component of the magnetic flux leakage signal zp-pand the axial component waveform area S x The two signal characteristic parameters are in direct proportion to the defect depth. The greater the defect depth, the stronger the signal characteristic. Therefore, the two signal characteristics are representative. The radial component peak-to-valley spacing S zp-p and the axial component waveform area S x like Figure 4 and 5 shown.
[0110] Therefore, the peak-to-valley spacing DS of the axial component differential signal is selected xp-p , axial component waveform area S x , circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value B zp-p , radial component peak-to-valley spacing S zp-p , and the number of sensors N that collect defect magnetic leakage signals are used as identification parameters of the defect type.
[0111] In this embodiment, there are 6 identification parameters for extracting defect types, and there are 400 groups of defect samples of different types. The corresponding relationship between the identification parameters and the defect types cannot be directly observed from the data alone.
[0112] In this embodiment, the unsupervised classification based on GA optimization K-means clustering to achieve identification parameters is first analyzed. Clustering is a process of classifying and organizing data members that are similar in some aspects in a data set. Clustering is a technology for discovering this inherent structure. Clustering technology is often referred to as unsupervised learning. All data are divided into K groups, and then K objects are randomly selected as initial cluster centers. Then, the squared Euclidean distances of all data samples to each cluster center are analyzed, and each sample is assigned to its nearest cluster center. The cluster center and the sample data to which it belongs represent a cluster. And every time a sample is divided into a cluster, the cluster center of the cluster will be updated according to the existing sample size. This process is repeated until all samples are clustered, the positions of the cluster center points of different clusters are no longer updated, and the local minimum of the sum of squared errors is met. This method uses the technology of principal component analysis to reduce the dimensionality of multidimensional data, and visualizes the clustering results of the data in a two-dimensional plane by calculating the comprehensive influencing factors.
[0113] Since the K cluster centers initially selected by the k-means clustering algorithm are random, the results of each calculation vary greatly and are highly unstable. If the initial cluster center selection has a poor effect, the number of algorithm iterations will increase, increasing the workload. And the final result may not be what we want, which will increase the clustering error. Therefore, in this embodiment, the K-means clustering is optimized based on the genetic algorithm. The purpose is to find the optimal initial clustering point through the genetic algorithm so that the algorithm can achieve the optimal clustering result. The number of optimized independent variables is:
[0114] N=K*n
[0115] Where: k is the number of clusters, i.e., the number of cluster groups, k = 4, representing 4 types of defects; n is the sample variable dimension, n = 6, representing the identification parameters of 6 types of defects; N is the number of independent variables, N = 24. The objective function of the genetic algorithm optimization is the sum of the Euclidean distances from each data sample to its nearest cluster center. The calculation formula for Euclidean distance is:
[0116]
[0117] Among them, d is the Euclidean distance, n is the dimension of sample variables, x i with y i The coordinates of two points when they are of the same dimension.
[0118] The optimal initial cluster center is determined by calculating the minimum value of the sum of the Euclidean distances, and then the algorithm model is imported to achieve the optimal clustering effect. In this embodiment, this method is used to determine whether the selected defect type identification parameters can achieve an effective defect classification effect. The clustering results are as follows: Figure 6 In the data dimensionality reduction process, impact factor 1 and impact factor 2 are the two principal components for calculating the comprehensive score of the impact weight of multidimensional data.
[0119] from Figure 6 As can be seen, the overall data clustering effect is very clear. The data points within each cluster are closely connected and highly correlated. The data points between different clusters are dispersed and easy to distinguish. Among the four defect types, only Clusters 2 and 3 have unclear boundaries. The edge data structures of these two clusters are similar, and the defect sizes are roughly the same, which will produce the effect shown in the figure.
[0120] To this end, the present invention identifies defect types through unsupervised machine learning, and ultimately verifies that the extracted six identification parameters are very effective in identifying and quantifying defect types, meeting the expected results.
[0121] In this embodiment, a BP neural network deeply optimized using a GA (genetic algorithm) is used to identify defect types. Numerous parameters influence the effectiveness of BP neural network training, including the algorithm parameter settings, the number of hidden layer nodes, and the randomly selected initial weights and initial biases. Different settings for these parameters significantly impact the training results of the BP neural network. Therefore, this embodiment optimizes these parameters using a genetic algorithm, which offers significant advantages over currently used mainstream optimization algorithms.
[0122] The genetic algorithm deeply optimizes the BP neural network. The greedy algorithm is used to iteratively optimize the number of hidden layer nodes within the range of hyperparameters and empirical formulas, and then iteratively optimize the initial weights and biases, so that the training ability of the neural network can reach the optimal effect. The purpose of using the greedy algorithm is to divide the overall optimization problem of the BP neural network into two sub-problems, solve each sub-problem, obtain the local optimal solution of the sub-problem, and then combine the optimal solutions of each sub-problem into the overall solution of the original problem. Because the number of independent variables in the overall optimization is large and the computational requirements are high, the greedy algorithm saves a lot of time and energy to exhaust all possibilities in order to find the overall optimal solution in one step, and can also achieve a relatively good optimization effect.
[0123] Depend on Figure 7 As shown, the genetic algorithm deep optimization BP neural network and the process of BP neural network training are as follows:
[0124] S41, initializing relevant parameters of the BP neural network, including: algorithm parameters, i.e., hyperparameters, the number of hidden layer nodes, initial weights, and initial biases;
[0125] S42, using a genetic algorithm to iteratively optimize the number of hidden layer nodes and the hyperparameters within the set range of the hyperparameters and the empirical formulas of the hidden layer nodes.
[0126] The empirical formula for setting hidden layer nodes is:
[0127]
[0128] Where h is the number of hidden layer nodes, m and n are the number of nodes in the input and output layers, respectively, and a is a tuning constant ranging from 1 to 10. The BP neural network designed here has 6 input layer nodes and 1 output layer node. Therefore, the number of hidden layer nodes, h, is set to an integer between 3 and 20 for optimal selection.
[0129] trainscg is a network training function that updates the initial weights and bias values according to the scaled conjugate gradient method. BP neural network training is performed according to the trainscg training parameters. Without intervention, training is performed according to the default parameter values. Most default parameter values have little effect on the training results of different neural networks. However, the two hyperparameters sigma and lambda are easily affected by different training data. The hyperparameter sigma is used to determine the weight change of the second-order derivative approximation. The default value is 5×10 -5 The hyperparameter lambda is used to adjust the uncertainty of the Hessian. The default value is 5×10 -7 Therefore, the two hyperparameters sigma and lambda are set in the range of 0 to 1 for optimization.
[0130] The objective function of the genetic algorithm optimization is the mean square error MSE of the BP neural network test set, and the formula is as follows:
[0131]
[0132] Among them, SSE is the sum variance, Z is the number of samples, p z is the true value, To predict the output value, we use the system's random initial weights and initial biases to optimize the two hyperparameters sigma and lambda and the three independent variables of the number of hidden layer nodes.
[0133] S43, after the optimization of the hyperparameters and the number of hidden layer nodes is completed, the optimal values of the hyperparameters and the number of hidden layer nodes are imported into the algorithm model. The topology of the BP neural network is first determined, and then the genetic algorithm is used to optimize the initial weights and initial biases. The objective function of the genetic algorithm optimization is still the mean square error (MSE) of the BP neural network test set. The relationship between the independent variables and the initial weights and initial biases and the formula for their composition are as follows:
[0134] Num=w1+b1+w2+b2
[0135] w1=m*h
[0136] b1=h
[0137] w2=h*n
[0138] b2=n
[0139] Where Num is the total number of independent variables, w1 is the number of weights from the input layer to the hidden layer, b1 is the number of biases in the hidden layer, w2 is the number of weights from the hidden layer to the output layer, b2 is the number of biases in the output layer, h is the number of nodes in the hidden layer, and m and n are the number of nodes in the input and output layers, respectively. The upper and lower bounds for the initial weights and initial biases are set to -2 to 2.
[0140] S44, finally, the optimal solution of the number of hidden layer nodes, the hyperparameters of sigma and lambda, the initial weights and the initial bias is imported into the BP neural network, the sample set is used to train the BP neural network, the error between the predicted output value and the true value is calculated to update the weights and biases, and it is judged whether the error between the predicted output value and the true value meets the conditions. If the conditions are not met, further iterative feedback is performed to update the weights and biases; if the conditions are met, the training results are output.
[0141] In this example, the dataset category labels for cracks, surface peeling, pits, and pores are set to 1, 2, 3, and 4, respectively. 60 samples of each defect type are used as a training set, 20 as a validation set, and 20 as a test set. The BP neural network has 6 input layer nodes, 1 output layer node, and 15 hidden layer nodes after optimization. The output of the BP neural network is rounded. The effect of the BP neural network on defect type recognition before and after genetic algorithm deep optimization is compared. Figure 8 and 9 As shown. Among them, Figure 8 This is the defect type recognition effect of the BP neural network before deep optimization of the genetic algorithm. Figure 9 The defect type recognition effect of the BP neural network after deep optimization by the genetic algorithm. In this embodiment, the defect type recognition results of the BP neural network before and after deep optimization by the GA are shown in Table 2 below:
[0142] Table 2
[0143]
[0144] Combined with Table 2 and Figure 8 、 9 It can be seen that the optimized BP neural network algorithm model has a very significant classification effect on sample data and can effectively distinguish the defect types. The recognition accuracy of the optimized BP neural network can reach 100%. At the same time, the deep optimization of the BP neural network through genetic algorithm also verifies the effectiveness of the selected recognition parameters for identifying defect types.
[0145] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A pipeline defect type identification method based on GA deep optimization machine learning, characterized in that: The following steps are involved: S1, obtain the three-axis magnetic flux leakage signal of the defect under different defect types; The three-axis magnetic flux leakage signal of the defect refers to: the axial magnetic flux leakage signal, i.e., the axial component; the radial magnetic flux leakage signal, i.e., the radial component; and the circumferential magnetic flux leakage signal, i.e., the circumferential component; The axial direction is the direction along the length of the pipe, the radial direction is the direction perpendicular to the inner wall of the pipe, and the circumferential direction is the direction along the circumference of the pipe. The circumferential component is selected by determining the peak position of the radial component on the axial path, and selecting the value of the radial component on the circumferential path where the peak position is located as the value of the circumferential component; S2, extract signal characteristic parameters for the three-axis magnetic leakage signal of the defect, including: axial component differential signal peak-to-valley distance DS xp-p , axial component waveform area S x , circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value B zp-p , radial component peak-to-valley spacing S zp-p ; Among them, the peak-to-valley distance DS of the axial component differential signal xp-p The extraction method is: take the differential of the axial component to obtain the axial component differential signal, and extract the peak-to-valley spacing DS of the axial component differential signal xp-p ; Circumferential component peak-to-valley median spacing S y-50% The extraction method is: extract the peaks and valleys of the circumferential component, calculate the middle value of the peaks and valleys, that is, 50% of the difference between the peaks and valleys as the peak-valley median, and the spacing between the peak-valley medians on the circumferential component is the circumferential component peak-valley median spacing S y-50% ; S3, the peak-to-valley distance DS of the axial component differential signal xp-p , circumferential component peak-to-valley median spacing S y-50% , radial component peak-to-valley value B zp-p , radial component peak-to-valley spacing S zp-p , axial component waveform area S x , and the number N of sensors that collect defect magnetic leakage signals on the magnetic leakage sensor is used as the identification parameter of the defect type to construct a sample set; The sample data in the sample set includes: each identification parameter value of the defect and the corresponding defect type; S4, constructing a neural network, wherein the input of the neural network is the various identification parameter values of the defect, and the output is the defect type; using the sample set to train and generate the neural network; S5, identify the type of unknown defects. The process is as follows: S51, extracting various signal characteristic parameters based on the three-axis magnetic flux leakage signal of the unknown defect, and obtaining the number N of magnetic flux leakage sensors that have collected the magnetic flux leakage signal of the unknown defect, to obtain various identification parameter values of the unknown defect; S52, inputting each identification parameter value of the unknown defect into the neural network obtained in step S4 for prediction, and predicting and outputting the defect type of the unknown defect.
2. The pipeline defect type identification method based on GA deep optimization machine learning according to claim 1 is characterized in that: In step S4, during the training process of the neural network, the neural network is deeply optimized based on the genetic algorithm. The process of the genetic algorithm deep optimization of the BP neural network and the BP neural network training is specifically as follows: S41, initializing the relevant parameters of the neural network, including: the number of hidden layer nodes, hyperparameters, initial weights, and initial biases; S42, within the set range of the hyperparameters and the empirical formula of the hidden layer nodes, first using a genetic algorithm to iteratively optimize the number of hidden layer nodes and the hyperparameters, and then importing the optimal values of the number of hidden layer nodes and the hyperparameters into the neural network model to determine the topological structure of the neural network; S43, iteratively optimizing the initial weights and initial biases using a genetic algorithm, and importing the initial weights and initial biases obtained after the iterative optimization into the neural network model; S44, using the sample set to train the neural network, calculate the error between the predicted value and the true value of the defect type, and determine whether the error between the predicted value and the true value meets the conditions. If not, update the weights and biases; if the conditions are met, output the training results to obtain the trained neural network.
3. The pipeline defect type identification method based on GA deep optimization machine learning according to claim 2 is characterized in that: In step S42, the empirical formula of the hidden layer node is: Among them, m and n are the number of nodes in the input layer and output layer respectively, m=6, n=1; a is a tuning constant ranging from 1 to 10; h is the number of nodes in the hidden layer, and the number of hidden layer nodes h is optimized in the range of 3 to 20.
4. The pipeline defect type identification method based on GA deep optimization machine learning according to claim 2 is characterized in that: In step S42 , the algorithm parameters of the neural network, i.e., the hyperparameters, include sigma and lambda; these two hyperparameters are set in the range of 0 to 1 to seek an optimal value.
5. The pipeline defect type identification method based on GA deep optimization machine learning according to claim 2 is characterized in that: In step S42, the objective function for iteratively optimizing the number of hidden layer nodes and hyperparameters using a genetic algorithm is the mean square error (MSE) between the predicted output value of the neural network and the true value, as shown in the following formula: Among them, Z is the number of sample data, p z is the true value, is the predicted output value.
6. The pipeline defect type identification method based on GA deep optimization machine learning according to claim 5 is characterized in that: In step S43, the objective function for iteratively optimizing the initial weights and initial biases using the genetic algorithm is also the mean square error (MSE) between the predicted output value of the neural network and the true value. The relationship between the independent variables of the objective function for optimizing the initial weights and initial biases and the initial weights and initial biases is as follows: Num=w1+b1+w2+b2 w1=m*h b1=h w2=h*n b2=n Where Num is the total number of independent variables, w1 is the number of weights from the input layer to the hidden layer, b1 is the number of biases in the hidden layer, w2 is the number of weights from the hidden layer to the output layer, b2 is the number of biases in the output layer, h is the number of nodes in the hidden layer, m and n are the number of nodes in the input layer and output layer respectively; the optimization intervals for the initial weights and initial biases are both set to -2 to 2.
7. The pipeline defect type identification method based on GA deep optimization machine learning according to claim 1 is characterized in that: In step S1, the defect types include: cracks, surface peeling, pits, and pores.
8. The pipeline defect type identification method based on GA deep optimization machine learning according to claim 7 is characterized in that: The classification information for each defect type is as follows: The length of the crack is 5 to 30 mm, the width is 0.3 to 1 mm, and the depth is 1 to 8 mm; The length of the surface layer peeling is 20-50 mm, the width is 20-50 mm, and the depth is 1-3 mm; The length of the pit is 5 to 15 mm, the width is 5 to 30 mm, and the depth is 2 to 9 mm. The radius of the air hole is 1 to 3 mm, and the depth from the inner wall of the pipe is 2 to 10 mm.
9. A pipeline defect type identification method based on GA deep optimization machine learning according to claim 1, 7 or 8, characterized in that: In step S1, a three-dimensional finite element model of the pipeline defect is established. In the three-dimensional finite element model, ANSYS Maxwell is used to perform magnetic flux leakage simulation on the pipeline defect to obtain the corresponding magnetic flux leakage signal, and the three-axis magnetic flux leakage signal of the defect under different defect types is obtained.
Citation Information
Patent Citations
Extreme learning machine-based pipeline magnetic flux leakage defect detection method
CN104034794A
Pipeline defect magnetic flux leakage inversion method based on Adaboost-RBF synergy
CN106018545A