Flood forecasting method and device based on intelligent optimization neural network

By optimizing variational mode decomposition and feature extraction methods, the shortcomings of noise processing and extreme event prediction in flood forecasting are addressed, achieving high-precision and robust flood forecasting.

CN121303477BActive Publication Date: 2026-05-19HANGZHOU SOUNDBEI SOFTWARE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-12
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing flood forecasting methods are insufficient in predictability when dealing with noise and mode aliasing, manual parameter tuning leads to inefficiency and bias, and they are not robust enough to extreme events.

Method used

The Sparrow Search algorithm is used to optimize the optimal penalty factor α and the optimal number of decompositions K in variational mode decomposition. Robust loss constraints are used to handle outliers, and features are extracted through multi-scale temporal convolutional networks and improved Transformer networks for flood flow prediction.

Benefits of technology

It improves the accuracy and robustness of flood forecasting, reduces the inefficiency and bias of manual parameter adjustment, and enhances the ability to predict extreme events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121303477B_ABST
    Figure CN121303477B_ABST
Patent Text Reader

Abstract

The application provides a flood forecasting method and device based on an intelligent optimization neural network, including the following steps: obtaining original hydrological time series data, performing variational mode decomposition on the original hydrological time series data based on an optimal penalty factor α and an optimal decomposition number K to obtain K intrinsic mode functions; dividing the K intrinsic mode functions into high-frequency intrinsic mode functions, medium-frequency intrinsic mode functions and low-frequency intrinsic mode functions based on the center frequency of each intrinsic mode function in a flood flow prediction network, and fusing the intrinsic mode functions to obtain local time sequence characteristics; fusing global time sequence characteristics and the local time sequence characteristics to obtain global-local fusion characteristics, and inputting the global-local fusion characteristics into a full connection layer to obtain a predicted flood flow value. In the scheme, the optimal penalty factor α and the optimal decomposition number K are globally and automatically optimized through an optimization algorithm, so that the inefficiency and deviation caused by manual parameter adjustment are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of hydrological forecasting, and in particular to a flood forecasting method and apparatus based on intelligent optimized neural networks. Background Technology

[0002] Floods, as one of the most widespread and devastating natural disasters globally, are triggered by a complex array of factors including heavy rainfall and snowmelt. Their hydrological processes exhibit strong nonlinearity, uncertain evolution paths, and dynamically expanding impact areas. Floods not only directly threaten the lives and property of residents within a watershed but also easily trigger secondary disasters such as river siltation and ecological damage, causing long-term impacts on the sustainable socio-economic development of the region. With the intensification of global warming, the frequency and intensity of extreme precipitation events have increased significantly. Simultaneously, the expansion of impermeable surfaces during urbanization has led to rapid changes in watershed underlying surface conditions. Traditional flood forecasting models face new challenges, including lags in the "precipitation-runoff-confluence" chain response and insufficient adaptability to complex underlying surfaces. This contradiction is particularly pronounced in small and medium-sized watersheds and urban rivers where monitoring stations are sparse, highlighting the urgent need to overcome existing technological bottlenecks to improve forecast accuracy and timeliness.

[0003] Current flood forecasting methods can be broadly categorized into four types, each with its limitations. The first type is based on physical mechanism-based hydrodynamic models, which rely on mathematical equations to reconstruct the physical processes of floods. Representative methods include HEC-HMS and MIKE. While these models offer clear physical meaning and strong interpretability, they heavily depend on high-precision topographic and soil parameters, and parameter setting is time-consuming, making them difficult to generalize to watersheds with limited data. The second type is based on statistical and empirical forecasting methods, which rely on historical data to mine statistical correlations, such as the unit hydrograph method and regression analysis. These methods are computationally simple but highly dependent on historical data, and their prediction accuracy and generalization ability significantly decrease when facing extreme events or new climate conditions. The third type is based on machine learning and traditional intelligent algorithms, which learn nonlinear mappings through SVM, random forests, etc. These methods do not require manual construction of physical equations but require a large amount of high-quality data and are sensitive to data noise and outliers, and are insufficient in characterizing the time-dependent structure of flood sequences. Fourthly, there are deep learning-based forecasting methods. Although models such as LSTM, TCN, and Transformer can capture long-term and short-term time series dependencies, they have problems such as being susceptible to noise interference when directly modeling the original sequence, relying on manual tuning of network hyperparameters, and lacking robustness in extreme flood events.

[0004] To address the aforementioned shortcomings, how to eliminate noise and mode aliasing in the input signal, improve the predictability of the input signal, and reduce the inefficiency and deviation caused by manual parameter tuning are urgent technical problems that need to be solved. Summary of the Invention

