Water plant ultra-short-term water supply quantity prediction method and system based on time multi-scale characteristics
By selecting feature factors from a time multi-scale perspective and using deep learning models to predict water plant water supply, the problem of failure to fully consider time multi-scale features in the prior art is solved, and the accuracy and robustness of the prediction are improved.
Patent Information
- Application Number
- CN202411414691.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-11
AI Technical Summary
The existing water plant water supply forecasting method fails to fully consider the time multi-scale characteristics, resulting in insufficient prediction accuracy and robustness.
By selecting historical water supply characteristic factors and related environmental characteristic factors from a multi-scale perspective, a feature set is constructed, and ultra-short-term water supply prediction is used using deep learning models such as RNN, LSTM, etc., and hyperparameter tuning is performed in combination with Bayesian optimization technology.
It improves the accuracy and robustness of water supply forecasting, can better match actual dynamic changes, achieve more refined water supply control, and improves the reliability and stability of water supply.
Smart Images

Figure CN119599159A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water resource management and prediction, and specifically to a method and system for predicting ultra-short-term water supply of a water plant based on time multi-scale characteristics. Background Art
[0002] With the continuous acceleration of urbanization and the increasing significance of climate change, water resources management has become an increasingly urgent challenge. In this context, the accurate prediction of water supply from water plants has become a key link in ensuring the living standards of urban residents and industrial production. The complexity of water resources and the uncertainty affected by various factors make traditional statistical methods reveal certain limitations in water volume prediction; therefore, it is crucial to consider more comprehensive feature selection and model selection techniques and explore more accurate and efficient methods for predicting water supply from water plants.
[0003] In the task of water supply prediction, feature selection and model selection are key steps. Through correlation analysis, data preprocessing and related statistics, it is ensured that the selected features are closely related to the target variables and meet the requirements of model training. In terms of model selection, the task type determines the type of model selected, and the appropriate model complexity and hyperparameters are selected according to the complexity of the problem. However, a study of existing literature shows that most studies have not considered the issue of time multi-scale in the selection of input feature sets. Time multi-scale refers to the simultaneous consideration of multiple features or change patterns at different scales in time series data. These scales can be different time intervals, such as hours, days, months or years, or different data aggregation levels, such as raw data, hourly averages, daily totals, etc. Time multi-scale is of high importance in sequence prediction tasks. It can help the model better capture the trend, periodicity, historical dependencies and the impact of emergencies in the data, thereby improving the accuracy and robustness of the prediction. For the short-term water supply prediction of water plants, it is still an urgent problem to be solved to select which time multi-scale feature set and model is more suitable. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for predicting ultra-short-term water supply of a water plant based on time multi-scale characteristics, to deeply study and solve the key problems of feature set selection and model selection based on time multi-scale, to make full use of historical water supply data, meteorological information and other relevant factors at different time scales for ultra-short-term prediction, and to explore more accurate and reliable modeling methods in water supply prediction to solve the technical problems raised in the background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a method for predicting ultra-short-term water supply of a water plant based on time multi-scale characteristics, comprising at least the following steps:
[0006] S1: Obtain a water supply-related data set of a water plant, the data set including historical water supply data and related environmental data, and divide the data set into a training set, a validation set, and a test set;
[0007] S2: Select historical water supply characteristic factors and related environmental characteristic factors from the perspective of time multi-scale to form a characteristic set;
[0008] S3: Verify the correlation and potential relationship between feature set and water supply through correlation analysis, mutual information analysis and feature histogram method;
[0009] S4: Use Bayesian optimization techniques to tune the hyperparameters of each network model separately;
[0010] S5: Based on the mean square error loss function, seven network models including RNN, BiRNN, LSTM, BiLSTM, GRU, BiGRU and Transformer are constructed, the training sets are input into the network models respectively, and the training results are output;
[0011] S6: Use the test set as the input of the seven network models, output the test results, and calculate the evaluation indicators of each network model, namely RMSE, MAE, MAPE and R 2 Compare and retain the best input parameters and network models;
[0012] S7: Use the optimal network model to make ultra-short-term predictions of the water plant’s future water supply and record the prediction results.
[0013] Furthermore, the S2 at least includes the following steps:
[0014] Firstly, the historical water supply data and relevant environmental data of the water plant were obtained, and the missing values and outliers of the data set were processed and normalized using the traditional mean interpolation method;
[0015] Then select the water supply lagged by 1 year, 1 month, 1 week, 1 day, the water supply every half hour lagged by 1 day, date, holiday, daily minimum temperature, daily maximum temperature and daily average temperature;
[0016] The dataset is then divided into training set, validation set and test set. 90% of the data is used as the training set for training the model, 10% of the data is used as the validation set for model hyperparameter tuning, and the remaining 10% of the data is used as the test set to evaluate model performance.
[0017] Furthermore, the S3 at least includes the following steps:
[0018] In the correlation analysis, the Pearson correlation coefficient, Spearman correlation coefficient, Kendall Tau correlation coefficient and partial correlation coefficient were used to analyze the correlation between the feature set and the water supply. Then a network model was constructed to take the feature set as input and output the prediction results.
[0019] Furthermore, the S4 at least includes the following steps:
[0020] Step 1: Define the search space of hyperparameters and specify the value range of hyperparameters;
[0021] Step 2: Select a priori function. If the function distribution is known, select the optimal model based on experience. If it is unknown, use the kernel function based on Gaussian process as the black box function for self-learning.
[0022] Step 3: Initialize some hyperparameter combinations and use these hyperparameter combinations to train the model and obtain the corresponding objective function values;
[0023] Step 4: Based on the existing hyperparameter combination and objective function value, establish a Gaussian process model to estimate the probability distribution of the objective function;
[0024] Step 5: Use the acquisition function to search for the maximum point of the objective function. AC usually selects the next hyperparameter combination to be evaluated based on the predicted mean and variance of the Gaussian process model to balance exploration and utilization.
[0025] Step 6: Input the hyperparameter combination selected by AC into the model for training and obtain the corresponding objective function value;
[0026] Step 7: Update the new hyperparameter combination and objective function value into the Gaussian process model;
[0027] Step 8: Repeat steps 5 to 7 until the preset number of iterations is reached.
[0028] The ultra-short-term water supply prediction system of a water plant based on time multi-scale characteristics at least includes a data acquisition module, a data analysis module, a model construction module, a model training module, a model optimization module and a water supply prediction module;
[0029] The data acquisition module is used to acquire relevant data sets, which include historical water supply data and relevant environmental data, and then divide the data sets into a training set and a test set;
[0030] The data analysis module is used to analyze each characteristic factor in the data set to find out the characteristic factors that are highly correlated with the water supply;
[0031] The model building module is used to build 7 deep learning network models based on mean square loss function;
[0032] The model training module is used to input the processed training set into 7 deep learning network models and output the training results;
[0033] The model optimization module is used to tune the hyperparameters of the seven deep learning network models, then input the test set into the network model, output the test results, compare the test results with the training results, and retain the optimal network model;
[0034] The water supply prediction module is used to use the optimal network model to predict the future ultra-short-term water supply of the water plant and record the prediction results.
[0035] Furthermore, the data acquisition module is used to acquire relevant data sets, which include water supply lagged by 1 year, 1 month, 1 week, and 1 day, water supply every half hour lagged by 1 day, dates, holidays, daily minimum temperature, daily maximum temperature, and daily average temperature; the data sets are divided into training set, validation set, and test set, 90% of the data from the data set is divided as a training set for training the model, 10% of the data from the training set is extracted as a validation set for model hyperparameter tuning, and the remaining 10% of the data is used as a test set to evaluate model performance.
[0036] Furthermore, the data analysis module uses correlation analysis, mutual information and histogram in feature engineering to comprehensively analyze the selected feature set, and the correlation analysis uses Pearson correlation coefficient, Spearman correlation coefficient, Kendall Tau correlation coefficient and partial correlation coefficient to analyze the correlation between the feature set and water supply.
[0037] Furthermore, the model optimization module uses Bayesian optimization technology to perform hyperparameter tuning on seven deep learning network models respectively, and the number of Bayesian optimization iterations is preset to 50.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] In view of the problem of insufficient research on historical water supply data in the field of water supply prediction, the present invention considers the selection of historical water supply characteristic factors from a multi-scale time perspective, extracts a series of characteristic factors with different time spans to form a feature set, and proves the effectiveness of the feature set through experiments, which can improve the accuracy of water supply prediction. At the same time, it proposes ultra-short-term prediction of water supply, which can better match actual dynamic changes, realize more precise water supply control, and improve the reliability and stability of water supply.
[0040] Compared with traditional statistical methods and machine learning methods, the deep learning model used in the present invention has higher efficiency and accuracy in processing time series data, can better capture the laws and patterns in the data, and improve the accuracy and robustness of predictions.
[0041] Therefore, the present invention provides an effective method for intelligent operation and maintenance in the field of water treatment, has broad application prospects, and can help water plants better plan and manage water resources to ensure the sustainable development of urban water supply systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0043] Figure 1 is a flowchart of an embodiment of the present invention;
[0044] Figure 2 A network model flow chart of an embodiment of the present invention;
[0045] Figure 3 A water supply data distribution diagram of an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of selecting time multi-scale historical water supply characteristics according to an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of correlation coefficient analysis according to an embodiment of the present invention;
[0048] Figure 6 A schematic diagram of mutual information analysis according to an embodiment of the present invention;
[0049] Figure 7 is a feature set histogram of an embodiment of the present invention;
[0050] Figure 8 A flowchart of Bayesian optimization hyperparameters according to an embodiment of the present invention;
[0051] Fig. 9 A comparison chart of the predicted value and the actual value of the water supply per half hour in an embodiment of the present invention;
[0052] Fig.10 A comparison chart of the predicted value and the actual value of the water supply volume on the day according to an embodiment of the present invention;
[0053] Fig.11 is a functional block diagram of a system according to an embodiment of the present invention;
[0054] Fig.12 FIG. 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0056] Embodiment 1:
[0057] The embodiment is basically as shown in the attached Figure 1 and Figure 2 As shown: The ultra-short-term water supply prediction method of a water plant based on time multi-scale characteristics includes at least the following steps:
[0058] S1: Obtain a water supply-related data set of a water plant, the data set including historical water supply data and related environmental data, and then divide it into a training set, a validation set, and a test set;
[0059] 90% of the data is divided from the dataset as a training set for training the model, 10% of the data is extracted from the training set as a validation set for model hyperparameter tuning, and the remaining 10% of the data is used as a test set to evaluate model performance; in this application, the water supply every half hour and the total water supply of a water plant in Chongqing from January 2019 to April 2022 are collected, and the mean interpolation method is used to process missing values and outliers in the feature set. The mean interpolation method is a common abnormal data processing method, which estimates missing values and outliers by using the mean of the features; the processed data is then normalized using the minimum-maximum scaling method, and the preprocessed water supply data of the water plant is as follows Figure 3 shown.
[0060] S2: Select historical water supply characteristic factors and related environmental characteristic factors from the perspective of time multi-scale to form a characteristic set;
[0061] In this application, a method of extracting features from a multi-scale perspective is proposed to solve the problem that most researchers in the field of water supply forecasting currently focus on the selection of environmental characteristic factors and ignore the extraction of historical water supply data; at the same time, in time series analysis and forecasting, considering the change pattern of multi-scale time is also one of the keys affecting the forecast results, because it can capture the change law of data at different time scales, improve the accuracy and robustness of the forecast, and provide more reliable decision support for the water supply management of water plants;
[0062] Therefore, this application is based on the multi-scale perspective of time and comprehensively considers the existing water supply prediction methods, such as Figure 4As shown in the figure, a series of characteristic factors with different time spans are extracted from the preprocessed historical water supply data, namely, the water supply with a lag of 1 year, the water supply with a lag of 1 month, the water supply with a lag of 1 week, the water supply with a lag of 1 day, and the water supply every half hour with a lag of 1 day; then, they are combined with relevant environmental characteristic factors, including date, holidays, daily minimum temperature, daily maximum temperature and daily average temperature to form an 89-dimensional feature set. For the convenience of display, each characteristic factor in the feature set is renamed, and the naming results are shown in Table 1.
[0063] Table 1 Renaming characteristic factors
[0064]
[0065]
[0066] S3: Verify the correlation and potential relationship between feature set and water supply through correlation analysis, mutual information analysis and feature histogram method;
[0067] In order to verify the correlation and potential relationship between the selected feature set and water supply, this application uses feature engineering methods, namely correlation analysis (CA), mutual information (MI) and histogram to conduct a comprehensive analysis of the selected feature set; feature correlation analysis can help understand the relationship between features in the data set and better reveal the inherent structure and pattern of the data set, as follows:
[0068] The feature correlation analysis is specifically as follows:
[0069] In the correlation analysis, the Pearson correlation coefficient, Spearman correlation coefficient, Kendall Tau correlation coefficient and partial correlation coefficient were used to analyze the correlation between the feature set and the water supply. Then a network model was constructed to take the feature set as input and output the prediction results. The results are shown in Figure 2. Figure 5 As shown;
[0070] Among them, the Pearson correlation coefficient is used to measure the degree of linear correlation between two continuous feature variables, which is expressed as follows:
[0071] There are two feature variables X and Y, and their sample data are x1, x2, ..., x n and y1,y2,...,y n , Pearson correlation coefficient ρ X,Y The calculation formula is:
[0072]
[0073] in, and are the sample means of X and Y, namely:
[0074]
[0075] The Spearman correlation coefficient is used to measure the monotonic relationship between two feature variables. It measures the relationship between feature variables by converting the original data into ranks, which is expressed as follows:
[0076] There are two sample data of feature variables X and Y, respectively x1, x2, .., x n and y1,y2,..,y n , first convert them to rank; for each data x in X i , find its rank R(x i ); (First, convert them to rank, that is, for each data x in X i , find its rank R(x i ) Similarly, for each data y in Y i , find its rank R(y i ) ; Then, calculate the Spearman correlation coefficient ρ s :
[0077]
[0078] The Kendall Tau correlation coefficient considers the hierarchical relationship between feature variables rather than specific values, and is expressed as follows:
[0079] There are two variables X and Y, and their sample data are x1, x2, ..., x n and y1,y2,...,y n , then the calculation formula of Kendall Tau correlation coefficient τ is:
[0080]
[0081] Among them, C represents the number of consistent pairs, that is, for any two sample points (x i ,y i ) and (x j ,y j )(i≠j), if x i >x j And y i >y j , or x i <x j And y i <y j , then these two sample points are called consistent pairs; D represents the number of inconsistent pairs, that is, for any two sample points (xi ,y i ) and (x j ,y j )(i≠j), if x i >x j And y i <y j , or x i <x j And y i >y j , then these two sample points are called inconsistent pairs;
[0082] The partial correlation coefficient measures the correlation between two characteristic variables while controlling the influence of other characteristic variables, which is expressed as follows:
[0083]
[0084] There are three characteristic variables X, Y and Z. The partial correlation coefficients of X and Y under the influence of Z are calculated. The correlation coefficient matrix R is:
[0085] Among them, γ ij Represents the correlation coefficient between feature variable i and feature variable j, and then calculates the partial correlation coefficient γ XY.Z :
[0086]
[0087] Mutual information is an indicator used to measure the degree of association between two random feature variables. It measures the influence of the amount of information in one random feature variable on another random feature variable, as follows:
[0088] There are two continuous random feature variables X and Y, their joint probability distribution is P(X,Y), and their marginal probability distributions are P(X) and P(Y), respectively. Then the mutual information I(X;Y) is:
[0089]
[0090] The mutual information method is used to calculate the mutual information value of each characteristic factor for the target variable (water supply). The results are as follows: Figure 6 As shown in the figure; Similar to the conclusion drawn from the correlation analysis, the characteristic factors such as the water supply with a lag of 1 week, the water supply with a lag of 1 month, the water supply with a lag of 1 day, and the water supply every half hour with a lag of 1 day all show high mutual information values, among which the mutual information value of the water supply with a lag of 1 day every half hour is particularly prominent, indicating that the prediction of the target variable (water supply) is strongly affected by this characteristic factor, while the mutual information values of other characteristic factors are all ≥ 0, and there is a dependency relationship with the target variable, so they are included in the input feature set of the model to improve the prediction accuracy;
[0091] The histogram can clearly show the distribution of data and understand the central trend, dispersion and shape of the data. Figure 7 The histogram of each characteristic factor in the feature set is displayed. From the histogram, it can be clearly seen that the data distribution of the characteristic factors except temperature is approximately Gaussian distribution, which is conducive to reducing the complexity of the modeling process and making the model fitting effect more accurate.
[0092] S4: Use Bayesian optimization techniques to tune the hyperparameters of each network model separately;
[0093] In this application, Bayesian optimization technology is selected for hyperparameter tuning. Bayesian optimization estimates the probability distribution of the objective function by establishing a probability model, while taking into account the uncertainty of the objective function and selecting the next hyperparameter combination to be evaluated based on the current estimated distribution, so that a better hyperparameter combination can be found within a relatively small number of iterations, saving time and cost. Bayesian optimization can adaptively adjust the next selected hyperparameter combination based on previous observations, thereby searching for the optimal solution more intelligently. This adaptability enables Bayesian optimization to dynamically adjust the search strategy during the search process to find the best hyperparameter combination as much as possible. The process is as follows: Figure 8 As shown, the specific process is as follows:
[0094] (1) Define the search space of hyperparameters and specify the value range of hyperparameters; in this application, there are four hyperparameters: learning rate, number of hidden layers, number of hidden layer neurons, and iteration rounds, and their ranges are shown in Table 2:
[0095] Table 2 Value ranges of hyperparameters
[0096]
[0097] (2) Select a prior function (PF); in this application, since the function distribution is unknown, a kernel function based on Gaussian process is used as a black box function for self-learning. The Gaussian process can be expressed as:
[0098] f(x)~gp(m(x),k(x,x'))
[0099] Where f(x) represents the target function, gp represents the Gaussian process, m(x) is the mean function, which is usually assumed to be zero mean, that is, m(x) = 0, and k(x, x') is the covariance function (kernel function) used to measure the similarity between two points x and x';
[0100] The covariance function uses a Gaussian kernel function (also called radial basis function, RBF):
[0101]
[0102] Among them, ||x-x'|| 2 is the square of the Euclidean distance between two points, l is the length scale parameter of the kernel function, which is used to control the smoothness of the function;
[0103] (3) Initialize some hyperparameter combinations and use these hyperparameter combinations to train the model and obtain the corresponding objective function values;
[0104] (4) Based on the existing hyperparameter combinations and objective function values, a Gaussian process model is established to estimate the probability distribution of the objective function;
[0105] (5) Use the acquisition function (AC) to search for the maximum point of the objective function; AC usually selects the next hyperparameter combination to be evaluated based on the predicted mean and variance of the Gaussian process model to balance exploration and utilization; the acquisition function used in this application is based on the expected improvement (EI) acquisition function:
[0106] EI(x)=E[max(0,f(x * )-f(x))]
[0107] Among them, x * is the current optimal hyperparameter combination, f(x) is the predicted mean of the Gaussian process model for the hyperparameter combination x, and E represents expectation. Specifically, EI calculates the expected value of the improvement that a new hyperparameter combination x may bring given the current optimal solution. If the predicted mean of f(x) is much lower than the objective function value of the current optimal solution, then the value of EI will be relatively large, indicating that this hyperparameter combination may bring greater improvements and is therefore more likely to be selected for the next experiment.
[0108] (6) Input the hyperparameter combination selected by AC into the model for training and obtain the corresponding objective function value;
[0109] (7) Update the new hyperparameter combination and objective function value into the Gaussian process model;
[0110] (8) Repeat steps (5)-(7) until the stopping condition is met, that is, the number of Bayesian optimization iterations reaches 50. The Bayesian optimization results are shown in Table 3.
[0111] Table 3 Bayesian optimization results of hyperparameters
[0112]
[0113] S5: Based on the mean square error loss function, seven network models including RNN, BiRNN, LSTM, BiLSTM, GRU, BiGRU and Transformer are constructed, the training sets are input into the network models respectively, and the training results are output;
[0114] S5: In this application, 7 neural network models based on deep learning are used, namely, recurrent neural network (RNN), bidirectional recurrent neural network (BiRNN), long short-term memory network (LSTM), bidirectional long short-term memory network (BiLSTM), gated recurrent unit (GRU), bidirectional gated recurrent unit (BiGRU) and Transformer. The model is trained under the premise of inputting the same feature set, and the water supply of a water plant in Chongqing every half hour in the next 24 hours and the total water supply in the next day are output (a total of 49 dimensions);
[0115] S6: Use the test set as the input of the seven network models, output the test results, and calculate the evaluation indicators of each network model, namely RMSE, MAE, MAPE and R 2 Compare and retain the best input parameters and network models;
[0116] In this application, the root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and goodness of fit (R 2 ) performance metrics were used to evaluate the performance of the seven deep learning network models on the test set. The results are shown in Table 4. It was found that except for the Transformer model, all other models showed good results. Among them, the LSTM model had the best performance metrics, including RMSE, MAE, MAPE and R 2 They are 647.7032, 162.7941, 5.3530% and 0.9981 respectively;
[0117] It can be seen that LSTM has a higher accuracy rate (R) in water plant short-term water supply forecasting compared with other deep learning models. 2 =0.9981) and lower percentage error (MAPE = 5.3530%), compared to RNN (R 2 =0.9964, MAPE = 6.6197%), the design of LSTM is more complex, including input gate, forget gate and output gate, which can better handle long-term dependencies and help capture the long-term laws and trends of water volume changes; for GRU (R 2 =0.9974, MAPE = 6.0990%), the gating mechanism of LSTM is more complex, it can selectively remember or ignore input information, and it has stronger adaptability, which helps the model better adapt to different data characteristics and changes;
[0118] In addition, the performance of the Transformer model in the short-term water supply forecast of water plants is slightly inferior to that of other models. Its RMSE, MAE, MAPE and R 2 They are 2803.3188%, 741.303%, 16.7595% and 0.9648 respectively. The reason for this problem may be that the Transformer model usually performs well in processing long sequence data (such as text sequences in natural language processing tasks), but may not be suitable for processing time series data such as short-term water supply forecasts. This data may have specific periodicity, trend or seasonality, and the Transformer model may not be able to effectively capture these patterns; secondly, the Transformer model has a more complex structure and strategy than the RNN, LSTM and GRU models. The short-term water supply forecast of a water plant is a relatively simple time series forecasting problem. The use of complex models will lead to worse prediction results.
[0119] Table 4 Performance metrics of each model (test data set)
[0120]
[0121] In addition, in this application, a series of feature ablation experiments are designed to verify the influence of time multi-scale feature factors on the network model. LSTM, which performs well in the above experiments, is selected as the prediction model and feature ablation experiments are performed on the multi-scale feature set.
[0122] The feature factors such as holidays, weekends, daily minimum temperature, daily maximum temperature, daily average temperature, water supply lagged by one year, water supply lagged by one month, water supply lagged by one week, water supply lagged by one day, and water supply lagged by one day every half hour are combined into a standard feature set and used as the input of the LSTM model;
[0123] The results are shown in Table 5. The same method is used to calculate the RMSE, MAE, MAPE and R 2 The performance metrics were used to evaluate the models using different feature sets as input. It was found that deleting any multi-scale feature factor in the standard feature set would cause the model performance to degrade. When the water supply with a lag of 1 year, 1 month, and 1 week was deleted at the same time, the model performance changed significantly, and the percentage error increased by 0.5121%.
[0124] Table 5 LSTM model performance under different feature sets
[0125]
[0126] So far, the experiment shows that the time multi-scale feature set proposed in this study is effective in predicting water supply of water plants. Each time multi-scale feature factor contributes to the model prediction to varying degrees, among which the water supply feature factor with a lag of one month contributes more significantly.
[0127] Therefore, in predicting the water supply of water plants, the above-mentioned characteristic factors should be included in the consideration of the feature set to improve the performance of the model and its generalization ability, so as to further strengthen the water plant's ability to control water resources and resource planning;
[0128] S7: Use the optimal network model to make ultra-short-term predictions of the future water supply of the water plant and record the prediction results;
[0129] Fig. 9 and Fig.10 The figure intuitively shows the consistency between the half-hourly and daily water supply observed by the seven models in the next 100 days and the half-hourly and daily water supply predicted by the models. It is not difficult to find from the figure that except for the Transformer model, the other models have shown good prediction ability, among which the LSTM and BiLSTM models perform better. Their predicted half-hourly and daily water supply are closest to the true values, and they also perform well at the peak changes of the true values.
[0130] Embodiment 2:
[0131] Based on the above-mentioned embodiment 1, this embodiment proposes a water plant ultra-short-term water supply prediction system based on time multi-scale characteristics, such as Fig.11 As shown, the ultra-short-term water supply prediction system for a water plant based on time multi-scale characteristics at least includes a data acquisition module, a data analysis module, a model construction module, a model training module, a model optimization module and a water supply prediction module;
[0132] The data acquisition module is used to acquire relevant data sets, including water supply lagged by 1 year, 1 month, 1 week, 1 day, water supply every half hour lagged by 1 day, date, holidays, daily minimum temperature, daily maximum temperature and daily average temperature; then the data sets are divided into training set, validation set and test set, 90% of the data from the data sets are divided as training set for training the model, 10% of the data from the training set are extracted as validation set for model hyperparameter tuning, and the remaining 10% of the data are used as test set for evaluating model performance;
[0133] The data analysis module uses correlation analysis (CA), mutual information (MI) and histogram in feature engineering to conduct a comprehensive analysis of the selected feature set; in terms of correlation analysis, the Pearson correlation coefficient, Spearman correlation coefficient, Kendall Tau correlation coefficient and partial correlation coefficient are used to analyze the correlation between the feature set and water supply;
[0134] Model building module, used to build 7 deep learning network models based on mean square loss function (MSE);
[0135] Model training module, used to input the processed training set into 7 deep learning network models and output the training results;
[0136] The model optimization module uses Bayesian optimization technology to tune the hyperparameters of seven deep learning network models, then inputs the test set into the network model, outputs the test results, compares the test results with the training results, and retains the optimal network model;
[0137] The water supply forecasting module is used to use the optimal network model to predict the future ultra-short-term water supply of the water plant and record the forecast results.
[0138] Embodiment three:
[0139] This embodiment provides an electronic device based on the above embodiment, such as Fig.12 As shown, an electronic device at least includes: an electronic device 400, a processor 401, a memory 402, an input device 403 and an output device 404;
[0140] The processor 401 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions;
[0141] The memory 402 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory; the volatile memory may, for example, include random access memory (RAM) and / or cache memory (cache), etc.; the non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.; one or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may run the program instructions to implement the ultra-short-term water supply prediction method for water plants based on time multi-scale characteristics of any embodiment of the present invention described above or other desired functions; various contents such as initial external parameters, thresholds, etc. may also be stored in the computer-readable storage medium.
[0142] To simplify, Fig. 9 Only some of the components related to the present invention in the electronic device 400 are shown, and components such as a bus, an input / output interface, etc. are omitted; in addition, the electronic device 400 may also include any other appropriate components according to specific application scenarios.
[0143] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for predicting the ultra-short-term water supply of a water plant based on time multi-scale characteristics provided by any embodiment of the present invention; the computer program product can be written in any combination of one or more programming languages to write program codes for executing the operations of the embodiments of the present invention, and the programming languages include object-oriented programming languages such as Python, Java, C++, etc. The program code can be executed completely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or completely on a remote computing device or server.
[0144] In addition, an embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon, wherein when the computer program instructions are executed by a processor, the processor executes the steps of the method for predicting ultra-short-term water supply of a water plant based on time multi-scale characteristics provided by any embodiment of the present invention;
[0145] The computer-readable storage medium may adopt any combination of one or more readable media; the readable medium may be a readable signal medium or a readable storage medium; the readable storage medium may, for example, include but is not limited to electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any combination of the above; more specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0146] In summary:
[0147] The present invention aims to solve the problems of insufficient research on historical water supply data and insufficient consideration of time multi-scale in existing water supply forecasting. First, the historical water supply data and related environmental factors of the water plant are collected, and the data are pre-processed and divided into a training set, a validation set and a test set. Then, historical water supply characteristic factors and related environmental characteristic factors are selected from the perspective of time multi-scale to form a feature set. The correlation and potential relationship between the feature set and the water supply are verified by correlation analysis, mutual information analysis and feature histogram method. Then, 7 deep learning models are constructed based on the mean square error loss function to conduct water supply forecasting research, and Bayesian optimization technology is used for hyperparameter tuning. The present invention also verifies the effectiveness of time multi-scale features through feature ablation experiments, provides water plants with more accurate and effective water supply planning, and strengthens the water plant's ability to control water resources and resource planning.
[0148] It is obvious to those skilled in the art that the present invention is not limited to the details of the above-mentioned exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention; therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any figure marks in the claims should not be regarded as limiting the claims involved.
Claims
1. A method for predicting ultra-short-term water supply of a water plant based on multi-scale temporal characteristics, characterized by: At least the following steps are included: S1: Obtain a water supply-related data set of a water plant, the data set including historical water supply data and related environmental data, and divide the data set into a training set, a validation set, and a test set; S2: Select historical water supply characteristic factors and related environmental characteristic factors from the perspective of time multi-scale to form a characteristic set; S3: Verify the correlation and potential relationship between feature set and water supply through correlation analysis, mutual information analysis and feature histogram method; S4: Use Bayesian optimization techniques to tune the hyperparameters of each network model separately; S5: Based on the mean square error loss function, seven network models including RNN, BiRNN, LSTM, BiLSTM, GRU, BiGRU and Transformer are constructed, the training sets are input into the network models respectively, and the training results are output; S6: Use the test set as the input of the seven network models, output the test results, and calculate the evaluation indicators of each network model, namely RMSE, MAE, MAPE and R 2 Compare and retain the best input parameters and network models; S7: Use the optimal network model to make ultra-short-term predictions of the water plant’s future water supply and record the prediction results.
2. The method for predicting ultra-short-term water supply of a water plant based on time multi-scale characteristics according to claim 1 is characterized by: The S2 at least comprises the following steps: Firstly, the historical water supply data and relevant environmental data of the water plant were obtained, and the missing values and outliers of the data set were processed and normalized using the traditional mean interpolation method; Then select the water supply lagged by 1 year, 1 month, 1 week, 1 day, the water supply every half hour lagged by 1 day, date, holiday, daily minimum temperature, daily maximum temperature and daily average temperature; The dataset is then divided into training set, validation set and test set. 90% of the data is used as the training set for training the model, 10% of the data is used as the validation set for model hyperparameter tuning, and the remaining 10% of the data is used as the test set to evaluate model performance.
3. The method for predicting ultra-short-term water supply of a water plant based on time multi-scale characteristics according to claim 1 is characterized in that: The S3 at least includes the following steps: In the correlation analysis, the Pearson correlation coefficient, Spearman correlation coefficient, Kendall Tau correlation coefficient and partial correlation coefficient were used to analyze the correlation between the feature set and water supply, and then a network model was constructed to take the feature set as input and output the prediction results.
4. The method for predicting ultra-short-term water supply of a water plant based on time multi-scale characteristics according to claim 1 is characterized in that: The S4 at least comprises the following steps: Step 1: Define the search space of hyperparameters and specify the value range of hyperparameters; Step 2: Select a priori function. If the function distribution is known, select the optimal model based on experience. If it is unknown, use the kernel function based on Gaussian process as the black box function for self-learning. Step 3: Initialize some hyperparameter combinations and use these hyperparameter combinations to train the model and obtain the corresponding objective function values; Step 4: Based on the existing hyperparameter combination and objective function value, establish a Gaussian process model to estimate the probability distribution of the objective function; Step 5: Use the acquisition function to search for the maximum point of the objective function. AC usually selects the next hyperparameter combination to be evaluated based on the predicted mean and variance of the Gaussian process model to balance exploration and utilization. Step 6: Input the hyperparameter combination selected by AC into the model for training and obtain the corresponding objective function value; Step 7: Update the new hyperparameter combination and objective function value into the Gaussian process model; Step 8: Repeat steps 5 to 7 until the preset number of iterations is reached.
5. A water plant ultra-short-term water supply forecasting system based on time multi-scale characteristics, referring to the water plant ultra-short-term water supply forecasting method based on time multi-scale characteristics according to any one of claims 1 to 4, characterized in that: At least includes a data acquisition module, a data analysis module, a model building module, a model training module, a model optimization module and a water supply prediction module; The data acquisition module is used to acquire relevant data sets, which include historical water supply data and relevant environmental data, and then divide the data sets into a training set and a test set; The data analysis module is used to analyze each characteristic factor in the data set to find out the characteristic factors that are highly correlated with the water supply; The model building module is used to build 7 deep learning network models based on mean square loss function; The model training module is used to input the processed training set into 7 deep learning network models and output the training results; The model optimization module is used to tune the hyperparameters of the seven deep learning network models, then input the test set into the network model, output the test results, compare the test results with the training results, and retain the optimal network model; The water supply prediction module is used to use the optimal network model to predict the future ultra-short-term water supply of the water plant and record the prediction results.
6. The water plant ultra-short-term water supply forecasting system based on time multi-scale characteristics according to claim 5 is characterized by: The data acquisition module is used to acquire relevant data sets, which include water supply lagged by 1 year, 1 month, 1 week, and 1 day, water supply every half hour lagged by 1 day, dates, holidays, daily minimum temperature, daily maximum temperature, and daily average temperature; the data sets are divided into training sets, validation sets, and test sets, 90% of the data from the data sets are divided as training sets for training models, 10% of the data from the training sets are extracted as validation sets for model hyperparameter tuning, and the remaining 10% of the data are used as test sets for evaluating model performance.
7. The water plant ultra-short-term water supply forecasting system based on time multi-scale characteristics according to claim 5 is characterized by: The data analysis module uses correlation analysis, mutual information and histogram in feature engineering to comprehensively analyze the selected feature set, and the correlation analysis uses Pearson correlation coefficient, Spearman correlation coefficient, Kendall Tau correlation coefficient and partial correlation coefficient to analyze the correlation between the feature set and water supply.
8. The water plant ultra-short-term water supply forecasting system based on time multi-scale characteristics according to claim 5 is characterized by: The model optimization module uses Bayesian optimization technology to tune the hyperparameters of 7 deep learning network models respectively, and the number of Bayesian optimization iterations is preset to 50.
Citation Information
Patent Citations
Water resource scheduling optimization method based on empirical model
CN110991687A
DWT-PCA-LSTM-based water supply quantity prediction device for water supply company
CN111079989A
Multi-step daily runoff forecasting method based on meteorological information and deep learning algorithm
CN113255986A
Construction method of air pollutant concentration seasonal prediction model
CN114741972A
Loess landslide slip prediction method and system based on meta-learning and Bayesian optimization
CN117349751A
Cited By
Industrial accumulation area water resource demand prediction and water-saving regulation and control method and system based on artificial intelligence
CN119809296A
An Artificial Intelligence-Based Method and System for Predicting Water Resource Demand and Controlling Water Saving in Industrial Agglomeration Areas
CN119809296B
Deep learning-based permafrost upper limit prediction method and device, and terminal
CN119885089A
Semiconductor factory point location data prediction method and device based on correlation calculation
CN121072892A
Water supply prediction model training method and device for waterworks
CN121233940A