CN113468803A - Improved WOA-GRU-based flood flow prediction method and system - Google Patents

Improved WOA-GRU-based flood flow prediction method and system Download PDF

Info

Publication number
CN113468803A
CN113468803A CN202110642031.7A CN202110642031A CN113468803A CN 113468803 A CN113468803 A CN 113468803A CN 202110642031 A CN202110642031 A CN 202110642031A CN 113468803 A CN113468803 A CN 113468803A
Authority
CN
China
Prior art keywords
data
model
flood
gru
improved
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110642031.7A
Other languages
Chinese (zh)
Other versions
CN113468803B (en
Inventor
嵇春雷
彭甜
张楚
孙娜
赵环宇
夏鑫
孙伟
李沂蔓
王振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Jiuzhou Longteng Scientific And Technological Achievement Transformation Co ltd
Original Assignee
Huaiyin Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huaiyin Institute of Technology filed Critical Huaiyin Institute of Technology
Priority to CN202110642031.7A priority Critical patent/CN113468803B/en
Publication of CN113468803A publication Critical patent/CN113468803A/en
Application granted granted Critical
Publication of CN113468803B publication Critical patent/CN113468803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A10/00TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE at coastal zones; at river basins
    • Y02A10/40Controlling or monitoring, e.g. of flood or hurricane; Forecasting, e.g. risk assessment or mapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Software Systems (AREA)
  • Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Development Economics (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Game Theory and Decision Science (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an improved WOA-GRU flood flow prediction method and system, wherein the method comprises the following steps: (1) preprocessing pre-acquired original data, and converting each processed data into matrix data according to time sequence; (2) establishing a random forest model for feature selection, training related data and carrying out importance measurement; (3) carrying out normalization processing on the data, and dividing sample data into a training set and a test set according to a time sequence; (4) building a GRU model, and initializing parameters of the GRU model; (5) optimizing the number of hidden layer units and the learning rate of the GRU model by using an improved WOA algorithm; (6) and establishing an improved WOA-GRU flood flow prediction model, predicting the flood flow by using the test set data and the model, and outputting an error and a prediction result. The invention uses the improved WOA-GRU model to predict the flood flow, has the characteristics of high convergence rate, strong generalization capability and high prediction precision, and is more suitable for predicting the flood flow.

Description

Improved WOA-GRU-based flood flow prediction method and system
Technical Field
The invention belongs to the field of flood flow prediction, and particularly relates to a flood flow prediction method and system based on improved WOA-GRU.
Background
In ancient times, natural disasters still exist as the biggest enemies encountered by people all over the world, and people all over the world gradually grow and grow up in the process of fighting with self-perceived disasters harmful to human beings. The population of China is continuously increased, the earth surface and the forest are artificially destroyed, and once severe weather such as rainstorm, strong convection and the like occurs, flood disasters can be caused to occur continuously. Flood disasters can cause great damage to lives and properties of people every time, so if accurate flood flow prediction can be achieved, loss of flood disasters to people can be greatly reduced, and great significance is achieved for the whole society and human beings.
Flood flow prediction is a trend of hydrology informatics in the current era and is also an important decision for making implementation scheduling of flood control and disaster reduction. Many models for flood flow prediction appear after years of development, but the modeling process can be divided into a physical process-based model and a data-driven model. The model based on the physical process is mainly used for calculating parameters according to the physical characteristics of local terrain, temperature and humidity, vegetation coverage, soil texture and the like, the model established by the method is high in prediction accuracy, but the calculation is quite troublesome, the model is only suitable for fixed terrain, and modeling needs to be carried out again when the place is changed. The data-driven model is a functional map or a joint distribution from input features to output features obtained by training past historical data and using an intelligent method such as machine learning. At present, a large number of flood flow prediction methods based on BP, ELM, SVM and other models exist, but the complexity of flood formation is basically not fully considered, the model parameter setting is not accurate enough, and the prediction precision needs to be improved.
Through the above analysis, the problems and defects of the prior art are as follows: due to the complexity of the flood forming process, when the current flood forecasting model carries out hydrologic flow sequence forecasting, an accurate and reliable forecasting result is difficult to make.
Disclosure of Invention
The purpose of the invention is as follows: the invention provides a flood flow prediction method and system based on improved WOA-GRU, solves the technical problem caused by the complexity of a flood forming process in the prior art, and improves the prediction accuracy of the flood flow.
The technical scheme is as follows: the invention provides a flood flow prediction method based on improved WOA-GRU, which specifically comprises the following steps:
(1) preprocessing flood data acquired in advance and environment data related to flood, and converting each processed data into matrix data according to time sequence;
(2) establishing a random forest model to perform feature selection on related environment data, taking flood data and the environment data related to the flood as input of the random forest model, training the environment data related to the flood, performing importance measurement, and selecting the environment data with high importance as an optimal feature set;
(3) normalization processing is carried out on the flood data and the screened optimal feature set, the flood data and the screened optimal feature set are mapped between 0 and 1, a sample data set is obtained, and the sample data set is divided into a training set and a testing set according to the time sequence;
(4) building a GRU model, and initializing parameters of the model, including batch processing size, model training times and dropout value;
(5) initializing WOA algorithm parameters, generating a population by adopting a chaos Tent initialization strategy, adding a nonlinear factor and an inertial weight to improve position updating, and adding a catfish effect strategy to improve the capacity of jumping out of local optimum by a whale optimization algorithm; optimizing the number n of hidden layer units and the learning rate epsilon of the GRU model by using an improved WOA algorithm;
(6) and establishing an improved WOA-GRU flood flow prediction model, predicting the flood flow by using the test set and the prediction model, and outputting an error and a prediction result.
Further, the environmental data related to flood in step (1) includes rainfall, temperature and humidity.
Further, the step (2) comprises the steps of:
(21) performing playback sampling on related environment data by a random extraction method, and dividing the data into sampled in-bag data and non-sampled out-of-bag data;
(22) constructing a random forest model with N decision trees by using in-bag data, and training out-of-bag data to obtain an error epsilon1
(23) Randomly changing the value of a certain relevant factor characteristic in the data outside the bag, and obtaining an error epsilon through random forest model training2
(24) Calculating the importance A of the relevant factors, wherein the formula is as follows:
Figure RE-GDA0003203759630000021
where N is the number of decision trees, ε1 and ε2Is the error of the two training sessions;
(25) and continuously changing the characteristics of other factors in the data outside the bag to obtain the importance of all factors related to the flood, sequencing the factors, and using the factors with high importance as the input of a flood flow prediction model.
Further, the formula of the normalization process in step (3) is:
Figure RE-GDA0003203759630000031
wherein ,
Figure RE-GDA0003203759630000032
Is the normalized sample data, xiIs the sample data before normalization, xminIs the minimum value of the sample data, xmaxIs the minimum value of the sample data, and n is the number of sample data.
Further, the step (4) comprises the steps of:
(41) initializing model parameters, including: carrying out optimization determination on the batch processing size, the model training times and the dropout value, the number of hidden layer units and the learning rate through an improved whale algorithm;
(42) calculating a reset gate value rtAnd candidate implicit states
Figure RE-GDA0003203759630000033
Through rtTo control
Figure RE-GDA0003203759630000034
Whether h is used or nott-1The calculation formula is as follows:
rt=σ(Wr·Xt+Qr·ht-1+br)
Figure RE-GDA0003203759630000035
where σ is the activation function, select
Figure RE-GDA0003203759630000036
Wr、Wz、Qr、QzIs the connection weight, XtIs the input vector at time t, br and bzIs an offset vector, ht-1Is the state information at the time t-1, and tanh is a hyperbolic tangent function, which functions as an activation function;
(43) calculating the value u of the update gatetWith the current state htBy updating the value u of the gatetTo control the current state htPreserving how much state information was last in time and accepting candidate implicit states
Figure RE-GDA0003203759630000037
The calculation formula of the amount of the information in (1) is as follows:
ut=σ(Wu·Xt+Qu·ht-1+bu)
Figure RE-GDA0003203759630000038
where σ is the activation function, Wu、QuIs connected with weight value XtIs the input vector at time t, buIs an offset vector, ht-1Is the state information at time t-1; current state htI.e. the output of the GRU model at time t.
Further, the step (5) comprises the steps of:
(51) initializing the population scale, the iteration times and the upper and lower limits of the whale position of a whale algorithm, and generating a population by using an initialization strategy of chaotic Tent mapping;
(52) calculating fitness values of all individuals in the population, obtaining and recording the current optimal whale individual position vector, checking whether the optimal position vector is the same as the optimal position vector of the last iteration, and entering (53) if the optimal position vector does not evolve within the specified iteration times; otherwise, entering (54);
(53) ranking the fitness values of all the current individuals in a descending order, and reusing chaotic initialization for the positions of the next 50% of individuals to improve the capacity of the whale algorithm for jumping out of local optimum;
(54) adding a nonlinear factor a and an inertia weight omega into a basic whale algorithm to improve the optimization performance of the algorithm, wherein the calculation formulas are as follows:
Figure RE-GDA0003203759630000041
Figure RE-GDA0003203759630000042
wherein T is the current iteration number, T is the maximum iteration number, and λ is an adjustment coefficient, which is optimal when λ is 3 through experiments;
(55) introducing parameters p, A, p being [0, 1 ]]A ═ 2a · r1-a; calculating the values of p and A if p is less than or equal to 0.5 and | A<1, entering (56); if p is less than or equal to 0.5 and | A | > is more than or equal to 1, entering (57); if p is>0.5, then enter (58);
(56) performing contraction surrounding iterative updating on the whale individual position vector, wherein the updating formula is as follows:
X(t+1)=ω·Xrand-A·|C·Xrand-Xt|
wherein X is the position of the individual, t is the current iteration number, and C is [0, 2 ]]A random number of (2), XrandAre random individuals in whale populations;
(57) carrying out random search predation iterative updating on whale individual position vectors, wherein the updating formula is as follows:
X(t+1)=ωXbest-A·|C·Xbest-Xt|
wherein X is the position of the individual, t is the current iteration number, and C is the interval [0, 2 ]]Random number of (2), XbestRepresenting the optimal individual in the current population;
(58) carrying out spiral predation iterative updating on whale individual position vectors according to the formula, wherein the updating formula is as follows:
X(t+1)=Dbset·ebl·cos(2πl)+(1-ω)·Xbest
wherein X is the location of the individual, Dbest=|Xbest-XtI denotes that the individual X is at the optimum distance from the individual X before the location updatebestB is a constant, l is the interval [ -1, 1 [ - ]]A random number of (c);
(59) adding 1 to the iteration number, judging whether the maximum iteration number of the algorithm is reached, if so, ending, otherwise, entering (510)
(510) And (4) sending the optimal solution output by the whale algorithm to the GRU model, calculating the training error according to the optimal number of the units of the current hidden layer and the learning rate of the GRU model, and returning to (52).
Based on the same inventive concept, the invention also provides an improved WOA-GRU-based flood flow prediction system, which comprises a data acquisition module, a data preprocessing module, a feature extraction module, a parameter optimization module and a flow prediction module;
the data acquisition module is used for acquiring original data of flood and relevant factors, including flow, rainfall and temperature and humidity;
the data preprocessing module is used for preprocessing the acquired original data, cleaning abnormal values, completing missing values by using a sample mean value and converting the data into matrix data;
the characteristic extraction module is used for extracting characteristics in the data of the relevant factors, calculating the importance of each sample data through a random forest model, sequencing the sample data, and selecting the factor data with high importance as a sample data set of the prediction module;
the parameter optimization module is used for using the improved whale algorithm to optimize the number of hidden layer units and the learning rate in the GRU model, and establishing a prediction model for optimizing the GRU based on the improved whale algorithm;
and the flow prediction module is used for inputting the data of the sample data output by the characteristic extraction module into the model by utilizing the established flood flow prediction model and obtaining a prediction result through calculation.
Has the advantages that: compared with the prior art, the invention has the beneficial effects that: 1. according to the method, the training set and the test set are obtained by performing feature extraction on historical flow data and historical data of factors related to flood through a random forest model, so that the effectiveness and reliability of the training set data are improved; 2. the whale optimization algorithm is improved aiming at the defect that the whale optimization algorithm is easy to fall into local optimization, a chaotic Tent initialization strategy is adopted to generate a population, a nonlinear factor and an inertia weight are added, and a catfish effect strategy is added. The capacity of jumping out of local optimum by a whale optimization algorithm is enhanced, the efficiency of global search is improved, and the technical effect of improving the accurate prediction precision of flood is achieved; and the improved WOA-GRU model is used for flood flow prediction, so that the method has the characteristics of high convergence rate, strong generalization capability and high prediction precision, and is more suitable for flood flow prediction.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a flow chart of the improved WOA-GRU prediction model algorithm provided by the present invention;
FIG. 3 is a comparison of true and predicted values obtained from simulations using the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
The invention provides a flood flow prediction method based on improved WOA-GRU (world Wide area network-group Unit), which specifically comprises the following steps as shown in figure 1:
step 1: collecting flood data (sample data) of a hydrological observation station and environment data related to flood, cleaning the collected data, eliminating abnormal values, filling missing values with sample mean values corresponding to environment factors, and converting each processed data into matrix data according to time sequence.
The flood related environmental data includes: local rainfall, temperature, humidity. The sample mean used to fill in missing values is:
Figure RE-GDA0003203759630000061
wherein ,xiIs the sample mean of the ith factor, n is the number of samples, fi(t) is the value of the t-th data of the i-th factor.
Step 2: establishing a random forest model to perform feature selection on related environment data, taking flood data and environment data related to flood as input of the random forest model, training the environment data related to flood, performing importance measurement, and selecting the environment data with high importance as an optimal feature set.
And (2.1) carrying out replacement sampling on the related environment data by a random extraction method, and dividing the data into sampled in-bag data and non-sampled out-of-bag data.
(2.2) constructing a random forest model with N decision trees by using the data in the bag, and training the data outside the bag to obtain an error epsilon1
(2.3) randomly changing the value of the characteristic of a certain relevant factor in the data outside the bag, and then obtaining an error epsilon through random forest model training2
(2.4) calculating the importance of the relevant factor, wherein the formula is as follows:
Figure RE-GDA0003203759630000071
where N is the number of decision trees, ε1 and ε2Is the error of the two trainings.
And (2.5) continuously changing the characteristics of other factors in the data outside the bag to obtain the importance of all factors related to the flood, sequencing the factors, and using the high importance as the input of a flood flow prediction model.
And step 3: and carrying out normalization processing on the flood data and the screened optimal feature set, mapping the normalized flood data and the screened optimal feature set between 0 and 1 to obtain a sample data set, and dividing the sample data into a training set and a testing set according to a time sequence, wherein the proportion of the training set to the testing set is 7: 3.
The formula of the normalization process is:
Figure RE-GDA0003203759630000072
wherein ,
Figure RE-GDA0003203759630000073
is the normalized sample data, xiIs the sample data before normalization, xminIs the minimum value of the sample data, xmaxIs the minimum value of sample data, n is the number of samplesThe number of data.
And 4, step 4: and constructing a GRU model and initializing parameters of the model.
(4.1) initializing model parameters, including: and optimizing and determining the batch processing size, the model training times and the dropout value, the number of hidden layer units and the learning rate through an improved whale algorithm.
(4.2) calculating the reset gate value rtAnd candidate implicit states
Figure RE-GDA0003203759630000074
Through rtTo control
Figure RE-GDA0003203759630000075
Whether h is used or nott-1The calculation formula is as follows:
rt=σ(Wr·Xt+Qr·ht-1+br)
Figure RE-GDA0003203759630000076
where σ is the activation function, select
Figure RE-GDA0003203759630000077
Wr、Wz、Qr、QzIs the connection weight, XtIs the input vector at time t, br and bzIs an offset vector, ht-1Is the state information at time t-1, and tanh is a hyperbolic tangent function, which acts as an activation function.
(4.3) calculating the value u of the update gatetWith the current state htBy updating the value u of the gatetTo control the current state htPreserving how much state information was last in time and accepting candidate implicit states
Figure RE-GDA0003203759630000081
The calculation formula of the amount of the information in (1) is as follows:
ut=σ(Wu·Xt+Qu·ht-1+bu)
Figure RE-GDA0003203759630000082
where σ is the activation function, Wu、QuIs connected with weight value XtIs the input vector at time t, buIs an offset vector, ht-1Is the status information at time t-1. Current state htI.e. the output of the GRU model at time t.
And 5: initializing parameters of a WOA algorithm, generating a population by adopting a chaotic Tent initialization strategy aiming at the defect that a whale optimization algorithm is easy to fall into local optimum, adding a nonlinear factor and an inertia weight to improve position updating, adding a catfish effect strategy, improving the jumping-out local optimum capability of the whale optimization algorithm, and optimizing the number n of hidden layer units and the learning rate epsilon of a GRU model by utilizing the improved whale algorithm. As shown in fig. 2, the method specifically includes the following steps:
and (5.1) initializing the population scale, iteration times and the upper and lower limits of the whale position of the whale algorithm, and generating the population by using an initialization strategy of chaotic Tent mapping.
(5.2) calculating fitness values of all individuals in the population, obtaining and recording the current optimal whale individual position vector, checking whether the current optimal whale individual position vector is the same as the optimal position vector of the last iteration, if the recorded optimal position vector does not evolve within the specified iteration times, entering (5.3), and if not, entering (5.4).
(5.3) ranking the fitness values of all the current individuals in a descending order, and reusing chaotic initialization for the positions of the latter 50% of individuals to improve the capacity of the whale algorithm to jump out of local optimum.
(5.4) adding a nonlinear factor a and an inertia weight omega into a basic whale algorithm to improve the optimization performance of the algorithm, wherein the calculation formulas are as follows:
Figure RE-GDA0003203759630000083
Figure RE-GDA0003203759630000084
where T is the current iteration number, T is the maximum iteration number, and λ is an adjustment coefficient, which is optimal when λ is 3 through experiments.
(5.5) introducing the parameters p, A, p being [0, 1 ]]A ═ 2a · r1-a; calculating the values of p and A if p is less than or equal to 0.5 and | A<1, entering (5.6); if p is less than or equal to 0.5 and | A | > is more than or equal to 1, entering (5.7); if p is>0.5, then enter (5.8).
(5.6) carrying out contraction and surrounding iterative updating on the whale individual position vector, wherein the updating formula is as follows:
X(t+1)=ω·Xrand-A·|C·Xrand-Xt|
wherein X is the position of the individual, t is the current iteration number, and C is [0, 2 ]]A random number of (2), XrandAre random individuals in whale populations.
(5.7) carrying out random search predation iterative updating on whale individual position vectors, wherein the updating formula is as follows:
X(t+1)=ωXbest-A·|C·Xbest-Xt|
wherein X is the position of the individual, t is the current iteration number, and C is the interval [0, 2 ]]Random number of (2), XbestRepresenting the best individual in the current population.
(5.8) carrying out spiral predation iterative updating on the whale individual position vector according to the formula:
X(t+1)=Dbset·ebl·cos(2πl)+(1-ω)·Xbest
wherein X is the location of the individual, Dbest=|Xbest-XtI denotes that the individual X is at the optimum distance from the individual X before the location updatebestB is a constant, l is the interval [ -1, 1 [ - ]]The random number of (2).
(5.9) adding 1 to the iteration number, judging whether the maximum iteration number of the algorithm is reached, if so, ending, otherwise, entering (5.10).
And (5.10) sending the optimal solution output by the whale algorithm to the GRU model, wherein the optimal solution is the current optimal hidden layer unit number and the learning rate of the GRU model, calculating a training error, and returning to (5.2).
Step 6: and comparing the test sample with the result of the prediction model, calculating the Root Mean Square Error (RMSE) and the average absolute percentage error (MAPE) of the predicted flood flow and the actual flood flow, and evaluating the effectiveness of the improved WOA-GRU flood flow prediction method.
The specific formulas of mean absolute error (RMSE) and Mean Absolute Percent Error (MAPE) are:
Figure RE-GDA0003203759630000091
Figure RE-GDA0003203759630000092
Figure RE-GDA0003203759630000101
wherein ,yob(t) is the true value of the t-th sample, ypre(t) is the predicted value of the t-th sample, and N is the total number of samples.
To demonstrate the effectiveness and the improvement of the proposed algorithm, 4048 data of the regain river basin high-field hydrological observation station from 2009-4-2020-4 are exemplified herein, and the hydrological observation station is located in the high town of the narrative state district of yibin city, Sichuan province. An algorithm program is written by adopting MATLAB language, and a prediction model and four groups of comparison prediction models are respectively constructed: the particle swarm optimization BP neural network and GRU prediction model (PSO-BP and PSO-GRU), the whale optimization BP neural network and GRU prediction model (WOA-BP and WOA-GRU) and the improved whale optimization GRU prediction model (IWOA-GRU) based on the invention.
Five prediction models of PSO-BP, WOA-BP, PSO-GRU, WOA-GRU and IWOA-GRU are simulated respectively for 10 times, the maximum value and the minimum value of each performance index are selected respectively, meanwhile, the average value of the performance indexes of 10 times of simulation of each model is calculated, and the running statistical result of each model is shown in table 1.
Table 1 shows the statistical table of the result performance indexes of the model of the invention and the model of the control group
Figure RE-GDA0003203759630000102
As is apparent from Table 1, the mean MAE value for IWOA-GRU is 293.8928, the mean RMSE value is 797.4514, and the mean MAPE value is 0.1034. The result of predicting by using the improved whale algorithm to optimize the GRU is obviously superior to the result of other prediction models, and all indexes are improved. The improved whale optimization algorithm has the advantages that the optimizing capability of the whale optimization algorithm is improved, and the prediction accuracy of the improved whale algorithm-based optimized GRU prediction model is also improved.
The error and the predicted value of a group of samples with the minimum RMSE in 10 times of simulation are selected for each model, the ratio of the error to the true value is calculated, and the number of samples less than 0.2 and 0.1 in the total number of samples is recorded, namely 80% accuracy and 90% accuracy, and the result is shown in table 2.
Table 2 is a statistical table of the result accuracy of the model of the invention and the model of the control group
Figure RE-GDA0003203759630000111
As is apparent from Table 2, the prediction accuracy of IWOA-GRU is obviously higher than that of a control group model, and the prediction accuracy of the optimized GRU prediction model based on the improved whale algorithm is also improved, the prediction accuracy is also improved, and the method provides a method with higher accuracy for flood flow prediction.
Fig. 3 is a comparison graph of the predicted result and the actual value in the above embodiment, and it can be seen from the graph that the predicted result of the present invention can basically follow the actual value, can basically predict the future runoff, and can predict the arrival of flood in time.
Based on the same inventive concept, the present invention further provides an improved WOA-GRU flood flow prediction system, as shown in fig. 1, including five modules, which are respectively:
the data acquisition module is used for acquiring original data of flood and relevant factors, including flow, rainfall and temperature and humidity;
the data preprocessing module is used for preprocessing the acquired original data, cleaning abnormal values, completing missing values by using the sample mean value and converting the data into matrix data;
the characteristic extraction module is used for extracting characteristics in the data of the relevant factors, calculating the importance of each sample data through a random forest model, sequencing the sample data, and selecting the factor data with high importance as a sample data set of the prediction module;
the parameter optimization module is used for using the improved whale algorithm to optimize the number of hidden layer units and the learning rate in the GRU model, and establishing a prediction model for optimizing the GRU based on the improved whale algorithm;
and the prediction module is used for inputting the data of the sample data output by the characteristic extraction module into the model by utilizing the established flood flow prediction model and obtaining a prediction result through calculation.
Those skilled in the art will appreciate that the flood flow prediction method of the present invention can be implemented by computer program instructions. These program instructions may be stored in memory and may be invoked for execution by a processor to perform the functions of the present invention. According to the present invention, there is also provided a computer-readable storage medium storing a computer program. The method for predicting flood flows according to the present invention can be designed as a related computer program, which can be executed and implemented by the computer readable storage medium.
It should be noted that the above-mentioned embodiments are illustrative rather than restrictive, and the present invention is not limited to the above-mentioned embodiments, and any other embodiments according to the principles of the present invention are also considered to be within the protection scope of the present invention.