[0005] This application provides a flood forecasting method and apparatus based on an intelligent optimized neural network. It optimizes the optimal penalty factor α and the optimal number of decompositions K in variational mode decomposition based on the sparrow search algorithm, realizing global automatic optimization of α and K, avoiding the inefficiency and bias of manual parameter tuning. Furthermore, it introduces robust loss constraints in variational mode decomposition to effectively handle outliers in the original hydrological time series data, suppress the interference of outliers on the decomposition process, and ensure that the intrinsic mode functions can accurately reflect the true characteristics of the original data.

[0006] In a first aspect, embodiments of this application provide a flood forecasting method based on an intelligent optimized neural network, the method comprising:

[0007] Raw hydrological time-series data are acquired, and variational mode decomposition is performed on the raw hydrological time-series data based on the optimal penalty factor α and the optimal number of decompositions K to obtain K intrinsic mode functions. An optimized sparrow search algorithm is used to minimize the objective function to obtain the optimal penalty factor α and the optimal number of decompositions K. The optimized sparrow search algorithm introduces chaotic mapping to generate an initial population. The population is iterated based on a multi-objective fitness function, and the iteration step size of the population is adaptively adjusted according to the number of iterations. The objective function is constructed based on the mode energy variance and the average correlation coefficient between modes.

[0008] The intrinsic mode functions (IMFs) are input into a pre-trained flood flow prediction network, which includes a multi-scale temporal convolutional network and an improved Transformer network. Each IMF is input into the multi-scale temporal convolutional network and divided into high-frequency, mid-frequency, and low-frequency IMFs based on the center frequency. Convolutional branches with different dilation rates are used to extract features from the high-frequency, mid-frequency, and low-frequency IMFs respectively. The feature extraction results are then weighted and fused using an attention mechanism to obtain local temporal features. The local temporal features are input into the improved Transformer network to obtain global temporal features. The global and local temporal features are fused to obtain global-local fused features, which are then input into a fully connected layer to obtain the predicted flood flow value.

[0009] Secondly, embodiments of this application provide a flood forecasting device based on an intelligent optimized neural network, comprising:

[0010] The acquisition module is used to acquire raw hydrological time-series data. Based on the optimal penalty factor α and the optimal number of decompositions K, variational mode decomposition is performed on the raw hydrological time-series data to obtain K intrinsic mode functions. An optimized sparrow search algorithm is used to minimize the objective function to obtain the optimal penalty factor α and the optimal number of decompositions K. The optimized sparrow search algorithm introduces chaotic mapping to generate an initial population. The population is iterated based on a multi-objective fitness function, and the iteration step size of the population is adaptively adjusted according to the number of iterations. The objective function is constructed based on the mode energy variance and the average correlation coefficient between modes.

[0011] The prediction module is used to input intrinsic mode functions (IMFs) into a pre-trained flood flow prediction network. The flood flow prediction network includes a multi-scale temporal convolutional network and an improved Transformer network. Each IMF is input into the multi-scale temporal convolutional network and divided into high-frequency, mid-frequency, and low-frequency IMFs based on the center frequency. Convolutional branches with different dilation rates are used to extract features from the high-frequency, mid-frequency, and low-frequency IMFs respectively to obtain feature extraction results. The feature extraction results are then weighted and fused using an attention mechanism to obtain local temporal features. The local temporal features are input into the improved Transformer network to obtain global temporal features. The global and local temporal features are fused to obtain global-local fused features. The global-local fused features are then input into a fully connected layer to obtain the predicted flood flow value.

[0012] Thirdly, embodiments of this application provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute a flood forecasting method based on an intelligent optimized neural network.

[0013] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, which, when executed by a processor, implements a flood forecasting method based on an intelligent optimized neural network.

[0014] The main contributions and innovations of this invention are as follows:

[0015] This application's embodiments optimize the optimal penalty factor α and optimal decomposition quantity K of variational mode decomposition based on the sparrow search algorithm. The objective function is constructed based on the modal energy variance and the average correlation coefficient between modes, achieving global automatic optimization of α and K, avoiding the inefficiency and bias of manual parameter tuning. This application's embodiments introduce robust loss constraints in variational mode decomposition to effectively handle outliers in the original hydrological time series data, suppressing the interference of outliers on the decomposition process and ensuring that the intrinsic mode functions accurately reflect the true characteristics of the original data. This application's embodiments divide the data according to the center frequency of the intrinsic mode functions. High, medium, and low frequency components are extracted separately using causal convolutional branches with different dilation rates, and then weighted and fused through a channel attention mechanism. Different dilation rates are used to adapt to the receptive field requirements of different frequency components, and causal convolution avoids future information leakage. Weighted fusion can highlight important frequency features and improve the effectiveness and relevance of local temporal features. In the embodiments of this application, local temporal features are encoded with multi-dimensional periodic positions using sine wave + annual cycle + quarterly cycle in the flood flow prediction network, thereby helping the model to actively learn runoff patterns with similar cycles and significantly improving the accuracy of long-term flood forecasting.

