Human drink drought prediction method based on AE-TT model
By using a deep learning method based on the AE-TT model, a drought index was constructed and an attribution-enhanced time-series Transformer model was built. This solved the multi-dimensional bottlenecks in existing technologies, achieved high-precision prediction and interpretability of drought in drinking water, and improved the ability to predict drought under complex hydrological and meteorological environments.
Patent Information
- Application Number
- CN202511069726.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-14
AI Technical Summary
Existing drought prediction technologies struggle to achieve high accuracy, interpretability, and generalization under complex hydrological and meteorological conditions. In particular, they face multi-dimensional technical bottlenecks in predicting droughts affecting drinking water resources driven by multiple factors, including weak collaborative modeling capabilities for multi-source data, insufficient modeling of long-sequence dependencies, generalization defects in error optimization mechanisms, and insufficient model interpretability.
We employ a deep learning approach based on the AE-TT model. By constructing a drought index, we build an attribution-enhanced time-series Transformer model. We combine SHAP values to calculate feature importance, introduce a self-attention-attribution correction mechanism, and use a cross-attention mechanism and a weighted loss function to form a closed loop of attribution optimization throughout the entire process. This improves the model's ability to collaboratively model multiple variables and enhances its long-sequence prediction accuracy.
It has achieved high-precision prediction of drought in drinking water, improved the ability to predict drought trends in different periods, provided scientific basis, enabled early deployment of water supply security measures, enhanced the interpretability and generalization ability of the model, and is applicable to complex hydrological and meteorological environments.
Smart Images