Claims (7)

1. A flood flow prediction method based on improved WOA-GRU is characterized by comprising the following steps:
(1) preprocessing flood data acquired in advance and environment data related to flood, and converting each processed data into matrix data according to time sequence;
(2) establishing a random forest model to perform feature selection on related environment data, taking flood data and the environment data related to the flood as input of the random forest model, training the environment data related to the flood, performing importance measurement, and selecting the environment data with high importance as an optimal feature set;
(3) normalization processing is carried out on the flood data and the screened optimal feature set, the flood data and the screened optimal feature set are mapped between 0 and 1, a sample data set is obtained, and the sample data set is divided into a training set and a testing set according to the time sequence;
(4) building a GRU model, and initializing parameters of the model, including batch processing size, model training times and dropout value;
(5) initializing WOA algorithm parameters, generating a population by adopting a chaos Tent initialization strategy, adding a nonlinear factor and an inertial weight to improve position updating, and adding a catfish effect strategy to improve the capacity of jumping out of local optimum by a whale optimization algorithm; optimizing the number n of hidden layer units and the learning rate epsilon of the GRU model by using an improved WOA algorithm;
(6) and establishing an improved WOA-GRU flood flow prediction model, predicting the flood flow by using the test set and the prediction model, and outputting an error and a prediction result.
2. The improved WOA-GRU flood flow prediction method according to claim 1, wherein the flood-related environmental data of step (1) includes rainfall, temperature, humidity.
3. The improved WOA-GRU flood traffic prediction method according to claim 1, wherein the step (2) comprises the steps of:
(21) performing playback sampling on related environment data by a random extraction method, and dividing the data into sampled in-bag data and non-sampled out-of-bag data;
(22) constructing a random forest model with N decision trees by using in-bag data, and training out-of-bag data to obtain an error epsilon1
(23) Randomly changing the value of a certain relevant factor characteristic in the data outside the bag, and obtaining an error epsilon through random forest model training2
(24) Calculating the importance A of the relevant factors, wherein the formula is as follows:
Figure RE-FDA0003203759620000021
where N is the number of decision trees, ε1 and ε2Is the error of the two training sessions;
(25) and continuously changing the characteristics of other factors in the data outside the bag to obtain the importance of all factors related to the flood, sequencing the factors, and using the factors with high importance as the input of a flood flow prediction model.
4. The improved WOA-GRU flood flow prediction method according to claim 1, wherein the normalization process of step (3) is formulated as:
Figure RE-FDA0003203759620000022
wherein ,
Figure RE-FDA0003203759620000023
is the normalized sample data, xiIs the sample data before normalization, xminIs the minimum value of the sample data, xmaxIs the minimum value of the sample data, n is the sampleThe number of data.
5. The improved WOA-GRU flood traffic prediction method according to claim 1, wherein the step (4) comprises the steps of:
(41) initializing model parameters, including: carrying out optimization determination on the batch processing size, the model training times and the dropout value, the number of hidden layer units and the learning rate through an improved whale algorithm;
(42) calculating a reset gate value rtAnd candidate implicit states
Figure RE-FDA0003203759620000024
Through rtTo control
Figure RE-FDA0003203759620000025
Whether h is used or nott-1The calculation formula is as follows:
rt=σ(Wr·Xt+Qr·ht-1+br)
Figure RE-FDA0003203759620000026
where σ is the activation function, select
Figure RE-FDA0003203759620000027
Wr、Wz、Qr、QzIs the connection weight, XtIs the input vector at time t, br and bzIs an offset vector, ht-1Is the state information at the time t-1, and tanh is a hyperbolic tangent function, which functions as an activation function;
(43) calculating the value u of the update gatetWith the current state htBy updating the value u of the gatetTo control the current state htPreserving how much state information was last in time and accepting candidate implicit states
Figure RE-FDA0003203759620000028
The calculation formula of the amount of the information in (1) is as follows:
ut=σ(Wu·Xt+Qu·ht-1+bu)
Figure RE-FDA0003203759620000031
where σ is the activation function, Wu、QuIs connected with weight value XtIs the input vector at time t, buIs an offset vector, ht-1Is the state information at time t-1; current state htI.e. the output of the GRU model at time t.
6. The improved WOA-GRU flood traffic prediction method according to claim 1, wherein said step (5) comprises the steps of:
(51) initializing the population scale, the iteration times and the upper and lower limits of the whale position of a whale algorithm, and generating a population by using an initialization strategy of chaotic Tent mapping;
(52) calculating fitness values of all individuals in the population, obtaining and recording the current optimal whale individual position vector, checking whether the optimal position vector is the same as the optimal position vector of the last iteration, and entering (53) if the optimal position vector does not evolve within the specified iteration times; otherwise, entering (54);
(53) ranking the fitness values of all the current individuals in a descending order, and reusing chaotic initialization for the positions of the next 50% of individuals to improve the capacity of the whale algorithm for jumping out of local optimum;
(54) adding a nonlinear factor a and an inertia weight omega into a basic whale algorithm to improve the optimization performance of the algorithm, wherein the calculation formulas are as follows:
Figure RE-FDA0003203759620000032
Figure RE-FDA0003203759620000033
wherein T is the current iteration number, T is the maximum iteration number, and λ is an adjustment coefficient, which is optimal when λ is 3 through experiments;
(55) introducing parameters p, A, p being [0, 1 ]]A ═ 2a · r1-a; calculating the values of p and A if p is less than or equal to 0.5 and | A<1, entering (56); if p is less than or equal to 0.5 and | A | > is more than or equal to 1, entering (57); if p is>0.5, then enter (58);
(56) performing contraction surrounding iterative updating on the whale individual position vector, wherein the updating formula is as follows:
X(t+1)=ω·Xrand-A·|C·Xrand-Xt|
wherein X is the position of the individual, t is the current iteration number, and C is [0, 2 ]]A random number of (2), XrandAre random individuals in whale populations;
(57) carrying out random search predation iterative updating on whale individual position vectors, wherein the updating formula is as follows:
X(t+1)=ωXbest-A·|C·Xbest-Xt|
wherein X is the position of the individual, t is the current iteration number, and C is the interval [0, 2 ]]Random number of (2), XbestRepresenting the optimal individual in the current population;
(58) carrying out spiral predation iterative updating on whale individual position vectors according to the formula, wherein the updating formula is as follows:
X(t+1)=Dbset·ebl·cos(2πl)+(1-ω)·Xbest
wherein X is the location of the individual, Dbest=|Xbest-XtI denotes that the individual X is at the optimum distance from the individual X before the location updatebestB is a constant, l is the interval [ -1, 1 [ - ]]A random number of (c);
(59) adding 1 to the iteration number, judging whether the maximum iteration number of the algorithm is reached, if so, ending, otherwise, entering (510)
(510) And (4) sending the optimal solution output by the whale algorithm to the GRU model, calculating the training error according to the optimal number of the units of the current hidden layer and the learning rate of the GRU model, and returning to (52).
7. An improved WOA-GRU based flood flow prediction system using the method of any of claims 1-6, comprising a data acquisition module, a data preprocessing module, a feature extraction module, a parameter optimization module, and a flow prediction module;
the data acquisition module is used for acquiring original data of flood and relevant factors, including flow, rainfall and temperature and humidity;
the data preprocessing module is used for preprocessing the acquired original data, cleaning abnormal values, completing missing values by using a sample mean value and converting the data into matrix data;
the characteristic extraction module is used for extracting characteristics in the data of the relevant factors, calculating the importance of each sample data through a random forest model, sequencing the sample data, and selecting the factor data with high importance as a sample data set of the prediction module;
the parameter optimization module is used for using the improved whale algorithm to optimize the number of hidden layer units and the learning rate in the GRU model, and establishing a prediction model for optimizing the GRU based on the improved whale algorithm;
and the flow prediction module is used for inputting the data of the sample data output by the characteristic extraction module into the model by utilizing the established flood flow prediction model and obtaining a prediction result through calculation.
CN202110642031.7A 2021-06-09 2021-06-09 WOA-GRU flood flow prediction method and system based on improvement Active CN113468803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110642031.7A CN113468803B (en) 2021-06-09 2021-06-09 WOA-GRU flood flow prediction method and system based on improvement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110642031.7A CN113468803B (en) 2021-06-09 2021-06-09 WOA-GRU flood flow prediction method and system based on improvement