[0016] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a flowchart of a flood forecasting method based on an intelligent optimized neural network according to an embodiment of this application;

[0019] Figure 2 This is a flowchart of a variational mode decomposition according to an embodiment of this application;

[0020] Figure 3 This is a flowchart of an optimization algorithm according to an embodiment of this application;

[0021] Figure 4 This is a flowchart illustrating an embodiment of obtaining local timing features according to this application;

[0022] Figure 5 This is a flowchart of an improved Transformer network according to an embodiment of this application;

[0023] Figure 6 This is a structural block diagram of a flood forecasting device based on an intelligent optimized neural network according to an embodiment of this application;

[0024] Figure 7 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0026] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0027] Example 1

[0028] This application provides a flood forecasting method based on an intelligent optimized neural network. It optimizes the optimal penalty factor α and the optimal number of decompositions K in variational mode decomposition using a sparrow search algorithm, achieving global automatic optimization of α and K. This avoids the inefficiency and bias of manual parameter tuning. Furthermore, it introduces robust loss constraints into the variational mode decomposition to effectively handle outliers in the original hydrological time series data, suppressing their interference with the decomposition process and ensuring that the intrinsic mode functions accurately reflect the true characteristics of the original data. Specifically, refer to... Figure 1 The method includes:

[0029] Raw hydrological time-series data are acquired, and variational mode decomposition is performed on the raw hydrological time-series data based on the optimal penalty factor α and the optimal number of decompositions K to obtain K intrinsic mode functions. An optimized sparrow search algorithm is used to minimize the objective function to obtain the optimal penalty factor α and the optimal number of decompositions K. The optimized sparrow search algorithm introduces chaotic mapping to generate an initial population. The population is iterated based on a multi-objective fitness function, and the iteration step size of the population is adaptively adjusted according to the number of iterations. The objective function is constructed based on the mode energy variance and the average correlation coefficient between modes.

[0030] The intrinsic mode functions (IMFs) are input into a pre-trained flood flow prediction network, which includes a multi-scale temporal convolutional network and an improved Transformer network. Each IMF is input into the multi-scale temporal convolutional network and divided into high-frequency, mid-frequency, and low-frequency IMFs based on the center frequency. Convolutional branches with different dilation rates are used to extract features from the high-frequency, mid-frequency, and low-frequency IMFs respectively. The feature extraction results are then weighted and fused using an attention mechanism to obtain local temporal features. The local temporal features are input into the improved Transformer network to obtain global temporal features. The global and local temporal features are fused to obtain global-local fused features, which are then input into a fully connected layer to obtain the predicted flood flow value.

[0031] In the current embodiment, the raw hydrological data includes historical runoff data and historical weather data. Before performing variational mode decomposition on the raw hydrological data, all the raw hydrological data are aligned and standardized to provide high-quality input for subsequent processing.

[0032] In this scheme, the flowchart of variational mode decomposition is as follows: Figure 2 As shown, the original hydrological time series data is decomposed into K intrinsic mode functions based on variational mode decomposition. The intrinsic mode functions characterize the basic components obtained after variational mode decomposition of the original hydrological time series data. Different intrinsic mode functions represent the vibration modes of the original hydrological time series data at different time scales.

[0033] In the current embodiment, the variational mode decomposition is a signal decomposition method used to partition a signal in the frequency domain and effectively separate its components. The formula for variational mode decomposition is expressed as follows:

[0034]

[0035] Where t represents time information. This is the original hydrological time series data. Let k be the eigenmode function at time t. Let K represent the center frequencies of different modes, and K be the optimal number of decompositions. For time partial derivative operators, Let j be the Dirac delta function, and j be the imaginary unit. represents the Hilbert transform kernel component, * represents the convolution operator, and e represents the inverse Fourier transform phase factor. This is used to identify constraints.

[0036] Specifically, in the variational mode decomposition process, the optimal penalty factor α and the optimal number of decompositions K are first obtained based on the optimization algorithm. The optimal number of decompositions K is used to control the number of eigenmode functions generated, and the optimal penalty factor α is used to control the compactness of each eigenmode function to avoid over-decomposition or under-decomposition. If K is too small, multiple scale features will be compressed into one eigenmode function. If K is too large, redundant modes without physical meaning will be generated. If α is too small, the modal energy of the eigenmode function will leak. If α is too large, the modal energy of the eigenmode function will be over-compacted.

