A method, medium and system for predicting corrosion rate of a grounding grid
By optimizing the BP neural network through data augmentation and simulated annealing algorithms, the problems of small sample size and limitations in the prediction of grounding grid corrosion rate are solved, achieving higher prediction accuracy and generalization ability, and meeting the maintenance needs of power systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies for predicting corrosion rates in grounding grids suffer from small sample size issues and limitations of BP neural networks, resulting in limited model generalization ability and decreased prediction accuracy, making it difficult to meet the needs of practical applications.
Data augmentation techniques are used to expand the data space for predicting the corrosion rate of grounding grids, and the weights and thresholds of the neural network model are optimized by simulated annealing algorithm. Combined with BP neural network, the learning and fitting capabilities of the model are improved.
It significantly improves the prediction accuracy and generalization ability of neural network models, enabling more accurate prediction of the corrosion rate of grounding grids and meeting the needs of practical applications.
Smart Images

Figure CN119578234B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of grounding grids, and in particular to a method, medium and system for predicting the corrosion rate of a grounding grid. BACKGROUND
[0002] In modern power systems, grounding grids are important safety facilities, and their stability and reliability are crucial to the safe operation of the entire system. Grounding grids are usually composed of metal conductors and are buried in the soil for a long time. Due to the influence of soil physicochemical properties, metal conductors are prone to corrosion, which leads to a decrease in the performance of the grounding grid and even failure. Therefore, accurately predicting the corrosion rate of the grounding grid is of great significance for assessing its health status, developing maintenance strategies, and extending its service life.
[0003] Soil physicochemical properties have a direct impact on the corrosion rate of metal conductors. For example, the pH value, resistivity, water content, temperature, and the content of chloride ions and sulfate ions in the soil are important factors affecting the corrosion rate. Therefore, to accurately predict the corrosion rate of the grounding grid, the complex interactions of these soil physicochemical properties need to be considered comprehensively.
[0004] Traditional corrosion rate prediction methods, such as electrochemical testing and field monitoring, usually require the placement of multiple sensors in the soil, which is not only costly but also difficult to implement on a large scale. In addition, these methods often only provide local or immediate corrosion state information, making it difficult to comprehensively assess the overall corrosion condition of the grounding grid.
[0005] In recent years, with the development of artificial intelligence technology, neural networks have been widely used in various prediction and classification problems as a powerful nonlinear modeling tool. In the field of grounding grid corrosion rate prediction, neural network models have shown great potential due to their ability to handle complex nonlinear relationships. By learning the relationship between soil physicochemical properties and the corrosion rate of the grounding grid, neural networks can predict the corrosion rate of the grounding grid, thereby providing a scientific basis for the maintenance and management of power systems.
[0006] Despite the obvious advantages of neural networks in predicting the corrosion rate of grounding grids, there are still some technical challenges in practical applications:
[0007] First, the small sample problem is one of the key factors that restrict the performance of the model. The small sample problem mainly manifests in the following aspects:
[0008] 1. Data scarcity: Since the acquisition of grounding grid corrosion data involves complex field testing and long-term monitoring, it not only increases the difficulty of data collection but also increases the cost. Therefore, the number of data samples available for training is often limited.
[0009] 2. Limited model generalization ability: In the case of insufficient sample size, the neural network model may not be able to fully learn the complex relationship between soil physicochemical properties and corrosion rate, resulting in limited generalization ability of the model.
[0010] 3. Decreased prediction accuracy: The small sample problem may also lead to decreased accuracy of the model in predicting the corrosion rate of the grounding grid, which cannot meet the needs of practical applications.
[0011] II. Limitations of BP neural network: The traditional BP neural network relies on the gradient descent algorithm in the training process, which is easily affected by the selection of initial weights and may cause the network to fall into a local optimal solution rather than a global optimal solution. In addition, the gradient descent algorithm requires a large number of iterations in the process of searching for the optimal solution, resulting in low training efficiency. These problems limit the performance of BP neural network in predicting the corrosion rate of the grounding grid. SUMMARY
[0012] The embodiment of the present application provides a grounding grid corrosion rate prediction method, medium and system to solve the problem of inaccurate prediction of the corrosion rate of the grounding grid in the prior art.
[0013] In a first aspect, a method for predicting the corrosion rate of a grounding grid is provided, comprising:
[0014] The corrosion rate of the grounding grid is used as the input of the neural network model, and the soil physicochemical data of the grounding grid is used as the output of the neural network model. The first grounding grid corrosion rate and the first grounding grid soil physicochemical data are used to train the neural network model, and a grounding grid corrosion rate prediction inversion model is obtained.
[0015] The second grounding grid corrosion rate is input into the grounding grid corrosion rate prediction inversion model, and the second grounding grid soil physicochemical data is output.
[0016] The first grounding grid soil physicochemical data and the second grounding grid soil physicochemical data are combined to obtain third grounding grid soil physicochemical data, and the first grounding grid corrosion rate and the second grounding grid corrosion rate are combined to obtain third grounding grid corrosion rate.
[0017] The soil physicochemical data of the grounding grid is used as the input of the neural network model, and the corrosion rate of the grounding grid is used as the output of the neural network model. The third grounding grid soil physicochemical data and the third grounding grid corrosion rate are used to train the neural network model, and the weights between neurons and the thresholds of neurons of the neural network model are optimized by the simulated annealing algorithm, and a grounding grid corrosion rate prediction model is obtained.
[0018] The actual collected soil physicochemical data is input into the grounding grid corrosion rate prediction model, and the corrosion rate of the grounding grid is output.
[0019] In a second aspect, a computer readable storage medium is provided, and computer program instructions are stored on the computer readable storage medium; the computer program instructions are executed by a processor to implement the grounding grid corrosion rate prediction method according to the first aspect.
[0020] In a third aspect, a grounding grid corrosion rate prediction system is provided, and the system comprises the computer readable storage medium according to the second aspect.
[0021] In this way, the embodiments of the present application can effectively improve the learning and fitting ability of the model to the sample through the data enhancement technology, and can play a role in optimizing the network structure and weight adjustment through the simulated annealing algorithm, and the combination of the two improves the prediction accuracy of the neural network model. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0023] Figure 1 is a flowchart of the grounding grid corrosion rate prediction method according to the embodiments of the present application;
[0024] Figure 2 is an optimization schematic diagram of the simulated annealing algorithm;
[0025] Figure 3 is a flowchart of the simulated annealing algorithm;
[0026] Figure 4 is a schematic diagram of the prediction comparison effect under different annealing coefficients;
[0027] Figure 5 is a schematic diagram of the comparison of the predicted value and the true value of the BP neural network before and after optimization without data enhancement;
[0028] Figure 6 is a schematic diagram of the comparison of the predicted value and the true value error of the BP neural network before and after optimization without data set expansion;
[0029] Figure 7 is a schematic diagram of the comparison of the predicted value and the true value of the BP neural network before and after optimization with data enhancement;
[0030] Figure 8 is a schematic diagram of the comparison of the predicted value and the true value error of the BP neural network before and after optimization without data enhancement. DETAILED DESCRIPTION
[0031] Clearly, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based upon the embodiments in the present application, all the other embodiments obtained by those ordinarily skilled in the art without creative effort on the premise that no inventive step is made, shall fall within the scope of the present application.
[0032] The embodiment of the present application discloses a grounding grid corrosion rate prediction method. Figure 1 As shown in the figure, the method of the embodiment of the present application comprises the following steps:
[0033] Step S101: taking the grounding grid corrosion rate as the input of a neural network model and taking the grounding grid soil physical and chemical data as the output of the neural network model, training the neural network model by using the first grounding grid corrosion rate and the first grounding grid soil physical and chemical data, and obtaining a grounding grid corrosion rate prediction inversion model.
[0034] Specifically, the grounding grid corrosion rate prediction neural network model of the embodiment of the present application can adopt a BP neural network.
[0035] The BP neural network is a network model of error reverse transmission, which is composed of an input layer, an output layer and a plurality of hidden layers. The BP neural network has strong learning ability, simple structure and stable model, and is a commonly used neural network structure at present.
[0036] In the BP neural network model, the function relationship between the input and the output is as follows:
[0037]
[0038] In the formula, x i is an input vector, subscript i is the index of each input node in the input vector, i.e. input feature i, w i is the weight between neurons, b is the threshold value of the neuron, f is the transfer function between neurons, y is the output vector, and R represents the number of nodes in the input layer.
[0039] The structural characteristics of the BP neural network include: 1. Forward information transmission, the input quantity of the network is positively diffused from the input layer to the hidden layer and the output layer. 2. Reverse information transmission, the error between the actual value and the predicted value is reversely transmitted to modify the weight and threshold value between the layers.
[0040] The function expression is as follows:
[0041] 1. Forward information transmission:
[0042] The output of the i-th network neuron in the hidden layer is:
[0043]
[0044] where y 1i is the output of the i-th hidden layer neuron, w 1ij is the weight from the j-th neuron of the input layer to the i-th neuron of the hidden layer, x j is the weight from the j-th neuron of the input layer to the i-th neuron of the hidden layer, b 1i is the threshold of the i-th neuron of the hidden layer, f1 is the activation function used by the hidden layer, which determines how the output of a neuron changes with the input, r is the number of neurons of the input layer, i.e., the number of input features, j is the index of the input layer neuron, from 1 to r, i = 1, 2, …, m.
[0045] The function expression of the k-th neuron of the output layer is:
[0046]
[0047] where y 2k is the output of the k-th neuron of the output layer, w kj is the weight from the j-th neuron of the hidden layer to the k-th neuron of the output layer, b 2k is the threshold of the k-th neuron of the output layer, f2 is the activation function used by the output layer, k = 1, 2, …, n.
[0048] 2. Backward propagation of error function:
[0049] The error function is propagated backward, which can modify the weights and thresholds between each layer. The modified weights and thresholds between the i-th neuron of the hidden layer and the k-th neuron of the output layer are:
[0050] Δw 2ki = ηδ ki y 1i
[0051] Δb 2ki = ηδ ki
[0052] where Δw 2ki represents the change in weight between the i-th neuron of the hidden layer and the k-th neuron of the output layer, Δb 2ki represents the change in threshold between the i-th neuron of the hidden layer and the k-th neuron of the output layer, η represents the network learning rate, δ ki represents the error gradient of the k-th neuron of the output layer.
[0053] The first grounding net soil physicochemical data can be actual soil physicochemical data of collected soil samples, which are the basis for predicting the corrosion rate of the grounding net. Since the soil physicochemical data is difficult to obtain, the number of the first grounding net soil physicochemical data is small, which belongs to a small sample. Specifically, the grounding net soil physicochemical data includes water content, resistivity, porosity, sulfate ions, chloride ions, and corrosion rate. The grounding net soil physicochemical data can also select other suitable physicochemical data according to actual conditions.
[0054] The first grounding net corrosion rate can be calculated by the weight loss method. The weight loss method is a method for determining the corrosion rate by measuring the weight loss of the metal (the calculation of the metal corrosion rate by the weight loss method is carried out in accordance with the provisions of GB / T16545-2015). The first grounding net soil physicochemical data of each soil sample numbered I and the first grounding net corrosion rate correspond.
[0055] n types of first grounding net soil physicochemical data {u1, u2,..., u n} are set, the first grounding net corrosion rate V, and the first grounding net soil physicochemical data and the first grounding net corrosion rate of the m soil samples form a sample space for obtaining a grounding net corrosion rate prediction inversion model, denoted as:
[0056]
[0057] wherein, u mn represents the n type of first grounding net soil physicochemical data of the m soil sample, v m represents the first grounding net corrosion rate of the m soil sample, i m represents the number of the m soil sample. It should be understood that the grounding net corrosion rate and the grounding net soil physicochemical data described in the embodiments of the present application are all pre-processed by normalization. Normalization can use the normalization method commonly used in the prior art.
[0058] The first grounding net corrosion rate and the first grounding net soil physicochemical data are used to train the neural network model. The obtained first grounding net corrosion rate vector V is used as the input of the BP neural network, the first grounding net soil physicochemical data n-dimensional vector {u1, u2,..., u n} is used as the output of the BP neural network, the number of input layer nodes is set to 1, corresponding to the first grounding net corrosion rate, the number of output layer nodes is n, corresponding to the first grounding net soil physicochemical data n-dimensional vector, and the number of hidden layer nodes of the neural network model is determined by the trial method according to the empirical formula. The formula is as follows:
[0059]
[0060] Wherein, hiddennum represents the number of nodes of the hidden layer, m represents the number of nodes of the input layer, n represents the number of nodes of the output layer, and a represents an integer between 1 and 10.
[0061] After setting the training parameters related to the BP neural network, the first grounding grid corrosion rate of the original small sample and the first grounding grid soil physicochemical data are imported into the BP neural network for training, the BP neural network learns the correlation between these data, and the grounding grid corrosion rate prediction inversion model is obtained after training.
[0062] Step S102: input the second grounding grid corrosion rate into the grounding grid corrosion rate prediction inversion model, and output the second grounding grid soil physicochemical data.
[0063] Wherein, the second grounding grid corrosion rate is randomly generated by the unifrnd function. Specifically, for the grounding grid of an area, the actual range of the grounding grid corrosion rate of the area is determined according to the grounding grid corrosion rate obtained in advance by the weight loss method, and the unifrnd function is used to generate a uniformly distributed second grounding grid corrosion rate random number. Uniform distribution is a kind of probability distribution, in which the probability of each number appearing in a given interval is equal.
[0064] Step S103: combine the first grounding grid soil physicochemical data and the second grounding grid soil physicochemical data to obtain the third grounding grid soil physicochemical data, and combine the first grounding grid corrosion rate and the second grounding grid corrosion rate to obtain the third grounding grid corrosion rate.
[0065] The generated random second grounding grid corrosion rate vector V = {v m+1 …v l} and the first grounding grid corrosion rate vector V = {v1…v k …v m} together form V = {v1…v m …v l} as the input of the grounding grid corrosion rate prediction inversion model, wherein l > m. According to the inversion model, new second grounding grid soil physicochemical data is output as an extended set of physicochemical data, and the grounding grid corrosion rate data enhancement method after this step obtains the expanded grounding grid corrosion rate prediction data space as follows:
[0066]
[0067] Wherein, the soil sample number i m The l-m dimensional data thereafter is newly generated data after data enhancement.
[0068] Through the data enhancement of the present step, the obtained second grounding net soil physicochemical data and the original first grounding net soil physicochemical data together constitute data for training a BP neural network model, which can improve the generalization ability and accuracy of the BP neural network model.
[0069] In the existing field of neural network-based grounding net corrosion prediction, in the face of small samples, unifrnd is often directly used to randomly expand the data, ignoring the action law characteristics between the soil physicochemical factors and the target output corrosion rate, and also ignoring the interaction between the characteristics of the soil physicochemical factors, so there is a problem of low training precision for subsequent neural network training, and the grounding net corrosion rate data enhancement method proposed in the embodiments of the present application uses the high-performance fitting characteristics of the BP neural network to inverse the original small-sample grounding net corrosion rate prediction data space, expand to obtain expansion data similar to the change law of the original data samples, consider the action law characteristics between the soil physicochemical factors and the target output corrosion rate, and also consider the interaction between the characteristics of the soil physicochemical factors.
[0070] Step S104: The grounding net soil physicochemical data is taken as the input of the neural network model, and the grounding net corrosion rate is taken as the output of the neural network model, the third grounding net soil physicochemical data and the third grounding net corrosion rate are used to train the neural network model, and the weights between neurons and the thresholds of the neurons of the neural network model are optimized through the simulated annealing algorithm to obtain a grounding net corrosion rate prediction model.
[0071] Specifically, the principle of the simulated annealing algorithm is as follows:
[0072] The simulated annealing algorithm (SA) is derived from the principle of solid annealing and is a probability-based algorithm. The solid is heated to a sufficiently high temperature and then slowly cooled. When heated, the particles in the solid become disordered, the internal energy increases, and the molecules and atoms become less stable. When slowly cooled, the particles gradually become ordered, the energy decreases, and the atoms become more stable. During the cooling (temperature reduction) process, the solid reaches an equilibrium state at each temperature, and finally reaches a ground state at room temperature with the minimum internal energy. The simulated annealing algorithm starts from a relatively high initial temperature, and with the continuous decrease of the temperature parameter, the global optimal solution of the objective function in the solution space is randomly searched by combining the probability jump characteristics, that is, the local optimal solution can be probabilistically jumped out and finally tends to be globally optimal. The simulated annealing algorithm is a serial structure optimization algorithm that can effectively avoid falling into a local minimum and finally tends to be globally optimal by giving the search process a time-varying and eventually zero probability jump.
[0073] The simulated annealing algorithm comprises two parts, namely the Metropolis algorithm and the annealing process, corresponding to the inner loop and the outer loop respectively. The outer loop is the annealing process, which raises the temperature of the solid to a high temperature (i.e. the initial temperature T(0)), and then lowers the temperature according to the cooling coefficient alpha, so that the temperature decreases by a certain proportion. When the final temperature Tf is reached, the cooling is completed, i.e. the annealing process is completed.
[0074] The Metropolis algorithm is the inner loop, i.e. at each temperature, the energy minimum (i.e. the optimal solution) at that temperature is found by iterating L times. As shown in Figure 2 , the change in the energy of the solid is iterated L times at a temperature. During the iteration process at this temperature, the temperature does not change, and the energy changes. When the energy of the current state x(n) is greater than the energy of the next state x(n+1), the solution of the state x(n) is not as good as the solution of the state x(n+1), so the state x(n+1) is accepted. However, if the energy of the next state is higher than that of the previous state, an acceptance probability P is set, i.e. if the energy of the next state is higher than that of the previous state, the probability of accepting the next state is P.
[0075] Suppose that the initial state is A, and after multiple iterations, the local optimal solution is updated to B. At this time, it is found that the energy of B is lower than that of A, which means that the optimal solution is close. Therefore, the state is transferred to B with a probability of 100%, and after the state reaches B, it is found that the energy of the next step increases. If it is gradient descent, it is not allowed to continue to move forward. However, in this case, it will jump out with a certain probability, which is related to the current state, energy, etc.
[0076] The BP neural network is greatly affected by the selection of initial values, and is prone to local minimum. The gradient descent optimization iteration is time-consuming and inefficient. The SA-BP neural network optimized based on the simulated annealing algorithm effectively makes up for the local optimal solution problem of the traditional BP network, improves the learning performance and generalization ability of the network, and is an effective method to improve the training process of the neural network. The basic idea is to keep a high "temperature" and "energy" during the network iteration process, so as to avoid the network from falling into local minimum and improve the prediction accuracy.
[0077] The present application applies the simulated annealing algorithm and the BP neural network, and the basic principle is to select the initialized BP neural network through the simulated annealing method, so as to solve the problem of falling into local optimal solution due to improper BP neural network, and to cause inaccurate prediction results.
[0078] Specifically, as shown in Figure 3 , the process of optimizing the weights between neurons and the threshold of neurons of the neural network model by the simulated annealing algorithm is as follows:
[0079] 1. Initialize the weights between neurons of the neural network model and the threshold of the neurons, and the annealing temperature of the simulated annealing algorithm.
[0080] The initialized annealing temperature is usually a large value to allow the algorithm to accept poor solutions in the early stage. Since the aforementioned step performs data augmentation, the data augmentation is not an unordered expansion, and too much data augmentation can lead to the following two problems:
[0081] (1) Increase in calculation cost: Data augmentation increases the size of the search space, and the simulated annealing algorithm can waste time in an excessively large search space, resulting in reduced efficiency.
[0082] (2) Risk of overfitting: Excessive data augmentation can also lead to loss of data patterns, and excessive data augmentation can cause the model to learn unrealistic features.
[0083] To solve these two problems, the amount of data augmentation is associated with the cooling coefficient of the simulated annealing to form an organic combination, thereby improving the problems of increased calculation cost and overfitting of the simulated annealing in the context of sample augmentation.
[0084] Therefore, compared with the annealing algorithm of the prior art, the embodiment of the present application establishes an association between the sample augmentation amount and the cooling coefficient in the context of sample augmentation, thereby performing adaptive parameter adjustment, controlling the speed of temperature drop, obtaining the best sample augmentation value, and improving the model precision while controlling the calculation amount and preventing overfitting.
[0085] Specifically, the cooling coefficient of the simulated annealing algorithm of the embodiment of the present application is calculated as follows:
[0086]
[0087] wherein a represents the cooling coefficient, and I represents the total number of the third grounding grid soil physicochemical data. It should be understood that the cooling coefficient should be between 0 and 1.
[0088] The cooling coefficient thus designed makes the combination of the aforementioned data augmentation and simulated annealing algorithm better, and can effectively avoid conflicts caused by the combination of the two.
[0089] The effect of the cooling coefficient of the embodiment of the present application will be described below by comparison.
[0090] The functions of the two cooling coefficients, test function 1: and test function 2: are compared with the prediction effect of the target function of the cooling coefficient of the embodiment of the present application, and 100 groups of test samples are selected as the test set to test the error of the neural network model. The test results are as followsFigure 4 The cooling function of the simulated annealing algorithm is calculated as follows: Figure 4 The calculation formula of the cooling coefficient of the embodiment of the application has good effect and is more accurate in prediction.
[0091] 2. Set the energy function of the neural network model.
[0092] Specifically, the energy function is as follows:
[0093]
[0094] wherein E(w,b) represents the energy, w represents the weight between neurons, b represents the threshold of the neuron, y i represents the target output of the i-th training sample, represents the actual output of the neural network model of the i-th training sample, and N represents the number of training samples.
[0095] 3. Perform iteration at the current annealing temperature, in each iteration, update the weight between neurons, and calculate the updated energy according to the updated weight between neurons by using the energy function, and according to the updated energy and the energy before updating, determine whether to accept the updated weight between neurons and the threshold of the neuron by using the Metropolis criterion, and then update the annealing temperature by using the annealing function of the simulated annealing algorithm.
[0096] A new solution, i.e., the weight w' of the neuron element, is generated by a small perturbation, and the energy E(w',b') of the new solution is calculated.
[0097] According to the updated energy and the energy before updating, the energy change ΔE=E(w',b')-E(w,b) is calculated. If ΔE<0, the new solution w' and b' are accepted. If ΔE≥0, the new solution is accepted with a probability P=exp(-ΔE / T), i.e., a uniformly distributed random number r in the interval [0,1] is generated by a computer, and the generated random number r is compared with the acceptance probability P. If r≤P, the new solution is accepted, i.e., the energy of the new solution is higher than the current solution; if r>P, the new solution is rejected, and the current solution remains unchanged, which allows the algorithm to accept a worse solution with a certain probability to avoid falling into a local optimum.
[0098] The calculation formula of the cooling function of the simulated annealing algorithm is as follows:
[0099] T k+1 =a×T k .
[0100] wherein T k+1 represents the annealing temperature of the k+1 iteration, and T k represents the annealing temperature of the k iteration.
[0101] 4. Repeat the iteration until a preset stop condition is met, and output the current weights between neurons and the threshold of neurons as the weights between neurons and the threshold of neurons of the trained neural network model.
[0102] The stop condition can be that the temperature drops to a certain threshold T min , or the number of iterations reaches a certain number.
[0103] When the algorithm terminates, the optimal weights and thresholds found at present are output, which define the optimized BP neural network.
[0104] Step S105: input the actually collected soil physicochemical data into the grounding grid corrosion rate prediction model, and output the grounding grid corrosion rate.
[0105] In summary, the optimal initial weights and thresholds of the BP neural network are detected by the SA algorithm in the embodiments of the present application, and the SA-BP grounding grid corrosion rate prediction model is established, so that the grounding grid corrosion rate can be accurately predicted.
[0106] In addition, the embodiments of the present application also provide a computer readable storage medium, and computer program instructions are stored on the computer readable storage medium; the computer program instructions are executed by a processor to implement the grounding grid corrosion rate prediction method described in the above embodiments.
[0107] In addition, the embodiments of the present application also provide a grounding grid corrosion rate prediction system, which comprises the computer readable storage medium described in the above embodiments.
[0108] The technical solutions of the present application will be further described below with a specific embodiment.
[0109] The data collected by a substation in Ningxia is used for model training and calculation. Since the soil physicochemical characteristic data samples are few, it may lead to the problems of poor robustness and low prediction accuracy of the prediction model, and the collected physicochemical characteristic data samples are data enhanced by the method of the embodiments of the present application. Part of the sample data is shown in Table 1.
[0110] Table 1 Part of sample data
[0111]
[0112]
[0113] The input layer nodes of the SA-BP model are 5, i.e. 5 kinds of soil physicochemical characteristics, the output layer nodes are 1, i.e. the grounding grid corrosion rate, and the hidden layer nodes are determined by the trial method according to the aforementioned empirical formula.
[0114] The normalized sample data set is divided, with 75% as the training set, 15% as the validation set, and 15% as the test set.
[0115] The initial weights and thresholds of the BP neural network are set respectively, the related parameters of the SA algorithm are set, the initial temperature is 1000, the cooling coefficient is calculated by the cooling coefficient calculation formula as 0.85, and the minimum temperature is 0.01. Iteration is performed, the maximum iteration number T is set to 500, the initial weights and thresholds of the neural network are optimized by the simulated annealing algorithm, and whether the result meets the requirements is determined. If it can be achieved, the optimal solution can be output, otherwise the iteration will continue.
[0116] Finally, the optimization result value is substituted into the BP neural network model, which meets the prediction of the test set data value.
[0117] The BP neural network model without data enhancement and the neural network model optimized by the simulated annealing algorithm are tested, and the soil physical and chemical property original sample group number is 60, of which 75% is the training set, 15% is the validation set, and 15% is the test set, that is, 10 groups of samples are tested, and the prediction result is as shown in Figure 5 .
[0118] Through Figure 5 , it can be observed that the optimized neural network has a significant improvement in prediction accuracy. Specifically, the optimized prediction curve is closer to the true value curve, which indicates that the generalization ability of the network has been enhanced. The reduction of error may be due to the global optimization of the simulated annealing algorithm in the initialization and training process of weights and thresholds, which effectively avoids the problem that BP algorithm is easy to fall into local optimum. In addition, in the iteration process of simulated annealing algorithm, by gradually reducing the "temperature" parameter, the transition from extensive search to fine search is realized, which helps the network to gradually approach the global optimal solution in the training process. Therefore, through the optimization of simulated annealing algorithm, the prediction accuracy of BP neural network in processing complex data pattern has been significantly improved, which is intuitively embodied in the comparison chart as shown in the figure.
[0119] From Figure 6 , it can be seen that the average absolute value MAE of the prediction error of the BP neural network optimized by SA decreases from 1.3408 to 0.6640, which shows that the SA algorithm has a certain effect on improving the prediction accuracy of BP neural network.
[0120] The BP neural network model with data enhancement and the neural network model optimized by the simulated annealing algorithm are tested, and the soil physical and chemical property sample group number is expanded to 430, of which 75% is the training set, 15% is the validation set, and 15% is the test set, that is, 65 groups of samples are tested, and the prediction result is as shown in Figure 7 .
[0121] After data sample augmentation, Figure 8 and Figure 6 The comparison charts clearly show that data augmentation significantly improves the network's predictive performance. The expanded dataset, by increasing the number of samples and its coverage, helps the BP neural network better learn and approximate the complex nonlinear relationship between soil physicochemical data and grounding grid corrosion rates.
[0122] Depend on Figure 8 It can be seen that the mean absolute error (MAE) of the BP neural network after SA optimization decreased from 0.4856 to 0.0231, indicating that the SA algorithm has a certain effect on improving the prediction accuracy of the BP neural network. Compared with the mean absolute error (MAE) without data augmentation, which decreased from 1.3408 to 0.6640, the mean absolute error decreased by 63.78% and 96.5% respectively, and the prediction effect was significantly improved.
[0123] To more deeply compare the prediction results of the four models, the prediction results of the four models were calculated and analyzed, and the model performance analysis table with mean squared error, mean absolute percentage error, and mean absolute error as evaluation indicators is shown in Table 2.
[0124] Table 2 Performance Analysis of Four Models
[0125]
[0126]
[0127] From Table 2, it can be seen that the traditional BP neural network without optimization and data enhancement has an average absolute error (MAE) of 1.341, an average absolute percentage error (MAPE) of 23.485%, and a mean square error (MSE) of 2.743, indicating that there is a certain deviation between the predicted value and the true value. The BP neural network optimized by the simulated annealing algorithm (SA-BP) has a significant decrease in MAE, MAPE and MSE, which are 0.664, 13.712% and 0.939 respectively, showing the advantage of the optimization algorithm in finding the global optimal solution. After further applying the data enhancement technology, the MAE of the BP neural network decreases to 0.262, the MAPE decreases to 8.779%, and the MSE decreases to 0.344, which indicates that the increase in data diversity and quantity helps to improve the generalization ability and prediction accuracy of the model. The performance of the BP neural network optimized by the simulated annealing algorithm after data enhancement is the best, with an MAE of only 0.012, an MAPE of 0.204%, and an MSE of almost 0.006. This indicates that the data enhancement technology can effectively improve the learning and fitting ability of the model to the samples, and the simulated annealing algorithm can play a role in optimizing the network structure and weight adjustment, and the combination of the two provides an effective strategy to improve the prediction performance of the BP neural network.
[0128] In summary, the embodiments of the present application can effectively improve the learning and fitting ability of the model to the samples through data enhancement technology, and the simulated annealing algorithm can play a role in optimizing the network structure and weight adjustment, and the combination of the two improves the prediction accuracy of the neural network model.
[0129] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any skilled person in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of predicting the corrosion rate of a ground grid, characterized by, The method comprises the following steps: The corrosion rate of the grounding grid is taken as the input of the neural network model, and the soil physical and chemical data of the grounding grid is taken as the output of the neural network model, the neural network model is trained by using the first corrosion rate of the grounding grid and the first soil physical and chemical data of the grounding grid, and a corrosion rate prediction inversion model of the grounding grid is obtained, wherein the first corrosion rate of the grounding grid is calculated by the weight loss method, and the first soil physical and chemical data of the grounding grid is the actual soil physical and chemical data of the collected soil sample; The second corrosion rate of the grounding grid is input into the corrosion rate prediction inversion model of the grounding grid, and the second soil physical and chemical data of the grounding grid is output, wherein the second corrosion rate of the grounding grid is randomly generated by a unifrnd function, for the grounding grid in a region, the actual range of the corrosion rate of the grounding grid in the region is determined according to the corrosion rate of the grounding grid obtained in advance by the weight loss method, and the unifrnd function is used to generate the second corrosion rate of the grounding grid in a uniform distribution; The first soil physical and chemical data of the grounding grid and the second soil physical and chemical data of the grounding grid are combined to obtain third soil physical and chemical data of the grounding grid, and the first corrosion rate of the grounding grid and the second corrosion rate of the grounding grid are combined to obtain a third corrosion rate of the grounding grid; The soil physical and chemical data of the grounding grid is taken as the input of the neural network model, and the corrosion rate of the grounding grid is taken as the output of the neural network model, the neural network model is trained by using the third soil physical and chemical data of the grounding grid and the third corrosion rate of the grounding grid, and the weights between neurons and the thresholds of the neurons of the neural network model are optimized by using the simulated annealing algorithm to obtain a corrosion rate prediction model of the grounding grid; The actual collected soil physical and chemical data is input into the corrosion rate prediction model of the grounding grid, and the corrosion rate of the grounding grid is output. The calculation formula of the cooling coefficient of the simulated annealing algorithm comprises: ; Wherein, a represents the cooling coefficient, the cooling coefficient is between 0 and 1, and I represents the total number of the third soil physical and chemical data of the grounding grid; The calculation formula of the cooling function of the simulated annealing algorithm comprises: T k+1 = a x T k ; where T k+1 represents the annealing temperature of the k+1th iteration, T k represents the annealing temperature of the kth iteration, and a represents a cooling coefficient.
2. The ground grid corrosion rate prediction method according to claim 1, characterized by, The step of optimizing the weights between neurons and the thresholds of the neurons of the neural network model by using the simulated annealing algorithm comprises: Initializing the weights between neurons and the thresholds of the neurons of the neural network model, and the annealing temperature of the simulated annealing algorithm; Setting the energy function of the neural network model; Carrying out iteration under the current annealing temperature, in each iteration, updating the weights between neurons, and calculating the updated energy by using the energy function according to the updated weights between neurons, and determining whether to accept the updated weights between neurons and the thresholds of the neurons according to the updated energy and the energy before updating by using the Metropolis criterion, and updating the annealing temperature by using the annealing function of the simulated annealing algorithm; Repeating the iteration until a preset stop condition is met, and outputting the current weights between neurons and the thresholds of the neurons as the trained weights between neurons and the thresholds of the neurons of the neural network model.
3. The ground grid corrosion rate prediction method according to claim 2, characterized by, The energy function comprises: ; where E(w,b) represents the energy, w represents the weight between neurons, b represents the threshold of the neuron, y i represents the target output of the i-th training sample, represents the actual output of the neural network model of the i-th training sample, and N represents the number of training samples.
4. The ground grid corrosion rate prediction method of claim 1, wherein: The neural network model is a BP neural network.
5. A computer-readable storage medium, characterized in that: The computer readable storage medium stores computer program instructions; the computer program instructions are executed by a processor to implement the grounding grid corrosion rate prediction method in any one of claims 1-4.
6. A ground grid corrosion rate prediction system characterized by, Comprise: The computer readable storage medium of claim 5.
Citation Information
Patent Citations
Grounding grid corrosion rate prediction method
CN107067036A
Assessment of corrosion
US6264824B1