Runoff prediction method for optimizing neural network based on hybrid optimization algorithm

By using a hybrid optimization algorithm to optimize neural network parameters in runoff prediction, the problems of low prediction accuracy and complex calculation in the prior art are solved, and high-precision and fast runoff prediction are achieved.

CN119514784APending Publication Date: 2025-02-25STATE GRID HENAN ELECTRIC POWER ELECTRIC POWER SCI RES INST
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411594485.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-09
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing runoff prediction methods have problems such as low prediction accuracy, complex calculation, cumbersome data processing and long time.

Method used

The runoff prediction method based on the hybrid optimization algorithm (simulated annealed particle swarm optimization algorithm) is adopted to optimize the neural network parameters, and quickly converge, avoid falling into the local optimal solution and improve prediction accuracy.

Benefits of technology

High accuracy and rapid convergence of runoff prediction are achieved, local optimal solutions are avoided, and prediction accuracy is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119514784A_ABST
    Figure CN119514784A_ABST
Patent Text Reader

Abstract

The invention discloses a runoff prediction method for optimizing a neural network based on a hybrid optimization algorithm, and belongs to the technical field of hydrological forecasting. Neural network parameters are optimized through an SAPSO algorithm (simulated annealing particle swarm optimization), and daily runoff prediction is further carried out. The method comprises the following steps: setting parameters of a neural network and an optimization algorithm, including the number of input layer nodes, the number of hidden layer nodes, the number of training times, the population scale and the like; the method comprises the following steps: dividing ten-year daily runoff actual measurement data of a Taojiang station into a training set and a test set, and carrying out normalization processing to prepare for training and testing of a neural network; the weight and the threshold of the neural network are randomly initialized, parameters are transmitted to a simulated annealing particle swarm optimization algorithm for iterative optimization, optimal network parameters are obtained, and a prediction network model is established; and training the network model by using the grouped training set data, and predicting the runoff volume of the Taojiang station by using the training model. And the prediction precision of the runoff volume is obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of hydrological forecasting, in particular to a runoff prediction method based on a hybrid optimization algorithm to optimize a neural network. Background Art

[0002] With global climate change, the climate characteristics of different regions have changed significantly, causing significant changes in the hydrological process of the basin, and frequent natural disasters such as droughts and floods. This has put forward severe challenges for the rational allocation of water resources in the basin and the prevention of natural disasters, and has put forward higher requirements for the prediction of river runoff. At present, scholars at home and abroad have done a lot of research work.

[0003] For example, in 2018, Qi Yinfeng et al. proposed a neural network reservoir inflow prediction method based on genetic algorithm. This method used genetic algorithm to iteratively optimize the neural network parameters to obtain a set of optimal network parameters, construct a network model, train the network and make predictions. Compared with the neural network model, this method has higher prediction accuracy, but due to the limitations of the genetic algorithm itself, the search speed is slow and the training takes a long time; in 2022, Wang Wanliang et al. proposed an improved temporal convolutional network and long short-term memory network runoff prediction model. By constructing a parallel network with multiple convolution kernels to extract multi-source time series features and maintaining the cause-effect convolution characteristics, dilated convolution is introduced to extract high-order hydrological features and improve the processing efficiency of long-span memory units. This method has high prediction accuracy, but the network model is complex and processes a large amount of data.

[0004] For example, publication number CN 116050595 A discloses a runoff prediction method that couples an attention mechanism with a decomposition mechanism. The standardized runoff sequence is respectively input into a time series decomposition module, a multi-head self-attention module, and a temporal convolutional network to obtain prediction components, and then the components are weighted added to obtain a coupled prediction sequence. This method has high prediction accuracy, but the data processing process is cumbersome and the model calculation amount is large; publication number CN 115455817 A discloses a short-term runoff hydrological prediction method based on deep learning. This method uses preprocessed data to train an LSTMAttention model, an Encoder Decoder model, and a Prophet model respectively and perform runoff prediction, and then takes the average of the training results of the three models as the final prediction result, thereby improving the accuracy of the prediction results. However, this method requires the establishment of three network models, and the training and prediction are performed separately. The prediction model is complex, a large amount of data needs to be processed, and it takes a long time. Summary of the invention

[0005] In view of this, the present invention aims at the deficiencies in the prior art and provides a runoff prediction method based on optimizing a neural network using a hybrid optimization algorithm. The method uses a simulated annealing particle swarm optimization algorithm to optimize the neural network parameters, and then uses the neural network to predict the runoff. The method has a fast convergence speed and can effectively avoid falling into a local optimal solution, and has a high prediction accuracy.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a runoff prediction method based on a hybrid optimization algorithm to optimize a neural network comprises the following steps:

[0007] Step I: Collect daily runoff data of the hydropower station for ten years;

[0008] Step II: Divide the daily runoff series into training set and test set;

[0009] Step III: Normalize the data;

[0010] Step IV: Setting the parameters of the neural network and hybrid optimization algorithm;

[0011] Step V: Optimize the neural network parameters using a hybrid optimization algorithm;

[0012] Step VI: Use the runoff data obtained in step III to train the neural network;

[0013] Step VII: Use the network model to predict runoff;

[0014] Step VIII: Denormalize the predicted runoff value;

[0015] Step IX: Evaluate the runoff prediction accuracy of the neural network.

[0016] Furthermore, in step I, a computer program is used to read and store the daily runoff data of the hydropower station for ten years.

[0017] Furthermore, in step II, several groups of daily runoff data are used as training sets, and the remaining runoff data are used as test sets, so as to be input into the neural network for training. The data volume of the training set should be greater than 2 / 3 of the total data volume.

[0018] Furthermore, in step III, the min-max normalization method is used to process the runoff value and map the result to [0,1] for subsequent use. The normalization formula is:

[0019]

[0020] Where: n is the dimension of input data, N is the number of input data sets, x scale is the normalized value, x ij is the input value, xmin 、x max are the sample minimum and maximum values ​​of the i-th indicator of the input data respectively.

[0021] Furthermore, in step IV, the neural network parameters include the number of input layer nodes, the number of hidden layer nodes, the number of output layer nodes, the number of training times, the learning rate, and the target error; the hybrid optimization algorithm parameters include the population size, the individual learning factor, the social learning factor, the annealing temperature attenuation coefficient, and the maximum number of iterations.

[0022] Furthermore, in step V, the weights and thresholds of the neural network are randomly initialized and encoded into particles, the fitness of the particles is calculated, the initial temperature is determined, the individual optimum and the global optimum of the particles are found, the roulette strategy is used to determine the global optimal alternative and update the speed and position of the particles, and then the target value of the particles is recalculated and annealed until the preset error is met or the maximum number of iterations is reached. The iterative process is terminated to obtain a set of optimal neural network parameters; in this process:

[0023] The fitness function calculation formula is:

[0024]

[0025] Where, t 1 is the current predicted value of runoff, t 2 is the measured value of runoff, m is the number of vector elements; the initial temperature calculation formula of the optimization algorithm is:

[0026] t 0 =f(p g ) / log5

[0027] In the formula, f(p g ) is the initial optimal fitness value of the population;

[0028] The annealing formula is:

[0029] t k+1 =λt k

[0030] Where λ is the annealing constant;

[0031] The particle speed and position update formula is:

[0032]

[0033] x(t+1)=x(t)+v(t+1)

[0034] In the formula, c=c 1 +c 2 , c 1 、c2 They are individual learning factor and social learning factor, r 1 、r 2 is a random number between [0,1], pbest and gbest are the individual optimal position and the global optimal position respectively.

[0035] Furthermore, in step VI, a neural network is established using the optimal network parameters obtained in step V, and the neural network is trained using the grouped runoff training set data.

[0036] Furthermore, in step VII, after the training of the neural network is completed, the test set data can be imported into the neural network to output the predicted runoff of the test set.

[0037] Furthermore, in step VIII, the simulated value output by the neural network after training is denormalized to obtain the actual predicted value of the runoff. The denormalization formula is:

[0038] X ij =x scale *(x max -x min )+x min .

[0039] Furthermore, in step IX, the coefficient of determination R 2 , mean absolute error (MAE), mean deviation error (MBE) and other statistical indicators are used to quantitatively evaluate the prediction results to verify the feasibility and efficiency of the method.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] The present invention is based on a hybrid optimization algorithm to optimize the runoff prediction method of the neural network, optimizes the neural network parameters through the simulated annealing particle swarm algorithm, and then predicts the daily runoff, sets the parameters of the neural network and the optimization algorithm, divides the measured daily runoff data of the hydropower station for ten years into a training set and a test set and performs normalization processing, and prepares for the training and testing of the neural network; randomly initializes the weights and thresholds of the neural network, and passes the parameters to the simulated annealing particle swarm algorithm for iterative optimization to obtain the optimal network parameters and establish a prediction network model; trains the network model with the grouped training set data, and uses the training model to predict the runoff of the hydropower station. The method has a fast convergence speed and can effectively avoid falling into a local optimal solution, and the prediction accuracy of the runoff is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a model diagram of a method for predicting runoff based on a hybrid optimization algorithm to optimize a neural network according to an embodiment of the present invention;