[0037] In the current embodiment, the flowchart of the optimization algorithm is as follows: Figure 3 As shown, in the step of minimizing the objective function using the optimization algorithm to obtain the optimal penalty factor α and the optimal number of decompositions K, the non-overlapping center frequencies of the various intrinsic mode functions are used as the constraint condition for the optimized sparrow search algorithm. Chaotic mapping is used to obtain the initial penalty factor and the initial number of decompositions as the initial population. The initial penalty factor and the initial number of decompositions are iteratively updated based on the multi-objective fitness function, wherein the iteration step size is adaptively adjusted according to the number of iterations of the population.

[0038] Furthermore, the formulas for obtaining the initial penalty factor and the initial number of decompositions using chaotic mapping are expressed as follows:

[0039]

[0040] in, Let be the chaotic sequence at time t. For control parameters, The value range is 3.5 < μ < 43.5, which represents the chaotic sequence at time t+1. In other words, this scheme achieves this by... The system continuously updates the data to obtain a chaotic sequence that matches the initial population size, and then maps the chaotic sequence to the actual parameter set to obtain the initial population.

[0041] Furthermore, a dynamic step size factor is constructed, and the iteration step size of the optimization algorithm in each iteration is obtained based on the dynamic step size factor. The formula for the dynamic step size factor is expressed as:

[0042]

[0043] in, Let t be the initial step size and t be the current iteration number. The decay exponent, The maximum number of iterations is defined as follows: This scheme constructs a step size iteration factor to use a large step size in the early iteration stage to enhance the global search, and gradually converges in the later stage to refine the solution space, thereby ensuring the stability of the optimization algorithm.

[0044] Furthermore, in each iteration of the population, a reverse candidate solution is generated based on the current optimal penalty factor and the optimal initial decomposition number. If the reverse candidate solution is better than the current optimal penalty factor and the optimal initial decomposition number, then the current optimal penalty factor and the optimal initial decomposition number are replaced by the reverse candidate solution.

[0045] Specifically, the formula for generating reverse candidate solutions based on the current optimal penalty factor and the optimal initial decomposition number after each iteration is expressed as:

[0046]

[0047] in, To optimize the minimum search boundary of the algorithm, To optimize the maximum search boundary of the algorithm, This represents the current optimal solution, i.e., the current optimal penalty factor and the optimal initial number of decompositions. It is a reverse candidate solution, that is, when If the reverse candidate solution is superior to the current optimal solution, then the reverse candidate solution is used to replace the current optimal penalty factor and the optimal initial decomposition number.

[0048] Specifically, generating reverse candidate solutions can prevent the current optimal solution from getting trapped in a local optimum.

[0049] In the current embodiment, the sparrow search algorithm is an intelligent optimization algorithm that simulates the foraging and defense behaviors of a sparrow flock. The flock consists of three types of individuals: Discoverers, Joiners, and Warners. The goal of the sparrow search algorithm is to find an optimization problem. Discoverers represent individuals with high energy and information within the population and are primarily responsible for guiding the flock in its food search. The position update formula for discoverers is:

[0050]

[0051] in, ST is the warning value, and S is the safety value. When this indicates that the current environment is safe, the exploration is carried out in an exponential manner, that is, the search scope is expanded. When the current environment is considered dangerous, random movement is initiated to avoid getting trapped in a local optimum. L is a matrix with all elements being 1×d, where d is the search dimension. L is used to ensure dimensional consistency in position updates. , are random numbers and , , Let t be the maximum number of iterations and t be the current iteration number. This represents the discoverer's position at the current iteration number t. Let (i,j) be the position of the discoverer at iteration number t+1, where (i,j) are the position coordinates.

[0052] Joiners are individuals with lower energy levels in the group who find food locations by following discoverers. The update formula for joiners is:

[0053]

[0054] in, This is a 1×d matrix used to ensure dimensional consistency during position updates. are random numbers and , This is the worst position globally. Let t be the global optimal position of the discoverer, t be the iteration number, and (i,j) be the position coordinates. A is a 1×d matrix with 1 or -1, and d is the search dimension.

[0055] The vigilant is used to simulate the alert response of a sparrow when it detects a predator. The update formula for the vigilant is:

[0056]

[0057] Where K is a random number, and , It is the smallest constant used to avoid a denominator of 0. These are step size control parameters. Let (i,j) be the current globally optimal position, t be the current iteration number, and (i,j) be the position coordinates. This represents the current fitness value of the sparrow. This represents the current optimal fitness value for sparrows. This represents the worst fitness value for the current sparrow.

[0058] In the current embodiment, the objective function is expressed as follows:

[0059]

