Pipeline crack propagation mode identification method based on GA optimization BP neural network
Through the genetic algorithm, the parameters and structure of the BP neural network are optimized, and the problems of local optimal solutions and initial parameter settings in BP neural network training are solved, the recognition accuracy of pipeline crack expansion patterns is improved, and the prediction accuracy and training efficiency are achieved. .
Patent Information
- Application Number
- CN202411078477.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-19
AI Technical Summary
In the prior art, BP neural networks are prone to fall into local optimal solutions during training, resulting in a decrease in prediction accuracy, and the initial parameter setting affects the training time and the analysis accuracy is not high.
Genetic algorithm (GA) is used to optimize the number of hidden layer nodes, hyperparameters, network weight initial values and bias initial values of BP neural networks, and jump out of local optimal solutions through global search capabilities, optimize network structure and parameters, and improve neural network Convergence speed and prediction accuracy.
Through GA optimization, the generalization ability and prediction accuracy of BP neural network are improved, the local optimal solution problem is overcome, and the recognition accuracy of pipeline crack propagation patterns is significantly improved.
Smart Images

Figure CN118982055A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of neural network, in particular to a pipeline crack propagation pattern recognition method based on GA optimized BP neural network. Background Art
[0002] The expansion of crack defects in oil and gas pipelines will lead to their fracture and damage, which will directly affect the safe operation of the pipelines. Therefore, it is of great significance to conduct reliability analysis on pipelines with crack defects.
[0003] At present, the most commonly used analysis methods for pipelines with crack defects are the R6 assessment method, the BS7910 assessment method and the SINTAP assessment method. The above-mentioned assessment methods usually only consider the randomness of parameters and regard some variables as fracture analysis of random variables that obey certain statistical laws. However, in actual engineering design, variables usually have both random and fuzzy uncertainty factors, resulting in low analysis accuracy. Therefore, in order to solve the problem of low analysis accuracy, patent CN112949190A discloses a fuzzy random reliability assessment method for pipelines with crack defects based on R6-FAD and BP-MCS. This method is based on the failure assessment diagram of the R6 specification, and combines BP neural network and Monte Carlo simulation to apply to the fuzzy random reliability assessment of pipelines with crack defects. It mainly includes: Step 1: input the actual working load, crack defect size, probability distribution type and parameters of material properties and the maximum number of simulations N, and establish the fuzzy limit state equation; Step 2: determine the basic parameters and construct the initialization BP neural network; Step 3: train the neural network to ensure that it can better approximate the fuzzy limit state equation; Step 4: random sampling, use the Monte Carlo principle to calculate the failure probability and reliability index. The present invention can simplify the fuzzy reliability randomization process and obtain a numerical solution with high simulation accuracy; at the same time, it takes into account the uncertainty of the fuzzy random coupling of the structure, which is more in line with engineering practice and has guiding significance for the safety assessment of the structure.
[0004] In the above prior art, the initial parameters of the BP neural network are random, which will cause the time for parameter optimization to be prolonged during the BP neural network training process; at the same time, the random initial parameters will also cause the BP neural network to fall into a local optimal solution during the training process, thereby reducing the prediction accuracy. It can be seen that the setting of the initial parameters in the BP neural network is crucial to the training process of the BP neural network. Summary of the invention
[0005] In order to avoid and overcome the technical problems existing in the prior art, the present invention provides a pipeline crack propagation pattern recognition method based on GA optimized BP neural network. The present invention can effectively improve the prediction accuracy of BP neural network.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A pipeline crack growth pattern recognition method based on GA optimized BP neural network includes the following recognition steps:
[0008] S1, collecting data samples including characteristic parameters and crack propagation modes of the pipeline, and storing each data sample in a sample set;
[0009] S2, constructing a BP neural network, recording the number of hidden layer nodes, hyperparameters, initial values of network weights and initial values of biases of the BP neural network as chromosomes, and solving the optimal chromosome using a genetic algorithm based on the sample set;
[0010] S3, assigning the value of the optimal chromosome to the BP neural network, and then using the sample set to train the assigned BP neural network to obtain the optimal BP neural network;
[0011] S4. Inputting the characteristic parameters of the pipeline into the optimal BP neural network, and predicting the crack propagation mode of the pipeline through the optimal BP neural network.
[0012] As a further solution of the present invention: the steps of using genetic algorithm to solve the optimal chromosome are as follows:
[0013] S21, encoding: encoding the number of hidden layer nodes, hyperparameters, initial values of network weights and initial values of biases of the BP neural network to form corresponding chromosomes;
[0014] S22, initialization population: randomly generate multiple sets of chromosomes and store them in the initial population;
[0015] S23, fitness evaluation: assign each group of chromosomes in the initial population to the BP neural network in turn, then input the sample set into the BP neural network after the current assignment, calculate the output of the BP neural network after the current assignment, and obtain the mean square error of the output through mathematical statistics; and take the inverse of the mean square error as the fitness of the current group of chromosomes;
[0016] S24, selection operation: using roulette selection method or tournament selection method, select some chromosomes from the initial population according to the fitness size and store them in the sub-population;
[0017] S25, crossover operation: performing a crossover operation on the chromosomes in the sub-population to generate new chromosomes, and storing the generated new chromosomes in the sub-population;
[0018] S26, mutation operation: performing mutation operation on some chromosomes in the sub-population to generate new chromosomes, and storing the generated new chromosomes in the sub-population;
[0019] S27, iterative evolution: according to the contents of step S23 to step S26, each group of chromosomes in the sub-population is assigned to the BP neural network in turn, and fitness evaluation, selection operation, crossover operation and mutation operation are performed in turn until the termination condition is met, and the chromosome that meets the termination condition is recorded as the optimal chromosome.
[0020] As a further solution of the present invention: the number of hidden layer nodes in a BP neural network having only one hidden layer is calculated as follows:
[0021]
[0022] In the formula, h represents the number of hidden layer nodes in the BP neural network; m represents the number of nodes in the input layer of the BP neural network; n represents the number of nodes in the output layer of the BP neural network; a represents the adjustment constant.
[0023] As a further solution of the present invention: the hyperparameters of the BP neural network include the coefficient λ of the regularization term and the standard deviation σ of the Gaussian noise.
[0024] As a further solution of the present invention: the relationship between the independent variable of the objective function for optimizing the initial value of the network weight and the initial value of the bias by calculating the mean square error and the number of network weights and the number of biases is expressed as follows:
[0025] Num = w1 + b1 + w2 + b2;
[0026] w1=m*h;
[0027] b1=h;
[0028] w2=h*n;
[0029] b2=n;
[0030] Among them, Num represents the total number of independent variables of the objective function; w1 represents the total number of network weights from the input layer to the hidden layer in the BP neural network; b1 represents the total number of biases in the hidden layer in the BP neural network; w2 represents the total number of network weights from the hidden layer to the output layer in the BP neural network; b2 represents the total number of biases in the output layer in the BP neural network.
[0031] As a further solution of the present invention: the objective function is specifically expressed as follows:
[0032]
[0033] In the formula, MSE represents the mean square error, that is, the objective function value; Z represents the total number of data samples in the sample set; P z represents the true value; Represents the output value of the BP neural network.
[0034] As a further solution of the present invention: the crack propagation mode includes a crack initiation stage, a crack stable propagation stage and a crack unstable propagation stage.
[0035] As a further solution of the present invention: the number of chromosome groups in the initial population is 20 to 100; after calculating the fitness of each group of chromosomes, the chromosomes are sorted in descending order, and the chromosomes ranked in the top 20 to 100 are selected and stored in the sub-population.
[0036] As a further solution of the present invention: the value range of the crossover probability in the crossover operation is [0.6, 0.9], and the value range of the mutation probability in the mutation operation is [0.01, 0.1].
[0037] As a further solution of the present invention: the termination condition is to reach the maximum number of iterations or to find a chromosome that meets the error accuracy.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] The present invention can overcome the defects of BP neural network and improve the performance of neural network by combining the global search ability of genetic algorithm (GA) and the accurate solution ability of BP neural network. The global search ability of genetic algorithm helps BP neural network to jump out of local optimal solution and find global optimal solution. By optimizing the initial value of network weight and initial value of bias, the convergence speed of BP neural network can be accelerated. The optimized BP neural network has better generalization ability and higher prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is the identification flow chart of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.
[0042] See also Figure 1 In an embodiment of the present invention, a pipeline crack propagation pattern recognition method based on GA optimized BP neural network includes the following contents.
[0043] 1. Collect data samples containing characteristic parameters and crack propagation patterns of the pipeline, and store each data sample in a sample set.
[0044] A data sample includes 7 principal components and corresponding crack extension modes, that is, the 7 principal components represent 7 characteristic parameters, which are used as the input of BP neural network. The crack extension mode includes crack initiation stage, stable crack extension stage and unstable crack extension stage, which are used as classification labels, that is, the output of BP neural network.
[0045] 2. Genetic algorithm optimization.
[0046] Construct a BP neural network, record the number of hidden layer nodes, hyperparameters, initial values of network weights and initial values of bias of the BP neural network as chromosomes, and use genetic algorithms to solve the optimal chromosomes based on the sample set. Within the setting 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 hyperparameters, and then import the optimal values of the number of hidden layer nodes and hyperparameters into the neural network model to determine the topological structure of the neural network. At the same time, use the genetic algorithm to iteratively optimize the initial values of network weights and biases, and import the initial values of network weights and biases obtained after iterative optimization into the neural network model.
[0047] The steps to use genetic algorithm to solve the optimal chromosome are as follows:
[0048] S21, encoding: Encode the number of hidden layer nodes, hyperparameters, initial values of network weights and initial values of biases of the BP neural network to form corresponding chromosomes.
[0049] The preferred BP neural network in the embodiment of the present invention includes an input layer, a hidden layer and an output layer. The number of nodes in the hidden layer of the BP neural network is calculated as shown in formula (1):
[0050]
[0051] The value range of the number of hidden layer nodes h is [3,20].
[0052] The hyperparameters of the BP neural network include the coefficient λ of the regularization term and the standard deviation σ of the Gaussian noise. The value range of the coefficient λ and the standard deviation σ is [0,1].
[0053] S22. Initialize the population: Randomly generate multiple sets of chromosomes and store them in the initial population. The population size affects the algorithm's search capability and computing time. The generally recommended population size range is 20 to 100, but the specific size should be determined based on the complexity of the problem and computing resources. A larger population size can enhance the search capability, but it will also increase the computing time.
[0054] S23, fitness evaluation: assign each group of chromosomes in the initial population to the BP neural network in turn, then input the sample set into the BP neural network after the current assignment, calculate the output of the BP neural network after the current assignment, and obtain the mean square error of the output through mathematical statistics; and take the inverse of the mean square error as the fitness of the current group of chromosomes.
[0055] The objective function formula (2) is shown as follows:
[0056]
[0057] The relationship between the independent variable of the objective function for optimizing the initial value of the network weight and the initial value of the bias by calculating the mean square error, the number of network weights, and the number of biases is shown in formulas (3) to (7):
[0058] Num=w1+b1+w2+b2 (3)
[0059] w1=m*h (4)
[0060] b1=h (5)
[0061] w2=h*n (6)
[0062] b2=n (7)
[0063] The value range of w1, w2, b1 and b2 is [-2, 2].
[0064] S24, selection operation: Use roulette wheel selection or tournament selection to select some chromosomes from the initial population according to the fitness size and store them in the sub-population. Selection strategies such as roulette wheel selection or tournament selection should be selected according to the characteristics of the problem. Different selection strategies are suitable for different types of problems. For example, if the problem is multi-peaked, tournament selection may be required.
[0065] S25, crossover operation: perform a crossover operation on the chromosomes in the sub-population to generate new chromosomes, and store the generated new chromosomes in the sub-population. The value range of the crossover probability in the crossover operation is [0.6, 0.9].
[0066] S26, mutation operation: perform mutation operation on some chromosomes in the sub-population to generate new chromosomes, and store the generated new chromosomes in the sub-population. The value range of mutation probability in the mutation operation is [0.01, 0.1].
[0067] S27, iterative evolution: according to the contents of step S23 to step S26, each group of chromosomes in the sub-population is assigned to the BP neural network in turn, and fitness evaluation, selection operation, crossover operation and mutation operation are performed in turn until the termination condition is met, and the chromosome that meets the termination condition is recorded as the optimal chromosome. The termination condition can be reaching the maximum number of iterations or finding a satisfactory solution. The setting of the termination condition needs to consider the complexity of the problem and the limitation of computing resources.
[0068] 3. Assign the optimal chromosome value to the BP neural network, and then use the sample set to train the assigned BP neural network to obtain the optimal BP neural network.
[0069] The initial weights and initial bias values obtained after iterative optimization are imported into the neural network model; the neural network is trained using the sample set, the error between the predicted value and the true value of the defect type is calculated, and it is determined whether the error between the predicted value and the true value meets the conditions. If not, the initial values of the network weights and the initial values of the bias are updated; if the conditions are met, the training results are output to obtain the optimal BP neural network after training.
[0070] 4. Input the characteristic parameters of the pipeline into the optimal BP neural network, and predict the crack propagation mode of the pipeline through the optimal BP neural network.
[0071] In an embodiment of the present invention, Roman characters Ⅰ, Ⅱ and Ⅲ are used as classification labels of sample output, which respectively represent the crack initiation stage, the stable crack extension stage and the unstable crack extension stage. Seven principal components form a group of samples, each group corresponds to a classification label, and there are a total of 180 groups of samples. Among them, 130 groups are used as training sets, 25 groups are used as validation sets, and 25 groups are used as test sets. The number of input layer nodes of the BP neural network is 7, the number of output layer nodes is 1, and the number of hidden layer nodes after optimization is 15.
[0072] The training set, validation set and test set are input into the BP neural network in sequence, and the error results are shown in Table 1.
[0073] Table 1 Error results
[0074]
[0075] From Table 1, we can see that the recognition accuracy of the test set is 80% for the BP neural network and 84% for the GA-optimized BP neural network. It can be seen that the classification effect of the sample data using the GA-optimized BP neural network is more significant, which can effectively distinguish the crack extension stage and effectively improve the recognition accuracy.
[0076] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A pipeline crack growth pattern recognition method based on GA optimized BP neural network, It is characterized in that The identification steps include: S1, collecting data samples including characteristic parameters and crack propagation modes of the pipeline, and storing each data sample in a sample set; S2, constructing a BP neural network, recording the number of hidden layer nodes, hyperparameters, initial values of network weights and initial values of biases of the BP neural network as chromosomes, and solving the optimal chromosome using a genetic algorithm based on the sample set; S3, assigning the value of the optimal chromosome to the BP neural network, and then using the sample set to train the assigned BP neural network to obtain the optimal BP neural network; S4. Inputting the characteristic parameters of the pipeline into the optimal BP neural network, and predicting the crack propagation mode of the pipeline through the optimal BP neural network.
2. According to claim 1, a pipeline crack growth pattern recognition method based on GA optimized BP neural network, It is characterized in that The steps to use genetic algorithm to solve the optimal chromosome are as follows: S21, encoding: encoding the number of hidden layer nodes, hyperparameters, initial values of network weights and initial values of biases of the BP neural network to form corresponding chromosomes; S22, initialization population: randomly generate multiple sets of chromosomes and store them in the initial population; S23, fitness evaluation: assign each group of chromosomes in the initial population to the BP neural network in turn, then input the sample set into the BP neural network after the current assignment, calculate the output of the BP neural network after the current assignment, and obtain the mean square error of the output through mathematical statistics; and take the inverse of the mean square error as the fitness of the current group of chromosomes; S24, selection operation: using roulette selection method or tournament selection method, select some chromosomes from the initial population according to the fitness size and store them in the sub-population; S25, crossover operation: performing a crossover operation on the chromosomes in the sub-population to generate new chromosomes, and storing the generated new chromosomes in the sub-population; S26, mutation operation: performing mutation operation on some chromosomes in the sub-population to generate new chromosomes, and storing the generated new chromosomes in the sub-population; S27, iterative evolution: according to the contents of step S23 to step S26, each group of chromosomes in the sub-population is assigned to the BP neural network in turn, and fitness evaluation, selection operation, crossover operation and mutation operation are performed in turn until the termination condition is met, and the chromosome that meets the termination condition is recorded as the optimal chromosome.
3. According to claim 2, a pipeline crack growth pattern recognition method based on GA optimized BP neural network, It is characterized in that The number of hidden layer nodes in a BP neural network with only one hidden layer is calculated as follows: In the formula, h represents the number of hidden layer nodes in the BP neural network; m represents the number of nodes in the input layer of the BP neural network; n represents the number of nodes in the output layer of the BP neural network; a represents the adjustment constant.
4. According to claim 3, a pipeline crack growth pattern recognition method based on GA optimized BP neural network, It is characterized in that The hyperparameters of the BP neural network include the coefficient λ of the regularization term and the standard deviation σ of the Gaussian noise.
5. According to claim 4, a pipeline crack growth pattern recognition method based on GA optimized BP neural network, It is characterized in that The relationship between the independent variable of the objective function for optimizing the initial value of the network weight and the initial value of the bias by calculating the mean square error and the number of network weights and the number of biases is expressed as follows: Num=w 1 +b 1 +w 2 +b 2 ; w 1 =m*h; b 1 =h; w 2 =h*n; b 2 =n; Where Num represents the total number of independent variables of the objective function; w 1 Represents the total number of network weights from the input layer to the hidden layer in the BP neural network; b 1 represents the total number of biases in the hidden layer of the BP neural network; w 2 Represents the total number of network weights from the hidden layer to the output layer in the BP neural network; b 2 Represents the total number of biases in the output layer of the BP neural network.
6. According to claim 5, a pipeline crack growth pattern recognition method based on GA optimized BP neural network, It is characterized in that The objective function is specifically expressed as follows: In the formula, MSE represents the mean square error, that is, the objective function value; Z represents the total number of data samples in the sample set; P z represents the true value; Represents the output value of the BP neural network.
7. A pipeline crack growth pattern recognition method based on GA optimized BP neural network according to any one of claims 1 to 6, It is characterized in that The crack propagation mode includes the crack initiation stage, the crack stable propagation stage and the crack unstable propagation stage.
8. According to claim 6, a pipeline crack growth pattern recognition method based on GA optimized BP neural network, It is characterized in that The number of chromosome groups in the initial population is 20 to 100. After calculating the fitness of each chromosome group, the chromosome groups are sorted in descending order, and the chromosomes ranked in the top 20 to 100 are selected and stored in the sub-population.
9. A pipeline crack growth pattern recognition method based on GA optimized BP neural network according to claim 8, It is characterized in that The value range of the crossover probability in the crossover operation is [0.6, 0.9], and the value range of the mutation probability in the mutation operation is [0.01, 0.1].
10. A pipeline crack growth pattern recognition method based on GA optimized BP neural network according to claim 9, It is characterized in that The termination condition is reaching the maximum number of iterations or finding a chromosome that meets the error accuracy.
Citation Information
Patent Citations
High-precision resistance measurement algorithm based on GA-BP neural network algorithm
CN110738006A
Fuzzy random reliability evaluation method for pipeline with crack defect based on R6-FAD and BP-MCS
CN112949190A
Method and system for predicting crack growth rate of stress corrosion cracking
CN114021432A
Pipeline defect type identification method based on GA deep optimization machine learning
CN115130343A
Metal full-stage fatigue crack propagation prediction method and system based on neural network
CN117669390A
Cited By
Green building equipment intelligent energy-saving control method and system based on artificial intelligence
CN119861643A
Intelligent energy-saving control method and system for green building equipment based on artificial intelligence
CN119861643B
