Cross-domain flood forecasting system based on spatial encoding and coupled bidirectional lstm
By introducing a spatial coding and coupled bidirectional LSTM architecture into the flood forecasting system, the problems of communication interruption and limited forecast accuracy in existing technologies are solved, and high-precision, disaster-resistant, and generalizable flood forecasting is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAMEN SIXIN INTERNET OF THINGS TECH CO LTD
- Filing Date
- 2026-05-13
- Publication Date
- 2026-06-26
Smart Images

Figure CN122286192A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flood prediction technology, and more specifically to a cross-domain flood prediction system based on spatial coding and coupled bidirectional LSTM. Background Technology
[0002] In current flood forecasting practices, a common approach is to process static spatial attributes such as catchment area and slope into one-dimensional vectors, concatenate them with meteorological observation data at each time step, and then input them into a one-way recurrent neural network for runoff prediction. In addition, some systems employ a three-layer deployment architecture of perception layer, edge layer, and cloud layer; however, the edge nodes typically only handle data aggregation and uploading, lacking deep learning feature extraction or local inference and forecasting capabilities.
[0003] However, the existing practices still have the following shortcomings: First, the data acquisition hardware and forecasting algorithms are isolated from each other. In extreme rainstorms and other disaster scenarios, communication links are easily interrupted, and the cloud forecasting system will completely fail, lacking basic operational resilience. Second, the processing of static attributes of the watershed (such as digital elevation models and soil type distribution) is too simplistic. Flattening them into one-dimensional vectors will destroy the two-dimensional spatial heterogeneity structure that determines the confluence path, such as the slope gradient direction and the uneven distribution of soil, resulting in limited cross-regional forecast accuracy. Third, the commonly used one-way recurrent neural network structure cannot effectively utilize the deterministic future rainfall information provided by numerical weather prediction when modeling at the current prediction time (e.g., the absence of future rain will inevitably lead to a decrease in the flood peak), thus causing the flood peak prediction value to be systematically low.
[0004] In view of the above, this application is hereby submitted. Summary of the Invention
[0005] This invention provides a cross-domain flood prediction system based on spatial coding and coupled bidirectional LSTM, which can at least partially improve the above-mentioned problems.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM includes: a multimodal sensing node layer, a watershed edge gateway layer, and a cloud-based forecasting engine layer; The multimodal sensing node layer is configured to determine the node type based on the actual geographical features and monitoring needs of the watershed, and to collect and preprocess hydrological data based on the node type, wherein at least one node type is determined each time; The watershed edge gateway layer is configured to use an inverse distance weighted interpolation algorithm to transform the preprocessed hydrological data to obtain a sensor topology weight map, and to perform spatial feature pre-calculation on the sensor topology weight map to generate an initial state vector. The cloud-based forecasting engine layer is configured to initialize the initial state vector as the cell state of a forward LSTM, and use a coupling matrix to inject the hidden state of the forward LSTM into the gating unit of the reverse LSTM in real time. The final feature representation is obtained through bidirectional collaborative processing of forward and reverse information, and the final feature representation is decoded to generate traffic forecasts for the next few days.
[0008] In summary, this invention provides a cross-domain flood prediction system based on spatial coding and coupled bidirectional LSTM. This system employs a three-layer collaborative architecture, including a multimodal sensing node layer, a watershed edge gateway layer, and a cloud-based forecasting engine layer. The sensing node layer adaptively determines at least one node type based on the actual geographical characteristics and monitoring needs of the target watershed, and completes the acquisition and preprocessing of hydrological data, ensuring the system's deployment flexibility and data reliability in different watershed environments. The watershed edge gateway layer receives the preprocessed data, transforms the discrete node data into a continuous spatial grid using an inverse distance weighted interpolation algorithm, and simultaneously generates a sensor topology weight map representing the credibility distribution of the sensing network. Furthermore, it pre-calculates spatial features from this weight map to generate a low-dimensional initial state vector, significantly reducing the data bandwidth requirements for uploading to the cloud. The cloud-based forecasting engine layer takes time-series meteorological data (including historical observations and future weather forecasts) and the initial state vector as input, and performs forward and reverse long short-term memory network processing. The initial state vector is used as the initial cell state of the forward LSTM, so that the spatial prior of the watershed runs through the time-series process. At the same time, the interaction and coordination of forward and reverse information are realized through the coupling mechanism. Finally, the fused feature representation is decoded to output the flow forecast for the next few days.
[0009] Compared with existing technologies, this invention has the following advantages: First, the combination of adaptive configuration of the perception node layer and spatial feature pre-computation of the edge gateway layer enables the system to operate effectively even with only a few or a single type of node, significantly improving the forecast generalization ability across regions and in areas without measured data. Second, directly injecting the initial state vector generated by spatial encoding into the forward LSTM cell state avoids the redundancy and interference caused by repeated splicing of spatial information and time steps in traditional methods, thus improving forecast accuracy. Third, the cloud engine adopts a bidirectional LSTM structure and introduces forward and reverse information coupling, enabling the model to fully utilize the future rainfall information provided by numerical weather prediction, effectively reducing flood peak forecast errors. Fourth, the collaborative mechanism between the edge gateway and the cloud not only saves uplink bandwidth for static data but also enables degraded forecasts based on local edge computing power when communication is interrupted, greatly enhancing the system's disaster resilience under extreme rainstorm conditions. Attached Figure Description
[0010] Figure 1This is a schematic diagram of the process of a cross-domain flood prediction system based on spatial coding and coupled bidirectional LSTM provided in an embodiment of the present invention. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0012] refer to Figure 1 As shown, the first embodiment of the present invention discloses a trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM, which includes: a multimodal sensing node layer (this layer consists of a basin-distributed multimodal hydrological sensing node array, mainly responsible for data acquisition), a basin edge gateway layer (this layer is responsible for intelligent data fusion and lightweight forecasting), and a cloud forecasting engine layer (this layer realizes bidirectional dual-layer LSTM multi-step runoff forecasting and assessment): S1, the multimodal sensing node layer is configured to determine the node type based on the actual geographical features and monitoring needs of the watershed, and to collect and preprocess hydrological data based on the node type, wherein at least one node type is determined each time; The multimodal sensing node layer includes sensor units and RK3588 edge computing units. The sensor units are configured to collect hydrological data in real time according to the node type. The sensor units transmit hydrological data to the RK3588 edge computing units through various communication protocols. The RK3588 edge computing units are configured to preprocess the hydrological data. The node types include three categories: main stream cross-section nodes, tributary confluence nodes, and slope runoff monitoring nodes. When the node type is a main stream cross-section node, the sensor unit uses FMCW radar water level gauges, H-ADCP velocity profilers, tipping bucket rain gauges, evaporation pans, and small weather stations, which have high-precision water level, flow velocity, and meteorological data acquisition capabilities. When the node type is a tributary confluence node, the sensor unit uses pressure water level gauges, electromagnetic flow meters, tipping bucket rain gauges, micro-weather stations, and water quality turbidity meters, which are mainly used to monitor the water level, flow rate, and water quality of the tributaries. When the node type is a slope runoff monitoring node, the sensor unit uses soil moisture sensors, slope runoff acquisition troughs, and micro-rain gauges, which focus on monitoring slope runoff.
[0013] Specifically, S1 further includes: the preprocessing steps of the RK3588 edge computing unit are as follows: clock synchronization processing is performed on the collected hydrological data to complete the timestamp alignment (i.e., GPS / BeiDou time synchronization is used to ensure that the time accuracy is less than 1μs), and the hydrological data after timestamp alignment is checked for rationality to ensure that the hydrological data is within the preset reasonable range. The Kalman filter algorithm is used to predict and impute missing values in hydrological data, and the imputed data is then standardized. Data from tributary nodes and slope nodes are aggregated to the master node, and online inference is performed using an INT8 quantization encoder to obtain preprocessed hydrological data.
[0014] In this embodiment, firstly, a multimodal sensing node layer is configured based on the actual geographical characteristics and monitoring needs of the target watershed. This sensing node layer includes sensor units and RK3588 edge computing units. The types of nodes to be deployed are determined according to the specific conditions of the watershed. There are three types of nodes: main stream cross-section nodes, tributary confluence nodes, and slope runoff monitoring nodes. At least one node type is determined each time, meaning one or more types can be selected based on the watershed characteristics. For example, in a plain river section with only a main stream and no major tributaries or significant slope runoff, only main stream cross-section nodes can be deployed; while in a small mountain watershed, both main stream cross-section nodes and slope runoff monitoring nodes need to be deployed simultaneously to capture the rapid contribution of slope confluence to flood peaks. This flexible node configuration allows the present invention to adapt to watersheds with different hydrological and geographical conditions, significantly improving the generalization ability of cross-regional deployment and avoiding the resource waste or data loss caused by the "one-size-fits-all" fixed sensor layout in existing technologies.
[0015] When the node type is determined to be a main stream cross-section node, the sensor unit is equipped with an FMCW radar water level gauge, an H-ADCP velocity profiler, a tipping bucket rain gauge, an evaporation pan, and a small weather station to collect meteorological data such as water level, flow velocity, rainfall, evaporation, and temperature, humidity, wind pressure, etc. When the node type is a tributary confluence node, a pressure water level gauge, an electromagnetic flow meter, a tipping bucket rain gauge, a micro-weather station, and a water quality turbidity meter are configured to monitor the tributary's water level, flow rate, rainfall, meteorological data, and water turbidity. When the node type is a slope runoff monitoring node, a soil moisture sensor, a slope runoff acquisition trough, and a micro-rain gauge are configured to acquire slope soil moisture, runoff, and micro-scale rainfall information. The above sensors transmit the real-time collected hydrological data to the RK3588 edge computing unit via multiple communication protocols such as RS485, RS232, and SDI-12.
[0016] After receiving sensor data, the RK3588 edge computing unit performs a series of preprocessing steps to ensure data quality and provide reliable input for subsequent spatial fusion at the edge gateway. First, clock synchronization is performed: using a GPS / BeiDou timing module, all sensor data is timestamped with high precision, achieving microsecond-level time alignment. This process ensures that sensor data from different nodes and of different types can be fused on the same time base, avoiding forecast deviations caused by time drift. This is a crucial foundation for the system's high-precision cross-regional forecasting. Subsequently, the timestamped data undergoes physical validity verification, checking whether water level, rainfall, and flow velocity are within preset reasonable ranges. For example, water level cannot be negative, and cumulative rainfall should not exceed local extreme rainfall thresholds. Outliers caused by sensor malfunctions or interference are eliminated.
[0017] For the unavoidable missing values in data acquisition, this invention employs the Kalman filter algorithm for prediction and imputation. Specifically, based on the state-space model of the hydrological time series, the Kalman filter recursively estimates the optimal value for the missing time point, filling the gaps using historical information and the correlation between current observations, thus forming a continuous and complete time series. This preprocessing step significantly improves data integrity, ensuring that subsequent spatial interpolation and time series forecasting will not fail due to short-term interruptions at individual nodes, and enhancing the system's resilience in harsh environments. Subsequently, the imputed data undergoes standardization, converting hydrological data of different dimensions (such as water level, rainfall, and flow velocity) to a uniform numerical range, eliminating the impact of magnitude differences on model training and inference.
[0018] Data from tributary nodes and slope nodes are aggregated to the main node (typically the edge computing unit corresponding to the main stream cross-section node) via LoRa wireless communication. The RK3588 edge computing unit of the main node embeds an INT8 quantization encoder to perform online inference on the aggregated data, outputting preprocessed hydrological data. INT8 quantization technology significantly reduces computational load and storage consumption with almost no loss of accuracy, enabling the edge computing unit to complete data preprocessing in real time and upload only lightweight feature data to the edge gateway, thereby saving communication bandwidth and reducing the system's dependence on the backbone network. Practice has shown that this edge preprocessing mechanism can reduce static data uplink bandwidth by more than 99%. Even when extreme rainstorms cause communication link congestion or interruption, the system can still maintain basic early warning functions by relying on the degraded forecasting capabilities of the edge side.
[0019] S2, the watershed edge gateway layer is configured to use an inverse distance weighted interpolation algorithm to transform the preprocessed hydrological data to obtain a sensor topology weight map, and to perform spatial feature pre-calculation on the sensor topology weight map to generate an initial state vector; The watershed edge gateway layer uses NVIDIA Jetson AGX Orin as its hardware platform, which has powerful data processing capabilities (275 TOPS). Its functional modules include clock synchronization, missing value imputation, watershed grid fusion, and lightweight local forecast sub-models, ensuring the accuracy and timeliness of the data.
[0020] Specifically, S2 further includes: using an exponential model to fit the variogram function to process the preprocessed hydrological data and determine the spatial relationship between each node; When it is determined that the number of nodes in a certain region is greater than or equal to the threshold, the weights are solved using the Kriging equations, and the watershed data is interpolated to obtain the watershed raster tensor. When it is determined that the number of nodes in a certain region is less than the threshold or the Kriging interpolation is unstable, the IDW method is used to supplement the interpolation and obtain the watershed grid tensor. Based on the watershed grid tensor, a sensor topology weight map is generated, and the sensor topology weight map is used as the 8th channel.
[0021] Features of the 8th channel static attribute raster are extracted using an INT8 quantized ResNet network (Residual Network), and Spatial Pyramid Pooling (SPP) is introduced to obtain an SPP multi-scale concatenated feature vector. Its formula is F is the input feature map. For splicing operations, This indicates that the input feature map is processed. Max pooling of windows This indicates that the input feature map is processed. Max pooling of windows This indicates that the input feature map is processed. Max pooling of windows; The SPP multi-scale feature vector is concatenated using a fully connected layer. Dimensionality reduction is performed to obtain the initial state vector. , It is the hyperbolic tangent function. It is a fully connected layer. It is the set of real numbers.
[0022] In this embodiment, the edge gateway layer first performs spatial relationship analysis on the received preprocessed hydrological data. It uses an exponential model to fit the variogram function to determine the spatial correlation between sensing nodes within the watershed. The variogram function quantitatively describes the similarity of data points at different distances and is a key basis for subsequent spatial interpolation. Through this step, the system can accurately capture the spatial distribution structure of elements such as water level and rainfall within the watershed, preserving necessary two-dimensional spatial information for cross-regional forecasting and overcoming the spatial heterogeneity loss problem caused by flattening static attributes into a one-dimensional vector in existing technologies.
[0023] Next, the edge gateway layer dynamically selects the interpolation strategy based on node density. When the number of nodes in a certain area is greater than or equal to a preset threshold (e.g., 5), the system adopts the ordinary Kriging interpolation method. This method uses the fitted variogram function to assign optimal weights to each known node by solving the Kriging equations, thereby performing an unbiased optimal estimate of the interpolation point and generating a high-precision watershed raster tensor (with a spatial resolution of 500m to 1km and time steps aligned to 60 minutes). Kriging interpolation can consider the spatial layout of nodes and the statistical characteristics of data, providing smooth and accurate rasterization results in areas with relatively dense nodes. Conversely, when the number of nodes in a certain area is less than the threshold or Kriging interpolation becomes unstable due to abnormal data distribution, the system automatically switches to the Inverse Distance Weighting (IDW) interpolation method for supplementation. IDW is based on the principle that "the closer the distance, the higher the similarity," using the inverse power of the distance as the weight for weighted averaging, and can stably output the raster tensor even under harsh conditions of sparse or unevenly distributed nodes. This adaptive interpolation strategy ensures both high accuracy in node-rich regions and availability in node-scarce regions, thereby improving the system's robustness under various data conditions.
[0024] After obtaining the watershed grid tensor, the edge gateway layer further generates a sensor topology weight map, which is then integrated as the 8th channel into the subsequent static attribute grid. The sensor topology weight map reflects the data reliability of the sensing network at different spatial locations: areas with dense nodes and high data quality have higher weights, while areas with sparse nodes or low data reliability have correspondingly lower weights. This design allows the subsequent feature extraction process to consciously focus on areas with high sensing reliability, reducing prediction bias caused by uneven sensor deployment and improving the model's applicability in watersheds with scarce measured data.
[0025] Subsequently, the edge gateway layer uses an INT8-quantized ResNet network to extract multi-level features from 8-channel static attribute rasters, including sensor topology weight maps. INT8 quantization significantly reduces computational cost and memory usage while maintaining the expressive power of the original model, making it possible to run complex convolutional neural networks on edge hardware. The ResNet network effectively mitigates gradient degradation during deep network training through residual connection structures, enabling it to learn rich spatial patterns from raster data, such as slope gradient direction, spatial distribution of soil types, and confluence paths. Based on the feature maps output by ResNet, the system introduces a Spatial Pyramid Pooling (SPP) module. This module performs max pooling operations in parallel with three different window sizes, specifically... window, Window and The window is then used to concatenate the three pooling results to form a multi-scale concatenated feature vector. This means that SPP can simultaneously capture the macroscopic topographic contours of the watershed (through...). Pooling), mesoscopic sub-basin structure (through...) Pooling) and microscopic local details (through Pooling allows subsequent models to see both the "forest" and the "trees," significantly improving their adaptability to watersheds of different sizes.
[0026] Finally, the edge gateway layer uses a multilayer perceptron (MLP) to reduce the dimensionality of the SPP multi-scale stitched feature vector, compressing it into a 256-dimensional initial state vector. The hyperbolic tangent function (tanh) is then used to constrain each element of the vector to the range [-1, 1]. This initial state vector is a highly condensed representation of the static spatial attributes of the entire watershed. It retains key spatial heterogeneity information while maintaining a fixed low dimensionality, facilitating uploading to the cloud. The edge gateway layer only needs to upload this vector along with a small amount of time-series meteorological data to the cloud, without transmitting the original large-size raster data, thus saving over 99% of the uplink bandwidth for static data. More importantly, when extreme weather causes communication disruptions, the lightweight local forecast sub-model built into the edge gateway layer can directly perform downgraded forecasts using the generated initial state vector and locally cached meteorological data, maintaining basic early warning capabilities and greatly enhancing the system's disaster resilience. Through the above steps, this invention achieves spatial feature pre-computation at the edge, providing a compact and informative input to the cloud while ensuring system availability under harsh network conditions.
[0027] In simple terms, the SPP (Spatial Pyramid Pooling) multi-scale spatial encoder structure diagram (including sensor weight fusion channels) demonstrates the structure of the SPP. Its input includes data from eight static attribute grids, covering information such as terrain, soil moisture, and snow cover rate, as well as a sensor node deployment density weight map, reflecting the synergy between perceptual topology and spatial attributes. Res-Block: Feature extraction is performed through multiple convolutional layers and activation functions, outputting a feature map. Three-level SPP: Features at different scales are extracted through multiple layers of max pooling operations, ultimately concatenating them into a high-dimensional feature vector. MLP dimensionality reduction: The feature vector is dimensionality reduced and constrained to the [-1,1] range using the Tanh activation function to adapt to the LSTM cell state initialization. The final output feature vector will serve as the initial cell state for the bidirectional LSTM forward branch.
[0028] S3, the cloud-based forecasting engine layer is configured to initialize the initial state vector as the cell state of a forward LSTM, and use a coupling matrix to inject the hidden state of the forward LSTM into the gating unit of the reverse LSTM in real time. The final feature representation is obtained through bidirectional collaborative processing of forward and reverse information, and the final feature representation is decoded to generate traffic forecasts for the next few days. The input to this layer includes edge pre-computation data, historical time-series data, and future weather forecast fields. The core algorithm is a bidirectional LSTM with coupling matrix and a seq2seq decoder (Sequence-to-Sequence, seq2seq), and the output is the future traffic forecast and confidence score.
[0029] Specifically, S3 further includes: acquiring time-series meteorological data and initial state vectors. and the initial state vector The initial positive cell state as a unit of the positive long short-term memory network. This allows spatial prior memory to permeate the temporal sequence, generating a positive information flow. This positive information flow contains multiple positive hidden states, and its formula is: , Let be the positive hidden state at time t. It is a positive long short-term memory network unit. The input data is at time t. This represents the forward hidden state at time t-1. This represents the positive cell state at time t-1; The forward hidden state is injected into the reverse gating through a preset coupling matrix U, and the formula is as follows: , This is the inverted input gate at time t. It is the Sigmoid activation function. This is the weight matrix of the inverse input gate. To be and To splice, This represents the reverse hidden state at time t+1. This is the coupling matrix corresponding to the inverse input gate. This is the bias term for the inverted input gate; The forward hidden state and the backward hidden state are concatenated to obtain the final feature representation at time t. The final feature representation is processed using a seq2seq decoder to obtain traffic forecasts for the next few days. Let be the reverse hidden state at time t. To be and Then, the parts are assembled.
[0030] In this embodiment, the input to this layer includes three parts: the initial state vector pre-computed by the edge gateway, historical hydrological and meteorological time-series data for the previous 180 days (such as rainfall, water level, flow rate, etc.), and numerical weather prediction (NWP) data for the next 5 days. The cloud engine uses a coupled matrix bidirectional long short-term memory network combined with a seq2seq decoder as its core algorithm, and finally outputs the flow rate forecast values and corresponding confidence scores for the next few days.
[0031] The cloud engine first acquires time-series meteorological data and an initial state vector, and then directly uses this initial state vector as the initial positive cell state of the forward Long Short-Term Memory (LSTM) network unit. This is significantly different from the traditional approach of simply concatenating spatial information with the input data at each time step. By using the spatial encoding vector as the initial value of the cell state, the spatial prior knowledge formed by the static attributes of the watershed (such as topographic slope, soil type distribution, river course, etc.) is integrated throughout the entire time-series prediction process, continuously influencing the memory update of the LSTM from the first time step to the last. This design allows the model to "know" the geographical endowment of the predicted watershed before receiving any meteorological data, thereby more accurately simulating the runoff response to rainfall. Especially in watersheds without measured data, this mechanism can significantly improve the initial accuracy of the forecast, demonstrating the cross-regional generalization advantage of this invention.
[0032] During the forward LSTM processing, the system starts from the earliest historical moment (e.g., day 1) and sequentially inputs observational data (including rainfall, evaporation, temperature, etc.) for each time step, updating the forward hidden state moment by moment. The forward information flow propagates along the timeline from the past to the future, gradually accumulating an understanding of the watershed's hydrological processes. Simultaneously, the cloud engine runs a reverse LSTM branch in parallel. In contrast to the forward branch, the reverse LSTM starts from the current moment (or the furthest future moment) and propagates information in the past direction. The reverse branch can use future weather forecast data to constrain the current moment's forecast: for example, when the NWP indicates no rain for the next three days, the reverse LSTM already "knows" at the current moment that there will be no subsequent water replenishment, thus causing the flood peak prediction to show a downward trend earlier, avoiding the flood peak lag or overestimation problems common in one-way models.
[0033] To achieve deep collaboration between the forward and reverse branches, this invention designs a coupling matrix U. Taking the input gate of the reverse LSTM as an example, its computation not only depends on the previous hidden state and the current input of the reverse branch, but also explicitly introduces the hidden state of the forward LSTM at the current time step through the coupling matrix. That is, when deciding "how much new information to accept," the reverse LSTM simultaneously refers to the understanding of the forward LSTM at the same time step. Similarly, the forget gate and output gate also receive the injection of the forward hidden state through their respective coupling matrices. This intermediate layer interaction breaks the limitation of the two branches being independent of each other in traditional bidirectional LSTMs, realizing true information coupling. The forward branch can pass its "memory" of the historical sequence to the reverse branch in real time, while the reverse branch, after reading future information, feeds back the constraints to the training process of the forward branch. Ultimately, this allows the model to utilize historical observations and future forecasts more evenly, reducing the relative error of flood peak prediction by about 20%.
[0034] After the forward and backward LSTMs have traversed all time steps, the system concatenates the forward and backward hidden states at each time step to obtain the final feature representation for that moment. This concatenated vector integrates information flows from both the past to the future and from the future to the past, encompassing both long-term dependence on historical events and predictions of future weather patterns. This feature representation is then fed into a seq2seq decoder. The decoder, typically composed of several fully connected layers or additional LSTM layers, maps the fixed-dimensional feature vectors to the forecast target space, directly outputting daily or hourly runoff values for the next five days (e.g., the next five days). The system also simultaneously outputs a confidence score for each forecast value, which can be calculated based on the model's uncertainty estimate or the variance of ensemble learning, providing users with a reference for forecast reliability.
[0035] In simple terms, it utilizes a coupled matrix bidirectional LSTM core structure (forward and reverse information flow), primarily focusing on the core structure of coupled matrix bidirectional LSTM. Its timeline shows the information flow from the furthest point in history (t=1) to the current time (t=180) and the future forecast (t=185). Forward LSTM: It receives the initial input state vector, processes it through multiple LSTM units, and generates a forward information flow; Reverse LSTM: It transmits information from the current time to the past, generating a reverse information flow. Information fusion is then performed: the forward and reverse information are concatenated to form the final feature representation, which is then passed to a seq2seq decoder for further processing; the final output is the future traffic forecast.
[0036] Preferably, in this embodiment, the method further includes: introducing a gradient equalization weighted loss function during the training phase. Its formula is: n is the number of training samples. Let j be the recent weights of the j-th training sample. Let j be the true value of the j-th training sample. Let j be the predicted value of the j-th training sample. The standard deviation of historical runoff in the watershed. This is a preset constant.
[0037] Specifically, in this embodiment, to address the significant differences in runoff levels between different watersheds (for example, the annual average runoff in arid and humid areas may differ by more than two orders of magnitude), a gradient-balanced weighted loss function is introduced during the model training phase. This loss function is calculated as follows: First, for each training sample, the absolute value of the difference between its true and predicted values is calculated and multiplied by the recent weight corresponding to that sample. The weighted absolute errors of all samples are summed and divided by the total number of samples to obtain the first term. The principle of recent weight allocation is to assign greater weight to samples closer to the current time, making the model focus more on recent forecast accuracy and penalizing errors from earlier historical periods less. This helps the model maintain sensitivity to recent dynamic changes while learning long-term hydrological patterns. Second, for each training sample, the square of the difference between its true and predicted values is calculated, multiplied by the same recent weight, and then divided by the square of the sum of the watershed's historical runoff standard deviation and a small constant. This ratio of all samples is summed and divided by the total number of samples to obtain the second term. The historical runoff standard deviation reflects the natural interannual or seasonal fluctuations in the runoff of a watershed. Humid regions exhibit large runoff variability and a large standard deviation, while arid regions have small runoff variability and a small standard deviation. Dividing the squared error by the square of the standard deviation has the following effect: for watersheds with large runoff variability, the denominator is larger, compressing the error contribution; for watersheds with small runoff variability, the denominator is smaller, amplifying the error contribution. Thus, the large runoff samples in humid regions, which might have previously dominated the gradient, no longer hold an absolute advantage, while the gradients of small runoff samples in arid regions are effectively enhanced, achieving balanced learning between watersheds of different magnitudes. A pre-set small constant is used to avoid a zero denominator, ensuring numerical stability. Finally, the first and second terms are added to obtain the gradient balance weighted loss function. During backpropagation, the model aims to minimize this loss function, updating all trainable parameters, including the LSTM and coupling matrix.
[0038] By employing the aforementioned gradient-equalization weighted loss function, this invention effectively addresses the problem that traditional mean squared error loss methods tend to favor large-flow samples in humid regions during cross-regional training, leading to severe degradation of forecasting capabilities in arid regions. Practice has shown that this loss function improves the convergence speed of arid region models by approximately three times, while maintaining forecast accuracy in humid regions. This allows the trained model to achieve consistently excellent performance across various watersheds globally. In other words, even when facing small arid watersheds with scarce historical data, this invention can still fully learn their limited hydrological patterns through the gradient equalization mechanism, significantly broadening the model's applicability. This is another important beneficial effect that distinguishes this invention from existing deep learning hydrological forecasting schemes.
[0039] Preferably, in this embodiment, the formula for the training effectiveness evaluation index (NSE) used in the training phase is: , Here, T is the time step index, and T is the total number of time steps. for The measured runoff value at time [time]. for Predicted runoff value at time, for The mean of the measured runoff at time [time]. The mean of the measured runoff is given. The closer the value of the training effectiveness evaluation index NSE is to 1, the better the training effect.
[0040] Specifically, in this embodiment, the cloud-based forecasting engine layer uses the Nash efficiency coefficient (NSE) as an evaluation metric for the model's training effectiveness during the offline training phase. The calculation method is as follows: First, for each time step within the evaluation period, the squared difference between the measured runoff value and the predicted runoff value at that moment is calculated, and the squared differences of all time steps are summed to obtain the sum of squared prediction errors. Simultaneously, the arithmetic mean of all measured runoff values within that period is calculated. Then, for each time step, the squared difference between the measured runoff value and this mean is calculated, and the squared differences of all time steps are summed to obtain the total variance of the measured sequence. Finally, the ratio of the sum of squared prediction errors to the total variance of the measured sequence is subtracted from 1 to obtain the NSE value. The time step index ranges from 1 to the total number of time steps T, and the value of T is determined based on the length of the actual training data; for example, a 180-day historical diurnal series can be used. Measured runoff values are obtained through hydrological station observations, and predicted runoff values are output by the model of this invention.
[0041] The NSE ranges from negative infinity to 1. The closer the value is to 1, the better the model's prediction matches the measured sequence, indicating better training performance. Specifically, when NSE equals 1, the predicted value is completely consistent with the measured value, representing an ideal and perfect prediction; when NSE equals 0, the model's prediction performance is equivalent to directly using historical averages; when NSE is negative, the model's prediction performance is even worse than simple mean prediction, rendering the model unusable. In hydrological practice, an NSE of 0.75 or higher is generally considered to indicate good forecasting capability and suitability for practical application. This invention has been trained and tested in multiple watersheds across different climate zones globally, with an average NSE consistently above 0.75, fully validating the advanced nature and generalization ability of the proposed three-layer architecture and coupled bidirectional LSTM algorithm.
[0042] During training, this invention employs the aforementioned gradient equalization weighted loss function for parameter optimization, while using NSE as a performance monitoring metric on the validation set. Whenever the NSE on the validation set improves, the current model parameters are saved. After training, the model with the highest NSE on the validation set is selected as the final forecast model. The combined use of NSE and the gradient equalization loss function ensures the numerical stability of the model optimization process and provides an intuitive and quantitative evaluation standard for forecast performance, facilitating engineers' assessment of the model's usability in actual watersheds. This evaluation mechanism makes the technical solution of this invention not only innovative in algorithm design but also clearly operable in engineering implementation, contributing to the commercial application of deep learning flood forecasting technology. In summary, this invention discloses a cross-regional flood prediction method and system based on multimodal edge coding and coupled bidirectional long short-term memory networks. It constructs a three-layer hardware-software collaborative architecture consisting of a sensing node layer, a watershed edge gateway layer, and a cloud-based forecasting engine layer. The sensing node layer adaptively configures at least one type of node based on the actual geographical characteristics of the watershed: main stream cross-section nodes, tributary confluence nodes, and slope runoff monitoring nodes. It collects hydrological data such as water level, flow velocity, rainfall, evaporation, and soil moisture in real time using various sensors, including FMCW radar water level gauges, H-ADCP current profilers, and soil moisture sensors. Preprocessing, such as clock synchronization, physical rationality verification, Kalman filtering missing value imputation, standardization, and INT8 quantization encoding, is performed by the RK3588 edge computing unit to ensure data quality. The watershed edge gateway layer utilizes the NVIDIA Jetson AGX Orin platform. It fits the variogram function using an exponential model and dynamically selects Kriging interpolation or inverse distance weighted interpolation based on node density to transform discrete data into a watershed raster tensor. Simultaneously, it generates a sensor topology weight map as the 8th channel. Multi-scale spatial features are then extracted via an INT8-quantized ResNet network and spatial pyramid pooling. This is further reduced to a 256-dimensional initial state vector using a multilayer perceptron, significantly saving uplink bandwidth. The cloud-based forecast engine layer receives this initial state vector, historical time-series data, and future numerical weather forecasts. It initializes this vector as the cell state of a forward LSTM, allowing spatial priors to permeate the temporal process. The forward hidden state is injected into the gating units of the inverse LSTM in real-time through a coupling matrix, achieving deep synergy between forward and inverse information. Finally, a seq2seq decoder outputs multi-day runoff forecasts and confidence scores. During offline training, a gradient-equalized weighted loss function normalized to the standard deviation of historical watershed runoff is used, with the Nash efficiency coefficient as the evaluation metric.
[0043] Compared with existing technologies, the advantages of this invention are: 1. Strong cross-regional generalization ability: The SPP spatial encoder fully preserves the two-dimensional spatial regularity of topographic gradient and soil distribution, significantly improving the forecast availability in ungauged basins. 2. Full utilization of future meteorological information: Coupled bidirectional LSTM breaks the limitation of unidirectional causality, enabling the model to perceive NWP rainfall attenuation information in advance, reducing the relative error of flood peak prediction by about 20%. 3. Elimination of extreme magnitude gradient imbalance: The normalized loss function increases the convergence speed of the arid zone model by 3 times, achieving balanced learning across various global watersheds. 4. Extremely optimized bandwidth and high availability: The edge pre-computation mechanism saves more than 99% of the uplink bandwidth for static data; and in the event of network outage, it can rely on the local computing power of the gateway to perform degraded forecasts, making the system extremely resilient to disasters.
[0044] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A transdomain flood prediction system based on spatial coding and coupled bidirectional LSTM, characterized in that, include: Multimodal sensing node layer, watershed edge gateway layer, and cloud forecasting engine layer; The multimodal sensing node layer is configured to determine the node type based on the actual geographical features and monitoring needs of the watershed, and to collect and preprocess hydrological data based on the node type, wherein at least one node type is determined each time; The watershed edge gateway layer is configured to use an inverse distance weighted interpolation algorithm to transform the preprocessed hydrological data to obtain a sensor topology weight map, and to perform spatial feature pre-calculation on the sensor topology weight map to generate an initial state vector. The cloud-based forecasting engine layer is configured to initialize the initial state vector as the cell state of a forward LSTM, and use a coupling matrix to inject the hidden state of the forward LSTM into the gating unit of the reverse LSTM in real time. The final feature representation is obtained through bidirectional collaborative processing of forward and reverse information, and the final feature representation is decoded to generate traffic forecasts for the next few days.
2. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 1, characterized in that, The multimodal sensing node layer includes sensor units and RK3588 edge computing units. The sensor units are configured to collect hydrological data in real time according to the node type. The sensor units transmit hydrological data to the RK3588 edge computing units through various communication protocols. The RK3588 edge computing units are configured to preprocess the hydrological data. The node types include three categories: main stream cross-section nodes, tributary confluence nodes, and slope runoff monitoring nodes. When the node type is a main stream cross-section node, the sensor units used include FMCW radar water level gauges, H-ADCP flow profilers, tipping bucket rain gauges, evaporation pans, and small weather stations. When the node type is a tributary confluence node, the sensor units used include pressure water level gauges, electromagnetic flow meters, tipping bucket rain gauges, micro-weather stations, and water quality turbidity meters. When the node type is a slope runoff monitoring node, the sensor units used include soil moisture sensors, slope runoff acquisition troughs, and micro-rain gauges.
3. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 2, characterized in that, The preprocessing steps for the RK3588 edge computing unit are as follows: The collected hydrological data is clock-synchronized to align the timestamps, and the time-stamp-aligned hydrological data is checked for reasonableness to ensure that the hydrological data is within the preset reasonable range. The Kalman filter algorithm is used to predict and impute missing values in hydrological data, and the imputed data is then standardized. Data from tributary nodes and slope nodes are aggregated to the master node, and online inference is performed using an INT8 quantization encoder to obtain preprocessed hydrological data.
4. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 1, characterized in that, The watershed edge gateway layer uses NVIDIA Jetson AGX Orin as its hardware platform, and its functional modules include clock synchronization, missing value imputation, watershed grid fusion, and lightweight local forecast sub-model.
5. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 1, characterized in that, The preprocessed hydrological data is transformed using an inverse distance weighted interpolation algorithm to obtain a sensor topology weight map, specifically: The hydrological data were processed by fitting the variogram with an exponential model to determine the spatial relationships between nodes. When it is determined that the number of nodes in a certain region is greater than or equal to the threshold, the weights are solved using the Kriging equations, and the watershed data is interpolated to obtain the watershed raster tensor. When it is determined that the number of nodes in a certain region is less than the threshold or the Kriging interpolation is unstable, the IDW method is used to supplement the interpolation and obtain the watershed grid tensor. Based on the watershed grid tensor, a sensor topology weight map is generated, and the sensor topology weight map is used as the 8th channel.
6. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 5, characterized in that, Spatial feature pre-calculation is performed on the sensor topology weight graph to generate an initial state vector, specifically as follows: The features of the 8th channel static attribute raster are extracted using an INT8 quantized ResNet network, and spatial pyramid pooling is introduced to obtain the SPP multi-scale concatenated feature vector. Its formula is F is the input feature map. For splicing operations, This indicates that the input feature map is processed. Max pooling of windows This indicates that the input feature map is processed. Max pooling of windows This indicates that the input feature map is processed. Max pooling of windows; The SPP multi-scale feature vector is concatenated using a fully connected layer. Dimensionality reduction is performed to obtain the initial state vector. , It is the hyperbolic tangent function. It is a fully connected layer. It is the set of real numbers.
7. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 6, characterized in that, The time-series meteorological data and initial state vector are processed by forward and reverse LSTM to obtain the final feature representation. The final feature representation is then decoded to generate multi-day traffic forecasts. Acquire time-series meteorological data and initial state vector and the initial state vector The initial positive cell state as a unit of the positive long short-term memory network. This allows spatial prior memory to permeate the temporal sequence, generating a positive information flow. This positive information flow contains multiple positive hidden states, and its formula is: , Let be the positive hidden state at time t. It is a positive long short-term memory network unit. The input data is at time t. This represents the forward hidden state at time t-1. This represents the positive cell state at time t-1; The forward hidden state is injected into the reverse gating through a preset coupling matrix U, and the formula is as follows: , This is the inverted input gate at time t. It is the Sigmoid activation function. This is the weight matrix of the inverse input gate. To be and To splice, This represents the reverse hidden state at time t+1. This is the coupling matrix corresponding to the inverse input gate. This is the bias term for the inverted input gate; The forward hidden state and the backward hidden state are concatenated to obtain the final feature representation at time t. The final feature representation is processed using a seq2seq decoder to obtain traffic forecasts for the next few days. Let be the reverse hidden state at time t. To be and Then, the parts are assembled.
8. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 1, characterized in that, Also includes: During the training phase, a gradient balancing weighted loss function is introduced. Its formula is: n is the number of training samples. Let j be the recent weights of the j-th training sample. Let j be the true value of the j-th training sample. The predicted value for the j-th training sample. The standard deviation of historical runoff in the watershed. This is a preset constant.
9. The trans-domain flood prediction system based on spatial coding and coupled bidirectional LSTM according to claim 1, characterized in that, Also includes: The formula for the training effectiveness evaluation metric NSE used in the training phase is: , Here, T is the time step index, and T is the total number of time steps. for The measured runoff value at time [time]. for Predicted runoff value at time, for The mean of the measured runoff at time [time]. The mean of the measured runoff is given. The closer the value of the training effectiveness evaluation index NSE is to 1, the better the training effect.