[0060] in, Let Variance be the modal energy. This represents the energy of the k-th eigenmode function. The average correlation coefficient between modes. and These are the weighting coefficients. Let K represent the optimal number of decompositions and the optimal penalty factor α when the objective function is minimized.

[0061] Specifically, the modal energy variance reflects the uniformity of energy distribution within each intrinsic mode function. The smaller the modal energy variance, the more uniform the energy distribution within each intrinsic mode function. The average correlation coefficient between modes is used to reflect the degree of correlation between each intrinsic mode function. The average correlation coefficient between modes ranges from (0,1). The closer the value of the average correlation coefficient between modes is to 1, the stronger the independence between each intrinsic mode function.

[0062] Furthermore, a robust loss constraint is introduced into the objective function, and the formula for the robust loss constraint is expressed as follows:

[0063]

[0064] in, The robust loss is y, where y is the true observed value. This refers to the predicted values ​​output by the flood flow prediction network. Specifically, actual observed values ​​represent the measured flood runoff values ​​in the watershed at a specific moment or time period, typically derived from monitoring data from hydrological stations. This is the loss threshold.

[0065] In this scheme, the loss threshold is set to 0.1-0.3 based on the data standard deviation, that is, when If the value is less than or equal to the loss threshold, it indicates that the original hydrological time-series data is normal data, and in this case, it can be used. As a robust loss, when If the value exceeds the loss threshold, it indicates the presence of outliers in the original hydrological time-series data. To prevent these outliers from interfering with variational mode decomposition, the following approach is adopted: It is used as a robust loss to suppress the impact of outliers.

[0066] In the current embodiment, the optimization algorithm uses the non-overlapping center frequencies of the various intrinsic mode functions as a constraint.

[0067] Specifically, by adding a correlation constraint term between the various intrinsic mode functions to the Lagrangian function as a constraint condition, the formula is expressed as:

[0068]

[0069] Where t represents time information. This is the original hydrological time series data. Let k be the eigenmode function at time t. Let K represent the center frequencies of different modes, and K be the optimal number of decompositions. For time partial derivative operators, Let j be the Dirac delta function, and j be the imaginary unit. represents the Hilbert transform kernel component, * represents the convolution operator, and e represents the inverse Fourier transform phase factor. For Lagrange multipliers, This is a collaborative penalty factor used to limit the correlation between different intrinsic mode functions. This represents the correlation between the i-th intrinsic mode function and the j-th intrinsic mode function.

[0070] In the current embodiment, a threshold segmentation method is used in the flood flow prediction network to divide the K intrinsic mode functions into high-frequency intrinsic mode functions, mid-frequency intrinsic mode functions, and low-frequency intrinsic mode functions. Specifically, a first segmentation frequency and a second segmentation frequency are set. Intrinsic mode functions with a center frequency less than or equal to the first segmentation frequency are designated as low-frequency intrinsic mode functions, intrinsic mode functions with a center frequency greater than or equal to the second segmentation frequency are designated as high-frequency intrinsic mode functions, and intrinsic mode functions with a center frequency greater than the first segmentation frequency and less than the second segmentation frequency are designated as mid-frequency intrinsic mode functions.

[0071] In the current embodiment, the flowchart for obtaining local temporal features is as follows: Figure 4 As shown, a first convolutional branch, a second convolutional branch, and a third convolutional branch are constructed, with the dilation rate of the first convolutional branch being greater than that of the second convolutional branch, which in turn is greater than that of the third convolutional branch. The first convolutional branch is used to extract features from high-frequency intrinsic mode functions, the second convolutional branch is used to extract features from mid-frequency intrinsic mode functions, and the third convolutional branch is used to extract features from low-frequency intrinsic mode functions. All three convolutional branches use causal convolution.

[0072] Specifically, the feature extraction of the convolutional branch is represented by the following formula:

[0073]

[0074] Where k=1 corresponds to the first convolution branch, k=2 corresponds to the second convolution branch, and k=3 corresponds to the third convolution branch. It is the ReLU activation function. For the input of the corresponding convolution branch, These are the weight parameters for the corresponding convolutional branches. This is the bias for the corresponding convolution branch. Indicates the expansion rate The kernel size is Causal convolution.

[0075] In the current embodiment, a channel attention mechanism is used to weightedly fuse the feature extraction results of the first convolutional branch, the second convolutional branch, and the third convolutional branch, as expressed by the formula:

[0076]

[0077] in, For local temporal features, The feature extraction results of the convolution branch, These are the corresponding weighting coefficients.

[0078] Specifically, ,in, Assign importance scores to convolution branches. It is obtained through learning in a fully connected layer, where e is the exponent. This is the score set for all convolutional branches.

