A parameter automatic feedback adjustment deep learning water demand prediction method
By combining STL decomposition and AdaBoost-LSTM model with a multi-objective optimization algorithm, a deep learning water demand prediction model with automatic parameter feedback adjustment is constructed. This solves the problems of model complexity and parameter adjustment, and achieves high-precision and stable water demand prediction, which is suitable for water resource management systems.
Patent Information
- Application Number
- CN202310277562.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-03-21
AI Technical Summary
Existing deep learning-based water demand prediction models have problems in water resource management, such as complex model structure, many parameters and high requirements for parameter tuning, which makes them difficult to promote and apply in practice. In addition, traditional water demand prediction models have low accuracy in predicting extreme points.
The historical water demand sequence is decomposed into trend, periodic and residual sequences using the STL decomposition method. Multiple LSTM neural networks are integrated using the AdaBoost algorithm for prediction, and the model parameters are optimized by a multi-objective optimization algorithm to construct a deep learning water demand prediction model with automatic parameter feedback adjustment, which simplifies the model operation and parameter adjustment process.
It significantly improves the accuracy of water demand forecasting, especially the ability to predict extreme points, simplifies model operation and parameter adjustment, and enhances the stability and generalizability of the model, making it suitable for water resource management systems.
Smart Images

Figure CN116245030B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water resource management and communication network technology, and specifically relates to a deep learning water demand prediction model with automatic parameter feedback adjustment. Background Technology
[0002] Real-time and accurate water demand forecasting is crucial for building an efficient water resource management system, providing a primary basis for short-term water resource allocation. Artificial intelligence-based water demand forecasting models can further improve the accuracy and timeliness of forecasts by leveraging their powerful big data mining capabilities, particularly addressing the low accuracy of traditional models in predicting extreme points. However, with the rapid development of artificial intelligence, AI-based water demand forecasting models are still under continuous improvement and refinement. Deep learning models, in particular, possess powerful feature mining capabilities and can significantly improve prediction accuracy compared to classic AI models. However, their complexity in practical water demand forecasting, the large number of internal parameters, and the high skill requirements for parameter tuning and operation by water resource system managers limit their widespread application. Water demand forecasting models that allow for automatic parameter feedback adjustment have not yet been researched and applied in water resource management, and the construction process for such models remains unclear. Summary of the Invention
[0003] The purpose of this invention is to provide a deep learning-based water demand prediction model with automatic parameter feedback adjustment. This method decomposes historical water demand sequences into trend sequences, periodic sequences, and residual sequences. Multiple LSTM neural networks are integrated using the AdaBoost algorithm to construct a deep learning water demand prediction model, which predicts each of the three sequences separately. A multi-objective optimization algorithm is then used to optimize the model parameters. The optimized parameter set is automatically fed back to the deep learning water demand prediction model for the next round of prediction, until the prediction accuracy meets a threshold, at which point the cycle ends. This method can significantly improve the accuracy of water demand prediction, especially for predicting extreme points. It also simplifies the model operation and parameter adjustment process, as the internal optimization algorithm autonomously completes parameter adjustment, eliminating the need for manual parameter tuning. This method has significant potential for widespread application in water resource management systems.
[0004] To achieve the above objectives, the technical solution of the present invention is as follows:
[0005] A method for optimizing the allocation of multi-source, multi-user, differentiated water supply systems that considers reclaimed water includes the following steps:
[0006] Step 1: Identify and process outliers in the historical water demand series using the 3σ criterion and weighted average method;
[0007] Step 2: The sample sequence is decomposed using the STL decomposition method (Seasonal and Trend decomposition using Loess) to obtain the decomposed sequence;
[0008] Step 3: The AdaBoost-LSTM deep learning water demand prediction model is proposed to predict each decomposition sequence, and the prediction results of each decomposition sequence are merged to obtain the preliminary prediction results.
[0009] Step 4: Determine whether the prediction accuracy of the Adobos-LSTM deep learning water demand prediction model is greater than the threshold. If yes, continue to step 5; otherwise, output the result directly.
[0010] Step 5: Input the parameters from the prediction model into the optimization model for optimization to obtain the optimized parameter set;
[0011] Step 6: Automatically input the optimized parameter set into the AdaBoost-LSTM deep learning water demand prediction model, repeat steps 3-4 until the prediction accuracy meets the threshold requirement, and output the water demand prediction result.
[0012] In the above technical solution, further, the 3σ criterion used in step 1 refers to first assuming that the historical water demand series only contains random errors due to observation mistakes, etc., then calculating and processing it to obtain the standard deviation, and determining the interval [μ t -3σ t ,μ t +3σ t ], where μ represents the historical water demand series mean and σ represents the standard deviation. It is believed that any error exceeding this range is not a random error but a gross error, and outliers containing gross errors in the series can be identified.
[0013] Furthermore, the weighted average method used in step 1 refers to smoothing outliers identified by the 3σ criterion by averaging their nearest neighbors. The calculation formula is as follows:
[0014] E t =θ t-k x t-k +…θ t-1 x t-1 +θ t+1 x t+1 +…+θ t+k x t+k (14)
[0015] In the formula, E tθ represents the estimated value of the outlier, x represents the observed value, t represents the observation time, and k is a positive integer. θ is inversely proportional to the time distance between the corresponding observed value and the outlier. The closer the observed value is to the outlier, the greater its weight. The sum of all weights is 1.
[0016] Furthermore, the STL decomposition method used in step 2 can be specifically referred to in [1] Lei Qingwen, Gao Peiqiang, Li Jianlin. Monthly runoff forecast model integrating time series decomposition and CNN-LSTM [J / OL]. Journal of Yangtze River Scientific Research Institute: 1-7 [2023-03-08].
[0017] Furthermore, step 3 proposes an integrated AdaBoost-LSTM deep learning water demand prediction model that comprehensively considers the seasonal characteristics of water demand prediction as well as the accuracy and stability of the prediction model. It integrates multiple LSTM neural network models into a single deep learning water demand prediction model using the AdaBoost algorithm, specifically including the following steps:
[0018] Step 3-1: Input the decomposed sequence as the training dataset;
[0019] Step 3-2, initialize the sample weights D1 = (w) in the training dataset. 11 ,w 12 ,…,w 1N ):
[0020] w 1i =1 / N, i=1,2,...,N (15)
[0021] In the formula, w 1i This represents the weights of each sample in the first training set, and N represents the number of samples.
[0022] Step 3-3: Iterate over m = 1, 2, ..., M to obtain m LSTM neural network models as base learners G for the AdaBoost algorithm. m (x), in the specific training process: if the error predicted by the LSTM neural network model for a certain training sample is small, the weight corresponding to the sample should be reduced in the next training set; conversely, if the error predicted by the LSTM neural network model for a certain training sample is large, then its weight should be increased; the training dataset with updated weights is used to train the next base learner, and the calculation is iterated for m = 1, 2, ..., M to obtain m base learners;
[0023] Steps 3-4 combine the trained base learners into a strong prediction model. After the training process of each base learner is completed, increase the weight of the base learner with the lower prediction error rate so that it plays a larger decisive role in the final model prediction, while decrease the weight of the base learner with the higher prediction error rate so that it plays a smaller decisive role in the final classification function. Combine the prediction advantages of each base learner on different samples to construct a linear combination of m base learners for prediction.
[0024]
[0025] In the formula, G(x) represents the final prediction result for a certain sample, and α m G represents the weights of each base learner. m (x) represents the predicted values of each LSTM neural network model.
[0026] Furthermore, the calculation method for obtaining m base learners in step 3-3 is as follows:
[0027] (1) According to the sample weight distribution D m The training data yields the m-th base learner:
[0028] G m (x):G m (x):χ→{-1,+1} (17)
[0029] (2) Construct LSTM neural network models as base learners in sequence and set the initial LSTM neural network model parameters;
[0030] (3) Use the LSTM neural network model to predict the training set samples;
[0031] (4) Calculate the maximum error of the LSTM neural network model:
[0032] E m =max(abs(y) i -y pre (18)
[0033] In the formula, E m Let y be the maximum error of the m-th LSTM neural network. i For the historical water demand of the training set, y pre This represents the model's predicted value in this iteration;
[0034] (5) Calculate emi:
[0035]
[0036] (6) Calculate the error rate:
[0037]
[0038] In the formula, w mi This represents the weight of the i-th sample in the m-th LSTM neural network model;
[0039] (7) Calculate the weights of each LSTM neural network model:
[0040]
[0041] (8) Update the weights of the training samples:
[0042] D m+1 =(w m+1,1 ,w m+1 ,2,...,w m+1,N ) (twenty two)
[0043]
[0044] In the formula, Z m It is a normalization factor, the purpose of which is to make all Z... m The sum of Z is 1. m The calculation formula is:
[0045]
[0046] Furthermore, the prediction accuracy mentioned in step 4 refers to the average absolute percentage error of the prediction result, and the prediction accuracy threshold mentioned in step 4 can be set by the water supply system according to its prediction accuracy requirements.
[0047] Furthermore, the parameters in the prediction model in step 5 include the number of LSTM model layers, the number of nodes per layer of the LSTM model, and the number of base learners in the AdaBoost ensemble algorithm, as well as other important adjustable parameters of the model.
[0048] Furthermore, the optimization model constructed in step 5 comprehensively considers the model's accuracy, stability, and complexity, specifically including:
[0049] (1) Objective equation
[0050] a. The model has the highest accuracy:
[0051]
[0052] b. The model has the strongest stability:
[0053]
[0054] c. Lowest model complexity:
[0055]
[0056] In the formula, RSS represents the sum of squared errors of the model predictions, k is the number of individuals, and N is the number of samples.
[0057] (2) Constraints: All model parameters are non-negative.
[0058] Furthermore, the training method for the optimization model described in step 5 employs an improved NSGA-Ⅲ multi-objective optimization algorithm, specifically including the following steps:
[0059] Step 5-1, initialize parameters, including the maximum number of generations G. max The parameter reference point size is H, the population size is N≈H, and the number of iterations is t=0;
[0060] Step 5-2: Randomly generate N individuals in the decision space to form the initial population P0;
[0061] Step 5-3, in generation t, for population P t Crossover and mutation operations are performed to obtain a population Q of offspring of size N. t ;
[0062] Step 5-4, put population P t and Q t Merge into a single population of size 2N: R t =P t ∪Q t ;
[0063] Step 5-5, for R t Perform a quick nondominated sort, and sort R t It is divided into several non-dominated layers;
[0064] Steps 5-6: Starting from the first non-dominated layer F1, merge individuals from the corresponding non-dominated layers one by one to form a new population St, until St equals N, i.e., S. t =F1∪F2…∪F l , and |S t |≥N, then define F l For the final acceptable non-dominated layer, F l+1 Individuals in the first and subsequent layers are discarded;
[0065] Steps 5-7, if population S t The size is exactly equal to N, that is, |S t If | = N, then the algorithm ends, the iteration terminates, and the next iteration proceeds to the next population P. t+1 =S t ;
[0066] Steps 5-8, if population S t Greater than N, i.e., |S tIf |>N, then first put F l Individuals previously in the non-dominant layer were classified into P. t+1 In, that is, P t+1 =F1∪F2…∪F l-1 Then from F l Select k individuals from P t+1 In, until P t+1 The algorithm terminates when the number of iterations reaches N.
[0067] Furthermore, the rapid non-dominated sorting in step 5-5 refers to the process of rapidly stratifying the population by evaluating it using Pareto non-dominated relations. For a population R of size 2N, t To perform rapid layering, follow these steps:
[0068] (1) In order to R t The first non-dominated layer F1 is determined, and each solution is used to match the population R. t To determine if an individual is dominated, it is compared to other individuals. This requires O(2MN) comparisons for each individual, where M is the number of targets. This process continues until all individuals in the F1 layer of the population are found, resulting in a time complexity of O(2MN). 2 );
[0069] (2) After finding all individuals in the F1 layer, first remove all individuals in the F1 layer from the population R. t Remove them, then repeat the above steps to find all individuals in layer F2, and so on, until R. t The process continues until all individuals have found their corresponding strata. Here, O() represents infinity of the same order.
[0070] Furthermore, the specific process of the layering in step 5-5 is as follows: First, give R... t Each individual i is assigned two basic parameters n i and S i , where n i Defined as population R t The number of individuals that dominate individual i, S i First, find the set of individuals dominated by individual i; second, find all individuals in the population that are not dominated, i.e., n. i Individuals with a value of 0 constitute the first non-dominated layer, namely the F1 layer; the non-dominated ranking of individual j belonging to the F1 layer is defined as j = 0. rank =1; Then, iterate through each individual j in F1, count the individuals Sj dominated by all individuals j, and subtract 1 from the number of individuals k in set Sj; after that, search through the population again for individuals k whose number of individuals dominating i is equal to 0, and then assign k to another set H. At this time, the non-dominated sort of set H is incremented by 1, that is, j rank=2, then H is defined as layer F2, and so on, until all individuals have a non-dominated order.
[0071] Compared with the prior art, the present invention has the following advantages:
[0072] (1) The STL decomposition method is used to decompose the historical water demand sequence, which effectively extracts the seasonal characteristics of the sequence as the input of the prediction model, thereby improving the efficiency of water demand prediction.
[0073] (2) The AdaBoost algorithm is used to integrate multiple LSTM models to construct a deep learning model for water demand prediction. By integrating multiple LSTM learners into a more powerful learner, the accuracy of water demand prediction can be significantly improved, especially the ability to predict extreme points. At the same time, thanks to the AdaBoost algorithm, the model can be prevented from overfitting, which further improves the stability of the deep learning model.
[0074] (3) Setting the threshold of MAPE as the condition for determining the termination of the water demand prediction model allows the model accuracy to be adjusted within a controllable range.
[0075] (4) The constructed multi-objective parameter optimization model balances the accuracy, stability and simplicity of the model to a certain extent by maximizing the prediction accuracy MAPE and minimizing RMSE and AIC. The relatively improved stability helps the water supply system obtain stable output and reduce pipe wear. At the same time, minimizing the complexity of the model is conducive to its practical application.
[0076] (5) The feedback adjustment mechanism that automatically inputs the optimized parameter set of NSGA-Ⅲ method into the prediction model for the next round of prediction can simplify the model operation and parameter adjustment process. The parameter adjustment is completed autonomously by the internal optimization algorithm of the model, without the need for manual parameter adjustment. It has the potential to be promoted in the actual application of water resource management system. Attached Figure Description
[0077] Figure 1 This is a flowchart of the method of the present invention;
[0078] Figure 2 This invention is an integrated AdaBoost-LSTM deep learning water demand prediction model.
[0079] Figure 3 This is the prediction result of the present invention in a certain region;
[0080] Figure 4 This is the result of comparing the present invention with other related models. Detailed Implementation
[0081] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0082] like Figure 1 As shown, a method for optimizing the configuration of multi-source, multi-user, differentiated water supply considering reclaimed water includes the following steps:
[0083] Step 1: Identify and process outliers in the historical water demand series using the 3σ criterion and weighted average method;
[0084] Step 2: Decompose the sample sequence using the STL decomposition method;
[0085] Step 3: The AdaBoost-LSTM deep learning water demand prediction model is proposed to predict each decomposition sequence, and the prediction results of each decomposition sequence are merged to obtain the preliminary prediction results.
[0086] Step 4: Determine whether the prediction accuracy of the Adobos-LSTM deep learning water demand prediction model is greater than the threshold. If yes, continue to step 5; otherwise, output the result directly.
[0087] Step 5: Input the parameters from the prediction model into the optimization model for optimization to obtain the optimized parameter set;
[0088] Step 6: Automatically input the optimized parameter set into the AdaBoost-LSTM deep learning water demand prediction model, repeat steps 3-4 until the prediction accuracy meets the threshold requirement, and output the water demand prediction result.
[0089] In step 1, the 3σ criterion refers to first assuming that the historical water demand series contains only random errors due to observational mistakes, then calculating and processing it to obtain the standard deviation, and finally determining the interval.
[0090] [μ t -3σ t ,μ t +3σ t ], where μ represents the historical water demand series mean and σ represents the standard deviation. It is believed that any error exceeding this range is not a random error but a gross error, and outliers containing gross errors in the series can be identified.
[0091] Step 1 uses the weighted average method, which smooths outliers identified by the 3σ criterion by averaging their nearest neighbors. The calculation formula is as follows:
[0092] E t =θ t-k x t-k+…θ t-1 x t-1 +θ t-1 x t-1 +…+θ t+k x t+k (28)
[0093] In the formula, E t Here, θ represents the estimated value of the outlier, x represents the observed value, t represents the observation time, and k is a positive integer. θ is inversely proportional to the time distance between the corresponding observed value and the outlier; the closer the observed value is to the outlier, the greater its weight. The sum of all weights is 1. The number of neighboring points here is 2^k.
[0094] Step 2 uses the STL decomposition method, which specifically includes the following steps:
[0095] Step 2-1: During the inner loop iteration, use the estimated trend component T obtained from the k-th iteration. t k For the original sequence X t Detrending:
[0096] Step 2-2: Use the Loess smoother to smooth the sub-periodic sequence to obtain the preliminary seasonal components.
[0097] Steps 2-3: Process the data obtained in step 2 using a low-pass filter. Then use the Loess smoother to identify any remaining trend components.
[0098] Steps 2-4: Calculate the difference between the low-pass value and the initial seasonal component to obtain the additive seasonal component.
[0099] Steps 2-5: Subtract the seasonal components from the original series to obtain a series without seasonality:
[0100] Steps 2-6 involve processing the seasonality-eliminating series obtained in steps 4-5. Smoothing is performed using the Loess smoother to obtain the trend component T. t k+1 ;
[0101] Steps 2-7: In the outer loop, calculate the residual components using the trend and seasonal components obtained in the inner loop (Steps 1-6). And calculate the weights of outliers in the residual components;
[0102] Steps 2-8: In the next iteration of the inner loop, weights are used to reduce the impact of outliers identified in the previous outer loop iteration. The original water demand X is then calculated using the STL method. t Sequence decomposition into seasonal S t Trend T t and residual R t The components are as follows: seasonal component corresponds to the periodic sequence, trend component corresponds to the trend sequence, and residual component corresponds to the residual sequence.
[0103] Step 3 proposes an integrated AdaBoost-LSTM deep learning water demand prediction model. This model comprehensively considers the seasonal characteristics of water demand prediction, as well as the accuracy and stability of the prediction model. It integrates multiple LSTM neural network models into a single deep learning water demand prediction model using the AdaBoost algorithm. The model structure diagram is shown below. Figure 2 As shown, the specific steps include:
[0104] Step 3-1: Input the decomposed sequences as the training dataset. Specifically, input the trend feature sequence (i.e., trend sequence), seasonal feature sequence (i.e., periodic sequence), and residual feature sequence (i.e., residual sequence) after STL decomposition into the model according to the 80% training set ratio.
[0105] Step 3-2, initialize the sample weights D1 = (w) in the training dataset. 11 ,w 12 ,…,w 1N ):
[0106] w 1i =1 / N, i=1,2,...,N (29)
[0107] In the formula, w 1i This represents the weights of each sample in the first training set, and N represents the number of samples.
[0108] Step 3-3: Iterate over m = 1, 2, ..., M, and obtain T, S, and R LSTM neural network models for the three input sequences mentioned in Step 3-1, respectively. These models serve as the base learners G for the trend feature deep learning prediction model, the seasonal feature deep learning prediction model, and the residual feature deep learning prediction model, respectively. t (x), G s (x) and G r(x) In the specific training process: if the error predicted by the LSTM neural network model for a certain training sample point is small, then the weight corresponding to that sample should be reduced in the next training set; conversely, if the error predicted by the LSTM neural network model for a certain training sample is large, then its weight should be increased. The sample set with updated weights is used to train the next base learner, and the entire training process continues iteratively, calculating m for m = 1, 2, ..., M, to obtain m base learners;
[0109] Steps 3-4 combine the trained base learners into a strong prediction model. After the training process of each base learner is completed, the weight of the base learner with the lower prediction error rate is increased, so that it plays a larger decisive role in the final model prediction, while the weight of the base learner with the higher prediction error rate is decreased, so that it plays a smaller decisive role in the final classification function. Combining the prediction advantages of each base learner at different sample points, linear combinations of T, S, and R LSTM neural network models are constructed to obtain three ensemble models for trend feature sequences, seasonal feature sequences, and residual feature sequences:
[0110]
[0111]
[0112]
[0113] In the formula, G T (x), G S (x), G R (x) represent the final prediction results of a sample's trend characteristic sequence, seasonal characteristic sequence, and residual characteristic sequence, respectively, where α t α represents the weights of each base learner in the trend feature deep learning prediction model. s α represents the weights of each base learner in the deep learning prediction model for seasonal features. r G represents the weights of each base learner in the residual feature deep learning prediction model. t (x), G s (x) and G r (x) represents the predicted values of each LSTM neural network model, namely the trend feature deep learning prediction model, the seasonal feature deep learning prediction model, and the residual feature deep learning prediction model.
[0114] The calculation method for obtaining T, S, and R base learners in step 3-3 is as follows:
[0115] (1) According to the sample weight distribution D m The training data yields the m-th base learner:
[0116] Gm (x):G m (x):χ→{-1,+1} (33)
[0117] (2) Construct LSTM neural network models as base learners in sequence and set the initial LSTM neural network model parameters;
[0118] (3) Use the LSTM neural network model to predict the training set samples;
[0119] (4) Calculate the maximum error of the LSTM neural network model:
[0120] E m =max(abs(y) i -y pre (34)
[0121] In the formula, E m Let y be the maximum error of the m-th LSTM neural network. i For the historical water demand of the training set, y pre This represents the model's predicted value in this iteration;
[0122] (5) Calculate emi:
[0123]
[0124] (6) Calculate the error rate:
[0125]
[0126] In the formula, w mi This represents the weight of the i-th sample in the m-th LSTM neural network model;
[0127] (7) Calculate the weights of each LSTM neural network model:
[0128]
[0129] (8) Update the weights of the training samples:
[0130] D m+1 =(w m+1,1 ,w m+1 ,2,...,w m+1,N (38)
[0131]
[0132] In the formula, Z m It is a normalization factor, the purpose of which is to make all Z... m The sum of Z is 1. m The calculation formula is:
[0133]
[0134] By inputting the trend feature sequence, seasonal feature sequence and residual feature sequence decomposed in step 2 into the model for training, and repeating the above (33)-(40), T, S and R LSTM neural network models are obtained respectively.
[0135] Step 5 predicts the model parameters, including the number of LSTM model layers, the number of nodes per LSTM model layer, and the number of base learners in the AdaBoost ensemble algorithm, among other important adjustable parameters.
[0136] The optimization model constructed in step 5 comprehensively considers the model's accuracy, stability, and complexity, specifically including:
[0137] (1) Objective equation
[0138] a. The model has the highest accuracy:
[0139]
[0140] b. The model has the strongest stability:
[0141]
[0142] c. Lowest model complexity:
[0143]
[0144] In the formula, y pre The value represented by y is the symbolic representation of the AdaBoost-LSTM deep learning water demand prediction model integrated in step 3. It contains multiple adjustable parameters of this integrated model. i RSS represents the true value, and RSS represents the sum of squared errors of the model's predicted values.
[0145] (2) Constraints: All model parameters are non-negative.
[0146] Step 5 describes the training method for the optimized model, which employs an improved NSGA-Ⅲ multi-objective optimization algorithm and specifically includes the following steps:
[0147] Step 5-1, initialize parameters, including the maximum number of generations G. max 1. Parameter reference point size H, population size N≈H, let the number of iterations t=0;
[0148] Step 5-2: Randomly generate N individuals in the decision space to form the initial population P0;
[0149] Step 5-3, in generation t, for population P tCrossover and mutation operations are performed to obtain a population Q of offspring of size N. t ;
[0150] Step 5-4, put population P t and Q t Merge into a single population of size 2N: R t =P t ∪Q t ;
[0151] Step 5-5, for R t Perform a quick nondominated sort, and sort R t It is divided into several non-dominated layers;
[0152] Steps 5-6: Starting from the first non-dominated layer F1, merge individuals from the corresponding non-dominated layers one by one to form a new population St, until St equals N, i.e., S. t =F1∪F2…∪F l , and |S t |≥N, then define F l For the final acceptable non-dominated layer, F l+1 Individuals in the first and subsequent layers are discarded;
[0153] Steps 5-7, if population S t The size is exactly equal to N, that is, |S t If | = N, then the algorithm ends, the iteration terminates, and the next iteration proceeds to the next population P. t+1 =S t ;
[0154] Steps 5-8, if population S t Greater than N, i.e., |S t If |>N, then first put F l Individuals previously in the non-dominant layer were classified into P. t+1 In, that is, P t+1 =F1∪F2…∪F l-1 Then from F l Select k individuals from P t+1 In, until P t+1 The algorithm terminates when the number of iterations reaches N.
[0155] Step 5-5 describes the rapid non-dominated ordination process, which uses Pareto non-dominated relations to evaluate a population and quickly stratify it. For a population R of size 2N, this process is applied... t To perform rapid layering, follow these steps:
[0156] (1) In order to R t The first non-dominated layer F1 is determined, and each solution is used to match the population R. tTo determine if an individual is dominated, it is compared to other individuals. This requires O(2MN) comparisons for each individual, where M is the number of targets. This process continues until all individuals in the F1 layer of the population are found, resulting in a time complexity of O(2MN). 2 );
[0157] (2) After finding all individuals in the F1 layer, first remove all individuals in the F1 layer from the population R. t Remove them, then repeat the above steps to find all individuals in layer F2, and so on, until R. t The process continues until all individuals have found their corresponding strata. Here, O() represents infinity of the same order.
[0158] The specific process of the layering in step 5-5 is as follows: First, give R... t Each individual i is assigned two basic parameters n i and S i , where n i Defined as population R t The number of individuals that dominate individual i, S i First, find the set of individuals dominated by individual i; second, find all individuals in the population that are not dominated, i.e., n. i Individuals with a value of 0 constitute the first non-dominated layer, namely the F1 layer; the non-dominated ranking of individual j belonging to the F1 layer is defined as j = 0. rank =1; Then, iterate through each individual j in F1, count the individuals Sj dominated by all individuals j, and subtract 1 from the number of individuals k in set Sj; after that, search through the population again for individuals k whose number of individuals dominating i is equal to 0, and then assign k to another set H. At this time, the non-dominated sort of set H is incremented by 1, that is, j rank =2, so H is defined as layer F2, and so on, until all individuals have a non-dominated order.
[0159] The optimization parameter set in step 6 specifically includes y in the optimization model. pre The multiple adjustable parameters contained in the integrated AdaBoost-LSTM deep learning water demand prediction model are the parameter set optimized by the NSGA-Ⅲ multi-objective optimization algorithm in step 5.
[0160] The prediction results of this invention in regions a and b are respectively Figure 3As shown in Figures (a) and (b), the horizontal axis represents time, and the vertical axis represents water demand. The blue line represents the actual value, and the red line represents the predicted value. In Figures (a) and (b), from top to bottom, `trend` represents the actual value of the trend series, and `trend_pre` represents the prediction result of the deep learning model for the trend series; `seasonal` represents the actual value of the seasonal series, and `seasonal_pre` represents the prediction result of the deep learning model for the seasonal series; `resid` represents the actual value of the residual series, and `resid_pre` represents the prediction result of the deep learning model for the residual series. Figure 3 It can be seen that the model has high prediction accuracy, especially its strong fitting ability for trend sequences and residual sequences.
[0161] like Figure 4 The figure shows a comparison of the prediction results of this invention in region a with other related machine learning prediction models. In the figure, the horizontal axis of each subplot represents the true value, and the vertical axis represents the predicted value of each model. STL-Ada-LSTM is a deep learning water demand prediction model with automatic parameter feedback adjustment proposed in this invention. Other machine learning models (back propagation neural network, long short-term memory network, prediction model Ada-BP coupled with Adaboost ensemble algorithm and BP neural network, prediction model Ada-LSTM coupled with Adaboost ensemble algorithm and LSTM, prediction model STL-LSTM coupled with STL decomposition method and LSTM) are widely used water demand prediction models in this field and closely related to this invention. As can be seen from the figure, the deep learning water demand prediction model with automatic parameter feedback adjustment proposed in this invention has the highest prediction accuracy and outperforms other models in practical applications.
Claims
1. A method of parameter automatic feedback adjustment for deep learning water demand prediction, characterized in that, The method comprises the following steps: Step 1, identifying and processing the abnormal values in the historical water demand sequence by using the 3σ criterion and the weighted average method; Step 2, decomposing the sample sequence by using the STL decomposition method to obtain a decomposed sequence; Step 3, proposing an AdaBoost-LSTM deep learning water demand prediction model to predict each decomposed sequence, and combining the prediction results of each decomposed sequence to obtain a preliminary prediction result; Step 4, judging whether the prediction accuracy of the Adobos-LSTM deep learning water demand prediction model is greater than a threshold value, if yes, continuing to step 5, if not, directly outputting the result; Step 5, inputting the parameters in the prediction model into an optimization model for optimization to obtain an optimized parameter set; Step 6, automatically inputting the optimized parameter set into the AdaBoost-LSTM deep learning water demand prediction model, repeating steps 3-4 until the prediction accuracy meets the threshold requirement, and outputting the water demand prediction result; Step 3-1, inputting the decomposed sequence as a training data set; the decomposed sequence specifically refers to respectively decomposing the trend feature sequence, the seasonal feature sequence and the residual feature sequence after STL decomposition; Step 3-2, initialize sample weights in the training data set D1= (w 11 ,w 12 ,L,w 1N ) : w 1i = 1 / N, i = 1,2,...,N (1) In the formula, w 1i N represents the number of samples in the first training set. Step 3-3, the training process of the base learner of the AdaBoost algorithm is as follows: if the error of a training sample predicted by the LSTM neural network model is small, the weight corresponding to the sample should be reduced in constructing the next training set; on the contrary, if the error of a training sample predicted by the LSTM neural network model is large, the weight of the sample should be increased; the training data set after weight updating is used to train the next base learner, and the iteration calculation is performed for m=1, 2,..., M to obtain m base learners; Step 3-4, combining each trained base learner into a strong prediction model; after the training process of each base learner is completed, the weight of the base learner with small prediction error rate is increased, so that it plays a greater decision role in the final model prediction, and the weight of the base learner with large prediction error rate is reduced, so that it plays a smaller decision role in the final classification function, and the advantages of each base learner in different sample prediction are combined to construct a linear combination of T, S and R LSTM neural network models to obtain three integrated models for the trend feature sequence, the seasonal feature sequence and the residual feature sequence. In the formula, G(x) is the final prediction result of a sample, a m is the weight of each base learner, G m (x) is the prediction value of each LSTM neural network model.
2. The method of claim 1, wherein the parameter automatic feedback adjustment is performed by using a deep learning model. In step 1, the standard deviation is obtained by calculating and processing the historical water demand sequence by using the 3σ criterion, and the error interval is determined; if the data in the historical water demand sequence exceeds this error interval, it is not a random error but a gross error, and the abnormal value containing the gross error in the sequence can be identified.
3. The method of claim 2, wherein the parameter is automatically adjusted based on the feedback. In step 1, the identified abnormal value is weighted and averaged with its adjacent points by using the weighted average method, and the obtained value is used to replace the abnormal value; in the weighted average process, the weight value of each adjacent point is inversely proportional to the time distance from itself to the abnormal value, and the closer to the abnormal value, the greater the weight; the sum of the weights of all adjacent points is 1.
4. The method of claim 1, wherein the parameter automatic feedback adjustment is performed by using a deep learning model. In step 3-3, the calculation method of the m base learners obtained by training is as follows: (1) According to the sample weight distribution D m The training data obtains the mth base learner: G m (x): G m (x): χ→{-1,+1} (3) (2) sequentially constructing an LSTM neural network model as a base learner, and setting initial LSTM neural network model parameters; (3) predicting the training set samples by using the LSTM neural network model; (4) calculating the maximum error of the LSTM neural network model: E m = max(abs(y i -y pre )) (4) In the formula, E m is the maximum error of the mth LSTM neural network, y i is the historical water demand of the training set, y pre is the predicted value of the model in this iteration; (5) calculating the error rate: In the formula, w mi represents the weight of the mth LSTM neural network model for the ith sample; (6) calculating the weight of each LSTM neural network model: (7) updating the weight of the training samples: D m+1 = (w m+1,1 ,w m+1,2 ,...,w m+1,N ) (8) where Z m is a normalization factor, all Z m sum to 1, Z m is calculated as:
5. The method of claim 1, wherein the parameter automatic feedback adjustment is performed by using a deep learning model. The prediction accuracy in step 4 refers to the average absolute percentage error of the prediction results, and the prediction accuracy threshold in step 4 can be set according to the demand of the water supply system for prediction accuracy.
6. The method of claim 1, wherein the parameter automatic feedback adjustment is performed by using a deep learning model. The construction of the optimization model in step 5 comprehensively considers the accuracy, stability and complexity of the model, specifically: (1) target equation a. The model has the highest accuracy: b. The model has the strongest stability: c. The model has the lowest complexity: In the formula, RSS represents the sum of the error squares of the model prediction values, k is the individual, and N is the number of samples; (2) constraint condition: all model parameters are non-negative.
7. The method of claim 1, wherein the parameter automatic feedback adjustment is performed by using a deep learning model. The training method of the optimization model in step 5 specifically includes the following steps: Step 5-1, initialize parameters, including the maximum evolution generation G max , the parameter reference point scale H, the population size N≈H, let the iteration number t=0; Step 5-2, randomly generate N individuals in the decision space to form the initial population P0; Step 5-3, at generation t, a population P t is obtained by performing crossover and mutation operations on the population P t ; Step 5 - 4, merge the populations P t and Q t into one population R of size 2N t = P t ∪ Q t ; Step 5-5, for R t perform fast non-dominated sorting, and divide R t into several non-dominated layers; Step 5-6, from the first non-dominated layer F1 layer, one layer by one layer to merge the individual on the corresponding non-dominated layer, to form a new population St, until St equals N, that is, S t = F1 U F2L U F l , and |S t |≥N, at this time, define F l as the last acceptable non-dominated layer, F l+1 layer and the individual of the layer after the layer are discarded; Step 5 - 7, if population S t is just equal to N, i.e. |S t | = N, then the algorithm ends, the iteration terminates and the population P t+1 = S t ; Step 5-8, if population S t is greater than N, i.e. |S t | > N, then first select F l from S t+1 , i.e. F t+1 = F1∪F2L∪F l-1 , then select k individuals from F l to P t+1 , until the number of P t+1 is N, then the algorithm ends.
8. The method of claim 7, wherein the parameter is automatically adjusted based on the feedback. The fast non-dominated sorting described in step 5 is a process of evaluating the population using the Pareto non-dominated relation and fast stratifying the population R of size 2N t Fast stratification is performed as follows: (1) In order to determine the first non-dominated layer F1 layer contains all individuals, each solution is used to and the population R t t The other individual comparison to determine whether it is dominated, each individual needs O (2MN) times of comparison, where M is the number of objectives, this step until the population of F1 layer of all individuals, time complexity is O (2MN 2 ) (2) After all individuals of F1 layer are found, all individuals of F1 layer are removed from population R t , and step (1) is repeated to find all individuals of F2 layer, and so on until all individuals in R t have their corresponding layers found.
9. The method of claim 8, wherein the parameter is automatically adjusted based on the feedback. For a population R of size 2N t To perform rapid stratification, the specific method is as follows: First, give R... t Each individual i is assigned two basic parameters n i and S i , where n i Defined as population R t The number of individuals that dominate individual i, S i First, find the set of individuals dominated by individual i; second, find all individuals in the population that are not dominated, i.e., n. i Individuals with a value of 0 constitute the first non-dominated layer, namely the F1 layer; the non-dominated ranking of individual j belonging to the F1 layer is defined as j = 0. rank =1; Then, iterate through each individual j in F1, count the individuals Sj dominated by all individuals j, and subtract 1 from the number of individuals k in set Sj; after that, search through the population again for individuals k whose number of individuals dominating i is equal to 0, and then assign k to another set H. At this time, the non-dominated sort of set H is incremented by 1, that is, j rank =2, then H is defined as layer F2, and so on, until all individuals have a non-dominated order.
Citation Information
Patent Citations
Dynamic water demand prediction method based on main driving factor screening and deep learning
CN114330818A
Short-term campus water demand prediction method based on SSA-ConvLSTM-LSTM hybrid model
CN115618995A