A method, system, device and medium for intelligent flood forecasting based on hydrological data feature extraction and sample enhancement
Patent Information
- Application Number
- CN202411377063.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Traditional flood forecasting methods rely on manual observation and empirical judgment, leading to inaccuracies and timeliness issues due to the complexity and uncertainty of meteorological conditions and limitations of hydrological models.
A flood forecasting method combining the temporal GANformer model and the improved Kepler optimization algorithm (IKOA) for hydrological data feature extraction and sample enhancement, utilizing LASSO for feature selection, Gaussian noise augmentation, and a two-stage GANformer model with Sobol sequence initialization and sine-cosine optimization to optimize parameters.
Enhances the accuracy and timeliness of flood forecasting, reducing losses by improving feature extraction, expanding data samples, and optimizing model parameters for real-time and reliable flood warnings.
Smart Images

Figure CN118916851B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of flood forecasting, and in particular relates to a method, system, equipment and medium for intelligent flood forecasting based on hydrological data feature extraction and sample enhancement. Background Art
[0002] Floods are a common natural disaster that has a huge impact on human life and economic development. Accurate and timely flood forecasting is of great significance for reducing the losses caused by floods. However, traditional flood forecasting methods often rely on manual observation and empirical judgment, and their accuracy and timeliness need to be improved. In recent years, with the development of artificial intelligence and big data technologies, using these technologies for flood forecasting has become a new research direction.
[0003] In the traditional flood forecasting method, the forecast mainly relies on meteorological observation data and hydrological models. The main problem of this method is that due to the complexity and uncertainty of meteorological conditions and the limitations of hydrological models, the accuracy and timeliness of the forecast often cannot meet the actual needs. Summary of the invention
[0004] The first object of the present invention is to provide an efficient and accurate flood forecasting method, in the hope of improving the accuracy and timeliness of flood forecasting by combining the temporal GANformer model and the improved Kepler optimization algorithm (IKOA).
[0005] To this end, the above-mentioned purpose of the present invention is achieved through the following technical solutions:
[0006] A flood intelligent forecasting method based on hydrological data feature extraction and sample enhancement includes the following steps:
[0007] S1. Collect historical flood event data, including rainfall, river water level, temperature and other meteorological and hydrological parameters, introduce satellite images and geographic information system data, and perform data cleaning and outlier detection on all data;
[0008] S2, use LASSO (Least Absolute Shrinkage and Selection Operator) method to extract features from input data, and improve the accuracy of feature extraction by adjusting parameters and using more training data;
[0009] S3, using Gaussian data enhancement to add Gaussian noise to the training set;
[0010] S4. Construct a GANformer flood intelligent forecasting model, and propose a new architecture by combining the generative adversarial network GAN and the sequence data feature extractor transformer;
[0011] S5. Use the Sobol sequence to initialize the population of the Kepler optimization algorithm KOA, use the sine-cosine optimization strategy to optimize the Kepler optimization algorithm KOA, improve the local search capability, and obtain the improved IKOA algorithm. Use IKOA to optimize the important parameters of the GANformer model, such as the learning rate, batch size, and number of hidden layers.
[0012] S6. Use the trained and optimized GDA-IKOA-GANformer model for intelligent flood forecasting.
[0013] While adopting the above technical solutions, the present invention may also adopt or combine the following technical solutions:
[0014] As a preferred technical solution of the present invention: in step S2, the minimum absolute value convergence and selection operator algorithm LASSO is used to extract features, and the specific process is as follows:
[0015] LASSO performs feature selection by minimizing the following objective function:
[0016] (1)
[0017] The loss function expression of LASSO regression is as follows:
[0018] (2)
[0019] Where n is the number of samples, is the step size, which needs to be tuned; is the L1 norm, is a differentiable convex function, hour A vector of n dimensions, is the penalty parameter; when As increases, more coefficients become zero, thus selecting fewer features. is the target value of the ith sample, is the eigenvalue of the i-th sample.
[0020] As a preferred technical solution of the present invention: in step S3, the steps of Gaussian data enhancement are as follows:
[0021] S31, Gaussian noise parameter setting, determine the Gaussian noise level to be added to the original data; the formula of Gaussian noise is as follows:
[0022] (3)
[0023] in, x are various parameters that affect flood events, is the mean, is the standard deviation;
[0024] S32: Inject the noise sequence obtained in S31 into the original sample (such as rainfall, lake, river water level) to obtain the enhanced sample Train enh , with R representing rainfall, W representing lake and river water levels, and T representing temperature, the formula can be expressed as:
[0025] (4)
[0026] (5)
[0027] (6)
[0028] in, , It is Gaussian noise generated according to the specified signal-to-noise ratio. , It is the rainfall, lake or river level data with noise added. , They represent the rainfall, lake mud or river level data in the original samples respectively;
[0029] S33, Train the enhanced samples obtained in S32 enh With the original sample Train ori Merge (which can be done simply by concatenating the two datasets vertically) as input for model training.
[0030] As a preferred technical solution of the present invention: in step S4, the steps of constructing the GANformer flood intelligent forecasting model are as follows:
[0031] S41. Flood forecasting process, using sliding window mode to achieve rolling forecast of runoff in different periods. This process slides along the time axis until the end of the data set is reached, forming a data set with a window shape. Input variables include rainfall, river water level, temperature and other meteorological and hydrological parameters.
[0032] S42. Construct a GANformer model with two-stage structures, namely Simplex-Attention and Duplex-Attention, which are used to propagate information from the latent layer to the evolving feature grid, followed by standard convolution and upsampling.
[0033] In the simple attention unidirectional structure Simplex-Attention, the input is defined as X, Y is the latent variable, and the attention calculation formula between the two vector groups is as follows:
[0034] (7)
[0035] (8)
[0036] Among them, Q is the query vector, K is the key vector, and V is the vector that generates the feature representation result based on the original data. All three are obtained by linear transformation of the original data. q(·), k(·), and v(·) are functions that map elements to queries, keys, and values, respectively. X and Y are mapped to Q, K, and V matrices, respectively, with sizes of ;
[0037] get After that, its dimension is , pass the attention information back to X and perform normalization:
[0038] (9)
[0039] The GANformer model uses the retrieved information to control the scale and bias of the elements, and uses the StyleGAN method to pass attention information from Y back to X:
[0040] (10)
[0041] in, , , They are multiplication and addition factors, and their dimensions are , is the normalization function;
[0042] In Duplex-Attention, bidirectional communication can be achieved between latent features and image features, allowing information transfer in a bottom-up and top-down strategy, that is, a combination of two attention operations to achieve bidirectional interaction between X and Y. The attention update rule is as follows:
[0043] (11)
[0044] in, ,pass Calculate the attention between X and Y, and K is the centroid of the attention between X and Y; this design choice enables the latent features to interact with image features, thereby achieving adaptive long-distance communication between remote pixels.
[0045] As a preferred technical solution of the present invention: in step S5, the steps of improving the Kepler optimization algorithm KOA are as follows:
[0046] S51. Use Sobol sequence to initialize the population:
[0047] (12)
[0048] in, represents the i-th planet in the search space; is the random number generated by the Sobol sequence, and up and low are the upper and lower bounds of the population respectively;
[0049] S52. Define gravity:
[0050] (13)
[0051] in, and express and Quality, and The normalized value represented and , is a very small value. is the gravitational constant; is the eccentricity of the planet's orbit, a value between 0 and 1; is a randomly generated value between 0 and 1, used to provide more variation to the gravity value during the optimization process; yes The normalized value of and The Euclidean distance between
[0052] S53, calculate the object speed:
[0053] (14)
[0054] in, represents the speed t of object i in time, is the object i, and represents the upper and lower bounds of the j-th decision of object i, and is a randomly generated value in the interval [0,1]. and are two vectors containing random values between 0 and 1, and represents a randomly selected solution from the population, F is the sign of the search direction, represents the normalized Euclidean distance, , then if an object approaches the sun, it will increase its speed due to the sun’s huge gravitational pull, preventing it from drifting toward the sun; otherwise, the object will slow down;
[0055] S54, update object position:
[0056] (15)
[0057] in, is the new position of object i at time T+1, is the speed required for the object to reach its new position, is the best position of the Sun ever found, and Used as a flag to change the search direction;
[0058] S55. Update the distance to the sun:
[0059] (16)
[0060] Where h is the adaptive factor used to control the sun and the current planet at time t;
[0061] S56. Implement an elitist strategy to ensure optimal positioning of the planets and the Sun:
[0062] (17)
[0063] S57, introduce the sine and cosine optimization strategy and update the planetary positions;
[0064] (18)
[0065] in, represents the position of the ith planet in the tth iteration, is the position of the optimal planet in the tth iteration, To control the parameters, is a random number that follows a uniform distribution.
[0066] As a preferred technical solution of the present invention: the specific process of step S6 is as follows:
[0067] S61, initializing the parameters of the KOA algorithm, including position, orbital eccentricity and orbital period;
[0068] S62. Calculate the predicted value after model training and the actual value of the sample The root mean square error between the two objects is calculated, and the calculated Fit is used as the fitness value of each object in the KOA algorithm:
[0069] (19)
[0070] S63. According to the elitist strategy, the position of each object is calculated, the fitness value of each object is calculated, and the objects are sorted;
[0071] S64, recalculating the position of the object using the sine-cosine optimization strategy, calculating the individual best position, and calculating the individual fitness value, comparing it with the individual fitness value obtained in S63, and selecting the optimal position corresponding to the optimal fitness value;
[0072] S65, determining whether the maximum number of iterations has been reached, if so, outputting the optimal solution and extracting the hyperparameters of the model from it, otherwise returning to step S63;
[0073] S66. Input the obtained training set into the optimized model for prediction, and finally obtain the flood forecast result.
[0074] The second object of the present invention is to provide a flood intelligent forecasting system based on hydrological data feature extraction and sample enhancement.
[0075] To this end, the above-mentioned purpose of the present invention is achieved through the following technical solutions:
[0076] A flood intelligent forecasting system based on hydrological data feature extraction and sample enhancement includes the following modules:
[0077] - A historical flood event data collection module, which is used to collect a variety of meteorological and hydrological parameters including rainfall, river water level, temperature, and introduce satellite images and geographic information system data;
[0078] - A data cleaning module, which is used to clean and detect outliers on the data collected by the historical flood event data collection module;
[0079] - a feature extraction module, which is used to extract features from the data cleaned and detected by the data cleaning module using the LASSO method;
[0080] - A data enhancement module, the data enhancement module is used to add Gaussian noise to the training set using Gaussian data enhancement;
[0081] - A flood intelligent forecasting model construction module, which is used to propose a flood intelligent forecasting model of a GANformer with a new architecture by combining a generative adversarial network (GAN) and a sequence data feature extractor (transformer);
[0082] - Flood intelligent forecasting model optimization module, which is used to initialize the population of Kepler optimization algorithm KOA using Sobol sequence, optimize Kepler optimization algorithm KOA using sine-cosine optimization strategy, improve local search capability, and obtain improved IKOA algorithm. IKOA is used to optimize the important parameters of learning rate, batch size and number of hidden layers of the GANformer model constructed by the flood intelligent forecasting model construction module, and obtain the GDA-IKOA-GANformer flood intelligent forecasting model after training and optimization.
[0083] A third object of the present invention is to provide an electronic device.
[0084] To this end, the above-mentioned purpose of the present invention is achieved through the following technical solutions:
[0085] An electronic device comprising a memory and a processor,
[0086] A memory for storing computer programs that can be run on the processor;
[0087] It is characterized in that the processor is used to execute the steps of the flood intelligent forecasting method based on hydrological data feature extraction and sample enhancement as described above when running the computer program.
[0088] Another object of the present invention is to provide a storage medium.
[0089] To this end, the above-mentioned purpose of the present invention is achieved through the following technical solutions:
[0090] A storage medium having a computer program stored thereon, characterized in that when the computer program is executed by at least one processor, the steps of the flood intelligent forecasting method based on hydrological data feature extraction and sample enhancement as described above are implemented.
[0091] The present invention provides a flood intelligent forecasting method, system, equipment and medium based on hydrological data feature extraction and sample enhancement. First, historical flood event data such as rainfall, river water level and temperature are collected; the input historical flood event data is feature extracted by the minimum absolute value convergence and selection operator algorithm LASSO, thereby reducing the complexity of the model and dividing the data into a training set and a test set; secondly, Gaussian data enhancement is used to add Gaussian noise to the training set, which can effectively increase the amount of data; then, a flood intelligent forecasting model based on GANformer is constructed; the Kepler optimization algorithm KOA is improved by using the Sobol sequence and sine-cosine optimization strategy to obtain an improved IKOA algorithm, and the IKOA algorithm is used to optimize the important parameters of the GANformer model such as the learning rate, batch size and number of hidden layers to improve the accuracy of flood intelligent forecasting; finally, the optimized GANformer model is applied to flood forecasting to provide real-time and accurate flood warning information for flood prevention and disaster reduction. The present invention can effectively improve the accuracy and reliability of flood forecasting and provide strong support for flood prevention and disaster reduction.
[0092] The present invention has the following beneficial effects:
[0093] (1) The present invention adopts LASSO for feature extraction, which can effectively extract features useful for flood forecasting from a large amount of input data; and through Gaussian data enhancement technology, it can expand the number of samples, enhance the generalization ability of the model, and prevent the model from overfitting;
[0094] (2) The present invention adopts the GANformer model for flood forecasting. GANformer uses multiplicative integration to allow flexible region-based modulation. The two-stage structure in the model can balance the expressiveness and efficiency of the model, maintain linear computational overhead while establishing long-term data dependency, and can significantly improve the performance of the model.
[0095] (3) The present invention uses the Sobol sequence to initialize the population of the Kepler optimization algorithm KOA, uses the sine-cosine optimization strategy to optimize the Kepler optimization algorithm KOA, improves the local search capability, and obtains the improved IKOA algorithm. The IKOA is used to optimize the important parameters of the GANformer model, such as the learning rate, batch size, and number of hidden layers, to realize the intelligent flood forecasting, which can improve the accuracy and timeliness of flood forecasting, thereby effectively reducing the losses caused by floods. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] Figure 1 This is a flow chart of the intelligent flood forecasting method based on hydrological data feature extraction and sample enhancement provided by the present invention.
[0097] Figure 2This is a schematic diagram of the GANformer model structure;
[0098] Figure 3 Flowchart for the Kepler Optimization Algorithm (KOA).
[0099] Figure 4 Performance indicator diagram of 7 different prediction models.
[0100] Figure 5 This is a line chart comparing the predicted values and true values of the GDA-IKOA-GANformer model at the Guangyuan site. DETAILED DESCRIPTION
[0101] The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
[0102] like Figure 1-3 As shown, a flood intelligent forecasting method based on hydrological data feature extraction and sample enhancement includes the following steps:
[0103] S1. Collect historical flood event data, including various meteorological and hydrological parameters such as rainfall, river water level, and temperature. At the same time, introduce satellite images and geographic information system (GIS) data, perform data cleaning and outlier detection on all data to ensure data quality and consistency;
[0104] S2, use LASSO method to extract features from input data, and improve the accuracy of feature extraction by adjusting parameters and using more training data;
[0105] S21. LASSO method is a linear regression analysis method, which achieves the purpose of feature selection by penalizing the absolute value of the regression coefficient so that some regression coefficients become zero. Specifically, LASSO performs feature selection by minimizing the following objective function:
[0106] (1)
[0107] The loss function expression of S22 and LASSO regression is as follows:
[0108] (2)
[0109] Where n is the number of samples, is the step size and needs to be tuned. is the L1 norm, is a differentiable convex function, hour A vector of n dimensions, is the penalty parameter. As increases, more coefficients become zero, thus selecting fewer features. is the target value of the ith sample, is the eigenvalue of the i-th sample.
[0110] S3. Using Gaussian Data Augmentation (GDA) to add Gaussian noise to the training set can effectively increase the amount of data, thereby improving the generalization ability of the model and preventing overfitting;
[0111] S31. Gaussian noise parameter setting, determine the Gaussian noise level to be added to the original data. The formula of Gaussian noise is as follows:
[0112] (3)
[0113] Among them, x is the various parameters that affect flood events, is the mean, is the standard deviation.
[0114] S32: Inject the noise sequence obtained in step S31 into the original sample (such as rainfall, lake, river water level) to obtain the enhanced sample Train enh For example, if R represents rainfall, W represents lake and river water levels, and T represents temperature, the formula can be expressed as:
[0115] (4)
[0116] (5)
[0117] (6)
[0118] in, , It is Gaussian noise generated according to the specified signal-to-noise ratio. , It is the rainfall, lake or river level data with noise added. , They represent the rainfall, lake mud or river water level data in the original samples respectively.
[0119] S33, train the enhanced sample obtained in step S32 enh With the original sample Train ori Merge as model training input. This can be done simply by vertically concatenating the two datasets.
[0120] S4. Construct a GANformer flood intelligent forecasting model, and propose a new architecture by combining the generative adversarial network GAN and the sequence data feature extractor transformer;
[0121] S41. The flood forecasting process uses a sliding window mode to achieve rolling forecasts of runoff in different periods. This process slides along the time axis until the end of the data set is reached, forming a data set with a window shape. The input variables include various meteorological and hydrological parameters such as rainfall, river water level, and temperature;
[0122] S42. Construct a GANformer model using two bipartite attention structures, namely simple attention and bipartite attention, which are used to propagate information from the latent layer to the evolving feature grid, followed by standard convolution and upsampling. The bipartite structure can balance the expressiveness and efficiency of the model, and can establish long-term dependencies between data while maintaining linear computational costs.
[0123] In the simple attention unidirectional structure Simplex-Attention, the input is defined as X, Y is the latent variable, and the attention calculation formula between the two vector groups is as follows:
[0124] (7)
[0125] (8)
[0126] Among them, Q is the query vector, K is the key vector, and V is the vector that generates the feature representation result based on the original data. All three are obtained by linear transformation of the original data. q(·), k(·), and v(·) are functions that map elements to queries, keys, and values, respectively. X and Y are mapped to Q, K, and V matrices, respectively, with sizes of ;
[0127] get After that, its dimension is , pass the attention information back to X and perform normalization:
[0128] (9)
[0129] GANformer uses the retrieved information to control the scale and bias of the elements, and uses StyleGAN's method to pass attention information from Y back to X:
[0130] (10)
[0131] in, , , They are multiplication and addition factors, and their dimensions are , is the normalization function;
[0132] In Duplex-Attention, bidirectional communication can be achieved between latent features and image features, allowing information transfer in a bottom-up and top-down strategy, that is, a combination of two attention operations. To achieve bidirectional interaction between X and Y, the attention update rule is as follows:
[0133] (11)
[0134] in, ,pass Calculate the attention between X and Y, and K is the centroid of the attention between X and Y; this design choice enables the latent features to interact with image features, thereby achieving adaptive long-distance communication between remote pixels.
[0135] S5. Use the Sobol sequence to initialize the population of the Kepler optimization algorithm KOA, use the sine-cosine optimization strategy to optimize the Kepler optimization algorithm KOA, improve the local search capability, and obtain the improved IKOA algorithm. Use IKOA to optimize the important parameters of the GANformer model such as learning rate, batch size, and number of hidden layers to improve the accuracy of intelligent flood forecasting;
[0136] S51. Use Sobol sequence to initialize the population:
[0137] (12)
[0138] in, represents the i-th planet in the search space; is the random number generated by the Sobol sequence, and up and low are the upper and lower bounds of the population respectively.
[0139] S52. Define gravity:
[0140] (13)
[0141] in, and express and Quality, and The normalized value represented and , is a very small value. is the gravitational constant; is the eccentricity of the planet’s orbit, a value between 0 and 1 designed to give the KOA a random character; is a randomly generated value between 0 and 1, used to provide more variation to the gravity value during the optimization process; yes The normalized value of and The Euclidean distance between
[0142] S53, calculate the object speed:
[0143] (14)
[0144] in, represents the speed t of object i in time, is the object i, and represents the upper and lower bounds of the j-th decision of object i, and is a randomly generated value in the interval [0,1]. and are two vectors containing random values between 0 and 1, and represents a randomly selected solution from the population, F is the sign of the search direction, represents the normalized Euclidean distance, , then when an object approaches the sun, it will increase its speed due to the sun's huge gravitational force, preventing it from drifting toward the sun. Otherwise, the object will slow down;
[0145] S54, update object position:
[0146] (15)
[0147] in, is the new position of object i at time T+1, is the speed required for the object to reach its new position, is the best position of the Sun ever found, and Used as a flag to change the search direction.
[0148] S55. Update the distance to the sun:
[0149] (16)
[0150] Where h is the adaptive factor used to control the sun and the current planet at time t;
[0151] S56. Implemented an elitist strategy to ensure optimal positioning of the planets and the Sun:
[0152] (17)
[0153] S57, introduce the sine and cosine optimization strategy and update the planetary positions;
[0154] (18)
[0155] in, represents the position of the ith planet in the tth iteration, is the position of the optimal planet in the tth iteration, To control the parameters, is a random number that follows a uniform distribution.
[0156] S6. Use the trained and optimized GANformer model for intelligent flood forecasting.
[0157] S61, initialize the parameters of the KOA algorithm, including position, orbital eccentricity and orbital period;
[0158] S62. Calculate the predicted value after model training and the actual value of the sample The root mean square error between the two objects is calculated, and the calculated Fit is used as the fitness value of each object in the KOA algorithm:
[0159] (19)
[0160] S63, according to the elitist strategy, calculate the position of each object, use formula (17) to calculate the best position of each object, calculate the fitness value of each object, and sort them;
[0161] S64, recalculate the position of the object using the sine-cosine optimization strategy, calculate the individual best position using formula (17), and calculate the individual fitness value, compare it with the individual fitness value obtained in step S63, and select the optimal position corresponding to the optimal fitness value;
[0162] S65, determine whether the maximum number of iterations has been reached, if so, output the optimal solution and extract the model's hyperparameters from it. Otherwise, return to step S63;
[0163] S66: Input the training set obtained in step S33 into the optimized model for prediction, and finally obtain the flood forecast result.
[0164] Furthermore, in order to verify the accuracy of the flood prediction model (GDA-IKOA-GANformer) proposed in the present invention in predicting flood time series and to confirm its effectiveness and improvement potential in the field of flood prediction, the Guangyuan Hydrological Observation Station in Guangyuan City, Sichuan Province was selected as the research target. The 4069 daily runoff data collected by the station from April 2007 to May 2018 were used as analysis samples. The GDA-IKOA-GANformer model was successfully constructed by developing the algorithm using the MATLAB programming language, and compared with five other prediction models, including IKOA-GANformer, GANformer, long short-term memory network (LSTM), back propagation neural network (BP), extreme learning machine (ELM) and time convolution network (TCN), as shown in Table 1 below. Through careful comparative analysis, the present invention aims to evaluate the superiority of the GDA-IKOA-GANformer model in flood prediction and explore its application prospects in hydrological monitoring and early warning systems.
[0165] Table 1 Statistical table of performance indicators of different prediction models
[0166] Model RMSE MAE NSE MAPE GDA-IKOA-GANformer 136.399 74.265 0.873 0.229 IKOA-GANformer 137.061 74.840 0.860 0.248 GANformer 139.570 76.069 0.851 0.255 LSTM 147.055 83.424 0.830 0.279 BP 149.942 86.606 0.808 0.297 ELM 151.475 86.900 0.806 0.309 TCN 156.694 90.564 0.781 0.277
[0167] The results show that the GANformer model has significant advantages in the field of flood prediction. Compared with the traditional LSTM and BP models, it shows higher accuracy and stability in predicting daily runoff flow. The GDA-IKOA-GANformer flood prediction model proposed in this invention is significantly lower than GANformer in terms of RMSE, MAE and MAPE, especially in the NSE index, reaching 0.873, far exceeding GANformer's 0.851, which fully proves the excellent performance of GDA-IKOA-GANformer in the task of daily runoff flow prediction. It not only has high prediction accuracy, but also strong stability, providing an efficient and reliable prediction tool for the field of flood prediction.
[0168] Figure 4 In the report, the performance indicators of the model are presented through various charts: horizontal histogram, line chart, radar chart and vertical histogram. From these charts, it can be clearly observed that the traditional prediction models ELM and TCN performed the worst, and GANformer outperformed LSTM, BP, ELM and TCN in various indicators; adding the IKOA algorithm and GDA to improve the effect is even better and in line with the expected results of the model. The GDA-IKOA-GANformer flood prediction model outperformed all other models in terms of NSE value, reaching 0.87, highlighting the excellent performance of the model in prediction performance.
[0169] Figure 5In the paper, the actual application of the GDA-IKOA-GANformer model at the Guangyuan site was further demonstrated. By comparing the daily runoff data from 2007 to 2018, a total of 4069 data points were predicted and the line graph of the true value, it can be clearly seen that the predicted value is highly consistent with the actual observed value. This intuitive comparison not only verifies the effectiveness of the model, but also shows the high accuracy and reliability of the model in terms of prediction accuracy.
[0170] Comprehensive analysis shows that the GDA-IKOA-GANformer flood prediction model proposed in the present invention shows a strong nonlinear fitting ability when processing data with large changes. At the same time, by introducing the IKOA algorithm and the improvement of GDA, the prediction accuracy of the model has been significantly improved, which fully meets the expected effect of the model. Therefore, it can be confirmed that the model of the present invention has important application value and broad development prospects in the field of flood prediction.
[0171] The above-mentioned specific implementation methods are used to explain the present invention and are only preferred embodiments of the present invention, rather than limiting the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A flood intelligent forecasting method based on hydrological data feature extraction and sample enhancement, characterized in that: The method comprises the following steps: S1. Collect historical flood event data, including rainfall, river water level, temperature and other meteorological and hydrological parameters, introduce satellite images and geographic information system data, and perform data cleaning and outlier detection on all data; S2, use LASSO method to extract features from input data, and improve the accuracy of feature extraction by adjusting parameters and using more training data; S3, using Gaussian data enhancement to add Gaussian noise to the training set; S4. Construct a GANformer flood intelligent forecasting model, and propose a new architecture by combining the generative adversarial network GAN and the sequence data feature extractor transformer; S5. Use the Sobol sequence to initialize the population of the Kepler optimization algorithm KOA, use the sine-cosine optimization strategy to optimize the Kepler optimization algorithm KOA, improve the local search capability, and obtain the improved IKOA algorithm. Use IKOA to optimize the important parameters of the GANformer model, such as the learning rate, batch size, and number of hidden layers. S6. Use the trained and optimized GDA-IKOA-GANformer model for intelligent flood forecasting; In step S2, the minimum absolute value convergence and selection operator algorithm LASSO is used to extract features. The specific process is as follows: LASSO performs feature selection by minimizing the following objective function: The loss function expression of LASSO regression is as follows: Where n is the number of samples, α is the step size, which needs to be tuned; ||θ||1 is the L1 norm, J(θ) is a differentiable convex function, θ is an n×1 vector, i.e., n dimensions, and λ is the penalty parameter; when λ increases, more coefficients will become zero, thus selecting fewer features, y (i) is the target value of the ith sample, x (i) is the eigenvalue of the i-th sample; In step S4, the steps of constructing the GANformer flood intelligent forecasting model are as follows: S41. Flood forecasting process, using sliding window mode to achieve rolling forecast of runoff in different periods. This process slides along the time axis until the end of the data set is reached, forming a data set with a window shape. Input variables include rainfall, river water level, temperature and other meteorological and hydrological parameters. S42. Construct a GANformer model with two-stage structures, namely Simplex-Attention and Duplex-Attention, which are used to propagate information from the latent layer to the evolving feature grid, followed by standard convolution and upsampling. In the simple attention unidirectional structure Simplex-Attention, the input is defined as X, Y is the latent variable, and the attention calculation formula between the two vector groups is as follows: a b (X,Y)=Attention(q(X),k(Y),v(Y)) (8) Among them, Q is the query vector, K is the key vector, and V is the vector that generates the feature representation result based on the original data. All three are obtained by linear transformation of the original data. q(·), k(·), and v(·) are functions that map elements to queries, keys, and values, respectively. X and Y are mapped to Q, K, and V matrices, respectively, with sizes of d×d. Get a b After (X,Y), its dimension is n×d, and the attention information is passed back to X for normalization: u a (X,Y)=LayerNorm(X+a(X,Y)) (9) The GANformer model uses the retrieved information to control the scale and bias of the elements, and follows the StyleGAN approach to pass attention information from Y back to X: Among them, Y:=u a (Y, X), γ(·), β(·) are the multiplication and addition factors, respectively, both of dimension are d×d, and ω(·) is the normalization function; In Duplex-Attention, bidirectional communication can be achieved between latent features and image features, allowing information transfer in a bottom-up and top-down strategy, that is, a combination of two attention operations to achieve bidirectional interaction between X and Y. The attention update rule is as follows: Where X: = u d (X, Y), the attention between X and Y is calculated by K = a(Y, X), where K is the centroid of the attention between X and Y; this design choice enables the latent features to interact with image features, thereby achieving adaptive long-distance communication between remote pixels; In step S5, the steps of improving the Kepler optimization algorithm KOA are as follows: S51. Use Sobol sequence to initialize the population: X i =X up +K i ·(X up -X low ) (12) Among them, X i represents the i-th planet in the search space; K i ∈[0,1] is the random number generated by the Sobol sequence, and up and low are the upper and lower bounds of the population respectively; S52. Define gravity: Among them, m s and m i Represents X s and X i Quality, and The normalized value m s and m i , ε is a very small value, u is the gravitational constant; e i is the eccentricity of the planet's orbit, a value between 0 and 1; r1 is a randomly generated value between 0 and 1, used to provide more variation to the gravity value during optimization; YesR i The normalized value of X s and X i The Euclidean distance between S53, calculate the object speed: Among them, V i (t) represents the velocity of object i in time t, is the object i, and represents the upper and lower bounds of the j-th decision of object i, r3 and r4 are randomly generated values in the interval [0,1]. and are two vectors containing random values between 0 and 1, and represents a randomly selected solution from the population, F is the sign of the search direction, and R i-norm (t) represents the normalized Euclidean distance, R i-norm (t)≤0.5, then the object will increase its speed due to the huge gravitational force of the sun as it approaches the sun, preventing it from drifting toward the sun; otherwise, the object will slow down; S54, update object position: in, is the new position of object i at time T+1, is the speed required for the object to reach its new position, is the best position of the Sun yet found, and F is used as a sign to change the direction of the search; S55. Update the distance to the sun: Where h is the adaptive factor used to control the sun and the current planet at time t; S56. Implement an elitist strategy to ensure optimal positioning of the planets and the Sun: S57, introduce the sine and cosine optimization strategy and update the planetary positions; in, represents the position of the ith planet in the tth iteration, is the position of the optimal planet in the tth iteration, a1 is the control parameter, and a2, a3, and a4 are random numbers that obey a uniform distribution.
2. The method according to claim 1, characterized in that In step S3, the steps of Gaussian data enhancement are as follows: S31, Gaussian noise parameter setting, determine the Gaussian noise level to be added to the original data; the formula of Gaussian noise is as follows: Among them, x is the various parameters that affect flood events, μ is the mean, and σ is the standard deviation; S32, inject the noise sequence obtained in S31 into the original sample to obtain the enhanced sample Train enh , with R representing rainfall, W representing lake and river water levels, and T representing temperature, the formula can be expressed as: R enh =R train +R no (4) IN enh =In train +W no (5) T enh =T train +T no (6) Among them, R no , W no is the Gaussian noise generated according to the specified signal-to-noise ratio, R enh , W enh is the rainfall, lake or river level data after adding noise, R train , W enh They represent the rainfall, lake mud or river level data in the original samples respectively; S33, Train the enhanced samples obtained in S32 enh With the original sample Train ori Merge and use as model training input.
3. The method according to claim 1, characterized in that The specific process of step S6 is as follows: S61, initializing the parameters of the KOA algorithm, including position, orbital eccentricity and orbital period; S62. Calculate the predicted value after model training and the actual value of the sample The root mean square error between the two objects is calculated, and the calculated Fit is used as the fitness value of each object in the KOA algorithm: S63. According to the elitist strategy, the position of each object is calculated, the fitness value of each object is calculated, and the objects are sorted; S64, recalculating the position of the object using the sine-cosine optimization strategy, calculating the individual adaptation position, and calculating the individual fitness value, comparing it with the individual fitness value obtained in S63, and selecting the optimal position corresponding to the optimal fitness value; S65, determining whether the maximum number of iterations has been reached, if so, outputting the optimal solution and extracting the hyperparameters of the model from it, otherwise returning to step S63; S66. Input the obtained training set into the optimized model for prediction, and finally obtain the flood forecast result.
4. A flood intelligent forecasting system based on hydrological data feature extraction and sample enhancement, characterized in that: The system includes the following modules: - A historical flood event data collection module, which is used to collect a variety of meteorological and hydrological parameters including rainfall, river water level, temperature, and introduce satellite images and geographic information system data; - A data cleaning module, which is used to clean and detect outliers on the data collected by the historical flood event data collection module; - a feature extraction module, which is used to extract features from the data cleaned by the data cleaning module and detected for outliers using the LASSO method; The specific operation process of the feature extraction module is as follows: LASSO performs feature selection by minimizing the following objective function: The loss function expression of LASSO regression is as follows: Where n is the number of samples, α is the step size, which needs to be tuned; ||θ||1 is the L1 norm, J(θ) is a differentiable convex function, θ is an n×1 vector, i.e., n dimensions, and λ is the penalty parameter; when λ increases, more coefficients will become zero, thus selecting fewer features, y (i) is the target value of the ith sample, x (i) is the eigenvalue of the i-th sample; - a data enhancement module, the data enhancement module is used to add Gaussian noise to the training set using Gaussian data enhancement; - A flood intelligent forecasting model construction module, which is used to propose a flood intelligent forecasting model of a GANformer with a new architecture by combining a generative adversarial network GAN and a sequence data feature extractor transformer; The specific operation process of the flood intelligent forecasting model construction module is as follows: S41. Flood forecasting process, using sliding window mode to achieve rolling forecast of runoff in different periods. This process slides along the time axis until the end of the data set is reached, forming a data set with a window shape. Input variables include rainfall, river water level, temperature and other meteorological and hydrological parameters. S42. Construct a GANformer model with two-stage structures, namely Simplex-Attention and Duplex-Attention, which are used to propagate information from the latent layer to the evolving feature grid, followed by standard convolution and upsampling. In the simple attention unidirectional structure Simplex-Attention, the input is defined as X, Y is the latent variable, and the attention calculation formula between the two vector groups is as follows: a b (X,Y)=Attention(q(X),k(Y),v(Y)) (8) Among them, Q is the query vector, K is the key vector, and V is the vector that generates the feature representation result based on the original data. All three are obtained by linear transformation of the original data. q(·), k(·), and v(·) are functions that map elements to queries, keys, and values, respectively. X and Y are mapped to Q, K, and V matrices, respectively, with sizes of d×d. Get a b After (X,Y), its dimension is n×d, and the attention information is passed back to X for normalization: u a (X,Y)=LayerNorm(X+a(X,Y)) (9) The GANformer model uses the retrieved information to control the scale and bias of the elements, and follows the StyleGAN approach to pass attention information from Y back to X: Among them, Y:=u a (Y, X), γ(·), β(·) are the multiplication and addition factors, respectively, both of dimension are d×d, and ω(·) is the normalization function; In Duplex-Attention, bidirectional communication can be achieved between latent features and image features, allowing information transfer in a bottom-up and top-down strategy, that is, a combination of two attention operations to achieve bidirectional interaction between X and Y. The attention update rule is as follows: Where X: = u d (X, Y), the attention between X and Y is calculated by K = a(Y, X), where K is the centroid of the attention between X and Y; this design choice enables the latent features to interact with image features, thereby achieving adaptive long-distance communication between remote pixels; -Flood intelligent forecasting model optimization module, which is used to initialize the population of Kepler optimization algorithm KOA using Sobol sequence, optimize Kepler optimization algorithm KOA using sine-cosine optimization strategy, improve local search capability, obtain improved IKOA algorithm, and use IKOA to optimize the important parameters of learning rate, batch size and number of hidden layers of GANformer model constructed by flood intelligent forecasting model construction module, and obtain GDA-IKOA-GANformer flood intelligent forecasting model after training and optimization; The specific operation process of the flood intelligent forecasting model optimization module is as follows: S51. Use Sobol sequence to initialize the population: X i =X up +K i ·(X up -X low ) (12) Among them, X i represents the i-th planet in the search space; K i ∈[0,1] is the random number generated by the Sobol sequence, and up and low are the upper and lower bounds of the population respectively; S52. Define gravity: Among them, m s and m i Represents X s and X i Quality, and The normalized value m s and m i , ε is a very small value, u is the gravitational constant; e i is the eccentricity of the planet's orbit, a value between 0 and 1; r1 is a randomly generated value between 0 and 1, used to provide more variation to the gravity value during optimization; YesR i The normalized value of X s and X i The Euclidean distance between S53, calculate the object speed: Among them, V i (t) represents the velocity of object i in time t, is the object i, and represents the upper and lower bounds of the j-th decision of object i, r3 and r4 are randomly generated values in the interval [0,1]. and are two vectors containing random values between 0 and 1, and represents a randomly selected solution from the population, F is the sign of the search direction, and R i-norm (t) represents the normalized Euclidean distance, R i-norm (t)≤0.5, then the object will increase its speed due to the huge gravitational force of the sun as it approaches the sun, preventing it from drifting toward the sun; otherwise, the object will slow down; S54, update object position: in, is the new position of object i at time T+1, is the speed required for the object to reach its new position, is the best position of the Sun yet found, and F is used as a sign to change the direction of the search; S55. Update the distance to the sun: Where h is the adaptive factor used to control the sun and the current planet at time t; S56. Implement an elitist strategy to ensure optimal positioning of the planets and the Sun: S57, introduce the sine and cosine optimization strategy and update the planetary positions; in, represents the position of the ith planet in the tth iteration, is the position of the optimal planet in the tth iteration, a1 is the control parameter, and a2, a3, and a4 are random numbers that obey a uniform distribution.
5. An electronic device comprising a memory and a processor, A memory for storing computer programs that can be run on the processor; It is characterized in that A processor is used to execute the steps of the flood intelligent forecasting method based on hydrological data feature extraction and sample enhancement as described in any one of claims 1 to 3 when running the computer program.
6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by at least one processor, the steps of the method for intelligent flood forecasting based on hydrological data feature extraction and sample enhancement as described in any one of claims 1 to 3 are implemented.
Citation Information
Cited By
Deep learning model flood forecasting method for less-data region based on data enhancement
CN122594750A
Flood forecasting method based on data enhancement deep learning model in area with little data
CN122594750B