[0079] In the current embodiment, in the set step, an initial parameter set is obtained using a chaotic mapping, and the initial parameter set is iteratively updated with a preset number of iterations, and the iteration step size decreases with the number of iterations. After each iteration, a reverse candidate solution is generated based on the current optimal initial parameter set. If the reverse candidate solution is better than the current optimal initial parameter set, the current optimal initial parameter set is replaced with the reverse candidate solution. After the preset number of iterations is completed, the optimal initial parameter set is obtained.

[0080] Furthermore, the objective function of the flood flow prediction network is:

[0081]

[0082] in, Let the objective function of the flood flow prediction network be , , , The weights are adjustable; MSE is the mean squared error; MAE is the mean absolute error. The goodness of fit is denoted as .

[0083] In the current embodiment, the flowchart of the improved Transformer network is as follows: Figure 5 As shown, in the improved Transformer network, periodic features are obtained by periodically encoding local temporal features. Then, multi-head attention is performed on the periodic features to obtain global temporal features. Finally, global and local temporal features are fused to obtain global-local fused features.

[0084] Furthermore, the local temporal features are input into the improved Transformer network for sinusoidal positional encoding, annual cycle encoding, and quarterly cycle encoding to obtain sinusoidal positional encoding results, annual cycle encoding results, and quarterly cycle encoding results. The sinusoidal positional encoding results, annual cycle encoding results, and quarterly cycle encoding results are fused to obtain periodic features. The periodic features are then subjected to multi-head attention computation to obtain global temporal features.

[0085] Specifically, the formula for periodic positional encoding of local temporal features is expressed as follows:

[0086]

[0087] in, It has periodic characteristics. The result of sinusoidal position encoding. The annual cycle coding result, The length of the annual cycle, The results of seasonal cycle coding, This represents the length of the seasonal cycle.

[0088] Specifically, in this scheme, the annual cycle length is 365 days and the seasonal cycle length is 90 days. By embedding the inherent annual / seasonal cycle information of the hydrological sequence into the model, the model can actively learn similar runoff patterns of similar cycles, thereby improving the accuracy of long-term predictions.

[0089] In the step of obtaining global temporal features through multi-head attention calculation of periodic features, a temperature coefficient and entropy regularization term are added to the multi-head attention calculation. The multi-head attention calculation with the added temperature coefficient and entropy regularization term is as follows:

[0090]

[0091] Where Q is the query matrix, K is the key matrix, and V is the value matrix, all of which are constructed based on periodic features. The dimension of the key vector. For temperature coefficient, This is the entropy regularization term.

[0092] Specifically, adding a temperature coefficient to multi-head attention computation can smooth the attention distribution and avoid over-concentration, while adding an entropy regularization term can increase the diversity of attention weights. It is a coefficient that adjusts the strength of entropy regularity. This represents the entropy value of the attention weight.

[0093] Specifically, this scheme adds a temperature parameter and an entropy regularization term to the original multi-head attention mechanism, so that the attention mechanism can maintain a stable distribution under extreme flood peak samples, preventing excessive concentration of attention on a single moment, thereby improving the robustness of perception of sudden events.

[0094] In the step of fusing global and local temporal features to obtain global-local fused features, gated residual connections are performed between global and local temporal features to obtain gated residual results. The gated residual results are then fused with local temporal features across layers to obtain global-local fused features.

[0095] Specifically, the formula for gated residual connection between global and local temporal features is expressed as follows:

[0096]

[0097] in, The result is the gated residual, where G is the gate factor. For Hadamard's element-wise product, It is the Sigmoid activation function. For local temporal features, For global time series features, where, , , These are learnable parameters.

[0098] Specifically, the formula for cross-layer fusion of gated residual results and local temporal features is expressed as follows:

[0099]

[0100] in, For global-local fusion features, For the gated residual results, For local temporal features, This is for cross-layer fusion weights.

[0101] In the current embodiment, the formula for inputting global-local fusion features into the fully connected layer is expressed as:

[0102]

[0103] in, For global-local fusion features, To predict flood flow values, , These are the learnable parameters in the fully connected layer.

[0104] Example 2

[0105] Based on the same concept, referencing Figure 6 This application also proposes a flood forecasting device based on an intelligent optimized neural network, comprising:

[0106] The acquisition module is used to acquire raw hydrological time-series data. Based on the optimal penalty factor α and the optimal number of decompositions K, variational mode decomposition is performed on the raw hydrological time-series data to obtain K intrinsic mode functions. An optimized sparrow search algorithm is used to minimize the objective function to obtain the optimal penalty factor α and the optimal number of decompositions K. The optimized sparrow search algorithm introduces chaotic mapping to generate an initial population. The population is iterated based on a multi-objective fitness function, and the iteration step size of the population is adaptively adjusted according to the number of iterations. The objective function is constructed based on the mode energy variance and the average correlation coefficient between modes.