Publications (2)

Publication Number Publication Date
CN113468803A true CN113468803A (en) 2021-10-01
CN113468803B CN113468803B (en) 2023-09-26

Family

ID=77869434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110642031.7A Active CN113468803B (en) 2021-06-09 2021-06-09 WOA-GRU flood flow prediction method and system based on improvement

Country Status (1)

Country Link
CN (1) CN113468803B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114282614A (en) * 2021-12-27 2022-04-05 淮阴工学院 Medium-and-long-term runoff prediction method for optimizing CNN-GRU (CNN-GRU) based on random forest and IFDA (IFDA)
CN114282431A (en) * 2021-12-09 2022-04-05 淮阴工学院 Runoff interval prediction method and system based on improved SCA and QRGRU
CN114282646A (en) * 2021-11-29 2022-04-05 淮阴工学院 Light power prediction method and system based on two-stage feature extraction and improved BilSTM
CN115346125A (en) * 2022-10-18 2022-11-15 南京金瀚途科技有限公司 Target detection method based on deep learning
CN115774399A (en) * 2023-02-14 2023-03-10 中铁四局集团第三建设有限公司 Weight real-time optimization hydraulic climbing formwork climbing synchronous control system and method
CN115859201A (en) * 2022-11-22 2023-03-28 淮阴工学院 Chemical process fault diagnosis method and system
CN116091801A (en) * 2023-03-07 2023-05-09 河海大学 Rainfall image similarity searching method based on deep learning
CN117518780A (en) * 2023-12-04 2024-02-06 陕西旭氢时代科技有限公司 Fuel cell cogeneration system control method based on simulation model
CN118036481A (en) * 2024-04-15 2024-05-14 江西省水利科学院(江西省大坝安全管理中心、江西省水资源管理中心) Method for predicting river flood flow

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170168195A1 (en) * 2015-12-15 2017-06-15 Wuhan University Method for forecasting floods for multiple lead times
CN108564272A (en) * 2018-04-08 2018-09-21 大连理工大学 A kind of team's recommendation system building method based on Catfish Effect
CN108804850A (en) * 2018-06-27 2018-11-13 大连理工大学 A kind of aero-engine transition state accelerator critical performance parameters prediction technique based on Space Reconstruction
US20190316309A1 (en) * 2018-04-17 2019-10-17 One Concern, Inc. Flood monitoring and management system
CN110458722A (en) * 2019-07-25 2019-11-15 淮阴工学院 Flood interval prediction method based on multiple target random vector function connection network
CN112069567A (en) * 2020-08-07 2020-12-11 湖北交投十巫高速公路有限公司 Method for predicting compressive strength of concrete based on random forest and intelligent algorithm
US20210049515A1 (en) * 2019-08-16 2021-02-18 China Institute Of Water Resources And Hydropower Research Prediction method and system of high slope deformation
CN112396152A (en) * 2020-11-17 2021-02-23 郑州大学 Flood forecasting method based on CS-LSTM
CN112733997A (en) * 2021-01-14 2021-04-30 河海大学 Hydrological time series prediction optimization method based on WOA-LSTM-MC

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170168195A1 (en) * 2015-12-15 2017-06-15 Wuhan University Method for forecasting floods for multiple lead times
CN108564272A (en) * 2018-04-08 2018-09-21 大连理工大学 A kind of team's recommendation system building method based on Catfish Effect
US20190316309A1 (en) * 2018-04-17 2019-10-17 One Concern, Inc. Flood monitoring and management system
CN108804850A (en) * 2018-06-27 2018-11-13 大连理工大学 A kind of aero-engine transition state accelerator critical performance parameters prediction technique based on Space Reconstruction
CN110458722A (en) * 2019-07-25 2019-11-15 淮阴工学院 Flood interval prediction method based on multiple target random vector function connection network
US20210049515A1 (en) * 2019-08-16 2021-02-18 China Institute Of Water Resources And Hydropower Research Prediction method and system of high slope deformation
CN112069567A (en) * 2020-08-07 2020-12-11 湖北交投十巫高速公路有限公司 Method for predicting compressive strength of concrete based on random forest and intelligent algorithm
CN112396152A (en) * 2020-11-17 2021-02-23 郑州大学 Flood forecasting method based on CS-LSTM
CN112733997A (en) * 2021-01-14 2021-04-30 河海大学 Hydrological time series prediction optimization method based on WOA-LSTM-MC

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
SUN W: "Analysis and forecasting of the carbon price using multi—resolution singularvalue decomposition and extreme learning machine optimized by adaptive whale optimization algorithm", 《APPLIED ENERGY》, vol. 231, pages 1354 - 1371 *
周有荣;王凯;: "改进WOA-指数幂乘积模型在基坑变形预测中的应用", 水资源与水工程学报, no. 03, pages 235 - 241 *
牛培峰;吴志良;马云鹏;史春见;李进柏;: "基于鲸鱼优化算法的汽轮机热耗率模型预测", 化工学报, no. 03, pages 257 - 265 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114282646A (en) * 2021-11-29 2022-04-05 淮阴工学院 Light power prediction method and system based on two-stage feature extraction and improved BilSTM
CN114282646B (en) * 2021-11-29 2023-08-25 淮阴工学院 Optical power prediction method and system based on two-stage feature extraction and BiLSTM improvement
CN114282431B (en) * 2021-12-09 2023-08-18 淮阴工学院 Runoff interval prediction method and system based on improved SCA and QRGRU
CN114282431A (en) * 2021-12-09 2022-04-05 淮阴工学院 Runoff interval prediction method and system based on improved SCA and QRGRU
CN114282614A (en) * 2021-12-27 2022-04-05 淮阴工学院 Medium-and-long-term runoff prediction method for optimizing CNN-GRU (CNN-GRU) based on random forest and IFDA (IFDA)
CN114282614B (en) * 2021-12-27 2023-09-26 淮阴工学院 Medium-long runoff prediction method for optimizing CNN-GRU based on random forest and IFDA
CN115346125A (en) * 2022-10-18 2022-11-15 南京金瀚途科技有限公司 Target detection method based on deep learning
CN115859201A (en) * 2022-11-22 2023-03-28 淮阴工学院 Chemical process fault diagnosis method and system
CN115774399B (en) * 2023-02-14 2023-05-02 中铁四局集团第三建设有限公司 Weight real-time optimization hydraulic climbing formwork climbing synchronous control system and method
CN115774399A (en) * 2023-02-14 2023-03-10 中铁四局集团第三建设有限公司 Weight real-time optimization hydraulic climbing formwork climbing synchronous control system and method
CN116091801A (en) * 2023-03-07 2023-05-09 河海大学 Rainfall image similarity searching method based on deep learning
CN117518780A (en) * 2023-12-04 2024-02-06 陕西旭氢时代科技有限公司 Fuel cell cogeneration system control method based on simulation model
CN117518780B (en) * 2023-12-04 2024-04-09 陕西旭氢时代科技有限公司 Fuel cell cogeneration system control method based on simulation model
CN118036481A (en) * 2024-04-15 2024-05-14 江西省水利科学院(江西省大坝安全管理中心、江西省水资源管理中心) Method for predicting river flood flow