Figure CN120952237A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water conservancy engineering technology, and specifically relates to a method for predicting drought in drinking water based on the AE-TT model. Background Technology
[0002] The karst mountainous region of Guangxi, mainly located in northwestern Guangxi, covers a vast area and affects a large population. Although rainfall is high during certain periods, its spatial and temporal distribution is extremely uneven. Furthermore, the region is characterized by karst topography with well-developed fissures, leading to severe water seepage, extreme scarcity of surface water, and difficulty in storing groundwater. This makes water resource development and utilization extremely challenging, resulting in a weak water storage capacity and perennial regional drought. This study focuses on areas in the karst mountainous region of Guangxi that rely on small-scale rural drinking water projects for water supply. Addressing the threat of drinking water drought caused by frequent extreme weather events under the backdrop of global climate change, improving the capacity for preventing and controlling drinking water drought is an urgent issue that needs to be addressed. In this paper, "drinking water" refers to human drinking water, and "drinking water drought" assesses the state of drinking water scarcity.
[0003] Existing drought prediction technologies still face multi-dimensional technical bottlenecks when dealing with complex hydrological and meteorological environments, long-term drought evolution patterns, and the need for high-precision predictions. Specific shortcomings are as follows:
[0004] I. Limitations of Data Processing and Feature Engineering
[0005] Weak ability to collaboratively model multi-source data
[0006] Traditional models (such as statistical models driven by a single meteorological index and shallow machine learning methods) often focus on single variables or a few key factors (such as precipitation and temperature), making it difficult to integrate multi-source time-series characteristics such as large-scale climate indices (such as ENSO and PDO), regional meteorological elements (such as humidity and wind speed), and data from drinking water projects (such as water storage and water supply). This insufficient modeling of the synergistic effects of multiple variables makes it impossible to capture the complex driving mechanisms of drought formation (such as the cascading effects of climate anomalies, meteorological responses, and engineering scheduling), and the prediction accuracy is limited by local data information.
[0007] Feature noise filtering mechanism missing
[0008] The input data contains a large amount of low-value interference information (such as random weather fluctuations and sensor error signals). Traditional models lack the ability to dynamically select features: they either treat all input features equally, causing the model to waste computing power on learning from noise; or they rely on manual experience to fix a subset of features, making it difficult to adapt to changes in the importance of features in different regions and different drought stages. This ineffective learning from noise directly reduces the model's sensitivity to capturing core drought signals.
[0009] II. Structural Defects in Modeling Long Sequence Dependencies
[0010] Long-term reliance on insufficient capture capabilities
[0011] Traditional time series models (such as ARIMA and LSTM) have inherent limitations when processing long series: statistical models are constrained by the assumption of a fixed order and cannot capture historical correlations beyond a preset window; while recurrent networks such as LSTM can handle series of a certain length, they suffer from the vanishing gradient problem, resulting in a significant decrease in accuracy when modeling the cumulative effects of drought across quarters and years (such as consecutive drought events). Even the basic Transformer model, with its self-attention mechanism, is prone to "uniform distribution tendency" or "recent information preference," leading to the dilution of the influence of key historical nodes in long series (such as the seed period of previous droughts), making it difficult to identify long-term driving signals of drought.
[0012] The physical meaning of temporal features is ambiguous.
[0013] Most models encode time-series data only at the level of numerical mapping, failing to fully integrate the physical meaning of features (such as the periodicity of climate indices and the magnitude differences of meteorological elements) with their temporal relationships. For example, traditional coding methods struggle to transform time-series correlations with clear physical logic, such as "drought may occur 6-12 months after an El Niño event," into structured information that the model can understand, resulting in insufficient modeling of the mechanistic dependencies in drought formation.
[0014] III. Generalization Defects of Error Optimization Mechanisms
[0015] The "averaging" trap of loss functions
[0016] Traditional models employ symmetric loss functions such as mean squared error (MSE) and mean absolute error (MAE), assigning equal weight to all prediction scenarios. However, in drought prediction, errors in critical scenarios (such as near drought thresholds or during water supply crises) have a far greater impact on decision-making than in conventional scenarios. This "averaging" approach dilutes the model's errors in core scenarios, failing to prioritize the correction of prediction biases crucial to drinking water safety, resulting in a phenomenon where "overall error meets standards, but accuracy at key points is insufficient."
[0017] Blindness in error attribution and correction
[0018] Existing models often rely on "black box" backpropagation for error feedback, adjusting parameters solely based on overall error without pinpointing the source of the error (such as misjudgment of a certain climate characteristic or mismatch of dependencies within a historical window). This lack of attribution-guided correction mechanisms makes it difficult for models to specifically optimize weak links, limiting their generalization ability—the error correction effect drops significantly in drought types not covered by the training set (such as sudden droughts) or in extreme scenarios.
[0019] IV. The disconnect between model interpretability and decision support
[0020] The "black box" approach to prediction logic
[0021] The internal computational processes of complex models (such as traditional deep learning models) lack interpretability, failing to answer key questions like "Why is a drought predicted for the next three months?" or "Which historical meteorological events are the main driving factors?" At best, they can only perform attribution analysis after outputting results, separating the predictive model from the attribution explanation model. This lack of interpretability reduces the credibility of prediction results in practical decision-making, especially in areas involving people's livelihoods such as drought affecting drinking water, making it difficult to support the formulation of refined risk prevention and control strategies.
[0022] Lack of a closed-loop optimization mechanism for attribution throughout the entire process
[0023] Traditional models often operate with fragmented processes, such as feature selection, attention calculation, and error correction, failing to establish a collaborative optimization mechanism based on attribution analysis. For example, the asynchronous nature of feature importance assessment and attention weight adjustment leads to "identified key features not being prioritized by the model"; the disconnect between error source analysis and loss function design results in a misalignment between the correction direction and the core issues. This fragmented optimization approach struggles to overcome deeper bottlenecks such as "overwhelming key information" and "misjudging dependencies."
[0024] These shortcomings collectively make it difficult for existing technologies to balance "accuracy, generalization, and interpretability" in drought prediction. In particular, in the prediction of the human drinking water drought index, which is driven by long cycles and multiple factors, it cannot meet the decision-making requirements of high accuracy and high reliability. There is an urgent need to achieve a technological breakthrough through a new architecture that enhances attribution throughout the entire process. Summary of the Invention
[0025] To address the shortcomings of existing technologies, this invention provides a high-precision prediction technology for the human drinking water drought index based on deep learning. This method, based on the AE-TT model, aims to improve the ability to predict drought trends at different times in the rocky mountainous areas of Guangxi, providing a scientific basis for the early deployment of water supply security measures.
[0026] This invention is achieved through the following technical solution:
[0027] A method for predicting drought in drinking water based on the AE-TT model includes the following steps:
[0028] S1. Constructing the drought index;
[0029] S11. Calculate the monthly water shortage for a single-point drinking water project:
[0030] W q =W x -W y -ET
[0031] W x =P×A×R
[0032] W y =ζ×G
[0033] Among them, W q Monthly water shortage for drinking water projects, ET is evapotranspiration, W x W represents the monthly water inflow of the project. y Let P be the monthly water supply of the drinking water project, A be the catchment area of the corresponding watershed of the drinking water project, R be the runoff coefficient, ζ be the water supply adjustment coefficient, and G be the monthly design water supply of the drinking water project.
[0034] S12. Based on the calculated monthly water shortage sequence of drinking water projects, further standardize it to construct the standardized drinking water drought index SHI.
[0035] S2. Build an Attribution-Enhanced Temporal Transformer (AE-TT) deep learning model to predict drought in drinking water, and output the drought prediction results through the AE-TT model;
[0036] The architecture of the AE-TT model includes:
[0037] Data input layer: Receives multi-source time-series features, including the Human Drinking Water Drought Index (SHI) sequence, meteorological elements, and large-scale climate indices, forming the raw input sequence; used to address the problem of insufficient multivariate collaborative modeling in traditional models;
[0038] Feature attribution filtering module: Calculates global feature importance based on SHAP value, filters low-impact features through dynamic threshold, and outputs a clean feature set; used to reduce ineffective learning of noisy information by the model and improve the modeling efficiency of feature dimensions;
[0039] The SHAP value is calculated as follows:
[0040]
[0041] in Global importance score of feature j; The SHAP value of feature j of sample i; N: total number of samples; j: feature index (j∈[1,M], M is the original number of features);
[0042] The dynamic threshold setting:
[0043]
[0044] τ: Feature selection threshold; Importance of all features The mean; Importance of all features The standard deviation of ; k: threshold adjustment coefficient (hyperparameter);
[0045] The purification feature set:
[0046]
[0047] S purified : The set of filtered feature indexes; |S purified |=M' (M' is the purified feature number);
[0048] Embedding layer encoding: Positional and feature encoding are performed on the purified feature set to generate an initial feature sequence with semantic information; this is used to lay a structured foundation for subsequent attribution analysis.
[0049] The feature embedding:
[0050] E feat =X purified ·W emb
[0051] The purified feature tensor; T: time step; Embedded weight matrix; d model : Hidden layer dimension of the model; Feature embedding representation
[0052] The location code:
[0053]
[0054] t: Time step index (1≤t≤T); i: Dimension index Position encoding matrix;
[0055] The initial feature sequence:
[0056] H (0) =F feat +PE
[0057] An initial sequence with location information;
[0058] Attribution Enhancement Encoder: Introduces a dual mechanism of "self-attention-attribution correction". First, the original self-attention weights are calculated, and then attribution analysis is performed through the attention flow method to correct the weight distribution bias. Simultaneously outputs encoded features and "time step attribution scores" to solve the problem of dilution of key historical information in long sequences.
[0059] The standard self-attention:
[0060]
[0061] Q = HW q : Query matrix; K = HW k : Key matrix; Projection weights; d k : key / query dimension (usually d k =d model / h, where h is the number of heads); Attention weight matrix
[0062] Attention flow attribution:
[0063]
[0064] Flow(A) t Attention flow value at time step t; l: Current layer index (1≤l≤L, L is the total number of layers); A (l) : Attention weights of layer l; t→s: Attention from target step t to source step s
[0065] The corrected attention weights:
[0066]
[0067] Corrected attention weights; λ: attribution correction coefficient (hyperparameter)
[0068] The time step attribution score:
[0069]
[0070] α t The attribution for time step t is obtained; Weight: The weight vector of the i-th head in multi-head attention at step t; Output: (Time step importance vector);
[0071] Attribution Fusion Decoder: Employs a cross-attention mechanism to focus on high-attribution features output by the encoder and fuses time-step attribution scores to generate preliminary prediction results; This module enhances the predictive ability for long-cycle events such as drought by strengthening key temporal dependencies.
[0072] The cross attention:
[0073]
[0074] Encoder output; Decoder input (T' is the decoding step size); Value projection weights; Context vector;
[0075] The attribution score fusion:
[0076]
[0077] ⊙: Element-wise multiplication (Hadamard product); outer product operation; A vector of all 1s (length d) v ); α: extended to The attribution score matrix;
[0078] The preliminary forecast:
[0079]
[0080] FFN: Feedforward Neural Network; Linear: Linear Projection Layer; Prediction results (d) y (for output dimensions);
[0081] Error Attribution Optimization Module: Calculates the attribution contribution of prediction error based on the gradient × input method, constructs a weighted loss function, updates model parameters in reverse, and achieves "priority correction of errors in key scenarios" to avoid core accuracy loss caused by averaging in traditional loss functions;
[0082] The error attribution calculation:
[0083]
[0084] Error attribution matrix; The gradient of the loss function with respect to the input x; Original loss function; y: true label;
[0085] The sample importance weights:
[0086]
[0087] w i : Weight of sample i; ||G (i) ‖2: Error attribution L2 norm for sample i; β: Weighted sharpening coefficient (hyperparameter);
[0088] The weighted loss function:
[0089]
[0090] Optimization during backpropagation
[0091] Output layer: Outputs optimized temporal prediction results, forming a closed loop of attribution optimization from feature input to prediction output;
[0092] Final prediction result:
[0093]
[0094] Decoder final layer output; MLP: Multilayer Perceptron; Final prediction results.
[0095] Furthermore, in step S12, the monthly water shortage sequence of the drinking water project is fitted to a gamma distribution using the unbiased probability weighted moment method, and the cumulative probability of the sequence is calculated. After standard normalization, the SHI value for each time scale is obtained. Assume that the monthly single-point water shortage sequence of the project satisfies the probability density function of the gamma distribution:
[0096]
[0097] In the formula, α and β are the location parameter and shape parameter, respectively (α>0, β>0); the cumulative probability of monthly single-point water shortage is as follows:
[0098]
[0099] By analyzing the cumulative probability F(W) q After normalization, the corresponding SHI can be obtained:
[0100] When 0 <F(W q When )≤0.5:
[0101]
[0102] When 0.5 <F(W q When )≤1:
[0103]
[0104] Among them W q Let k be the monthly water shortage for the drinking water project, and k be a process parameter. The constant values in the formula are as follows:
[0105] c0=2.515517, c1=0.802853, c2=0.010328, d1=1.4132788, d2=0.189269d3=0.001308.
[0106] Beneficial effects:
[0107] This invention constructs a drought assessment index system for drinking water in the region, enabling precise quantification and scientific classification of water shortage conditions in areas without stable water sources, providing a standardized tool for drought severity assessment. It overcomes the limitations of existing drought prediction technologies in the drinking water field by developing a high-precision prediction technology for the drinking water drought index based on deep learning, improving the ability to predict drought trends at different times and providing a scientific basis for the early deployment of water supply security measures. Simultaneously, the AE-TT model, through an attribution enhancement mechanism, achieves a synergistic breakthrough in "efficiency-accuracy-interpretability" in high-precision drinking water drought index prediction, providing drought prevention and control under complex hydrological and meteorological environments with both scientific explanatory power and engineering practicality. Attached Figure Description
[0108] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0109] Figure 2 This is a schematic diagram of the architecture of the attribution-enhanced time series model of this invention. Detailed Implementation
[0110] The invention will now be further described with reference to the accompanying drawings.
[0111] Example
[0112] A method for predicting drought in drinking water based on the AE-TT model, characterized by the following steps:
[0113] S1. Constructing the drought index;
[0114] S11. Calculate the monthly water shortage for a single-point drinking water project:
[0115] W q =W x -W y -ET
[0116] W x =P×A×R
[0117] W y =ζ×G
[0118] Among them, W q Monthly water shortage for drinking water projects, ET is evapotranspiration, W x W represents the monthly water inflow of the project. y Let P be the monthly water supply of the drinking water project, A be the catchment area of the corresponding watershed of the drinking water project, R be the runoff coefficient, ζ be the water supply adjustment coefficient, and G be the monthly design water supply of the drinking water project.
[0119] S12. Based on the calculated monthly water shortage sequence of drinking water projects, further standardize it to construct the standardized drinking water drought index SHI.
[0120] S2. Build an Attribution-Enhanced Temporal Transformer (AE-TT) deep learning model to predict drought in drinking water, and output the drought prediction results through the AE-TT model;
[0121] The architecture of the AE-TT model includes:
[0122] Data input layer: Receives multi-source time-series features, including the SHI drought index for drinking water, meteorological elements, and large-scale climate indices (such as PDO and ENSO indices), forming the original input sequence; used to address the problem of insufficient multivariate collaborative modeling in traditional models;
[0123] By collaboratively receiving and integrating multi-source time-series features through the data input layer, the limitations of traditional models relying on single variables are overcome, enabling the complete capture of the cascading driving relationship between "large-scale climate anomalies - regional meteorological responses - drinking water project scheduling." In real-world scenarios, the prediction accuracy for complex droughts caused by multi-factor coupling (such as high temperatures and low rainfall triggered by El Niño + insufficient water storage in engineering projects) is improved.
[0124] Feature Attribution Filtering Module: Calculates global feature importance based on SHAP value, filters low-impact features such as random meteorological fluctuation signals through dynamic threshold, and outputs a purified feature set; used to reduce the model's ineffective learning of noisy information and improve the modeling efficiency of feature dimensions;
[0125] The SHAP value is calculated as follows:
[0126]
[0127] in Global importance score of feature j; The SHAP value of feature j of sample i; N: total number of samples; j: feature index (j∈[1,M], M is the original number of features);
[0128] The dynamic threshold setting:
[0129]
[0130] τ: Feature selection threshold; Importance of all features The mean; Importance of all features The standard deviation of ; k: threshold adjustment coefficient (hyperparameter);
[0131] The purification feature set:
[0132]
[0133] S purified : The set of filtered feature indexes; |S purified |=M' (M' is the purified feature number);
[0134] The feature attribution filtering module uses global feature importance assessment based on SHAP values, combined with a dynamic threshold mechanism to accurately remove noise signals such as random meteorological fluctuations, thereby increasing the model's focus on core drought drivers (such as prolonged periods of no rain and abrupt changes in key climate indices). Simultaneously, the "purified feature set" compresses the input dimension, improving model training efficiency and avoiding unnecessary computational waste.
[0135] Embedding layer encoding: Position encoding of the purified feature set, i.e., capturing the temporal sequence relationship, and feature encoding, i.e. quantifying the physical meaning of the features, to generate an initial feature sequence with semantic information; used to lay a structured foundation for subsequent attribution analysis;
[0136] The feature embedding:
[0137] E feat =X purified ·W emb
[0138] The purified feature tensor; T: time step; Embedded weight matrix; d model : Hidden layer dimension of the model; Feature embedding representation
[0139] The location code:
[0140]
[0141] t: Time step index (1≤t≤T); i: Dimension index Position encoding matrix;
[0142] The initial feature sequence:
[0143] H (0) =E feat +PE
[0144] An initial sequence with location information;
[0145] The combination of location encoding and feature encoding in the embedding layer transforms information such as the cyclical characteristics of climate indices and the physical magnitude of meteorological elements into structured semantic features. For example, the model can directly map the 6-12 month lag correlation between El Niño events and subsequent droughts into a coupling relationship of "feature importance - time decay coefficient" through the encoding layer, effectively improving the accuracy of capturing mechanistic dependencies and reducing over-reliance on data distribution.
[0146] Attribution Enhancement Encoder: Introduces a dual mechanism of "self-attention-attribution correction". First, the original self-attention weights are calculated, and then attribution analysis is performed through the attention flow method to correct the weight distribution bias, such as suppressing the tendency of uniform distribution. Simultaneously outputs the encoded features and "time step attribution score", which marks the historical time window that has a significant impact on the current prediction, in order to solve the problem of dilution of key historical information in long sequences.
[0147] The standard self-attention:
[0148]
[0149] Q = HW q : Query matrix; K = HW k : Key matrix; Projection weights; d k : key / query dimension (usually d k =d model / h, where h is the number of heads); Attention weight matrix
[0150] Attention flow attribution:
[0151]
[0152] Flow(A) t Attention flow value at time step t; l: Current layer index (1≤l≤L, L is the total number of layers); A (l) : Attention weights of layer l; t→s: Attention from target step l to source step s
[0153] The corrected attention weights:
[0154]
[0155] Corrected attention weights; λ: attribution correction coefficient (hyperparameter)
[0156] The time step attribution score:
[0157]
[0158] α t The attribution for time step t is obtained; Weight: The weight vector of the i-th head in multi-head attention at step t; Output: (Time step importance vector);
[0159] The attribution enhancement encoder's "self-attention-attribution correction" dual mechanism effectively corrects the attention bias of traditional models: by correcting the weight distribution through the attention flow method, the influence weight of the drought seed period (such as precipitation anomalies 6-12 months ago) in long sequences is increased, solving the problem of dilution of key historical windows. For cross-year consecutive drought events, the root mean square error (RMSE) of predictions for 1-3 months is reduced.
[0160] Attribution Fusion Decoder: Employs a cross-attention mechanism to focus on high-attribution features output by the encoder and fuses time-step attribution scores to generate preliminary prediction results; This module enhances the predictive ability for long-cycle events such as drought by strengthening key temporal dependencies.
[0161] The cross attention:
[0162]
[0163] Encoder output; Decoder input (T' is the decoding step size); Value projection weights; Context vector;
[0164] The attribution score fusion:
[0165]
[0166] ⊙: Element-wise multiplication (Hadamard product); outer product operation; A vector of all 1s (length d) v ); α: extended to The attribution score matrix;
[0167] The preliminary forecast:
[0168]
[0169] FFN: Feedforward Neural Network; Linear: Linear Projection Layer; Prediction results (d) y (for output dimensions);
[0170] Error Attribution Optimization Module: Calculates the attribution contribution of prediction error based on the gradient × input method, constructs a weighted loss function that assigns higher weights to high-impact scenarios, updates model parameters in reverse, and achieves "priority correction of errors in key scenarios", avoiding the core accuracy loss caused by the averaging of traditional loss functions;
[0171] The error attribution calculation:
[0172]
[0173] Error attribution matrix; The gradient of the loss function with respect to the input x; Original loss function; y: true label;
[0174] The sample importance weights:
[0175]
[0176] w i : Weight of sample i; ||G (i) ‖2: Error attribution L2 norm for sample i; β: Weighted sharpening coefficient (hyperparameter);
[0177] The weighted loss function:
[0178]
[0179] Optimization during backpropagation
[0180] The error attribution optimization module analyzes the error contribution of the gradient × input method. It assigns high weights to key scenarios such as drought thresholds and periods of extreme drought through a weighted loss function, thereby reducing prediction errors in these scenarios. Compared to the "average loss" of traditional models, AE-TT exhibits a lower false negative rate in water supply crisis early warning, significantly improving the response timeliness of drinking water safety risk prevention and control.
[0181] Attribution-guided parameter update mechanisms can accurately pinpoint the source of error (such as misjudgment of a climate index or dependency mismatch of a specific historical window), enabling the model to overcome the generalization limitations of traditional models in scenarios such as sudden droughts (such as spring drought followed by summer drought) and abnormal climate combinations (such as the unconventional correlation between La Niña and regional drought) not covered by the training set.
[0182] Output layer: Outputs optimized time-series prediction results, such as the drought index for drinking water in the next 1-3 months, forming a closed loop of attribution optimization from feature input to prediction output; Final prediction result:
[0183]
[0184] Decoder final layer output; MLP: Multilayer Perceptron; Final prediction results.
[0185] In step S12, the monthly water shortage sequence of the drinking water project is fitted to a gamma distribution using the unbiased probability weighted moment method. The cumulative probability of the sequence is then calculated, and after standard normalization, the SHI values for each time scale are obtained. Assume that the monthly single-point water shortage sequence of the project satisfies the probability density function of the gamma distribution:
[0186]
[0187] In the formula, α and β are the location parameter and shape parameter, respectively (α>0, β>0); the cumulative probability of monthly single-point water shortage is as follows:
[0188]
[0189] By analyzing the cumulative probability F(W) q After normalization, the corresponding SHI can be obtained:
[0190] When 0 <F(W q When )≤0.5:
[0191]
[0192] When 0.5 <F(W q When )≤1:
[0193]
[0194] Among them W q Let k be the monthly water shortage for the drinking water project, and k be a process parameter. The constant values in the formula are as follows:
[0195] c0=2.515517, c1=0.802853, c2=0.010328, d1=1.4132788, d2=0.189269d3=0.001308.
[0196] The model synchronously outputs time-step attribution scores and feature importance rankings, which can intuitively mark the historical time windows (such as precipitation deficit in the past 3 months) and driving factors (such as ENSO index intensity) that have the greatest impact on the current forecast, enabling decision-makers to clearly trace "why drought is predicted" and "what the key influencing factors are".
[0197] Simultaneously, the attribution loop, from feature filtering to attention correction and error optimization, enables each stage of the model to respond collaboratively to drought prediction needs: feature selection and attention weight correction are synchronized to ensure that key features are given priority; error attribution and loss function design are linked to achieve precise optimization by "correcting where the error is." Through long-term iteration, the model's adaptive learning ability to regional drought patterns continues to improve, providing stable and reliable algorithmic support for long-term drought relief planning for drinking water.
Claims
1. A method for predicting drought in drinking water supply based on the AE-TT model, characterized in that: Includes the following steps: S1. Constructing the drought index; S11. Calculate the monthly water shortage for a single-point drinking water project: W q *W x -W y -AND IN x =P×A×R IN y =ζ×G Among them, W q Monthly water shortage for drinking water projects, ET is evapotranspiration, W x W represents the monthly water inflow of the project. y Let P be the monthly water supply of the drinking water project, A be the catchment area of the corresponding watershed of the drinking water project, R be the runoff coefficient, ζ be the water supply adjustment coefficient, and G be the monthly design water supply of the drinking water project. S12. Based on the calculated monthly water shortage sequence of the drinking water project, further standardize it to construct the standardized drinking water drought index SHI; S2. Build an Attribution-Enhanced Temporal Transformer (AE-TT) deep learning model to predict drought in drinking water, and output the drought prediction results through the AE-TT model; The architecture of the AE-TT model includes: Data input layer: Receives multi-source time-series features, including the Human Drinking Water Drought Index (SHI) sequence, meteorological elements, and large-scale climate indices, forming the raw input sequence; used to address the problem of insufficient multivariate collaborative modeling in traditional models; Feature attribution filtering module: Calculates global feature importance based on SHAP value, filters low-impact features through dynamic threshold, and outputs a clean feature set; used to reduce ineffective learning of noisy information by the model and improve the modeling efficiency of feature dimensions; The SHAP value is calculated as follows: in Global importance score of feature j; The SHAP value of feature j of sample i; N: total number of samples; j: feature index (j∈[1,M], M is the original number of features); The dynamic threshold setting: τ: Feature selection threshold; Importance of all features The mean; Importance of all features The standard deviation of ; k: threshold adjustment coefficient (hyperparameter); The purification feature set: S purified : The set of filtered feature indexes; |S purified |=M,(M,is the purified characteristic number); Embedding layer encoding: Positional and feature encoding are performed on the purified feature set to generate an initial feature sequence with semantic information; this is used to lay a structured foundation for subsequent attribution analysis. The feature embedding: HAVE BEEN feat =X purified ·W emb The purified feature tensor; T: time step; Embedded weight matrix; d model : Hidden layer dimension of the model; Feature embedding representation The location code: t: Time step index (1≤t≤T); i: Dimension index Position encoding matrix; The initial feature sequence: A (0) =E feat +PE An initial sequence with location information; Attribution-enhanced encoder: Introduces a dual mechanism of "self-attention-attribution correction". First, it calculates the original self-attention weights, and then performs attribution analysis through the attention flow method to correct the weight distribution bias. It simultaneously outputs encoded features and "time step attribution scores" to solve the problem of dilution of key historical information in long sequences. The standard self-attention: Q = HW q : Query matrix; K = HW k : Key matrix; Projection weights; d k : key / query dimension (usually d k =d model / h, where h is the number of heads); Attention weight matrix The attention stream attribution: Flow(A) t : Attention flow value at time step t; l: Current layer index (1≤l≤L, L is the total number of layers); A (l) : Attention weights of layer l; t→s: Attention from target step t to source step s The corrected attention weights: Corrected attention weights; λ: attribution correction coefficient (hyperparameter) The time step attribution score: α t The attribution for time step t is obtained; Weight: The weight vector of the i-th head in multi-head attention at step t; Output: (Time step importance vector); Attribution Fusion Decoder: Employs a cross-attention mechanism to focus on high-attribution features output by the encoder and fuses time-step attribution scores to generate preliminary prediction results; This module enhances the predictive ability for long-cycle events such as drought by strengthening key temporal dependencies. The cross attention: Encoder output; Decoder input (T′ is the decoding step size); Value projection weights; Context vector; The attribution score fusion: ⊙: Element-wise multiplication (Hadamard product); outer product operation; A vector of all 1s (length d) v ); α: extended to The attribution score matrix; The preliminary forecast: FFN: Feedforward Neural Network; Linear: Linear Projection Layer; Prediction results (d) y (for output dimensions); Error Attribution Optimization Module: Calculates the attribution contribution of prediction error based on the gradient × input method, constructs a weighted loss function, updates model parameters in reverse, and achieves "priority correction of errors in key scenarios", avoiding the core accuracy loss caused by the averaging of traditional loss functions; The error attribution calculation: Error attribution matrix; The gradient of the loss function with respect to the input x; Original loss function; y: true label; The sample importance weights: w i : Weight of sample i; ||G (i) ‖2: Error attribution L2 norm for sample i; β: Weighted sharpening coefficient (hyperparameter); The weighted loss function: Optimization during backpropagation Output layer: Outputs optimized temporal prediction results, forming a closed loop of attribution optimization from feature input to prediction output; Final prediction result: Decoder final layer output; MLP: Multilayer Perceptron; Final prediction results.
2. A method for predicting drought in drinking water supply based on the AE-TT model, characterized in that: In step S12, the monthly water shortage sequence of the drinking water project is fitted to a gamma distribution using the unbiased probability weighted moment method, and the cumulative probability of the sequence is calculated. After standard normalization, the SHI value of each time scale is obtained. Suppose that the monthly single-point water shortage sequence of an engineering project satisfies the probability density function of a gamma distribution: In the formula, α and β are the location parameter and shape parameter, respectively (α>0, β>0); the cumulative probability of monthly single-point water shortage is as follows: By analyzing the cumulative probability F(W) q After normalization, the corresponding SHI can be obtained: When 0 <F(W q When )≤0.5: When 0.5 <F(W q When )≤1: Among them W q Let k be the monthly water shortage for the drinking water project, and k be a process parameter. The constant values in the formula are as follows: c0=2.515517, c1=0.802853, c2=0.010328, d1=1.4132788, d2=0.189269 d3=0.001308.
Citation Information
Cited By
Staged prediction method, system and equipment for leakage amount of sewage treatment system and medium
CN121684060A