[0107] The prediction module is used to input intrinsic mode functions (IMFs) into a pre-trained flood flow prediction network. The flood flow prediction network includes a multi-scale temporal convolutional network and an improved Transformer network. Each IMF is input into the multi-scale temporal convolutional network and divided into high-frequency, mid-frequency, and low-frequency IMFs based on the center frequency. Convolutional branches with different dilation rates are used to extract features from the high-frequency, mid-frequency, and low-frequency IMFs respectively to obtain feature extraction results. The feature extraction results are then weighted and fused using an attention mechanism to obtain local temporal features. The local temporal features are input into the improved Transformer network to obtain global temporal features. The global and local temporal features are fused to obtain global-local fused features. The global-local fused features are then input into a fully connected layer to obtain the predicted flood flow value.

[0108] Example 3

[0109] This embodiment also provides an electronic device, see reference. Figure 7 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.

[0110] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0111] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0112] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.

[0113] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any of the flood forecasting methods based on intelligent optimized neural networks in the above embodiments.

[0114] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.

[0115] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0116] The input / output device 408 is used to input or output information. In this embodiment, the input information may be raw hydrological time-series data, etc., and the output information may be parameters of the flood flow prediction network, predicted flood flow values, etc.

[0117] Optionally, in this embodiment, the processor 402 can be configured to perform the following steps via a computer program:

[0118] Raw hydrological time-series data are acquired, and variational mode decomposition is performed on the raw hydrological time-series data based on the optimal penalty factor α and the optimal number of decompositions K to obtain K intrinsic mode functions. An optimized sparrow search algorithm is used to minimize the objective function to obtain the optimal penalty factor α and the optimal number of decompositions K. The optimized sparrow search algorithm introduces chaotic mapping to generate an initial population. The population is iterated based on a multi-objective fitness function, and the iteration step size of the population is adaptively adjusted according to the number of iterations. The objective function is constructed based on the mode energy variance and the average correlation coefficient between modes.

[0119] The intrinsic mode functions (IMFs) are input into a pre-trained flood flow prediction network, which includes a multi-scale temporal convolutional network and an improved Transformer network. Each IMF is input into the multi-scale temporal convolutional network and divided into high-frequency, mid-frequency, and low-frequency IMFs based on the center frequency. Convolutional branches with different dilation rates are used to extract features from the high-frequency, mid-frequency, and low-frequency IMFs respectively. The feature extraction results are then weighted and fused using an attention mechanism to obtain local temporal features. The local temporal features are input into the improved Transformer network to obtain global temporal features. The global and local temporal features are fused to obtain global-local fused features, which are then input into a fully connected layer to obtain the predicted flood flow value.

[0120] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0121] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0122] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 7Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.

[0123] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0124] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A flood forecasting method based on intelligent optimized neural networks, characterized in that, Includes the following steps: Raw hydrological time-series data is acquired. Variational mode decomposition (VMD) is performed on the raw hydrological time-series data based on the optimal penalty factor α and the optimal number of decompositions K to obtain K intrinsic mode functions (EMFs). An optimized sparrow search algorithm is used to minimize the objective function to obtain the optimal penalty factor α and the optimal number of decompositions K. The optimized sparrow search algorithm introduces chaotic mapping to generate an initial population. The population is iterated based on a multi-objective fitness function, and the iteration step size is adaptively adjusted according to the number of iterations. The objective function is constructed based on the mode energy variance and the average correlation coefficient between modes. In each iteration of the population, a reverse candidate solution is generated based on the current optimal penalty factor and the optimal initial number of decompositions. If the reverse candidate solution is better than the current optimal penalty factor and the optimal initial number of decompositions, then the reverse candidate solution replaces the current optimal penalty factor and the optimal initial number of decompositions. The objective function is expressed as follows: in, Let Variance be the modal energy. The average correlation coefficient between modes. and These are the weighting coefficients. This represents the optimal number of decompositions K and the optimal penalty factor α when the objective function is minimized; Intrinsic mode functions (EMFs) are input into a pre-trained flood discharge prediction network, which includes a multi-scale temporal convolutional network and an improved Transformer network. Each EMF is input into the multi-scale temporal convolutional network and divided into high-frequency, mid-frequency, and low-frequency EMFs based on its center frequency. Convolutional branches with different dilation rates are used to extract features from the high-frequency, mid-frequency, and low-frequency EMFs, respectively. The feature extraction results are then weighted and fused using an attention mechanism to obtain local temporal features. Specifically, the first, second, and third convolutional branches are constructed. The network employs a multiplication branch, where the expansion rate of the first convolutional branch is greater than that of the second convolutional branch, which in turn is greater than that of the third convolutional branch. The first convolutional branch is used to extract features from high-frequency intrinsic mode functions (IMFs), the second convolutional branch is used to extract features from mid-frequency IMFs, and the third convolutional branch is used to extract features from low-frequency IMFs. All three convolutional branches utilize causal convolution. Local temporal features are input into the improved Transformer network to obtain global temporal features. These global and local temporal features are then fused to obtain global-local fused features. These global-local fused features are then input into the fully connected layer to obtain the predicted flood discharge value.