Also Published As

Publication number Publication date
CN113468803B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
CN113468803A (en) Improved WOA-GRU-based flood flow prediction method and system
CN109492822B (en) Air pollutant concentration time-space domain correlation prediction method
CN109142171B (en) Urban PM10 concentration prediction method based on feature expansion and fusing with neural network
Kisi et al. River suspended sediment estimation by climatic variables implication: Comparative study among soft computing techniques
Guan et al. An artificial-neural-network-based, constrained CA model for simulating urban growth
Fan et al. Temporal and spatial change detecting (1998–2003) and predicting of land use and land cover in Core corridor of Pearl River Delta (China) by using TM and ETM+ images
CN109359166B (en) Space growth dynamic simulation and driving force factor contribution degree synchronous calculation method
CN112733996B (en) GA-PSO (genetic algorithm-particle swarm optimization) based hydrological time sequence prediction method for optimizing XGboost
Huangpeng et al. Forecast of the hydropower generation under influence of climate change based on RCPs and Developed Crow Search Optimization Algorithm
CN112884226A (en) Multi-agent algorithm-based territorial spatial pattern simulation planning method and system
CN111881971A (en) Power transmission line fault type identification method based on deep learning LSTM model
CN116721537A (en) Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model
CN114202122A (en) Urban traffic flow prediction method based on Markov cluster map attention network
CN113516304B (en) Regional pollutant space-time joint prediction method and device based on space-time diagram network
CN112733997A (en) Hydrological time series prediction optimization method based on WOA-LSTM-MC
CN114781538A (en) Air quality prediction method and system of GA-BP neural network coupling decision tree
Li et al. A method of rainfall runoff forecasting based on deep convolution neural networks
CN114912673A (en) Water level prediction method based on whale optimization algorithm and long-term and short-term memory network
CN114065646B (en) Energy consumption prediction method based on hybrid optimization algorithm, cloud computing platform and system
CN117808214A (en) Hydraulic engineering data analysis system
CN113240219A (en) Land utilization simulation and prediction method
CN117233869A (en) Site short-term wind speed prediction method based on GRU-BiTCN
CN114566048A (en) Traffic control method based on multi-view self-adaptive space-time diagram network
CN116449460B (en) Regional month precipitation prediction method and system based on convolution UNet and transfer learning
Song et al. A short-term electricity load forecasting method based on WOA-BiLSTM-attention

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240111

Address after: 230000 Room 203, building 2, phase I, e-commerce Park, Jinggang Road, Shushan Economic Development Zone, Hefei City, Anhui Province

Patentee after: Hefei Jiuzhou Longteng scientific and technological achievement transformation Co.,Ltd.

Address before: 223003 No.1, Meicheng East Road, qingjiangpu District, Huai'an City, Jiangsu Province

Patentee before: HUAIYIN INSTITUTE OF TECHNOLOGY