Generative adversarial network-based urban medium and long term water consumption trend prediction method
The cyclic condition generation adversarial network model generates simulated time series data and weighted combination predictions, which solves the problem of insufficient data and insufficient consideration of multiple factors in mid- and long-term urban water supply predictions, achieves more accurate water use trend predictions, and provides urban water supply management. Scientific basis.
Patent Information
- Application Number
- CN202411000272.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-15
AI Technical Summary
The existing mid- and long-term continuous forecasting methods for urban water supply have problems such as poor data quality, insufficient data volume, error accumulation, and insufficient comprehensive consideration of multiple factors, resulting in low accuracy in mid- and long-term water use trend forecasting.
Using cyclic conditional generative adversarial network models (RCGANs), the training generator is used to generate simulated time series data for data enhancement, expanding the amount of data, and using a weighted combination of the generator and downstream models for prediction, combined with meteorological and socioeconomic indicators, to build a more Accurate prediction models.
It significantly improves the amount and quality of data, enhances the generalization ability of the model, achieves accurate prediction of medium- and long-term continuous water use trends in cities, improves prediction performance and reliability, and provides scientific basis for urban water supply planning.
Smart Images

Figure CN118780439A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a medium- and long-term urban water supply prediction technology, which belongs to the application scope of big data technology, and specifically relates to a medium- and long-term urban water use trend prediction method based on a generative adversarial network. Background Art
[0002] At present, the methods of urban water supply forecasting using big data algorithms are mainly divided into two categories: 1. Sequence analysis algorithm and 2. System analysis algorithm. Sequence analysis algorithm uses the historical water supply data of the water system for statistical analysis. The required training data is of a single type, the data volume requirement is low, the model parameters are simple, and the running speed is fast. However, it ignores the impact of other factors such as weather, seasons, and holidays on water supply, resulting in low accuracy of prediction results. Traditional sequence analysis methods mainly include time series models (such as ARIMA) and exponential smoothing methods. They perform well in short-term predictions, but poorly in medium- and long-term predictions. The system analysis method comprehensively considers historical water use data and various major influencing factors, and uses machine learning methods such as support vector machines, BP neural networks, recurrent neural networks and other algorithms to build models. The model parameters are large and the prediction effect is good. However, the model training completion and accuracy in the system analysis method are highly dependent on the amount and quality of training data. At present, due to inaccurate meter reading and aging equipment, many cities' water supply data have a large number of outliers and missing values in the collected time series data, and the data quality is difficult to guarantee. At the same time, for medium- and long-term predictions (such as one week, one month, etc.), time series data with a wider time span, larger scale and smaller error are needed to train the model to improve the long-term prediction performance of the model. At present, the quality and quantity of historical water supply data in many cities are difficult to guarantee the completion of model training, and most models do not have a feedback mechanism for error accumulation, making it difficult to accurately predict the trend of medium- and long-term continuous water use. Summary of the invention
[0003] In view of the problems of poor data quality, insufficient data volume, error accumulation and insufficient comprehensive consideration of multiple factors in the existing medium- and long-term continuous prediction methods for urban water supply, the present invention uses existing historical time series data to train cyclic conditional generative adversarial network models (RCGANs). On the one hand, the trained generator is used to directly predict the future long-term water use trend. On the other hand, the generator is used to generate simulated time series data, perform data enhancement, expand the data scale, improve the training efficiency and prediction performance of the downstream model, and finally weightedly combine the generator prediction results and the downstream model prediction results to obtain the final prediction. The present invention uses the generator and adversary in the generative adversarial network to use recurrent neural networks and their variants, which are naturally endowed with an error feedback mechanism, can better capture long-term dependencies and reduce error accumulation; at the same time, the generator outputs simulated time series data, which greatly increases the amount of data, making the reasoning and generalization ability of the trained downstream model stronger. Further through model fusion, the present invention can finally achieve accurate prediction of the medium- and long-term continuous water use trend sequence in the city.
[0004] The present invention can be implemented through the following technical solutions:
[0005] The present invention provides a method for predicting the trend of urban medium- and long-term water consumption based on a generative adversarial network, and the main steps include:
[0006] Obtain the original data set, including the city's historical water supply data and corresponding time stamps, meteorological data, and socio-economic indicator data;
[0007] After data preprocessing, the moving window method is used to obtain the historical water consumption time series set and the corresponding influencing factor time series set;
[0008] Using the above sequence set, train a generative adversarial network model based on recurrent neural network and external condition information
[0009] (RCGANs), the model includes a generator and a discriminator, wherein the generator receives a random noise sequence and an influencing factor time series, and outputs a simulated medium- and long-term water consumption time series; the output sequence is then judged together with the real historical water consumption data by the discriminator until the discriminator cannot distinguish between the simulated water consumption sequence and the real water consumption sequence, and the model training is completed;
[0010] Add the time series of influencing factors, use the trained generator to generate new simulated water consumption time series, and expand the original data set;
[0011] Use the expanded data set to train a downstream water consumption series prediction model;
[0012] The generator prediction sequence and the downstream model prediction sequence are weighted together to obtain the final prediction result.
[0013] Furthermore, the time mark in step (1) includes year, season, month, day, whether it is a working day, whether it is a holiday, etc., the meteorological data includes average temperature, maximum temperature, minimum temperature, rainfall / snow amount, average wind speed, relative humidity, sunshine duration, etc.; the socio-economic data includes population size, per capita income, average domestic water price and other water price, etc.
[0014] The data preprocessing method in step (2) includes removal of outliers and missing values and normalization processing.
[0015] In step (2), the window size of the moving window method is consistent with the final prediction sequence length n, and the sliding step length is 1. If the total length of the preprocessed historical water consumption time series is m, the original water consumption time series set v = {v i |i=1,2,3,...,m-n+1}, where v i represents a time series vector of length n, v i =[v i ,v i+1 ,...,v i+n-1 ]; the corresponding time series set of influencing factors is c = {c i |i=1,2,3,...,m-n+1},
[0016] where c i Represents the time series matrix of the i-th influencing factor with length n.
[0017] Furthermore, the generative adversarial network model based on the recurrent neural network and external condition information in step (3)
[0018] (RCGANs), including a generator and a recognizer; the structure of the generator is a recurrent neural network, including a standard recurrent network (RNN), a long short-term memory network (LSTM), a gated recurrent unit (GRU), a recurrent neural network, and the input is a random noise vector z that conforms to a uniform distribution and a time series matrix c of influencing factors, and the output is a new sample
[0019] The sequence set v′={v′|i=1,2,3,...,k}: where v′=G(z i ,c i ), represents the time series vector of the i-th generated water consumption. The generator loss function is:
[0020] L G =-E z ~ pz(z) [logD(G(z,c))]
[0021] The structure of the discriminator is consistent with that of the generator, and is also one of RNN, LSTM, GRU, and recursive neural networks. The input is the sample sequence set generated by the generator and the corresponding real water consumption data set, and the output is the judgment result set.
[0022] {D(v),D(G(z,c))}, where D(v) and D(G(z,c)) represent the discriminator's judgment results on real samples and generated samples, respectively, taking into account the influencing factors. The discriminator loss function is:
[0023]
[0024] The parameter optimization method of the generative adversarial network model in step (3) is iterative game optimization, that is, the generator and the discriminator are trained alternately and iteratively, and the generator and the discriminator use different learning rates respectively.
[0025] The criterion for the completion of model training in step (3) is that both the generator and discriminant loss functions converge to stable values.
[0026] Furthermore, the method of increasing the time sequence of influencing factors in step (4) includes:
[0027] Utilize historical dates with missing water use data and their meteorological and socio-economic data;
[0028] Use meteorological and socio-economic data for future dates and forecasts.
[0029] The expanded data set in step (4) includes the original water supply time series set, the original influencing factor time series set, the added influencing factor time series set and the simulated water consumption time series set generated by the generator.
[0030] The downstream model in step (5) is a recurrent neural network and one of its variants, and the prediction result is v*.
[0031] The combined model weight α in step (6) is determined by the ratio of the size k of the simulated time series set added by the generator in the expanded data set to the size L of the original historical time series set: α = k / L. The final prediction result is:
[0032] v final =αv′+(1-α)v*
[0033] Beneficial effects of the present invention:
[0034] The present invention uses recurrent conditional generative adversarial networks (RCGANs) to achieve data enhancement and model optimization in the prediction of urban medium- and long-term water consumption. By training the generator of RCGANs, high-quality simulated water consumption time series data is generated, which significantly expands the original data set, improves the data volume and diversity, and overcomes the problem of insufficient model training caused by insufficient data volume and low data quality. At the same time, the present invention comprehensively considers various influencing factors such as meteorological and socio-economic indicators to construct a more accurate prediction model. By weighted combination of the generator prediction sequence and the downstream prediction model prediction sequence, the accuracy and reliability of the prediction results are significantly improved. The method of the present invention can effectively improve the prediction performance of the medium- and long-term water consumption trend in cities, provide a scientific basis for urban water supply planning and management, and has significant application value and promotion prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flow chart of a method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network in an embodiment of the present invention.
[0036] Figure 2 The adversarial network model framework is generated by the loop condition in the embodiment of the present invention.
[0037] Figure 3 This is a comparison diagram between the generator simulation generation timing and the actual timing in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The present invention provides embodiments to fully and completely describe the specific schemes in the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.
[0039] The embodiment of the present invention provides a method for predicting the trend of urban medium- and long-term water use based on a generative adversarial network. Figure 1 As shown, the following steps are included:
[0040] Obtain the original data set, including the city's historical water supply data and corresponding time stamps, meteorological data, and socio-economic indicator data;
[0041] Data preprocessing, and then the moving window method is used to obtain the historical water consumption time series set and the corresponding influencing factor time series set; the data preprocessing process includes outlier detection and removal, missing value filling and data normalization. Missing value filling outlier detection and removal adopts the statistical Z-Score-based method, missing value filling can use average filling, interpolation and regression filling techniques, and data normalization uses Min-Max normalization. Through the moving window method, the processed historical water supply time series data and the corresponding influencing factor time series data are sliced to form a sequence data set for model training.
[0042] Using the above sequence set, train a generative adversarial network model based on recurrent neural network and external condition information
[0043] (RCGANs), the model includes a generator and a discriminator, wherein the generator receives a random noise sequence and an influencing factor time series, and outputs a simulated medium- and long-term water consumption time series; the output sequence is then judged together with the real historical water consumption data by the discriminator until the discriminator cannot distinguish between the simulated water consumption sequence and the real water consumption sequence, and the model training is completed; the cyclic conditional generative adversarial network model framework in this embodiment is shown in the attached Figure 2 As shown in the figure, both the generator and the discriminator adopt the long short-term memory network (LSTM) structure. The generator accepts the random noise vector and the time series matrix of the influencing factors as input to generate the simulated water consumption time series, where the random noise follows a uniform distribution. During the training process, the generator and the discriminator are optimized alternately until the discriminator cannot distinguish between the real water consumption time series and the generated simulated water consumption time series, that is, the loss functions of the generator and the discriminator converge to a stable value.
[0044] 4. Add influencing factor time series, use the trained generator to generate new simulated water consumption time series, and expand the original data set; specifically, use the trained generator to input different combinations of influencing factors to generate a large amount of simulated water consumption time series data. The comparison between the generator simulated time series and the real time series is shown in the attached figure. Figure 3 Combinations of influencing factors can be constructed using historical dates with missing water use data and their meteorological and socioeconomic data, or using future dates and predicted meteorological and socioeconomic data.
[0045] 5. Use the expanded data set to train the downstream water consumption sequence prediction model; in this embodiment, the downstream water consumption sequence prediction model is an LSTM prediction model. The LSTM model can comprehensively consider multiple influencing factors and can predict future water consumption. During the training process, the cross-validation method is used to adjust the model parameters to ensure the generalization ability and prediction accuracy of the model.
[0046] 6. The generator prediction sequence and the downstream model prediction sequence are weighted to obtain the final prediction result. The weight coefficient α is determined by the ratio of the size of the newly added simulated time series set k of the generator in the expanded data set to the size of the original historical time series set L:
[0047]
[0048] The final combined prediction formula is:
[0049] v final =αv′+(1-α)v*
[0050] Among them, v′ is the prediction sequence of the generator, v* is the prediction sequence of the downstream model, and v final The final water consumption prediction result.
[0051] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network, characterized in that: The main steps of the method include: (1) Obtain the original data set, including the city’s historical water supply data and corresponding time stamps, meteorological data, and socio-economic indicator data; (2) Data preprocessing: using the moving window method to obtain the historical water consumption time series set and the corresponding influencing factor time series set; (3) Using the above sequence set, a generative adversarial network model (RCGANs) based on recurrent neural networks and external condition information is trained. The model includes a generator and a discriminator, wherein the generator receives a random noise sequence and an influencing factor time series and outputs a simulated medium- and long-term water consumption time series; the output sequence is then judged together with the real historical water consumption data by the discriminator until the discriminator cannot distinguish between the simulated water consumption sequence and the real water consumption sequence, and the model training is completed; (4) Add the time series of influencing factors, use the trained generator to generate new simulated water consumption time series, and expand the original data set; (5) Using the expanded data set, train a downstream water consumption series prediction model; (6) Weighted combination of the generator prediction sequence and the downstream model prediction sequence to obtain the final prediction result.
2. According to claim 1, a method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network is characterized in that: The time mark in step (1) includes year, season, month, day, whether it is a working day, whether it is a holiday, etc. The meteorological data includes average temperature, maximum temperature, minimum temperature, rainfall / snow amount, average wind speed, relative humidity, and sunshine duration; the socioeconomic data includes population size, per capita income, average domestic water price and average other water prices.
3. According to claim 1, a method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network is characterized in that: The data preprocessing method in step (2) includes removal of outliers and missing values and normalization processing.
4. According to claim 1, a method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network is characterized in that: In step (2), the window size of the moving window method is consistent with the final prediction sequence length n, and the sliding step length is 1. If the total length of the preprocessed historical water consumption time series is m, the original water consumption time series set v = {v i |i=1, 2, 3,..., m-n+1}, where v i represents a time series vector of length n, υ i =[υ i , i+ 1, ..., υ i+n-1 ]; the corresponding time series set of influencing factors is c = {c i |i=1,2,3,...,m-n+1}, Where ci represents the time series matrix of the i-th influencing factor with a length of n.
5. According to claim 1, a method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network is characterized in that: The generative adversarial network model (RCGANs) based on recurrent neural network and external condition information in step (3) comprises a generator G and a recognizer D; the structure of the generator is a recurrent neural network, including a standard recurrent network (RNN), a long short-term memory network (LSTM), a gated recurrent unit (GRU), or a recursive neural network, and the input is a random noise vector z that conforms to a uniform distribution and an influencing factor time series matrix c, and the output is a new sample sequence set v′={v′|i=1,2,3,...,k}: wherein v′=G(z i ,c i ), represents the i-th generated water consumption time series vector, and the generator loss function is: The structure of the discriminator is consistent with that of the generator, and is also one of RNN, LSTM, GRU, and recursive neural networks. The input is the sample sequence set generated by the generator and the corresponding real water consumption data set, and the output is the judgment result set {D(v), D(G(z,c))}, where D(v) and D(G(z,c)) represent the judgment results of the discriminator on the real samples and the generated samples, respectively. Considering the influencing factors, the discriminator loss function is:
6. The method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network according to claim 1 is characterized in that: The parameter optimization method of the generative adversarial network model in step (3) is iterative game optimization, that is, the generator and the discriminator are trained alternately and iteratively, and the generator and the discriminator use different learning rates respectively.
7. The method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network according to claim 1 is characterized in that: The criterion for the completion of model training in step (3) is that both the generator and discriminant loss functions converge to stable values.
8. The method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network according to claim 1 is characterized in that: The method for increasing the time sequence of influencing factors in step (4) includes: (a) Use historical dates with missing water use data and their meteorological and socio-economic data; (b) Use of meteorological and socio-economic data for future dates and forecasts.
9. The method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network according to claim 1 is characterized in that: The expanded data set in step (4) includes the original water supply time series set, the original influencing factor time series set, the added influencing factor time series set and the simulated water consumption time series set generated by the generator.
10. According to claim 1, a method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network, It is characterized in that The downstream model in step (5) is a recurrent neural network and one of its variants, and the prediction result is v*.
11. The method for predicting urban medium- and long-term water consumption trends based on a generative adversarial network according to claim 1, characterized in that: The combined model weight α in step (6) is determined by the ratio of the size k of the simulated time series set added by the generator in the expanded data set to the size L of the original historical time series set: α = k / L, The final prediction result is: v final =αv ′ +(1-α)v*.
Citation Information
Cited By
Smart city residential electricity consumption prediction method based on hesitant generative adversarial network
CN119476640A
Method, device, equipment and medium for predicting short-term water demand of urban water supply pipe network
CN121257814A
Methods, devices, equipment and media for predicting short-term water demand in urban water supply networks
CN121257814B
