Hydrological forecasting method based on multi-feature combination and Transform model
The hydrological forecasting method using multi-feature combination and Transformer model solves the problems of accuracy and adaptability of hydrological forecasting under complex conditions, and achieves high-precision hydrological forecasting, which is applicable to flood forecasting and water resource allocation in small and medium-sized river basins.
Patent Information
- Application Number
- CN202511775030.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-13
AI Technical Summary
Existing hydrological forecasting technologies lack accuracy under complex conditions, suffer from insufficient feature fusion, inadequate capture of time-dependent features, lack of physical constraints, and difficulty in hyperparameter optimization, making it difficult to meet the forecasting requirements for high accuracy and high reliability.
A hydrological forecasting method based on multi-feature combination and Transformer model is adopted. By constructing a multi-dimensional feature pool, combining a multi-head attention mechanism and a feedforward neural network, and optimizing hyperparameters, the synergistic improvement of feature combination and model architecture is achieved.
It improves the accuracy and adaptability of hydrological forecasts, meets the needs of actual water conservancy projects for high-precision forecasts, and reduces the complexity and resource requirements of model construction.
Smart Images

Figure CN121525985A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of hydrology and water resources prediction, and particularly relates to a hydrological prediction method based on multi-feature combination and a Transformer model. BACKGROUND
[0002] Hydrological prediction is the core technical support for flood control and disaster reduction, optimal scheduling of water resources, and planning and operation of water conservancy projects. The traditional hydrological prediction technology system has long been centered on physical hydrological models. Such models are based on the physical mechanisms and process laws of hydrological cycles to construct mathematical expressions, and achieve prediction by describing the physical nature of key links such as precipitation, evaporation, infiltration, runoff generation, and confluence. The Xin'anjiang model (XAJ) is a typical representative, which is based on the runoff generation theory, simulates hydrological processes by dividing runoff generation area and setting soil moisture content threshold, and is widely used in short-term runoff prediction in humid and semi-humid areas. However, the prediction performance of physical hydrological models is highly dependent on the accurate description of hydrological physical processes, and its limitations are increasingly prominent under complex hydrological conditions. On the one hand, the calibration of model parameters requires a large amount of measured data and empirical judgment, and the adaptability to the spatial and temporal heterogeneity of underlying conditions (such as terrain, soil type, and vegetation cover) and meteorological conditions (such as extreme rainfall and drought) is insufficient. On the other hand, when faced with scenarios of increasing non-stationarity of hydrological processes caused by rapid urbanization and frequent extreme climate events, models based on traditional physical assumptions are difficult to accurately capture the complex response relationship of hydrological elements, resulting in a significant increase in prediction error and an inability to meet the demand for high-precision prediction.
[0003] To overcome the limitations of physical hydrological models, data-driven machine learning methods have been widely introduced into the field of hydrological forecasting in recent years due to their powerful nonlinear fitting capabilities. These methods do not require pre-setting complex physical process assumptions; they achieve forecasting by mining potential correlations between hydrological elements from historical observation data. They have shown certain advantages in some simple watersheds or short-term forecasting scenarios. However, existing machine learning hydrological forecasting technologies still face many critical problems that urgently need to be addressed: the input features of existing machine learning models are mostly limited to direct observation data such as precipitation, temperature, and measured runoff, failing to fully integrate multi-source derived features that significantly influence hydrological processes, such as indirect features like initial soil moisture content, vegetation cover, topographic indices, and channel roughness, as well as intermediate outputs from physical hydrological models (such as simulated runoff and soil water storage). The synergistic effect of these features with direct observation data can more comprehensively reflect the complexity of hydrological processes, but current technologies... The lack of a systematic feature fusion scheme results in insufficient dimensionality of model input information, making it difficult to fully explore the deep correlations between hydrological elements. Simultaneously, hydrological processes exhibit significant temporal correlations; earlier hydrological elements (such as cumulative precipitation over multiple periods and previous runoff) have a continuous impact on later forecast results. This long-term temporal dependence is crucial for accurate forecasting. However, traditional machine learning models are mostly static modeling frameworks, lacking targeted processing mechanisms for time-series data. They cannot effectively capture the dynamic evolution of hydrological processes, especially in medium- and long-term hydrological forecasting scenarios, where the models' ability to characterize time-series information is insufficient, leading to a rapid decline in forecast accuracy. Furthermore, existing machine learning models often rely on purely data-driven modeling approaches, failing to fully incorporate prior knowledge of hydrological physical processes. During training, these models only focus on statistical correlations between data, ignoring the fundamental laws of hydrological processes, easily resulting in forecasts that contradict physical principles—a true "black box." The traditional modeling approach not only reduces the reliability of forecast results but also limits the model's ability to be applied across different watersheds. Furthermore, the hyperparameters of hydrological forecasting models directly affect model performance, and the hydrological characteristics of different watersheds vary significantly. Therefore, it is necessary to adjust the hyperparameters specifically to achieve the best forecast results. In existing technologies, hyperparameter tuning often adopts traditional methods such as grid search and random search, which suffer from low tuning efficiency and limited search space, making it difficult to find the globally optimal parameter combination. At the same time, there is a lack of hyperparameter adaptive adjustment mechanisms based on watershed hydrological characteristics, resulting in poor adaptability of the same model to different watersheds and hindering its rapid promotion and application.
[0004] In summary, while physical hydrological models possess clear physical meaning, their accuracy is insufficient under complex conditions. Although machine learning methods have strong data fitting capabilities, they suffer from shortcomings such as insufficient feature fusion, inadequate capture of temporal dependencies, lack of physical constraints, and difficulty in hyperparameter tuning. Currently, there is no hydrological forecasting solution that can systematically integrate physical model outputs, multi-source observation data, and derived features, while simultaneously utilizing advanced deep learning architectures to overcome the bottleneck of temporal dependency capture and incorporating physical constraints and optimizing hyperparameter tuning mechanisms. Consequently, it is difficult to meet the high-precision and high-reliability forecasting requirements under complex hydrological conditions. Summary of the Invention
[0005] The purpose of this invention is to provide a hydrological forecasting method based on multi-feature combination and Transformer model, so as to achieve a synergistic improvement in hydrological forecasting accuracy, efficiency and adaptability, and meet the needs of practical water conservancy projects for high-precision forecasting.
[0006] To achieve the above functions, this invention designs a hydrological forecasting method based on multi-feature combination and Transformer model, which executes the following steps S1-S6 to complete the hydrological simulation and hydrological forecasting of the target watershed:
[0007] Step S1: Collect measured data from hydrological stations in the target watershed, build a physical hydrological model for the target watershed, obtain the output data and derived feature data of the physical hydrological model, and integrate them to obtain basic hydrological data;
[0008] Step S2: Based on the data obtained in Step S1, create enhanced hydrophysical features, including basic periodic features, hydrological derivative features, spatial features, and runoff composition features, forming a multi-dimensional original feature pool;
[0009] Step S3: Based on basic hydrological data and multi-dimensional original feature pools, construct various combined strategies;
[0010] Step S4: Construct a hydrological forecasting model based on the Transformer model; the Transformer model includes a multi-head attention mechanism, layer normalization, and a feedforward neural network, taking the features of the combined strategy selected in step S3 as input and the hydrological forecasting results as output;
[0011] Step S5: Use the Optuna framework to optimize and train the hydrological forecasting model for hyperparameters;
[0012] Step S6: Use the trained hydrological forecasting model to make predictions and obtain hydrological forecast results.
[0013] Beneficial effects: Compared with the prior art, the advantages of the present invention include:
[0014] A hydrological forecasting method based on multi-feature combination and Transformer model is designed to address the problems of limited accuracy of physical hydrological models (such as the Xin'anjiang model XAJ) under complex conditions, blind feature selection in traditional machine learning methods, insufficient capture of temporal dependencies, and inefficient hyperparameter tuning in existing hydrological forecasting technologies. Based on system experiments and verification of 10 feature combination strategies, a hydrological forecasting method with experimental-driven optimal feature combination and deep integration of Transformer is provided. By accurately selecting feature combinations and optimizing model architecture and hyperparameters, the method achieves a synergistic improvement in hydrological forecasting accuracy, efficiency, and adaptability, meeting the high-precision forecasting requirements of practical water conservancy projects. Attached Figure Description
[0015] Figure 1 This is a flowchart of a hydrological forecasting method based on multi-feature combination and Transformer model provided according to an embodiment of the present invention;
[0016] Figure 2 This is a schematic diagram of the target watershed DEM provided according to an embodiment of the present invention;
[0017] Figure 3 This is a comparison chart of NSE / KGE / RMSE for each strategy provided according to an embodiment of the present invention. Detailed Implementation
[0018] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0019] The hydrological forecasting method based on multi-feature combination and Transformer model provided in this embodiment of the invention refers to... Figure 1 , Figure 2 Taking the Tunxi River Basin as the target basin, the period from January 1, 2008 to December 30, 2018 (11 years) was selected as the calibration period, and the period from January 1, 2019 to December 31, 2023 (5 years) was selected as the validation period. Daily-scale observation data from one hydrological station and 18 rain gauge stations within the basin were used. The following steps S1-S6 were performed to complete the hydrological simulation and forecasting for the target basin:
[0020] Step S1: Collect measured data from hydrological stations in the target watershed, build a physical hydrological model for the target watershed, obtain the output data and derived feature data of the physical hydrological model, and integrate them to obtain basic hydrological data;
[0021] The specific steps of step S1 are as follows:
[0022] Step S1.1: Collect measured data from hydrological stations in the target watershed, including daily rainfall, daily flow, and daily evaporation data, and organize them into an Excel file according to time.
[0023] Step S1.2: For the target watershed, build an XAJ model, including four modules: three-layer evapotranspiration, full-storage runoff generation, three-source water division, and slope confluence and river confluence module;
[0024] Step S1.3: Run the XAJ model to obtain the calculation process file and result file;
[0025] Step S1.4: Organize the XAJ model output data, meteorological and hydrological measured data, underlying surface static data, and station rainfall measured data;
[0026] The dataset includes XAJ model output data (simulated runoff, soil water storage, runoff, etc.), meteorological and hydrological measured data (precipitation, evaporation, measured runoff, etc.), underlying surface static data (topography, soil type, vegetation cover, etc.), and multi-station measured rainfall data. All data are preprocessed, and missing values are filled using forward and backward imputation combined with zero-value supplementation to ensure data integrity.
[0027] Step S2: Based on the data obtained in Step S1, create enhanced hydrophysical features, including basic periodic features, hydrological derivative features, spatial features, and runoff composition features, forming a multi-dimensional original feature pool;
[0028] The specific steps of step S2 are as follows:
[0029] Step S2.1: Based on the data obtained from running the XAJ model, the characteristics are divided into periodic characteristics, seasonal characteristics, rainfall characteristics, evaporation characteristics, soil water characteristics, water balance characteristics, and runoff composition characteristics; the characteristic classification is shown in Table 1 below:
[0030] Table 1. Feature Classification
[0031]
[0032] Step S2.2: Based on the data obtained in Step S2.1, the basic periodic characteristics, hydrological derivative characteristics, spatial characteristics, and runoff composition characteristics are calculated to form a multi-dimensional original feature pool; specifically as follows:
[0033] The basic periodic characteristics include day-series, month-series, week-series and their corresponding sine and cosine transform characteristics, as well as seasonal dummy variables, as shown in the following formula:
[0034] Sine and cosine transformations of day order:
[0035] ;
[0036] ;
[0037] Where d represents the date sequence of the current year (1-365, adjusted to 366 for leap years); This is a sine transformation of the day sequence. This is the day sequence cosine transform;
[0038] Sine and cosine transformations of the lunar sequence:
[0039] ;
[0040] ;
[0041] Where m is the month sequence (1-12). For the lunar sequence sine transformation, For lunar sequence cosine transformation;
[0042] Cyclic sine and cosine transformations:
[0043] ;
[0044] ;
[0045] Where w is the week number (1-7, where 1 represents Monday and 7 represents Sunday); For the cyclic sine transformation, This is the periodic cosine transform;
[0046] Seasonal dummy variable:
[0047] ;
[0048] ;
[0049] ;
[0050] ;
[0051] in, Represents the spring dummy variable. Represents a summer dummy variable. Represents the autumn dummy variable. Indicates a dummy variable for winter;
[0052] Hydrological derivatives include cumulative precipitation, soil moisture index, cumulative water balance value, and runoff potential index, as shown in the following formula:
[0053] Cumulative rainfall:
[0054] ;
[0055] In the formula, t represents the current day sequence (unit: day), and k represents the cumulative time period (optional 1 / 3 / 5 / 7 days, default is 3 days). This represents the average rainfall (mm) in the watershed on day i, calculated from rainfall data from multiple stations. This represents the cumulative rainfall within the cumulative time period k in the current day sequence;
[0056] Soil moisture content index:
[0057] ;
[0058] In the formula, This represents the total soil water storage (mm) on day t, taken from the XAJ model output. This represents the maximum soil water storage capacity of the watershed (mm), and is a calibration parameter for the XAJ model (determined based on the characteristics of the underlying surface of the watershed, typically ranging from 100 to 200 mm). This represents the soil moisture content index on day t.
[0059] Water balance cumulative value:
[0060] ;
[0061] Where t represents the current day sequence (day), and T represents the cumulative time period (default 3 days, optional 5 / 7 days). This represents the average rainfall (mm) in the basin on day i. The actual evapotranspiration on day i (mm) is taken from the sum of the three evapotranspiration modules of the XAJ model (upper layer + lower layer + deep layer evaporation). denoted as the measured runoff depth on day i (mm), and F represents the target catchment area (km²), taken from static data of the underlying surface. This represents the cumulative water balance value within the cumulative time period T in the current daily sequence;
[0062] Abortion Potential Index:
[0063] ;
[0064] in, This represents the potential flow index on day t. This represents the average rainfall (mm) in the basin on day t. This represents the soil moisture content index (%) on day t.
[0065] Spatial characteristics include the spatial mean, maximum value, standard deviation, and coefficient of variation of rain gauges, as shown in the following formula:
[0066] Spatial mean of rain gauge:
[0067] ;
[0068] Where n represents the number of rain gauges, and in this embodiment n=18; This represents the rainfall (mm) on day t at the j-th rain gauge station. This represents the spatial mean of the rainfall at the rain gauge station on day t (mm).
[0069] Maximum space of rain gauge:
[0070] ;
[0071] in, This represents the spatial maximum value of the rain gauge on day t.
[0072] Spatial standard deviation of rain gauges:
[0073] ;
[0074] in, This represents the spatial mean of the rainfall at the rain gauge station on day t. This represents the spatial standard deviation of the rain gauge on day t.
[0075] Coefficient of variation:
[0076] ;
[0077] in, This represents the spatial standard deviation of the rain gauge on day t. This represents the spatial mean of the rainfall at the rain gauge station on day t.
[0078] Runoff composition characteristics include the proportion of surface runoff and the proportion of groundwater runoff.
[0079] Step S3: Based on basic hydrological data and multi-dimensional original feature pools, construct various combined strategies;
[0080] The specific method for step S3 is as follows:
[0081] Ten combination strategies are constructed, as detailed in Table 2 below:
[0082] Table 2.10 Combination Strategies
[0083]
[0084] Combination Strategy 1 is a comprehensive feature selection strategy that integrates core hydrological features, XAJ model output features, and observational data features, comprising a total of 35 features to ensure comprehensive information. Core hydrological features refer to those directly involved in key hydrological cycle processes (runoff generation, confluence, and evapotranspiration) and having a significant physical driving effect on runoff prediction. The criteria for selection are: directly related to the core mechanisms of precipitation-runoff-confluence; errors in data from XAJ model output or measured data ≤ 5%; and a decrease in model prediction error (NSE) ≥ 10% after verification using the controlled variable method.
[0085] The specific features obtained include: daily evaporation, rainfall AU, net rainfall, initial soil water storage S0_start, upper soil moisture content WU, lower soil moisture content WL, deep soil moisture content WD, total water storage W, current runoff area ratio FR_prev_used, surface runoff RS, interflow flow RI, groundwater runoff RG, outlet flow rates QRS, QRI, QRG for surface, interflow, and groundwater sources, watershed area, daily, monthly, and annual sequence, current runoff area ratio FR, soil water storage change ΔS, upper evaporation, lower evaporation, deep evaporation, impervious runoff, cumulative precipitation, maximum precipitation during the period, previous runoff, runoff change rate, soil moisture index, cumulative water balance value, runoff potential index, spatial mean of rain gauges, spatial standard deviation of rain gauges, and seasonal dummy variables. During the screening process, core hydrological features, XAJ model output features, and features derived from observational data were integrated to ensure no redundancy or duplication.
[0086] Strategy 2 is a core hydrological + rain gauge strategy, focusing on key hydrological elements of runoff formation and combining spatial characteristics of precipitation from multiple stations, comprising a total of 19 features, balancing information completeness and model simplicity. Core hydrological features refer to key variables that directly dominate runoff formation and cannot be replaced by other features. The criteria for selection are: playing a decisive role in runoff generation, having a Pearson correlation coefficient <0.7 between features with no strong correlation, and having readily available data that requires no complex calculations.
[0087] The specific features obtained include: measured precipitation, measured runoff, evaporation, total water storage W, current runoff area ratio FR, surface runoff, groundwater runoff, cumulative precipitation, maximum precipitation during the period, rainfall at each rain gauge station, spatial mean of each rain gauge station, and spatial standard deviation of the rain gauge station. In this example, there are 18 rain gauge stations. The rainfall at these 18 rain gauge stations refers to the original data of the measured rainfall at each station on the same day. Single-point observation information is retained, and together with the spatial mean and spatial standard deviation, they constitute the complete information of "single-point + spatial distribution" of rainfall.
[0088] Combination Strategy 3 is an XAJ feature-only strategy, relying entirely on the XAJ model output and making full use of physical process simulation information. It includes 23 features. Among them, intermediate variables refer to variables generated during the XAJ model calculation process that characterize the intermediate state of the hydrological process. They are not directly used as output but affect the final result. State parameters refer to variables that characterize the current state of the watershed hydrological system and reflect the cumulative effects of previous periods.
[0089] The specific features obtained include: upper evaporation, lower evaporation, deep evaporation, total evapotranspiration, current runoff area ratio FR, runoff volume, net rainfall, surface runoff RS, interflow flow RI, groundwater runoff RG, slope outflow process, outlet section flow, total runoff depth, upper soil moisture content WU, lower soil moisture content WL, deep soil moisture content WD, total water storage W, soil water storage change ΔS, impervious runoff, upper soil moisture content, lower soil moisture content, deep soil moisture content, and total soil water storage change; covering all output variables and state parameters of the four major modules of the XAJ model: three-layer evapotranspiration, full-storage runoff, three-source water division, and slope confluence-river confluence.
[0090] Combination Strategy 4 is a mutual information selection strategy. Based on the descending order of mutual information values between features and measured runoff, it automatically filters high-contribution features, comprising 30 features in total. The feature selection method is as follows: First, calculate the mutual information values between all original features and the target variable (measured runoff). After sorting by mutual information values in descending order, retain features with a value ≥ 0.1 (an empirical threshold determined through cross-validation). If more than 30 features meet the criteria, select the top 30; if fewer, supplement with the next highest-valued relevant features. Finally, for features with strong correlations (correlation coefficient ≥ 0.8) after sorting, remove redundancy and retain the feature with the highest mutual information value.
[0091] The specific characteristics obtained include: previous day's runoff, current precipitation, total water storage W, current runoff-producing area ratio FR, 3-day cumulative precipitation, 7-day cumulative precipitation, evaporation, surface runoff RS, interflow RI, groundwater runoff RG, day sequence, month sequence, seasonal dummy variable, net rainfall, precipitation AU, initial soil water storage S0_start, previous current runoff-producing area ratio FR_prev_used, maximum precipitation in the 24-hour period, maximum precipitation in the 48-hour period, soil moisture index, cumulative water balance value, runoff potential index, spatial mean of rain gauge, spatial maximum of rain gauge, spatial standard deviation of rain gauge, runoff change rate, groundwater runoff ratio, surface runoff ratio, soil water storage change ΔS, and upper layer evaporation;
[0092] The mutual information value is calculated as follows:
[0093] ;
[0094] in, The mutual information value (in bits) between characteristic X and measured runoff Y. Let X be the joint probability density function of Y. Let X be the marginal probability density function of feature X. Let Y be the marginal probability density function of the measured runoff Y.
[0095] Strategy 5 is a physical process-driven strategy. Based on hydrophysical mechanisms, it selects key variables that play a decisive role in runoff formation, comprising six characteristics. These key characteristics are variables that, based on hydrophysical mechanisms, are indispensable for runoff formation and reflect the core processes. The definition criteria are: conforming to the theory of full-storage runoff generation; covering the entire chain of "precipitation input - water storage state - runoff output - loss term"; maintaining a significant impact in different hydrological years (high / normal / low water years); and having a NSE contribution value fluctuation of <5%.
[0096] The specific characteristics obtained include: net rainfall, total water storage W, current runoff area ratio FR, previous runoff, daily evaporation, and seasonal index; each characteristic corresponds to the runoff source, watershed water storage capacity, runoff range, runoff persistence, water loss, and seasonality, fully reflecting the core process of the hydrological cycle.
[0097] The combined strategy 6 is the "Optimal 5+ Key Hydrological Strategy," which combines data-driven selection of the best fundamental features and core physical variables. The model is streamlined and efficient, containing a total of 5 features. The optimal fundamental features refer to the 5 basic variables with the highest mutual information values to measured runoff, selected through mutual information analysis, without complex derivative calculations. Key hydrological variables refer to core state variables that are crucial for runoff prediction based on hydrological physical mechanisms; their inclusion enhances the model's physical rationality.
[0098] The specific features obtained include: current precipitation, previous day's runoff, total water storage W, 3-day cumulative precipitation, and current runoff area ratio FR. The selection logic is as follows: first, the five basic features with the best mutual information are selected through data-driven selection, and then the core state variable FR is added from the perspective of physical mechanism to achieve a simplified combination of "data optimal + physical core".
[0099] Strategy 7 is a top 15 mutual information strategy, selecting the top 15 features based on mutual information to balance feature quantity and information completeness, encompassing a total of 15 features. Among these, time-periodic features refer to those characterizing the temporal regularity of hydrological processes, derived from calendar time attributes, retaining only the original ordinal values (excluding sine / cosine transforms); key hydrological variables refer to variables that significantly contribute to runoff prediction and possess both data relevance and physical significance. The selection logic is to select the top 15 features in descending order of mutual information value, ensuring coverage of three categories: time-periodic features (daily, monthly, and seasonal dummy variables), meteorological driving features (precipitation / evaporation), and state variables and runoff components, balancing relevance and information diversity.
[0100] The specific features obtained include: previous day's runoff, current precipitation, total water storage W, current runoff area ratio FR, 3-day cumulative precipitation, evaporation, surface runoff RS, day sequence, month sequence, net rainfall, seasonal dummy variable, maximum precipitation in 24 hours, previous current runoff area ratio FR_prev_used, groundwater runoff RG, and runoff change rate.
[0101] Combination Strategy 8 is a periodic + key hydrological strategy, integrating time-periodic features with core hydrological variables to capture both temporal patterns and physical state information, comprising a total of 13 features. The most important feature is a variable that simultaneously satisfies "temporal periodicity + core hydrological and physical function," and whose absence significantly reduces model performance. The definition criteria are: it captures temporal patterns and directly affects runoff generation; the absence of a single feature leads to a decrease in NSE of ≥8%; it is non-redundant and covers all dimensions.
[0102] The specific features obtained include: daily sine and cosine, monthly sine and cosine, spring dummy variable, summer dummy variable, autumn dummy variable, winter dummy variable, measured precipitation, evaporation, total water storage W, current runoff area ratio FR, previous runoff, runoff change rate, and 3-day cumulative precipitation; among which, the daily sine and cosine include daily sine and cosine transformations, and the monthly sine and cosine include monthly sine and cosine transformations; there are a total of 8 periodic features, and the remaining 5 are key hydrological features, for a total of 13 features.
[0103] Combination Strategy 9 is a minimalist 3-feature strategy. After dual screening through mutual information analysis and physical meaning, it retains the core features, which include a total of 3 features. The most important feature is the core variable that plays a decisive role in runoff prediction and achieves the best prediction effect with the fewest variables. The definition standard is: the absence of any feature will cause the model's NSE to decrease by ≥15%. It covers the smallest logical chain of "previous state (previous day's runoff) + current input (current precipitation) + watershed conditions (W)" and can maintain stable prediction effect in different watersheds and different hydrological years (NSE fluctuation <10%).
[0104] The specific features obtained include: previous day's runoff, current precipitation, and total water storage W. These three features correspond to runoff persistence, runoff source, and watershed water storage capacity, respectively, forming the minimum logical closed loop for predicting runoff.
[0105] Strategy 10 is a comprehensive feature strategy that maximizes the use of all available data, including various observations, simulations, and derived features, totaling 50 features.
[0106] The specific characteristics obtained include: measured precipitation, measured runoff, evaporation, total water storage W, upper soil moisture content WU, lower soil moisture content WL, deep soil moisture content WD, initial soil water storage S0_start, current runoff area ratio FR, previous current runoff area ratio FR_prev_used, surface runoff RS, interflow flow RI, groundwater runoff RG, outlet flow rates QRS, QRI, QRG corresponding to the three water sources (surface, interflow, and groundwater), net rainfall, precipitation AU, soil water storage change ΔS, upper evaporation, lower evaporation, deep evaporation, total evapotranspiration, runoff, impervious runoff, slope outflow process, outlet section flow rate, total runoff depth, daily, monthly, and annual sine and cosine values, four seasonal dummy variables, and daily cumulative precipitation. The data included 3-day cumulative precipitation, 5-day cumulative precipitation, 7-day cumulative precipitation, maximum precipitation over 24 hours, maximum precipitation over 48 hours, maximum precipitation over 72 hours, soil moisture index, cumulative water balance value, runoff potential index, spatial mean of rain gauges, spatial maximum of rain gauges, spatial standard deviation of rain gauges, coefficient of variation, runoff change rate, surface runoff proportion, groundwater runoff proportion, watershed area, topographic index, soil type code, and vegetation cover. Among these, the topographic index, soil type code, and vegetation cover were obtained through ArcGIS processing and used as "embedded features" input to the model (maintaining these static values at each time step, without changing over time). These features worked in conjunction with the temporal features, covering four main categories: basic observations, model outputs, derived features, and static underlying surface, with no information omissions.
[0107] Step S4: Construct a hydrological forecasting model based on the Transformer model; the Transformer model includes a multi-head attention mechanism, layer normalization, and a feedforward neural network, taking the features of the combined strategy selected in step S3 as input and the hydrological forecasting results as output;
[0108] The specific method for step S4 is as follows:
[0109] Step S4.1: Construct a hydrological forecasting model based on the Transformer model; take the features of the strategy selected in step S3 as input and the hydrological forecasting results as output;
[0110] Step S4.2: The input layer of the Transformer model is adapted to the dimension of time series features. The hidden layer contains multiple Transformer blocks. Each layer integrates a multi-head attention mechanism and a feedforward neural network (FFN). Overfitting is avoided through layer normalization and dropout regularization. Finally, the hydrological forecast results are output through a global average pooling layer and a fully connected layer.
[0111] Step S5: Use the Optuna framework to optimize and train the hydrological forecasting model for hyperparameters;
[0112] The specific method is as follows:
[0113] The Optuna framework was used to optimize the hyperparameters of the Transformer model. The optimized parameters included the number of multi-head attention heads (2-6), key dimensions (16-64), feedforward network dimensions (64-256), dropout rate (0.1-0.3), learning rate (1e-4-1e-3), batch size (16 / 32 / 64), and number of training epochs (50-150). The optimization target was the validation period Nash efficiency coefficient (NSE), and an early stopping mechanism (patience=10) was used to ensure the generalization ability of the Transformer model.
[0114] Step S6: Use the trained hydrological forecasting model to make predictions and obtain hydrological forecast results.
[0115] The specific method is as follows:
[0116] Run the built Transformer model to obtain experimental results based on 10 strategies. Sort by NSE to select the optimal feature combination. Plot the comparison charts of NSE, KGE, and RMSE for each strategy, as well as the scatter plot and trend line of the relationship between the number of features and NSE, to complete the visualization analysis of the correlation between each strategy and the model performance.
[0117] The parameters that can be used to evaluate the results of each strategy experiment are as follows:
[0118] ;
[0119] in, For the i-th observation (actual value); This is the i-th predicted value (simulated value); The average of the observed values (all) The mean of NSE); n is the number of samples; NSE ranges from (−∞, 1], the closer to 1, the better the model performance;
[0120] ;
[0121] Where r is the Pearson correlation coefficient between the predicted and observed values. It is the ratio of the standard deviation of the predicted value to the standard deviation of the observed value. This is the ratio of the mean of predicted values to the mean of observed values.
[0122] ;
[0123] in, For the i-th observation (actual value); Let be the i-th predicted value (simulated value); n is the number of samples.
[0124] ;
[0125] in, For the i-th observation (Observed) Let be the i-th predicted value (Predicted), and n be the number of samples.
[0126] ;
[0127] in, For the i-th observation (Observed) Let be the i-th predicted value (Predicted), and n be the number of samples.
[0128] ;
[0129] in, For the i-th observation (Observed) This is the i-th predicted value.
[0130] The specific effects of this invention were verified through the above-described systematic experiments. Results are referenced below. Figure 3 and Table 3 below:
[0131] Table 3. Validation results of 10 feature combination strategies
[0132]
[0133] Among all 10 feature combination strategies, "Strategy 8 - Periodicity + Key Hydrological Elements" performed best, achieving the highest Nash efficiency coefficient (NSE=0.8695) and Kling-Gupta efficiency coefficient (KGE=0.8062) during the validation period. The superiority of this strategy lies in its efficient balance between information completeness and model simplicity: by introducing periodic features such as daily, weekly, and monthly variations, it enables the model to capture the inherent seasonality and cyclical patterns of hydrological phenomena; simultaneously, by integrating key hydrological state variables such as soil water storage and runoff area ratio from the XAJ model, it ensures that the core information of the watershed's runoff generation and confluence physical mechanisms is preserved. This combination avoids the incomplete information caused by too few features (such as Strategy 9) and also avoids the dimensionality curse and overfitting risks that may be caused by too many features (such as Strategy 10), thus endowing the model with the best generalization ability. Furthermore, this strategy successfully incorporates the mechanistic knowledge of hydrophysical models as prior knowledge into the data-driven Transformer architecture, achieving a deep integration of physical mechanisms and data intelligence, and improving the forecast robustness and physical rationality of the model under complex conditions.
[0134] In practical engineering applications, this optimal strategy has significant potential for widespread adoption. Its moderate number of features (13) and relatively low requirements for data acquisition and computational resources make it highly suitable for rapid deployment and stable operation in scenarios such as real-time flood forecasting in small and medium-sized river basins, precise water resource allocation, and automated operation of water conservancy projects. This provides engineers with a clear and efficient technical path, significantly reducing the complexity of building high-precision hydrological forecasting models and improving the overall efficiency and reliability of forecasting operations.
[0135] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A hydrological forecasting method based on multi-feature combination and Transformer model, characterized in that, Perform the following steps S1-S6 to complete the hydrological simulation and hydrological forecasting for the target watershed: Step S1: Collect measured data from hydrological stations in the target watershed, build a physical hydrological model for the target watershed, obtain the output data and derived feature data of the physical hydrological model, and integrate them to obtain basic hydrological data; Step S2: Based on the data obtained in Step S1, create enhanced hydrophysical features, including basic periodic features, hydrological derivative features, spatial features, and runoff composition features, forming a multi-dimensional original feature pool; Step S3: Based on basic hydrological data and multi-dimensional original feature pools, construct various combined strategies; Step S4: Construct a hydrological forecasting model based on the Transformer model; the Transformer model includes a multi-head attention mechanism, layer normalization, and a feedforward neural network, taking the features of the combined strategy selected in step S3 as input and the hydrological forecasting results as output; Step S5: Use the Optuna framework to optimize and train the hydrological forecasting model for hyperparameters; Step S6: Use the trained hydrological forecasting model to make predictions and obtain hydrological forecast results.
2. The hydrological forecasting method based on multi-feature combination and Transformer model according to claim 1, characterized in that, The specific steps of step S1 are as follows: Step S1.1: Collect measured data from hydrological stations in the target watershed, including daily rainfall, daily flow, and daily evaporation data, and organize them into an Excel file according to time. Step S1.2: For the target watershed, build an XAJ model, including four modules: three-layer evapotranspiration, full-storage runoff generation, three-source water division, and slope confluence and river confluence module; Step S1.3: Run the XAJ model to obtain the calculation process file and result file; Step S1.4: Organize the XAJ model output data, meteorological and hydrological measured data, underlying surface static data, and station rainfall measured data.
3. The hydrological forecasting method based on multi-feature combination and Transformer model according to claim 1, characterized in that, The specific steps of step S2 are as follows: Step S2.1: Based on the data obtained from running the XAJ model, the data is divided into periodic characteristics, seasonal characteristics, rainfall characteristics, evaporation characteristics, soil water characteristics, water balance characteristics, and runoff composition characteristics; Step S2.2: Based on the data obtained in Step S2.1, the basic periodic characteristics, hydrological derivative characteristics, spatial characteristics, and runoff composition characteristics are calculated to form a multi-dimensional original feature pool; specifically as follows: The basic periodic characteristics include day-series, month-series, week-series and their corresponding sine and cosine transform characteristics, as well as seasonal dummy variables, as shown in the following formula: Sine and cosine transformations of day order: ; ; Where d represents the date sequence of the current year; This is a sine transformation of the day sequence. This is the day sequence cosine transform; Sine and cosine transformations of the lunar sequence: ; ; Where m represents the month sequence; For the lunar sequence sine transformation, This is the lunar cosine transform; Cyclic sine and cosine transformations: ; ; Where w represents the week number of the current week; For the cyclic sine transformation, This is the periodic cosine transform; Seasonal dummy variable: ; ; ; ; in, Represents the spring dummy variable. Represents a summer dummy variable. Represents the autumn dummy variable. Indicates a dummy variable for winter; Hydrological derivatives include cumulative precipitation, soil moisture index, cumulative water balance value, and runoff potential index, as shown in the following formula: Cumulative rainfall: ; In the formula, t represents the current day sequence, and k represents the cumulative time period; This represents the average rainfall in the basin on day i. This represents the cumulative rainfall within the cumulative time period k in the current day sequence; Soil moisture content index: ; In the formula, This represents the total soil water storage on day t, taken from the XAJ model output. This represents the maximum soil water storage capacity of the watershed and is a calibration parameter for the XAJ model. This represents the soil moisture content index on day t. Water balance cumulative value: ; Where t represents the current day sequence and T represents the cumulative time period; This represents the average rainfall in the basin on day i. This represents the actual evapotranspiration on day i, taken from the sum of the three-layer evapotranspiration modules of the XAJ model; denoted as the measured runoff depth on day i, and F represents the target catchment area, taken from static data of the underlying surface. This represents the cumulative water balance value within the cumulative time period T in the current daily sequence; Abortion Potential Index: ; in, This represents the potential flow index on day t. This represents the average rainfall in the basin on day t. This represents the soil moisture content index on day t. Spatial characteristics include the spatial mean, maximum value, standard deviation, and coefficient of variation of rain gauges, as shown in the following formula: Spatial mean of rain gauge: ; Where n represents the number of rain gauges; This represents the rainfall on day t at the j-th rain gauge station; This represents the spatial mean of the rainfall at the rain gauge station on day t. Maximum space of rain gauge: ; in, This represents the spatial maximum value of the rain gauge on day t. Spatial standard deviation of rain gauges: ; in, This represents the spatial mean of the rainfall at the rain gauge station on day t. This represents the spatial standard deviation of the rain gauge on day t. Coefficient of variation: ; in, This represents the spatial standard deviation of the rain gauge on day t. This represents the spatial mean of the rainfall at the rain gauge station on day t. Runoff composition characteristics include the proportion of surface runoff and the proportion of groundwater runoff.
4. The hydrological forecasting method based on multi-feature combination and Transformer model according to claim 1, characterized in that, The specific method for step S3 is as follows: Ten combination strategies are constructed as follows: The features in combined strategy 1 include: daily evaporation, rainfall AU, net rainfall, initial soil water storage S0_start, upper soil moisture content WU, lower soil moisture content WL, deep soil moisture content WD, total water storage W, current runoff area ratio FR_prev_used, surface runoff RS, interflow flow RI, groundwater runoff RG, outlet flow rates QRS, QRI, QRG corresponding to the three water sources (surface, interflow, and groundwater), watershed area, day sequence, month sequence, year sequence, current runoff area ratio FR, soil water storage change ΔS, upper evaporation, lower evaporation, deep evaporation, impermeable runoff, cumulative precipitation, maximum precipitation during the period, previous runoff, runoff change rate, soil moisture index, cumulative water balance value, runoff potential index, spatial mean of rain gauge, spatial standard deviation of rain gauge, and seasonal dummy variables. The features in combined strategy 2 include: measured precipitation, measured runoff, evaporation, total water storage W, current runoff area ratio FR, surface runoff, groundwater runoff, cumulative precipitation, maximum precipitation during the period, precipitation at each rain gauge station, spatial mean of each rain gauge station, and spatial standard deviation of the rain gauge station. The features in combined strategy 3 include: upper evaporation, lower evaporation, deep evaporation, total evapotranspiration, current runoff area ratio FR, runoff, net rainfall, surface runoff RS, interflow RI, groundwater runoff RG, slope outflow process, outlet section flow, total runoff depth, upper soil moisture content WU, lower soil moisture content WL, deep soil moisture content WD, total water storage W, soil water storage change ΔS, impervious runoff, upper soil moisture content, lower soil moisture content, deep soil moisture content, and total soil water storage change. The features in combined strategy 4 include: previous day's runoff, current precipitation, total water storage W, current runoff-producing area ratio FR, 3-day cumulative precipitation, 7-day cumulative precipitation, evaporation, surface runoff RS, interflow RI, groundwater runoff RG, day sequence, month sequence, seasonal dummy variable, net rainfall, precipitation AU, initial soil water storage S0_start, previous current runoff-producing area ratio FR_prev_used, maximum precipitation in 24 hours, maximum precipitation in 48 hours, soil moisture index, cumulative water balance value, runoff potential index, spatial mean of rain gauge, spatial maximum of rain gauge, spatial standard deviation of rain gauge, runoff change rate, groundwater runoff ratio, surface runoff ratio, soil water storage change ΔS, and upper layer evaporation; The features in combined strategy 5 include: net rainfall, total water storage W, current runoff area ratio FR, previous runoff, daily evaporation, and seasonal index; The features in combined strategy 6 include: current precipitation, previous day's runoff, total water storage W, 3-day cumulative precipitation, and current runoff area ratio FR; The features in combined strategy 7 include: previous day's runoff, current precipitation, total water storage W, current runoff area ratio FR, 3-day cumulative precipitation, evaporation, surface runoff RS, day sequence, month sequence, net rainfall, seasonal dummy variable, maximum precipitation in 24 hours, previous current runoff area ratio FR_prev_used, groundwater runoff RG, and runoff change rate. The features in combined strategy 8 include: daily sine and cosine, monthly sine and cosine, spring dummy variable, summer dummy variable, autumn dummy variable, winter dummy variable, measured precipitation, evaporation, total water storage W, current runoff area ratio FR, previous runoff, runoff change rate, and 3-day cumulative precipitation; among which, daily sine and cosine include daily sine transformation and cosine transformation, and monthly sine and cosine include monthly sine transformation and cosine transformation; The features in combined strategy 9 include: previous day's runoff, current precipitation, and total water storage W. These three features correspond to runoff persistence, runoff source, and watershed water storage capacity, respectively. Features in Strategy 10 include: measured precipitation, measured runoff, evaporation, total water storage W, upper soil moisture content WU, lower soil moisture content WL, deep soil moisture content WD, initial soil water storage S0_start, current runoff-producing area ratio FR, previous current runoff-producing area ratio FR_prev_used, surface runoff RS, interflow flow RI, groundwater runoff RG, outlet flow rates QRS, QRI, QRG for surface, interflow, and groundwater sources, net rainfall, precipitation AU, soil water storage change ΔS, upper evaporation, lower evaporation, deep evaporation, total evapotranspiration, runoff production, impervious runoff, slope outflow process, and outflow... The data included cross-sectional flow, total runoff depth, daily, monthly, and annual sine and cosine values, four seasonal dummy variables, 1-day cumulative precipitation, 3-day cumulative precipitation, 5-day cumulative precipitation, 7-day cumulative precipitation, maximum precipitation over 24 hours, maximum precipitation over 48 hours, maximum precipitation over 72 hours, soil moisture index, cumulative water balance value, runoff potential index, spatial mean of rain gauges, spatial maximum of rain gauges, spatial standard deviation of rain gauges, coefficient of variation, runoff change rate, surface runoff share, groundwater runoff share, watershed area, topographic index, soil type code, and vegetation cover. Among these, the topographic index, soil type code, and vegetation cover were obtained through ArcGIS processing.
5. The hydrological forecasting method based on multi-feature combination and Transformer model according to claim 1, characterized in that, The specific method for step S4 is as follows: Step S4.1: Construct a hydrological forecasting model based on the Transformer model; take the features of the strategy selected in step S3 as input and the hydrological forecasting results as output; Step S4.2: The input layer of the Transformer model is adapted to the dimension of time series features. The hidden layer contains multiple Transformer blocks. Each layer integrates a multi-head attention mechanism and a feedforward neural network. Overfitting is avoided through layer normalization and dropout regularization. Finally, the hydrological forecast results are output through a global average pooling layer and a fully connected layer.
6. The hydrological forecasting method based on multi-feature combination and Transformer model according to claim 1, characterized in that, The specific method for step S5 is as follows: The Optuna framework is used to optimize the hyperparameters of the Transformer model. The optimized parameters include the number of multi-head attention heads, key dimensions, feedforward network dimensions, dropout rate, learning rate, batch size, and number of training epochs. The optimization objective is NSE, and an early stopping mechanism is used to ensure the generalization ability of the Transformer model.
7. The hydrological forecasting method based on multi-feature combination and Transformer model according to claim 1, characterized in that, The specific method for step S6 is as follows: Run the built Transformer model to obtain experimental results based on 10 strategies. Sort by NSE to select the optimal feature combination. Plot the comparison charts of NSE, KGE, and RMSE for each strategy, as well as the scatter plot and trend line of the relationship between the number of features and NSE, to complete the visualization analysis of the correlation between each strategy and the model performance.
Citation Information
Cited By
Three-dimensional sea temperature long-term intelligent forecasting method considering multi-element influence
CN122132843A
Three-dimensional sea surface temperature long-term intelligent prediction method considering multi-element influence
CN122132843B