Grounding grid corrosion rate prediction method, medium and system
Through data augmentation technology and simulated annealing algorithm, the neural network model is optimized, and the problem of inaccurate prediction of grounding network corrosion rate is solved, and the prediction accuracy and generalization ability of the model are improved.
Patent Information
- Application Number
- CN202411651198.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The prior art has problems with inaccuracy in predicting the corrosion rate of grounding grids, especially under the conditions of small sample data, the generalization ability of the model is limited and the prediction accuracy decreases.
Through data augmentation technology, the soil physical and chemical data and corrosion rate of the grounding network are combined, and the weight and threshold of the neural network model are optimized by using a simulated annealing algorithm to improve the learning and fitting ability of the model.
It effectively improves the prediction accuracy of neural network models, improves the generalization ability of the model, and solves the problem of degradation of prediction accuracy under small sample problems.
Smart Images

Figure CN119578234A_ABST
Abstract
Description
Technical Field
[0001] The present invention 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 Art
[0002] In modern power systems, the grounding grid is an important safety facility, and its stability and reliability are crucial to the safe operation of the entire system. The grounding grid is usually composed of metal conductors and buried in the soil for a long time. Due to the influence of the physical and chemical properties of the soil, the metal conductors are prone to corrosion, resulting in the degradation of the grounding grid performance or even failure. Therefore, accurately predicting the corrosion rate of the grounding grid is of great significance for evaluating its health status, formulating maintenance strategies, and extending its service life.
[0003] The physical and chemical properties of soil 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 all important factors affecting the corrosion rate. Therefore, to accurately predict the corrosion rate of the grounding grid, it is necessary to comprehensively consider the complex interactions of these physical and chemical properties of the soil.
[0004] Traditional corrosion rate prediction methods, such as electrochemical testing and field monitoring, usually require the deployment of multiple sets of sensors in the soil, which is not only costly but also difficult to implement on a large scale. In addition, these methods can only provide local or immediate corrosion status information, making it difficult to fully evaluate the overall corrosion status of the grounding grid.
[0005] In recent years, with the development of artificial intelligence technology, neural networks, as a powerful nonlinear modeling tool, have been widely used in various prediction and classification problems. In the field of grounding grid corrosion rate prediction, neural network models show great potential because they can handle complex nonlinear relationships. By learning the relationship between soil physical and chemical properties and grounding grid corrosion rate, neural networks can predict the corrosion rate of grounding grids, thus providing a scientific basis for the maintenance and management of power systems.
[0006] Although neural networks have obvious advantages in predicting the corrosion rate of grounding grids, they still face some technical challenges in practical applications:
[0007] 1. The small sample problem is one of the key factors that restrict the performance of the model. The small sample problem is mainly manifested in the following aspects:
[0008] 1. Data scarcity: Since the acquisition of grounding grid corrosion data involves complex field tests and long-term monitoring, which not only increases the difficulty of data collection, but also increases the cost. Therefore, the number of data samples that can actually be used for training is often limited.
[0009] 2. Limited generalization ability of the model: When the number of samples is insufficient, the neural network model may not be able to fully learn the complex relationship between soil physical and chemical properties and corrosion rate, resulting in limited generalization ability of the model.
[0010] 3. Decreased prediction accuracy: The small sample problem may also cause the model to have a decreased accuracy in predicting the corrosion rate of the grounding grid, which cannot meet the needs of practical applications.
[0011] 2. Limitations of BP neural network: Traditional BP neural network relies on gradient descent algorithm during training, which is easily affected by the initial weight selection and may cause the network to fall into a local optimal solution instead of 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 grounding grids. Summary of the invention
[0012] The embodiments of the present invention provide a method, medium and system for predicting the corrosion rate of a grounding grid, so as to solve the problem that the corrosion rate of a grounding grid is inaccurately predicted 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 grounding grid corrosion rate is used as the input of the neural network model and the physical and chemical data of the grounding grid soil is used as the output of the neural network model, and the first grounding grid corrosion rate and the physical and chemical data of the first grounding grid soil are used to train the neural network model to obtain a grounding grid corrosion rate prediction inversion model;
[0015] Inputting the corrosion rate of the second grounding grid into the grounding grid corrosion rate prediction inversion model, and outputting the physical and chemical data of the soil of the second grounding grid;
[0016] The first grounding grid soil physical and chemical data and the second grounding grid soil physical and chemical data are combined to obtain the third grounding grid soil physical and chemical data, and the first grounding grid corrosion rate and the second grounding grid corrosion rate are combined to obtain the third grounding grid corrosion rate;
[0017] The physical and chemical data of the soil 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 physical and chemical data of the soil of the third grounding grid and the corrosion rate of the third grounding grid 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 a simulated annealing algorithm to obtain a grounding grid corrosion rate prediction model;
[0018] The actual soil physical and chemical data collected are input into the grounding grid corrosion rate prediction model to output the grounding grid corrosion rate.
[0019] In a second aspect, a computer-readable storage medium is provided, on which computer program instructions are stored; when the computer program instructions are executed by a processor, the method for predicting the corrosion rate of the grounding grid as described in the embodiment of the first aspect is implemented.
[0020] In a third aspect, a grounding grid corrosion rate prediction system is provided, comprising: a computer-readable storage medium as described in the embodiment of the second aspect.
[0021] In this way, the embodiment of the present invention can effectively improve the model's learning and fitting capabilities for samples through data enhancement technology, and can play a role in optimizing network structure and weight adjustment through the simulated annealing algorithm. The combination of the two improves the prediction accuracy of the neural network model. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0023] Figure 1 is a flow chart of a method for predicting grounding grid corrosion rate according to an embodiment of the present invention;
[0024] Figure 2 It is a schematic diagram of simulated annealing algorithm optimization;
[0025] Figure 3 It is the simulated annealing algorithm flow chart;
[0026] Figure 4 It is a schematic diagram of the prediction comparison effect under different annealing coefficients;
[0027] Figure 5 It is a schematic diagram comparing the predicted value and the true value of the BP neural network before and after data enhancement optimization;
[0028] Figure 6 It is a schematic diagram of the comparison of the error between the BP neural network prediction value and the true value before and after the optimization of the unexpanded data set;
[0029] Figure 7 It is a schematic diagram comparing the predicted value and the true value of the BP neural network before and after data enhancement optimization;
[0030] Figure 8 It is a schematic diagram of the error comparison between the BP neural network prediction value and the true value before and after data enhancement optimization. DETAILED DESCRIPTION
[0031] 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 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.
[0032] The embodiment of the present invention discloses a method for predicting the corrosion rate of a grounding grid. Figure 1 As shown, the method of the embodiment of the present invention includes the following steps:
[0033] Step S101: taking the grounding grid corrosion rate as the input of the neural network model and the grounding grid soil physical and chemical data as the output of the neural network model, using the first grounding grid corrosion rate and the first grounding grid soil physical and chemical data to train the neural network model to obtain 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 invention may adopt a BP neural network.
[0035] BP neural network is a network model that uses reverse error transmission, which consists of an input layer, an output layer, and several hidden layers. BP neural network has strong learning ability, simple structure, and stable model. It is a widely used neural network structure.
[0036] In the BP neural network model, the functional relationship between its input and output is as follows:
[0037]
[0038] In the formula, x i is the input vector, the subscript i is the index of each input node in the input vector, that is, the input feature i, w i is the weight between neurons, b is the threshold of neurons, 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 BP neural network include: 1. Forward information transmission, the input of the network is forwardly diffused from the input layer to the hidden layer and output layer. 2. Reverse information transmission, the error between the actual value and the predicted value is reversely transmitted to modify the weights and thresholds between each layer.
[0040] Its function expression is as follows:
[0041] 1. Positive information transmission:
[0042] The output of the i-th network neuron in the hidden layer is:
[0043]
[0044] Among them, y 1i is the output of the i-th hidden layer neuron, w 1ij is the weight from the jth neuron in the input layer to the ith neuron in the hidden layer, x j is the weight from the jth neuron in the input layer to the ith neuron in the hidden layer, b 1i is the threshold of the i-th neuron in the hidden layer, f1 is the activation function used in the hidden layer, which determines how the output of the neuron changes with the change of the input, r is the number of neurons in the input layer, that is, 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 kth neuron in the output layer is:
[0046]
[0047] Among them, y 2k is the output of the kth neuron in the output layer, w kj is the weight from the jth neuron in the hidden layer to the kth neuron in the output layer. 2k is the threshold of the kth neuron in the output layer, f2 is the activation function used in the output layer, k = 1, 2, ..., n.
[0048] 2. Error function backward transfer:
[0049] The error function is propagated backwards to modify the weights and thresholds between layers. After the change, the weights and thresholds between the i-th neurons in the hidden layer and the k-th neurons in the output layer are:
[0050] Δw 2ki =ηδ ki y 1i
[0051] Δb 2ki =ηδ ki
[0052] Among them, △w 2ki represents the weight change between the i-th neuron in the hidden layer and the k-th neuron in the output layer, △b 2ki represents the threshold change between the i-th neuron in the hidden layer and the k-th neuron in the output layer, η represents the network learning rate, δ ki represents the error gradient of the kth neuron in the output layer.
[0053] The first grounding grid soil physicochemical data may be actual soil physicochemical data of collected soil samples, which are the basis for predicting the corrosion rate of the grounding grid. Since it is difficult to obtain the soil physicochemical data, the number of soil physicochemical data of the first grounding grid is small, and it belongs to a small sample. Specifically, the grounding grid soil physicochemical data includes: water content, resistivity, porosity, sulfate ions, chloride ions, and corrosion rate. The grounding grid soil physicochemical data may also select other suitable physicochemical data according to actual conditions.
[0054] The corrosion rate of the first grounding grid 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 metal (the weight loss method is used to calculate the metal corrosion rate in accordance with the provisions of GB / T16545-2015). The physical and chemical data of the first grounding grid soil of each soil sample numbered I corresponds to the corrosion rate of the first grounding grid.
[0055] Set the soil physical and chemical data of n types of first grounding grid {u1, u2, ..., u n}, the first grounding grid corrosion rate V, the first grounding grid soil physical and chemical data of m soil samples and the first grounding grid corrosion rate constitute the sample space used to obtain the grounding grid corrosion rate prediction inversion model, which is recorded as:
[0056]
[0057] Among them, u mn represents the soil physical and chemical data of the first grounding grid of the nth type of the mth soil sample, v m represents the corrosion rate of the first grounding grid of the mth soil sample, i m It should be understood that the grounding grid corrosion rate and grounding grid soil physical and chemical data described in the embodiment of the present invention are pre-normalized. The normalization can be performed using a normalization method commonly used in the prior art.
[0058] The first grounding grid corrosion rate and the first grounding grid soil physical and chemical data are used to train the neural network model. The first grounding grid corrosion rate vector V is used as the input of the BP neural network, and the first grounding grid soil physical and chemical data n-dimensional vector {u1, u2, ..., u n As the output of the BP neural network, the number of input layer nodes is set to 1, corresponding to the corrosion rate of the first grounding grid, and the number of output layer nodes is set to n, corresponding to the n-dimensional vector of the soil physical and chemical data of the first grounding grid. The hidden layer nodes of the neural network model are determined by the heuristic method according to the empirical formula. The formula is as follows:
[0059]
[0060] Among them, hiddennum represents the number of nodes in the hidden layer, m represents the number of nodes in the input layer, n represents the number of nodes in the output layer, and a represents an integer between 1 and 10.
[0061] After setting the relevant training parameters of the BP neural network, the corrosion rate of the first grounding grid and the physical and chemical data of the first grounding grid soil of the original small sample are imported into the BP neural network for training. The BP neural network learns the relationship between these data. After the training is completed, the grounding grid corrosion rate prediction inversion model is obtained.
[0062] Step S102: inputting the corrosion rate of the second grounding grid into the grounding grid corrosion rate prediction inversion model, and outputting the physical and chemical data of the soil of the second grounding grid.
[0063] The second grounding grid corrosion rate is randomly generated by the unifrnd function. Specifically, for a grounding grid in a region, the actual range of the grounding grid corrosion rate in the region is determined based on the grounding grid corrosion rate obtained in advance by the weight loss method, and the unifrnd function is used to generate uniformly distributed random numbers of the second grounding grid corrosion rate. Uniform distribution is a probability distribution in which the probability of each number appearing in a given interval is equal.
[0064] Step S103: combining the physical and chemical data of the first grounding grid soil and the physical and chemical data of the second grounding grid soil to obtain the physical and chemical data of the third grounding grid soil, and combining 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, where l>m. According to the inversion model, the new second grounding grid soil physical and chemical data is output as the extended set of physical and chemical data. Then, the grounding grid corrosion rate prediction data space after the expansion is obtained by the grounding grid corrosion rate data enhancement method in this step is as follows:
[0066]
[0067] The soil sample number is i. m The subsequent lm-dimensional data is the newly generated data after data enhancement.
[0068] Through the data enhancement in this step, the obtained second grounding grid soil physical and chemical data and the original first grounding grid soil physical and chemical data are combined to form data for training the BP neural network model, which can improve the generalization ability and accuracy of the BP neural network model.
[0069] In the existing field of grounding grid corrosion prediction based on neural network, when faced with small samples, unifrnd is often used to randomly expand the data, ignoring the action law characteristics between soil physical and chemical factors and target output corrosion rate, and also ignoring the interaction between the characteristics of various soil physical and chemical factors. Therefore, there is a problem of low training accuracy for subsequent neural network training. The grounding grid corrosion rate data enhancement method proposed in the embodiment of the present invention utilizes the high-performance fitting characteristics of the BP neural network to invert the original small sample grounding grid corrosion rate prediction data space, and expands the expanded data that is similar to the change law of the original data sample, taking into account the action law characteristics between soil physical and chemical factors and target output corrosion rate, and also taking into account the interaction between the characteristics of various soil physical and chemical factors.
[0070] Step S104: using the physical and chemical data of the grounding grid soil as the input of the neural network model and the grounding grid corrosion rate as the output of the neural network model, using the third grounding grid soil physical and chemical data and the third grounding grid corrosion rate to train the neural network model, and optimizing the weights between neurons and the thresholds of neurons in the neural network model through a simulated annealing algorithm to obtain a grounding grid 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. When the solid is heated to a sufficiently high temperature and then cooled slowly, the particles inside the solid become disordered as the temperature rises, the internal energy increases, and the molecules and atoms become more unstable. When slowly cooled, the particles gradually become ordered, the energy decreases, and the atoms become more stable. During the cooling (cooling) process, the solid reaches an equilibrium state at each temperature, and finally reaches the ground state at room temperature, and the internal energy is reduced to a minimum. Starting from a relatively high initial temperature, the simulated annealing algorithm combines the probability jump characteristics to randomly search for the global optimal solution of the objective function in the solution space as the temperature parameter continues to decrease, that is, the local optimal solution can probabilistically jump out and eventually tend to the global optimal. The simulated annealing algorithm is an optimization algorithm for a serial structure that effectively avoids falling into a local minimum and eventually tends to the global optimal by giving the search process a time-varying and eventually zero probability jump.
[0073] The simulated annealing algorithm consists of two parts, namely the Metropolis algorithm and the annealing process, which correspond to the inner loop and the outer loop respectively. The outer loop is the annealing process, which brings the solid to a higher temperature (i.e., the initial temperature T(0)), and then reduces the temperature in a certain proportion according to the cooling coefficient alpha. When the termination temperature Tf is reached, the cooling ends, that is, the annealing process ends.
[0074] The Metropolis algorithm is an inner loop, that is, at each temperature, it iterates L times to find the minimum energy (i.e. the optimal solution) at that temperature. Figure 2 The figure shows the change in solid energy at one temperature after L iterations. At this temperature, the temperature does not change during the entire iteration process, but the energy changes. When the energy of the previous state x(n) is greater than the energy of the next state x(n+1), the solution of state x(n) is not as good as the solution of state x(n+1), so 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, that is, 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] Assume that the starting state is A, and after multiple iterations it is updated to the local optimal solution of B. At this time, it is found that when updating to B, the ability is lower than A, which means that it is close to the optimal solution. Therefore, it is transferred 100%. After the state reaches B, it is found that the energy has increased in the next step. If it is a gradient descent, it is not allowed to move forward. Here it will jump out with a certain probability. This probability is related to the current state, energy, etc.
[0076] BP neural network is greatly affected by the selection of initial values and is prone to fall into local minima. The number of iterations of gradient descent optimization is large and inefficient. SA-BP neural network optimized based on simulated annealing algorithm effectively makes up for the local optimal solution problem of traditional BP network by introducing global search and acceptance probability control, improves the learning performance and generalization ability of the network, and is an effective method to improve the neural network training process. Its basic idea is to ensure that the "temperature" and "energy" of the network are always high during the iteration process, so as to avoid the network from falling into local minima and improve the prediction accuracy.
[0077] The present invention combines the simulated annealing algorithm with the BP neural network for application. The basic principle is to select the initialized BP neural network through simulated annealing to solve the problem that the BP neural network is improperly trapped in the local optimal solution and causes inaccurate prediction results.
[0078] Specifically, Figure 3 As shown in the figure, the process of optimizing the weights between neurons and the thresholds of neurons in the neural network model by simulated annealing algorithm is as follows:
[0079] 1. Initialize the weights between neurons and the thresholds of neurons in the neural network model, as well as 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 stages. Since the data expansion is performed in the previous steps, the data expansion is not disorderly expansion. When the data samples are expanded too much, it will cause the following two problems:
[0081] (1) Increased computational cost: As the data space increases, data expansion will increase the size of the search space. The simulated annealing algorithm may waste time in an overly large search space, resulting in reduced efficiency.
[0082] (2) Overfitting risk: Excessive data augmentation may also lead to the loss of data patterns. Excessive data augmentation may cause the model to learn unrealistic features.
[0083] In order to solve these two problems, a correlation is established between the data expansion amount and the simulated annealing cooling coefficient to form an organic combination, thereby improving the problems of increased computational cost of simulated annealing and overfitting of grounding grid corrosion rate prediction under the background of sample expansion.
[0084] Therefore, compared with the annealing algorithm of the prior art, the embodiment of the present invention establishes a design that associates the sample expansion amount with the temperature reduction coefficient under the background of sample expansion, thereby performing adaptive parameter adjustment, controlling the speed of temperature drop, and obtaining the optimal sample expansion value, thereby improving the model accuracy while controlling the amount of calculation and preventing overfitting.
[0085] Specifically, the calculation formula of the temperature reduction coefficient of the simulated annealing algorithm of the embodiment of the present invention is as follows:
[0086]
[0087] Where a represents the temperature reduction coefficient, and I represents the total number of soil physical and chemical data of the third grounding grid. It should be understood that the temperature reduction coefficient should be between 0 and 1.
[0088] The cooling coefficient designed in this way makes the combination of the aforementioned data expansion and simulated annealing algorithms more effective and can effectively avoid conflicts caused by the combination of the two.
[0089] The effect of the temperature reduction coefficient of the embodiment of the present invention is described below by comparison.
[0090] The functions of the two cooling coefficients are tested as function 1: And test function 2: Compared with the prediction effect of the objective function of the cooling coefficient of the embodiment of the present invention, 100 groups of test samples were selected as the test set to test the neural network model error. The test results are as follows Figure 4 As shown. Figure 4 It shows that the calculation formula of the temperature reduction coefficient of the embodiment of the present invention has a better effect and the prediction is more accurate.
[0091] 2. Set the energy function of the neural network model.
[0092] Specifically, the energy function is as follows:
[0093]
[0094] Among them, E(w,b) represents energy, w represents the weight between neurons, b represents the threshold of neurons, and 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. Iterate at the current annealing temperature. In each iteration, update the weights between neurons, and use the energy function to calculate the updated energy based on the updated weights between neurons. Based on the updated energy and the energy before the update, use the Metropolis criterion to determine whether to accept the updated weights between neurons and the threshold of neurons, and then use the annealing function of the simulated annealing algorithm to update the annealing temperature.
[0096] A new solution, namely the weight w' of the neural element, is generated through 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 the update, calculate the energy change ΔE=E(w′,b′)-E(w,b). If ΔE<0, accept the new solutions w' and b'. If ΔE≥0, accept the new solution with probability P=exp(-ΔE / T), that is, the computer generates a uniformly distributed random number r in the interval [0,1], and compares the generated random number r with the acceptance probability P. If r≤P, accept the new solution, even if the energy of the new solution is higher than the current solution; if r>P, reject the new solution and keep the current solution unchanged, which allows the algorithm to accept worse solutions with a certain probability to avoid falling into the 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] Among them, T k+1 represents the annealing temperature of the k+1th iteration, T k represents the annealing temperature of the kth iteration.
[0101] 4. Repeat the iteration until the preset stop condition is met, and output the current inter-neuron weights and neuron thresholds as the inter-neuron weights and neuron thresholds 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 is reached.
[0103] When the algorithm terminates, the currently found optimal weights and thresholds are output. These parameters define the optimized BP neural network.
[0104] Step S105: inputting the actually collected soil physical and chemical data into the grounding grid corrosion rate prediction model, and outputting the grounding grid corrosion rate.
[0105] In summary, the SA algorithm is used in the embodiment of the present invention to detect the optimal initial weights and thresholds of the BP neural network, and a SA-BP-based grounding grid corrosion rate prediction model is established, thereby accurately predicting the grounding grid corrosion rate.
[0106] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which computer program instructions are stored; when the computer program instructions are executed by a processor, the grounding grid corrosion rate prediction method as described in the above embodiment is implemented.
[0107] In addition, an embodiment of the present invention further provides a grounding grid corrosion rate prediction system, comprising: a computer-readable storage medium as described in the above embodiment.
[0108] The technical solution of the present invention is further described below with reference to a specific embodiment.
[0109] The data collected from a substation in Ningxia was used for model training and calculation. Since there are few samples of soil physical and chemical characteristics data, which may lead to poor robustness of the prediction model and low prediction accuracy, the method of the embodiment of the present invention was used to enhance the collected physical and chemical characteristics data samples. Some sample data are shown in Table 1 below.
[0110] Table 1 Part of sample data
[0111]
[0112]
[0113] The input layer nodes of the SA-BP model are 5, i.e., 5 soil physical and chemical characteristics, the output layer node is 1, i.e., the grounding grid corrosion rate, and the hidden layer nodes are determined by the heuristic method according to the aforementioned empirical formula.
[0114] The normalized sample data set is divided into 75% for training set, 15% for validation set, and 15% for test set.
[0115] The initial weights and thresholds of the BP neural network are set respectively, and the relevant parameters of the SA algorithm are set. The initial temperature is 1000, and the cooling coefficient is calculated as 0.85 through the cooling coefficient calculation formula, and the minimum temperature is 0.01. Perform iterations, set the maximum number of iterations T to 500, and optimize the initial weights and thresholds of the neural network through the simulated annealing algorithm to determine whether the results meet the requirements. If they 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 to meet the prediction of the test set data value.
[0117] The BP neural network model without data enhancement and the neural network model optimized by simulated annealing algorithm were tested. The original sample groups of soil physical and chemical properties were 60 groups, of which 75% were training sets, 15% were validation sets, and 15% were test sets, that is, 10 groups of samples were tested. The prediction results are as follows Figure 5 shown.
[0118] pass 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 in error may be due to the global optimization of the simulated annealing algorithm during the initialization of weights and thresholds and the training process, which effectively avoids the problem that the BP algorithm is prone to fall into the local optimum. In addition, during the iteration of the simulated annealing algorithm, the transition from extensive search to fine search is achieved by gradually reducing the "temperature" parameter, which helps the network gradually approach the global optimal solution during the training process. Therefore, through the optimization of the simulated annealing algorithm, the prediction accuracy of the BP neural network when processing complex data patterns has been significantly improved, which is intuitively reflected in the comparison diagram shown in the figure.
[0119] Depend on Figure 6 It can be seen that the mean absolute value MAE of the prediction error of the BP neural network after SA optimization dropped from the original 1.3408 to 0.6640, indicating that the SA algorithm has a certain effect in improving the prediction accuracy of the BP neural network.
[0120] The BP neural network model after data enhancement and the neural network model after simulated annealing algorithm optimization were tested. The number of soil physical and chemical property sample groups was expanded to 430 groups, of which 75% were training sets, 15% were validation sets, and 15% were test sets, that is, 65 groups of samples were tested. The prediction results are as follows Figure 7 shown.
[0121] After data sample expansion, Figure 8 and Figure 6 From the comparison chart, it can be observed that data expansion significantly improves the prediction performance of the network. The expanded data set helps the BP neural network to better learn and approximate the complex nonlinear relationship between soil physical and chemical data and grounding grid corrosion rate by increasing the number of samples and coverage.
[0122] Depend on Figure 8 It can be seen that the mean absolute value MAE of the prediction error of the BP neural network after SA optimization has dropped from the original 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 value MAE without data enhancement, which has dropped from the original 1.3408 to 0.6640, the mean absolute error has been reduced by 63.78% and 96.5% respectively, and the prediction effect has been significantly improved.
[0123] In order to make a more in-depth comparison of the prediction results of the four models, the prediction results of the four models were calculated and analyzed, and a model performance analysis table with mean square error, mean absolute percentage error and mean absolute error as evaluation indicators was obtained, as shown in Table 2.
[0124] Table 2 Performance analysis of four models
[0125]
[0126]
[0127] As shown in Table 2, the mean absolute error (MAE) of the traditional BP neural network without optimization and data enhancement is 1.341, the mean absolute percentage error (MAPE) is 23.485%, and the mean square error (MSE) is 2.743, which indicates that there is a certain deviation between its predicted value and the true value. The BP neural network (SA-BP) optimized by the simulated annealing algorithm has a significant decrease in MAE, MAPE and MSE, which are 0.664, 13.712% and 0.939 respectively, showing the advantages of the optimization algorithm in finding the global optimal solution. After further application of data enhancement technology, the MAE of the BP neural network dropped to 0.262, MAPE dropped to 8.779%, and MSE dropped 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 BP neural network optimized by the simulated annealing algorithm after data enhancement has the best performance, with a MAE of only 0.012, a MAPE of 0.204%, and an MSE of almost 0.006. This shows that data augmentation technology can effectively improve the model's learning and fitting ability for samples, while the simulated annealing algorithm can play a role in optimizing the network structure and weight adjustment. The combination of the two provides an effective strategy for improving the prediction performance of the BP neural network.
[0128] In summary, the embodiments of the present invention can effectively improve the model's learning and fitting capabilities for samples through data enhancement technology, and can play a role in optimizing the network structure and weight adjustment through the simulated annealing algorithm. The combination of the two improves the prediction accuracy of the neural network model.
[0129] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for predicting the corrosion rate of a grounding grid, characterized in that: include: The grounding grid corrosion rate is used as the input of the neural network model and the physical and chemical data of the grounding grid soil is used as the output of the neural network model, and the first grounding grid corrosion rate and the physical and chemical data of the first grounding grid soil are used to train the neural network model to obtain a grounding grid corrosion rate prediction inversion model; Inputting the corrosion rate of the second grounding grid into the grounding grid corrosion rate prediction inversion model, and outputting the physical and chemical data of the soil of the second grounding grid; The first grounding grid soil physical and chemical data and the second grounding grid soil physical and chemical data are combined to obtain the third grounding grid soil physical and chemical data, and the first grounding grid corrosion rate and the second grounding grid corrosion rate are combined to obtain the third grounding grid corrosion rate; The physical and chemical data of the soil 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 physical and chemical data of the soil of the third grounding grid and the corrosion rate of the third grounding grid 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 a simulated annealing algorithm to obtain a grounding grid corrosion rate prediction model; The actual collected soil physical and chemical data are input into the grounding grid corrosion rate prediction model to output the grounding grid corrosion rate.
2. The method for predicting grounding grid corrosion rate according to claim 1, characterized in that: The calculation formula of the temperature reduction coefficient of the simulated annealing algorithm includes: Wherein, a represents the temperature reduction coefficient, and I represents the total amount of soil physical and chemical data of the third grounding grid.
3. The method for predicting grounding grid corrosion rate according to claim 2, characterized in that: The calculation formula of the cooling function of the simulated annealing algorithm includes: T k+1 =a×T k ; Among them, T k+1 represents the annealing temperature of the k+1th iteration, T k represents the annealing temperature of the kth iteration.
4. The method for predicting grounding grid corrosion rate according to claim 1, characterized in that: The step of optimizing the inter-neuron weights and neuron thresholds of the neural network model by using a simulated annealing algorithm comprises: Initializing the weights between neurons and the thresholds of neurons in the neural network model, as well as the annealing temperature of the simulated annealing algorithm; Setting an energy function of the neural network model; Iterate at the current annealing temperature, update the weights between the neurons in each iteration, and calculate the updated energy according to the updated weights between the neurons using the energy function, determine whether to accept the updated weights between the neurons and the threshold of the neurons according to the updated energy and the energy before the update using the Metropolis criterion, and then update the annealing temperature using the annealing function of the simulated annealing algorithm; The iteration is repeated until a preset stop condition is met, and the current inter-neuron weights and neuron thresholds are output as the inter-neuron weights and neuron thresholds of the trained neural network model.
5. The method for predicting grounding grid corrosion rate according to claim 1, characterized in that: The second grounding grid corrosion rate is randomly generated by the unifrnd function.
6. The method for predicting the corrosion rate of a grounding grid according to claim 5, characterized in that: The energy function includes: Among them, E(w,b) represents energy, w represents the weight between neurons, b represents the threshold of neurons, and 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.
7. The method for predicting grounding grid corrosion rate according to claim 1, characterized in that: The neural network model is a BP neural network.
8. The method for predicting grounding grid corrosion rate according to claim 7, characterized in that: The number of nodes in the hidden layer of the neural network model is: Among them, hiddennum represents the number of nodes in the hidden layer, m represents the number of nodes in the input layer, n represents the number of nodes in the output layer, and a represents an integer between 1 and 10.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the grounding grid corrosion rate prediction method according to any one of claims 1 to 8 is implemented.
10. A grounding grid corrosion rate prediction system, characterized in that: include: The computer readable storage medium of claim 9.
Citation Information
Patent Citations
Grounding grid corrosion rate prediction method
CN107067036A
Method and system for predicting soil corrosion rate through BP neural network based on genetic algorithm
CN116955946A
A method and system for predicting pipeline corrosion
US20230034897A1
Assessment of corrosion
US6264824B1
Cited By
Soil resistivity three-dimensional reconstruction method and system, computer equipment and medium
CN121437808A
A soil resistivity three-dimensional reconstruction method, system, computer device and medium
CN121437808B