2. The flood forecasting method based on intelligent optimized neural networks according to claim 1, characterized in that, The non-overlapping center frequencies of the intrinsic mode functions are used as the constraint condition for the optimized sparrow search algorithm. Chaotic mapping is used to obtain the initial penalty factor and the initial number of decompositions as the initial population. The initial penalty factor and the initial number of decompositions are iteratively updated based on the multi-objective fitness function, wherein the iteration step size is adaptively adjusted according to the number of iterations of the population.

3. The flood forecasting method based on intelligent optimized neural networks according to claim 2, characterized in that, A robust loss constraint is introduced into the objective function, and the formula for the robust loss constraint is as follows: ; in, The robust loss is y, where y is the true observed value. The predicted values ​​output by the flood flow prediction network. This is the loss threshold.

4. The flood forecasting method based on intelligent optimized neural networks according to claim 1, characterized in that, In the improved Transformer network, periodic features are obtained by periodically encoding local temporal features. Then, multi-head attention is performed on the periodic features to obtain global temporal features. Finally, global and local temporal features are fused to obtain global-local fused features.

5. The flood forecasting method based on intelligent optimized neural networks according to claim 4, characterized in that, Local temporal features are input into an improved Transformer network for sinusoidal positional encoding, annual cycle encoding, and quarterly cycle encoding to obtain sinusoidal positional encoding results, annual cycle encoding results, and quarterly cycle encoding results. The sinusoidal positional encoding results, annual cycle encoding results, and quarterly cycle encoding results are fused to obtain periodic features. Multi-head attention is then performed on the periodic features to obtain global temporal features.

6. A flood forecasting device based on an intelligent optimized neural network, characterized in that, include: The acquisition module is used to acquire raw hydrological time-series data. Based on the optimal penalty factor α and the optimal number of decompositions K, variational mode decomposition is performed on the raw hydrological time-series data to obtain K intrinsic mode functions. An optimized sparrow search algorithm is used to minimize the objective function to obtain the optimal penalty factor α and the optimal number of decompositions K. The optimized sparrow search algorithm introduces chaotic mapping to generate an initial population. The population is iterated based on a multi-objective fitness function, and the iteration step size is adaptively adjusted according to the number of iterations. The objective function is constructed based on the mode energy variance and the average correlation coefficient between modes. In each iteration of the population, a reverse candidate solution is generated based on the current optimal penalty factor and the optimal initial number of decompositions. If the reverse candidate solution is better than the current optimal penalty factor and the optimal initial number of decompositions, then the reverse candidate solution replaces the current optimal penalty factor and the optimal initial number of decompositions. The objective function is expressed as follows: in, Let Variance be the modal energy. The average correlation coefficient between modes. and These are the weighting coefficients. This represents the optimal number of decompositions K and the optimal penalty factor α when the objective function is minimized; The prediction module is used to input intrinsic mode functions (IMFs) into a pre-trained flood flow prediction network. This network includes a multi-scale temporal convolutional network and an improved Transformer network. Each IMF is input into the multi-scale temporal convolutional network and divided into high-frequency, mid-frequency, and low-frequency IMFs based on its center frequency. Convolutional branches with different dilation rates are used to extract features from these three IMFs respectively. The extracted features are then weighted and fused using an attention mechanism to obtain local temporal features. Specifically, the first and second convolutional branches are constructed... The first convolutional branch has a higher expansion rate than the second convolutional branch, which in turn has a higher expansion rate than the third convolutional branch. The first convolutional branch is used to extract features from high-frequency intrinsic mode functions (IMFs), the second convolutional branch is used to extract features from mid-frequency IMFs, and the third convolutional branch is used to extract features from low-frequency IMFs. All three convolutional branches use causal convolution. Local temporal features are input into the improved Transformer network to obtain global temporal features. Global and local temporal features are fused to obtain global-local fused features. These global-local fused features are then input into the fully connected layer to obtain the predicted flood discharge value.

7. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, implements a flood forecasting method based on an intelligent optimized neural network as described in any one of claims 1-5.