[0043] Figure 2It is a flow chart of a method for predicting runoff volume based on a hybrid optimization algorithm to optimize a neural network according to an embodiment of the present invention;

[0044] Figure 3 A neural network model used in the runoff prediction of the embodiment of the present invention;

[0045] Figure 4 A comparison chart of training set prediction results of the method, neural network model and particle swarm optimization neural network model according to the embodiment of the present invention;

[0046] Figure 5 It is a comparison chart of the test set prediction results of the embodiment method of the present invention, the neural network model and the particle swarm optimization neural network model. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.

[0048] Example: A runoff prediction method model based on a hybrid optimization algorithm to optimize a neural network Figure 1 shown.

[0049] Reference Figure 2 The specific implementation steps of the present invention are as follows:

[0050] S1. Calculation The language (version: MATLAB_2021a) is used to implement the neural network toolbox of MATLAB. After completing the relevant preparations, the daily runoff data is imported from the Excel spreadsheet (3652 sets of daily runoff data of Taojiang Hydropower Station and its upstream stations in the past ten years).

[0051] S2. Divide the daily runoff data of the past ten years into a training set and a test set. To ensure that the divided training set and test set are representative, before dividing the data set, generate a random sequence of 1 to 3652, shuffle the data set, and then use the first 3000 sets of data as the training set and the last 652 sets of data as the test set.

[0052] S3. Normalize the data. In order to eliminate the impact of the large difference in the magnitude of the index value, the min-max normalization method is used to normalize the measured data and map the results to [0,1]. The simulated value output by the neural network after training is then denormalized to obtain the actual predicted value of the runoff. The data normalization formula is:

[0053]

[0054] Where: n is the dimension of input data, N is the number of input data sets, x scale is the normalized value, x ij is the input value, x min 、x max are the minimum and maximum values ​​of the samples of the i-th index of the input data, respectively, ij is the denormalized value.

[0055] S4. Set the parameters of the neural network and hybrid optimization algorithm. That is, it is necessary to determine in advance the parameters such as the number of input layer nodes, the number of hidden layer nodes, the number of output layer nodes, the number of training times, the learning rate, the target error, etc. of the neural network, and the population size, individual learning factor, social learning factor, annealing temperature attenuation coefficient, and the maximum number of iterations of the hybrid optimization algorithm.

[0056] S5. Use the hybrid optimization algorithm to optimize the neural network parameters. First, randomly initialize the weights and thresholds of the neural network and encode them into particles. Calculate the fitness of the particles. The fitness function uses the root mean square error between the current value and the measured value as the evaluation index. The calculation formula is:

[0057]

[0058] Where, t 1 is the current predicted value of runoff, t 2 is the measured value of runoff, and m is the number of vector elements.

[0059] S6. Determine the initial temperature according to the optimal fitness value of the particle, find the individual optimum and global optimum of the particle, and the calculation formula of the initial temperature is:

[0060] t 0 =f(p g ) / log5

[0061] In the formula, f(p g ) is the initial optimal fitness value of the population.

[0062] S7. Use the roulette strategy to determine the global optimal replacement. The basic idea of ​​the roulette strategy is that the probability of each individual being selected is proportional to the value of its fitness function, thereby avoiding the direct elimination of individuals with smaller fitness values. The core lies in the individual selection probability, cumulative probability and strategy for selecting individuals. The calculation formula for individual selection probability is:

[0063]

[0064] The cumulative probability formula for an individual is:

[0065]

[0066] In the formula, f(x i ) is the fitness value of the ith individual, p(x i ) is the probability that the i-th individual is selected.

[0067] S8. Individual selection. The cumulative probability of each individual is calculated, and then the optimal individual is selected using random numbers in the interval [0,1].

[0068] S9, update the speed and position of the particle, and recalculate the target value of the particle. After finding the new global optimal solution, update the speed and position of each particle, and then calculate the target value of the updated particle. The formula for updating the particle speed and position is as follows:

[0069]

[0070] x(t+1)=x(t)+v(t+1)

[0071] In the formula,

[0072] c=c 1 +c 2

[0073] , c 1 、c 2 They are individual learning factor and social learning factor, r 1 、r 2 is a random number between [0,1], pbest and gbest are the individual optimal position and the global optimal position respectively.

[0074] S10, perform annealing operation. The annealing formula is:

[0075] t k+1 =λt k

[0076] Where λ is the annealing constant.

[0077] S11, repeat the process of S7-S10 until the preset error is met or the maximum number of iterations is reached, terminating the iterative process and obtaining a set of optimal neural network parameters.

[0078] S12, train the neural network. Use the obtained optimal network parameters to establish a neural network, such as Figure 3 As shown, the neural network is trained using the grouped training set data.

