Intelligent water consumption prediction method based on multi-scale grouping convolution
By adopting the combination of multi-scale grouping convolution and Transformer model in the smart water system, the local and global characteristics of water consumption data are extracted, and the problem of poor data quality in the water industry is solved, and accurate prediction of water consumption and system intelligence is achieved.
Patent Information
- Application Number
- CN202510205247.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-13
AI Technical Summary
The poor data quality of the existing water industry leads to the lack of water consumption data and overfitting problems, affecting the operation and management efficiency of smart water systems.
The intelligent water consumption prediction method based on multi-scale packet convolution is adopted, and local features and Transformer models are extracted through the ResNeXt network to capture global dependence, and combined with local and global features to achieve accurate prediction of water consumption.
It improves the accuracy of water consumption prediction and the intelligence level of the system, effectively solves the problems of data loss and overfitting, and improves the accurate prediction ability of the supply and demand relationship of water resources.
Smart Images

Figure CN119989202A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water resource management, and in particular to a method for predicting water consumption of smart water services based on multi-scale grouping convolution. Background Art
[0002] The infrastructure of my country's water industry is relatively old and faces many problems. The first is the problem of data quality. In the early stage of smart water construction, the data collected by traditional water management software was generally of poor quality, with a large number of outliers and missing values, and the available effective data was relatively limited. This situation is not only not conducive to data analysis, but also leads to overfitting in the model training process, further affecting the training effect. Secondly, it is difficult to identify water consumption readings. In practical applications, water meter images are often not accurately identified for various reasons, making it difficult for target detection technology to accurately obtain water consumption data. This situation will cause the problem of missing water consumption data and cannot effectively guarantee the continuity of data, thereby affecting the operation and management efficiency of the smart water system.
[0003] In this case, there is an urgent need for a water consumption prediction technology that can accurately predict water consumption, make up for the data loss caused by unreadable readings, effectively ensure the continuity of water consumption data, and achieve accurate prediction of water supply and demand. This will help water managers to formulate water resource management and protection strategies more scientifically and efficiently, and improve the intelligence level of smart water systems. The present invention proposes a smart water consumption prediction method based on multi-scale grouped convolution. By combining feature extraction of local information and long-term dependencies, the comprehensive performance of the prediction model is improved, and accurate prediction of water consumption is achieved. Summary of the invention
[0004] The present invention proposes a smart water consumption prediction method based on multi-scale group convolution, which mainly includes two parts: local feature extraction based on multi-scale residual network and global dependency feature extraction based on Transformer, thereby realizing accurate prediction of water consumption.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions.
[0006] A smart water consumption prediction method based on multi-scale group convolution is designed based on the Transformer model and includes the following steps:
[0007] S1. Collect historical water consumption data and related identifiers, including time identifiers and type identifiers, and perform data preprocessing and coding classification;
[0008] S2. Divide the time series data into blocks to improve the diversity of data samples and reduce the impact of length on the model;
[0009] S3, extract local features from time series data of different scales using grouped convolution and multi-path learning;
[0010] S4, use the Transformer model to capture the global dependency of the time series and perform feature fusion with the local features of S3 to obtain the overall model;
[0011] S5. Use the test data to input the model for testing, obtain the comparison curve between the predicted value and the true value and the error analysis, and select the model with the smallest error to export.
[0012] Further S1 is as follows: collect historical water consumption data of different water meters and the type of monitored water volume of each water meter, and perform One-hot encoding of different types of water consumption data in accordance with the "Urban Water Classification Standard CJ / T3070-1999", and perform outlier processing and missing value interpolation on historical data. The outlier processing uses the interquartile range to find outliers. There are fewer missing value abnormal data, so a simple linear interpolation method is chosen to estimate based on the trend of adjacent data points, which can better retain the original trend of the time series.
[0013] Further S2 is as follows: the processed water consumption time series data is divided into blocks using a dynamic sliding window method, and the length of the window is dynamically adjusted according to the change rate. The window length is w min and w max are the minimum and maximum window lengths, when r t When r is larger, the window length is reduced to capture mutation information; t When it is smaller, the window length increases to cover the stable area, thus obtaining water consumption time series data at multiple scales.
[0014] The further S3 is as follows: put the divided water consumption time series data into the ResNeXt network for group convolution and multi-path learning. (i) The feature dimension is (w t , 1), expanded to high-dimensional input (w t , d), where d is the number of features. The block data is stacked into batch input, and local features are extracted for each block through group convolution. Where C is the number of groups, Wc is the group convolution kernel, and * represents the convolution operation.
[0015] Further S4 is as follows: Convert the window sequence into an embedding: E (i) =W embed ·X (i) +P, where W embedis the embedding matrix, and P is the positional encoding. Use Transformer to extract global features Then it is fused with the local features extracted from S3
[0016] Beneficial effects of the present invention:
[0017] The present invention uses multi-scale grouped convolution and Transformer to jointly extract water consumption time series features, and realizes data enhancement and model optimization in water consumption prediction. The Patch mechanism solves the problem of low efficiency in long series modeling by dividing the time series into blocks. In addition, the addition of the ResNeXt module uses grouped convolution to realize parallel feature extraction, which can efficiently capture local patterns in the time series. Transformer captures global time series dependencies. Finally, the local and global features are fused to obtain richer information and improve prediction performance.
[0018] The method of the present invention can effectively improve the processing and analysis capabilities of the smart water system for water resource data and realize accurate prediction of the relationship between water resource supply and demand. This will help water managers to formulate water resource management and protection strategies more scientifically and efficiently, improve the intelligence level of the smart water system, and has significant application value and promotion prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0020] Figure 1 This is a flow chart of the water consumption prediction method for smart water services based on multi-scale grouping convolution;
[0021] Figure 2 This is a model structure diagram of the smart water consumption prediction method based on multi-scale group convolution;
[0022] Figure 3 This is a comparison chart of the predicted value and actual value of smart water consumption based on multi-scale group convolution. DETAILED DESCRIPTION
[0023] The present invention provides embodiments and drawings to fully and completely describe the specific schemes in the present invention, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0024] The embodiment of the present invention provides a method for predicting water consumption of smart water services based on multi-scale group convolution, such as Figure 1 As shown, the following steps are included:
[0025] Step S1, collect historical water consumption data and related identifiers, including time identifier and type identifier, and perform data preprocessing and coding classification;
[0026] Step S2, divide the time series data into blocks to improve the diversity of data samples and reduce the impact of length on the model;
[0027] Step S3, using grouped convolution and multi-path learning to extract local features from time series data of different scales;
[0028] Step S4: Use the Transformer model to capture the global dependency of the time series and perform feature fusion with the local features of S3 to obtain the overall model;
[0029] Step S5: Use the test data to input the model for testing, obtain the comparison curve between the predicted value and the true value and the error analysis, and select the model with the smallest error for export.
[0030] In this embodiment, step S1 is specifically as follows: historical water consumption data of different water meters and the type of monitored water volume of each water meter are collected from the smart water platform. By observing the trend of time series data, it can be seen that the water consumption of residents' daily life will decrease during holidays, the water consumption of public services will increase during holidays, and the water consumption in winter is significantly less than that in summer. Different types of water consumption data are One-hot encoded according to the "Urban Water Classification Standard CJ / T3070-1999". One-hot encoding is a common feature encoding method that can independently represent different urban water use categories in vector form. For the set C={c 1 , ..., c 41}, define a vector v i ∈R 41 :v i =(v 1 , v 2 , ..., v 41 ),in This vector v i For category c iOne-hot encoding is required, and outlier processing and missing value interpolation are required for historical data. Outlier processing uses the interquartile range to find outliers. The standard for judging outliers is based on quartiles and interquartile ranges, where the interquartile range (IQR) is the difference between the third quartile (Q3) and the first quartile (Q1). Every data below the lower limit (Q1-1.5*IQR) and above the upper limit (Q3+1.5*IQR) is considered an outlier. During the implementation process, the lower limit was changed to Q1-0.6*IQR, which can handle negative values and other obvious abnormal data. The simple linear interpolation method is selected to fill the missing values, and the estimation is based on the trend of adjacent data points, which can better preserve the original trend of the time series.
[0031] In this embodiment, step S2 is specifically as follows: take the data collected every 8 hours and its corresponding time point and the coded information in step S1 as input, take the data of the next 8-hour interval as the output label, establish a data set, take 2 / 3 of the data set size as the training set, and the remaining 1 / 3 of the data set size as the validation set. The divided water consumption time series data is divided into blocks using the dynamic sliding window method, and the length of the window is dynamically adjusted according to the change rate. The change rate is The window length is w min and w max are the minimum and maximum window lengths, when r t When r is larger, the window length is reduced to capture mutation information; t When it is smaller, the window length increases to cover the stable area, thus obtaining water consumption time series data at multiple scales.
[0032] In this embodiment, step S3 is specifically as follows: the divided water consumption time series data is put into the ResNeXt network for group convolution and multi-path learning. (i) The feature dimension is (w t , 1), expanded to high-dimensional input (w t , d), where d is the number of features. The block data is stacked into batch input, and local features are extracted for each block through group convolution. Where C is the number of groups, Wc is the group convolution kernel, and * indicates the convolution operation. Figure 2 Shown on the left.
[0033] In this embodiment, step S4 is specifically: converting the window sequence into an embedding: E (i) =W embed ·X (i) +P, where W embed is the embedding matrix, and P is the positional encoding. Using the self-attention mechanism Where Q, K, and V are query, key, and value respectively; k is the dimension of the key, using Transformer to extract global features Then it is fused with the local features extracted from S3 like Figure 2 shown.
[0034] In this embodiment, step S5 specifically includes: using the test data to input the model for testing, such as Figure 3 As shown in the figure, a comparison curve between the predicted value and the true value is obtained for visualization, and the model file with the smallest error is selected for export.
[0035] The above disclosure is only a specific embodiment of the present invention. According to the technical concept provided by the present invention, any changes that can be thought of by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A method for predicting water consumption of smart water services based on multi-scale grouping convolution, characterized in that: The steps include: S1. Collect historical water consumption data and related identifiers, including time identifiers and type identifiers, and perform data preprocessing and coding classification; S2. Divide the time series data into blocks to improve the diversity of data samples and reduce the impact of length on the model; S3, extract local features from time series data of different scales using grouped convolution and multi-path learning; S4, use the Transformer model to capture the global dependency of the time series and perform feature fusion with the local features of S3 to obtain the overall model; S5. Use the test data to input the model for testing, obtain the comparison curve between the predicted value and the true value and the error analysis, and select the model with the smallest error to export.
2. According to claim 1, the method for predicting water consumption of smart water services based on multi-scale grouping convolution is characterized in that: In the described step S1, the historical water consumption data of different water meters and the type of monitored water volume of each water meter are collected, and the different types of water consumption data are One-hot encoded according to the "Urban Water Classification Standard CJ / T3070-1999", and the historical data need to be processed for outliers and interpolated for missing values. The outlier processing uses the interquartile range to find outliers. There are fewer missing value abnormal data, and the simple linear interpolation method is selected to estimate based on the trend of adjacent data points, which can better retain the original trend of the time series.
3. According to claim 1, the method for predicting water consumption of smart water services based on multi-scale grouping convolution is characterized in that: The process of dividing the time series data in step S2 is as follows: the processed water consumption time series data is divided into blocks using a dynamic sliding window method, and the length of the window is dynamically adjusted according to the change rate. The window length is w min and w max are the minimum and maximum window lengths, when r t When r is larger, the window length is reduced to capture mutation information; t When it is smaller, the window length increases to cover the stable area, thus obtaining water consumption time series data at multiple scales.
4. The method for predicting water consumption of smart water services based on multi-scale grouping convolution according to claim 1 is characterized in that: The process of extracting local features from time series data of different scales using group convolution and multi-path learning in step S3 is as follows: the divided water consumption time series data is put into the ResNeXt network for group convolution and multi-path learning. (i) The feature dimension is (w t , 1), expanded to high-dimensional input (w t , d), where d is the number of features. The block data is stacked into batch input, and local features are extracted for each block through group convolution. Where C is the number of groups, Wc is the group convolution kernel, and * represents the convolution operation.
5. The method for predicting water consumption of smart water services based on multi-scale grouping convolution according to claim 1 is characterized in that: The process of using the Transformer model in step S4 to capture the global dependency of the time series and perform feature fusion with the local features of S3 is as follows: Convert the window sequence into an embedding: E (i) =W embed ·X (i) +P, where W embed is the embedding matrix, and P is the positional encoding. Use Transformer to extract global features Then it is fused with the local features extracted from S3