[0079] S13, predicting the runoff volume. After the training of the neural network is completed, the test set data can be imported into the neural network to output the predicted runoff volume of the test set.

[0080] S14, after the neural network is trained, the simulated value output is denormalized to obtain the actual predicted value of the runoff. The denormalization formula is:

[0081] X ij =x scale *(x max -x min )+x min

[0082] S15. Use statistical indicators such as determination coefficient R2, mean absolute error MAE, and mean deviation error MBE to quantitatively evaluate the prediction results and verify the feasibility and efficiency of this method.

[0083] The prediction results of the training set and test set are as follows: Figure 4 , Figure 5 The training accuracy and prediction accuracy of the runoff volume of the present invention are higher than those of the neural network (NN) model and the particle swarm optimization neural network (PSO-NN) model.

[0084] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A runoff prediction method based on a hybrid optimization algorithm to optimize a neural network, characterized in that: The following steps are involved: Step I: Collect daily runoff data of the hydropower station for ten years; Step II: Divide the daily runoff series into training set and test set; Step III: Normalize the data; Step IV: Setting the parameters of the neural network and hybrid optimization algorithm; Step V: Optimize the neural network parameters using a hybrid optimization algorithm; Step VI: Use the runoff data obtained in step III to train the neural network; Step VII: Use the network model to predict runoff; Step VIII: Denormalize the predicted runoff value; Step IX: Evaluate the runoff prediction accuracy of the neural network.

2. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step I, a computer program is used to read and store the daily runoff data of the hydropower station for ten years.

3. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step II, several groups of daily runoff data are used as training sets, and the remaining runoff data are used as test sets, so as to be input into the neural network for training. The amount of data in the training set should be greater than 2 / 3 of the total data.

4. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step III, the min-max normalization method is used to process the runoff value and map the result to [0,1] for subsequent use. The normalization formula is: Where: n is the dimension of input data, N is the number of input data sets, x scale is the normalized value, x ij is the input value, x min 、x max are the sample minimum and maximum values ​​of the i-th indicator of the input data respectively.

5. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step IV, the neural network parameters include the number of input layer nodes, the number of hidden layer nodes, the number of output layer nodes, the number of training times, the learning rate, and the target error; the hybrid optimization algorithm parameters include the population size, the individual learning factor, the social learning factor, the annealing temperature attenuation coefficient, and the maximum number of iterations.

6. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step V, the weights and thresholds of the neural network are randomly initialized and encoded into particles, the fitness of the particles is calculated, the initial temperature is determined, the individual optimum and global optimum of the particles are found, the roulette strategy is used to determine the global optimal alternative and update the speed and position of the particles, and then the target value of the particles is recalculated and annealed until the preset error is met or the maximum number of iterations is reached. The iterative process is terminated to obtain a set of optimal neural network parameters; in this process: The fitness function calculation formula is: In the formula, t1 is the current predicted value of runoff, t2 is the measured value of runoff, and m is the number of vector elements; The initial temperature calculation formula of the optimization algorithm is: t0=f(p g ) / log5 In the formula, f(p g ) is the initial optimal fitness value of the population; The annealing formula is: t k+1 =λt k Where λ is the annealing constant; The particle speed and position update formula is: x(t+1)=x(t)+v(t+1) In the formula, c=c1+c2, c1 and c2 are individual learning factors and social learning factors respectively, r1 and r2 are random numbers between [0,1], pbest and gbest are individual optimal position and global optimal position respectively.

7. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step VI, a neural network is established using the optimal network parameters obtained in step V, and the neural network is trained using the grouped runoff training set data.

8. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step VII, after the training of the neural network is completed, the test set data can be imported into the neural network and the predicted runoff of the test set can be output.

9. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step VIII, the simulated value output by the trained neural network is denormalized to obtain the actual predicted value of the runoff. The denormalization formula is: X ij =x scale *(x max -x min )+x min 。 10. The method for predicting runoff based on a hybrid optimization algorithm and a neural network according to claim 1, characterized in that: In step IX, the coefficient of determination R 2 , mean absolute error (MAE), mean deviation error (MBE) and other statistical indicators are used to quantitatively evaluate the prediction results to verify the feasibility and efficiency of the method.

Citation Information

Cited By

  • Gas flow metering system in pressure tank

    CN120217238A

  • Mountain torrent disaster prediction model training method based on hybrid optimization neural network

    CN121188371A

  • Mountain torrent disaster prediction model training method based on hybrid optimization neural network

    CN121188371B

  • Sea water quality detection method, device and equipment based on hybrid optimization neural network

    CN121456306A