A building energy consumption prediction method based on a convolutional bidirectional gated recurrent unit neural network optimized based on an efficient channel attention mechanism
By processing building energy consumption data using grouped box plots and weighted temporal similarity completion, and combining correlation analysis and feature synergistic gain techniques, the convolutional bidirectional gated recurrent neural network is optimized. This solves the problems of data error and insufficient utilization of weather features in building energy consumption prediction, achieving higher prediction accuracy and reliability, and supporting refined decision-making in energy management.
Patent Information
- Application Number
- CN202511324070.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-17
AI Technical Summary
Existing building energy consumption prediction methods suffer from data errors and noise interference, difficulty in obtaining building physical parameters, insufficient prediction accuracy and reliability, and underutilization of weather-related features, leading to decreased prediction accuracy and insufficient generalization ability.
Energy consumption data are processed using grouped box plots and weighted time similarity completion. Weather features are screened by combining correlation analysis and feature collaborative gain techniques. Building energy consumption prediction models are optimized by convolutional neural networks and attention mechanisms. Feature extraction and weight allocation are performed using convolutional bidirectional gated recurrent unit neural networks, and an efficient channel attention mechanism-optimized prediction model is constructed.
It improves the accuracy and reliability of energy consumption forecasting, enhances the ability to process complex energy data, improves forecasting accuracy, provides a scientific basis for energy allocation optimization, and enhances the level of intelligence in energy management.
Smart Images

Figure CN120822857B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of building energy consumption prediction, and more specifically, to a building energy consumption prediction method based on a convolutional bidirectional gated recurrent unit neural network optimized by an efficient channel attention mechanism. Background Technology
[0002] In the early days, building energy consumption prediction relied solely on simple statistical analysis of historical data to estimate energy consumption and meet basic cost control needs. However, with the rise of the energy crisis and environmental protection concepts, it has gradually incorporated building physical characteristics, meteorological factors, and other factors, using statistical models to improve accuracy in order to cope with the pressure of energy conservation and consumption reduction.
[0003] In the era of intelligent building, the integration of technologies such as machine learning and deep learning enables buildings to handle complex nonlinear relationships and adapt to the needs of building cluster management and low-carbon transformation. Its necessity has been a constant throughout development: from initially reducing operating costs to supporting the implementation of energy-saving policies, and now providing data support for renewable energy dispatch and the achievement of carbon emission reduction targets, it has become a core tool for buildings to move from extensive management to refined and intelligent operation. It is both a practical choice to address energy shortages and a key technological support for promoting the development of green buildings.
[0004] Although significant progress has been made in building energy consumption forecasting, current methods still have the following shortcomings:
[0005] (1) Existing energy consumption data has errors and noise interference. (2) It is difficult to obtain building physical parameters, which makes prediction difficult. (3) The accuracy and reliability of the prediction need to be improved, and it cannot provide a more scientific basis for the fine allocation and optimized scheduling of energy. (4) In the existing building energy consumption prediction, the potential collaborative effect between weather-related features is not utilized, resulting in a decrease in prediction accuracy and insufficient generalization ability.
[0006] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention
[0007] To address the problems in related technologies, this invention proposes a building energy consumption prediction method based on a convolutional bidirectional gated recurrent unit neural network optimized by an efficient channel attention mechanism, in order to overcome the aforementioned technical problems existing in the current related technologies.
[0008] Therefore, the specific technical solution adopted by the present invention is as follows:
[0009] A building energy consumption prediction method based on a convolutional bidirectional gated recurrent unit neural network optimized by an efficient channel attention mechanism includes:
[0010] Building energy consumption data is preprocessed based on the grouped box plot method and the weighted time similarity completion method, combined with a time-based building energy consumption data grouping mechanism.
[0011] Using correlation analysis, the correlation between the candidate weather features and the preprocessed building energy consumption data is calculated. Combined with partial correlation and feature synergistic gain techniques, several desired weather features are selected.
[0012] By improving the feature extraction and weight allocation of the neural network structure through convolutional neural networks and attention mechanisms, a building energy consumption prediction model is obtained.
[0013] By using preprocessed building energy consumption data and required weather characteristics, combined with optimization algorithms, the building energy consumption prediction model is trained and optimized; the building energy consumption value is predicted using the optimized building energy consumption prediction model and the input vector.
[0014] Furthermore, based on the grouped box plot method and the weighted time similarity completion method, and combined with a time-based building energy consumption data grouping mechanism, the building energy consumption data is preprocessed, including:
[0015] Based on the energy station energy management system, building energy consumption data is collected and divided into training set, validation set and test set;
[0016] The training set is divided into different groups according to a pre-set time interval, and within each group, the boundary values calculated by the box plot method are used to identify and eliminate outliers in the building energy consumption data of the training set.
[0017] Based on the boundary values of different groups, calculate the boundary average value, and use the boundary average value to identify and eliminate outliers in the validation set and test set.
[0018] When there are missing values in the building energy consumption data, the distance weight between the valid data points and the missing points is calculated; the weighted mean of the valid data points is calculated based on the distance weight, and the weighted mean is used as the supplementary value for the missing points.
[0019] Furthermore, the boundary values obtained using the box plot method are used to identify and eliminate outliers in the building energy consumption data of the training set, including:
[0020] Calculate the first and second quartiles of the building energy consumption data, and subtract the second quartile from the first quartile, multiply by a factor, and add the result to the second quartile to obtain the first boundary value.
[0021] Subtract the first quartile from the second quartile and then multiply the result by a factor to obtain the second boundary value.
[0022] Furthermore, when missing values exist in the building energy consumption data, the distance weight between valid data points and missing points is calculated; the weighted average of the valid data points is calculated based on the distance weight, including:
[0023] Calculate the time distance between each valid data point and the location of the missing value, and combine it with the decay factor to calculate the time decay weight corresponding to each time distance;
[0024] The weighted mean is calculated based on time decay weights and valid data points, using a weighted averaging method.
[0025] Furthermore, using correlation analysis, the correlation between the candidate weather features and the preprocessed building energy consumption data is calculated. Combined with partial correlation and feature synergistic gain techniques, several desired weather features are selected, including:
[0026] The correlation coefficient between different candidate weather characteristics and preprocessed building energy consumption data was calculated using the Pearson correlation coefficient method.
[0027] A correlation judgment threshold is preset, and the correlation of each candidate weather feature is determined based on the comparison between the correlation judgment threshold and the correlation coefficient; using the correlation, several candidate weather features are determined.
[0028] For each candidate weather feature, after eliminating the influence of other candidate features, the independent correlation value between the corresponding candidate weather feature and the preprocessed building energy consumption data is calculated using the partial correlation coefficient formula.
[0029] Obtain redundancy-free candidate weather features that meet the partial correlation coefficient threshold requirements, and use each redundancy-free candidate weather feature as a node in the network.
[0030] The predictive performance of any two nodes when de-redundant candidate weather features are used simultaneously to predict building energy consumption is calculated and compared with the performance of individual de-redundant candidate weather features when used to predict building energy consumption, to obtain the collaborative gain value.
[0031] A weather feature symbiotic network structure containing nodes, edges, and collaborative gain weights is established by using the collaborative gain as the edge weight between node pairs.
[0032] In a weather feature symbiotic network structure, calculate the average cooperative gain and degree centrality of each node with other nodes;
[0033] Select the desired nodes whose average collaborative gain is greater than or equal to the collaborative gain threshold and whose degree centrality ranks highly, and use the features corresponding to the desired nodes as the desired weather features.
[0034] Furthermore, by improving the feature extraction and weight allocation of the neural network structure through convolutional neural networks and attention mechanisms, a building energy consumption prediction model is obtained, including:
[0035] By running several independent gated recurrent unit layers simultaneously in the time dimension, a bidirectional gated recurrent unit is obtained to capture the bidirectional dependencies of sequence data;
[0036] A building energy consumption prediction model is formed by sequentially combining convolutional neural network layers, attention mechanism layers, and bidirectional gated recurrent unit layers.
[0037] Furthermore, in the building energy consumption prediction model, the convolutional neural network layer is used to extract the initial input features, generate feature maps, and serve as the input to the attention mechanism layer; the initial input features include building energy consumption data and required weather features.
[0038] The attention mechanism layer is used to assign weights to each feature map to highlight the features of the target channel and output the flattened feature vector.
[0039] The bidirectional gated cyclic unit layer is used to receive the flattened feature vector, update and transmit information through a gating mechanism to capture the trend of building energy consumption over time, and output the final building energy consumption prediction result.
[0040] Furthermore, the attention mechanism layer includes:
[0041] Global average pooling is performed on each channel to fuse global contextual information, and channel-dimensional operations are performed using convolution; the size of the convolution kernel is dynamically determined based on the number of channels in the input feature map.
[0042] Based on the activation function, the channel importance scores are normalized and their dimensions are expanded;
[0043] The target channel features are highlighted by multiplying each element of the original feature map with the importance score of the corresponding location.
[0044] Furthermore, using preprocessed building energy consumption data and required weather characteristics, combined with optimization algorithms, the building energy consumption prediction model is trained and optimized, including:
[0045] Using the training set of preprocessed building energy consumption data, the lagged and moving average terms of historical data, and the required weather features, the parameters of the building energy consumption prediction model are fitted by an optimization algorithm.
[0046] The performance of the building energy consumption prediction model is evaluated using a validation set in order to adjust the model parameters and prevent overfitting.
[0047] The performance of the building energy consumption prediction model on the test set is evaluated to measure the prediction accuracy and generalization ability of the building energy consumption prediction model.
[0048] Furthermore, the building energy consumption prediction model and input vector are used to predict building energy consumption values, including:
[0049] Substitute the input vector into the optimized building energy consumption prediction model and output the building energy consumption value for future time periods;
[0050] The input vector includes historical energy consumption data features and the required real-time weather data features.
[0051] The beneficial effects of this invention are as follows:
[0052] 1. This invention effectively eliminates outliers in energy consumption data through grouped box plots and uses a weighted time similarity completion method to process missing data, thereby improving data quality and laying the foundation for accurate energy consumption prediction.
[0053] 2. By integrating real-time weather data and fully considering the impact of weather factors on energy consumption, energy consumption forecasts are more in line with actual conditions, improving the accuracy and reliability of forecast results.
[0054] 3. By combining Convolutional Neural Network (CNN) and Bidirectional Gated Recurrent Unit (BiGRU) network, a deep learning ensemble model, CNN-BiGRU, is built to achieve feature extraction and time-series prediction tasks through a data-driven approach.
[0055] 4. By introducing the ECA attention mechanism, the predictive performance of CNN-BiGRU is optimized, enabling the model to allocate attention weights at the channel dimension, thereby improving predictive performance. The improved ECA-CNN-BiGRU fusion model enhances the ability to process complex energy data and learn features. Compared with traditional models, it significantly improves the accuracy of energy demand prediction and provides strong support for energy allocation optimization.
[0056] 5. Data visualization and result comparison analysis make it easy for users to intuitively understand the prediction results and model performance, improving the visualization and intelligence level of energy management and providing intuitive and effective basis for energy management decisions.
[0057] 6. When selecting weather features, we should retain the significance and independence of univariate variables and the complementarity of multivariate combinations to avoid missing important weather features due to relying on a single correlation index, thereby improving the effectiveness of the feature set and the generalization ability of the prediction model. Specifically, we should use the partial correlation coefficient to eliminate the influence of multicollinearity, introduce synergistic gain as the weight of the connection between features, quantify the collaborative effect of feature combination on energy consumption prediction performance, and form the final required weather feature set. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a box plot schematic diagram according to an embodiment of the present invention;
[0060] Figure 2 This is a schematic diagram illustrating the basis for selecting weather features according to an embodiment of the present invention;
[0061] Figure 3 This is a schematic diagram of convolution operation according to an embodiment of the present invention;
[0062] Figure 4 This is a schematic diagram of the GRU network structure according to an embodiment of the present invention;
[0063] Figure 5 This is a schematic diagram of the BiGRU network structure according to an embodiment of the present invention;
[0064] Figure 6 This is a line graph of total building energy consumption data in a certain location according to an embodiment of the present invention;
[0065] Figure 7 This is a heat map showing the correlation coefficients between various weather characteristics and total energy consumption characteristics according to an embodiment of the present invention;
[0066] Figure 8 This is a flowchart of a building energy consumption prediction method based on a convolutional bidirectional gated recurrent unit neural network optimized by an efficient channel attention mechanism, according to an embodiment of the present invention.
[0067] Figure 9 This is a schematic diagram of the ECA-CNN-BiGRU model network structure according to an embodiment of the present invention. Detailed Implementation
[0068] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention. The components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0069] According to an embodiment of the present invention, a method for predicting building energy consumption based on a convolutional bidirectional gated recurrent unit neural network optimized by an efficient channel attention mechanism is provided.
[0070] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 8 As shown, the building energy consumption prediction method based on a highly efficient channel attention mechanism optimized convolutional bidirectional gated recurrent unit neural network according to an embodiment of the present invention includes:
[0071] S1. Based on the grouped box plot method and the weighted time similarity completion method, and combined with the time-based building energy consumption data grouping mechanism, the building energy consumption data is preprocessed.
[0072] S2. Using correlation analysis, calculate the correlation between the candidate weather features and the preprocessed building energy consumption data, and combine partial correlation and feature synergistic gain techniques to select several desired weather features.
[0073] S3. Improve the feature extraction and weight allocation of the neural network structure by using convolutional neural networks and attention mechanisms to obtain a building energy consumption prediction model.
[0074] S4. Using the preprocessed building energy consumption data and required weather characteristics, combined with the optimization algorithm, train and optimize the building energy consumption prediction model; predict the building energy consumption value using the optimized building energy consumption prediction model and the input vector.
[0075] In one embodiment, preprocessing of building energy consumption data based on grouped box plots and weighted time similarity completion, combined with a time-based building energy consumption data grouping mechanism, includes:
[0076] Based on the energy station energy management system, building energy consumption data is collected and divided into training, validation, and test sets. The training set is further divided into different groups according to pre-set time intervals. Within each group, boundary values calculated using box plots are used to identify and eliminate outliers in the training set's building energy consumption data. Based on the boundary values of different groups, boundary averages are calculated, and these averages are used to identify and eliminate outliers in the validation and test sets. When missing values exist in the building energy consumption data, the distance weight between valid data points and missing points is calculated. A weighted average of the valid data points is then calculated based on the distance weights, and this weighted average is used as a supplementary value for the missing points.
[0077] In one embodiment, using boundary values calculated using the box plot method to identify and eliminate outliers in the building energy consumption data of the training set includes:
[0078] Calculate the first and second quartiles of the building energy consumption data, subtract the second quartile from the first quartile, multiply by a factor, and add the result to the second quartile to obtain the first boundary value; subtract the first quartile from the result of subtracting the second quartile from the first quartile and multiplying by a factor to obtain the second boundary value.
[0079] In one embodiment, when missing values exist in the building energy consumption data, the distance weight between valid data points and missing points is calculated; the weighted average of the valid data points is calculated based on the distance weight, including:
[0080] Calculate the time distance between each valid data point and the location of the missing value, and combine it with the decay factor to calculate the time decay weight corresponding to each time distance; based on the time decay weight and the valid data points, calculate the weighted average using a weighted average method.
[0081] In one embodiment, correlation analysis is used to calculate the correlation between candidate weather features and preprocessed building energy consumption data. Combined with partial correlation and feature synergistic gain techniques, several desired weather features are selected, including:
[0082] The correlation coefficient between different candidate weather features and preprocessed building energy consumption data is calculated using the Pearson correlation coefficient method. A correlation threshold is pre-set, and the correlation of each candidate weather feature is determined based on the comparison between the threshold and the correlation coefficient. Several candidate weather features are identified using the correlation. For each candidate weather feature, after eliminating the influence of other candidate features, the independent correlation value between the corresponding candidate weather feature and the preprocessed building energy consumption data is calculated using the partial correlation coefficient formula. Redundant candidate weather features that meet the partial correlation coefficient threshold are obtained, and each redundant candidate weather feature is used as a node in the network. The predictive performance of any two nodes' redundant candidate weather features when used simultaneously to predict building energy consumption is calculated, for example, using existing gradient augmentation methods. The decision tree model or random forest regression model calculates the coefficient of determination or root mean square error on the validation set and compares its performance with that of individual deredundant candidate weather features used to predict building energy consumption to obtain the synergistic gain value. The synergistic gain is equal to the performance when used simultaneously minus the maximum performance when used alone. The synergistic gain is used as the edge weight between node pairs to establish a weather feature symbiotic network structure containing nodes, edges, and synergistic gain weights. In the weather feature symbiotic network structure, the average synergistic gain value and degree centrality of each node with other nodes are calculated, which is a comprehensive measure of the number and strength of significant connections between the feature and other features. The nodes with average synergistic gain greater than or equal to the synergistic gain threshold and high degree centrality ranking are selected, and the features corresponding to the selected nodes are taken as the required weather features.
[0083] In one embodiment, an improved building energy consumption prediction model is obtained by using convolutional neural networks and attention mechanisms to refine the feature extraction and weight allocation of the neural network structure, including:
[0084] By running several independent gated recurrent unit layers simultaneously in the time dimension, a bidirectional gated recurrent unit is obtained to capture the bidirectional dependencies of sequential data; a building energy consumption prediction model is formed by sequentially combining convolutional neural network layers, attention mechanism layers, and bidirectional gated recurrent unit layers.
[0085] In one embodiment, in the building energy consumption prediction model, a convolutional neural network layer is used to extract initial input features, generate feature maps, and serve as input to the attention mechanism layer; the initial input features include building energy consumption data and required weather features; the attention mechanism layer is used to assign weights to each feature map to highlight target channel features and output flattened feature vectors; a bidirectional gated recurrent unit layer is used to receive the flattened feature vectors, update and transmit information through a gating mechanism to capture the changing trend of building energy consumption over time, and output the final building energy consumption prediction result.
[0086] In one embodiment, the attention mechanism layer includes:
[0087] Global average pooling is performed on each channel to fuse global contextual information, and channel dimension operations are performed using convolution; the size of the convolution kernel is dynamically determined based on the number of channels in the input feature map; the channel importance scores are normalized and dimensionally expanded based on the activation function; and the target channel features are highlighted by multiplying each element of the original feature map with the importance score at the corresponding position.
[0088] In one embodiment, training and optimizing a building energy consumption prediction model using preprocessed building energy consumption data and required weather characteristics, combined with an optimization algorithm, includes:
[0089] Using a training set of preprocessed building energy consumption data, lagged and moving average terms of historical data, and required weather features, the parameters of a building energy consumption prediction model are fitted by an optimization algorithm. The performance of the building energy consumption prediction model is evaluated using a validation set to adjust the model parameters and prevent overfitting. The performance of the building energy consumption prediction model on the test set is evaluated to measure its prediction accuracy and generalization ability.
[0090] In one embodiment, predicting building energy consumption values using an optimized building energy consumption prediction model and an input vector includes:
[0091] The input vector is substituted into the optimized building energy consumption prediction model, and the building energy consumption value for future time periods is output; the input vector includes historical energy consumption data features and the required real-time weather data features.
[0092] To facilitate understanding of the above technical solutions of the present invention, the working principle of the present invention in actual process will be described in detail below.
[0093] This invention addresses the issue of improving the accuracy of building energy consumption prediction, helping decision-makers optimize electricity consumption behavior through accurate forecasts. By applying grouped box plots and weighted temporal similarity completion to preprocess the original data for outliers and missing values, data augmentation is performed, which improves the training efficiency and predictive performance of deep learning models. Using the Python programming language and a building management platform, an interface is built to call third-party libraries to write predictive models, and attention-optimized deep learning ensemble model techniques are employed to further optimize predictive performance. Specifically, it includes:
[0094] 1. Based on the data acquisition function of the energy station's energy management system, it enables the collection, storage, preprocessing, and analysis of large amounts of energy data.
[0095] 1.1 The collected data is divided into training set, validation set and test set in a ratio of 7:1:2.
[0096] 1.2, such as Figure 1 As shown, the grouped box plot method is used to identify and eliminate outliers in the real-time energy consumption data of the training set. The principle of the box plot method is to determine the normal upper and lower boundaries of the overall data by calculating the 1 / 4 and 3 / 4 quantiles of the energy consumption data. The calculation formula is as follows:
[0097]
[0098]
[0099] In the formula, It is the 1 / 4 quantile. It is a 3 / 4 quantile.
[0100] Considering the inaccuracies of the overall box plot method, this invention divides energy consumption data into different groups based on 30-day recording intervals, and calculates the upper and lower boundaries of each group as the basis for identifying outliers. Then, the average of the upper and lower boundaries of each group is used as the basis for anomaly detection in the validation and test set data. This avoids data leakage in the test set and ensures the reliability of the model's prediction results.
[0101] 1.3 For hourly data recorded by sensors that has some missing moments, along with identified outliers, a weighted time similarity completion method is used for filling. This method selects all energy consumption values at the same moment within 10 days before and after the current missing value, where data points without missing moments are called valid data points. Then, the weights of the valid data points are calculated. By calculating the time distance of each point from the current missing point, different weights are assigned, with closer time distances resulting in higher weights. The weighted average is then calculated and used as the supplementary value for missing or outlier data, ensuring data integrity and continuity. The calculation process is as follows:
[0102] 1.3.1 Calculation of time distance:
[0103] For missing value locations Valid data points found The time is Then the time distance is .
[0104] 1.3.2 Time decay weight:
[0105] The formula for calculating the weight is: .
[0106] in It is the decay factor (set to 0.1), which controls the rate at which the weight decays over time.
[0107] 1.3.3 Weighted average filling:
[0108] Missing value imputation formula: ;
[0109] in, This represents the number of valid data points. If there are no missing data points before or after, That is, 20. If any are missing, the number will be reduced accordingly.
[0110] 2. By utilizing correlation analysis to fully consider the significant impact of real-time weather data on energy forecasting, real-time weather data (such as temperature and humidity) is integrated with historical energy consumption data.
[0111] The correlation coefficient between different weather characteristics and energy consumption was calculated using the Pearson correlation coefficient method to analyze their correlation characteristics. The formula for calculating the correlation coefficient is as follows:
[0112] ;
[0113] In the formula, , Let represent the sample means of the two, respectively. These are the sample values for the two features, For the first The serial number of each sample. This represents the total sample size.
[0114] according to The magnitude of the value can determine the strength of the correlation between variables. It is generally believed that... Low correlation; It has a moderate correlation. The correlation is high. A correlation heatmap is provided as a basis for selecting weather features, such as... Figure 2 As shown.
[0115] Based on the correlation coefficient calculation results, two weather features with moderate correlation strength with total energy consumption characteristics, namely temperature and dew point temperature, are selected to assist in the prediction. They are used together as input features of the prediction model to predict future energy consumption changes more accurately.
[0116] The independent correlation between features and building energy consumption is calculated using partial correlation coefficients after eliminating the influence of other features, removing redundant information and retaining features with independent explanatory power. These deredundant features are treated as network nodes, and the synergistic gain of any two features in combined prediction of building energy consumption is calculated, obtained from the difference between the combined prediction performance and the single-feature prediction performance. This constructs a weighted feature co-occurrence network. By analyzing the average synergistic gain and degree centrality of each node in the network, features that not only contribute independently but also significantly improve prediction performance in combination and occupy key positions in the network are selected. This reduces feature redundancy, significantly improves the prediction accuracy and generalization ability of the building energy consumption prediction model on the dataset, and provides a more refined, informationally valuable, and multi-dimensionally contributing weather feature set for subsequent modeling.
[0117] 3. This invention establishes a BiGRU (Bidirectional Gated Recurrent Unit) model as the training prediction algorithm and innovatively incorporates a CNN (Convolutional Neural Network) module and an ECA attention mechanism module. The CNN module is responsible for feature extraction from the input feature data, automatically identifying local features and patterns in the data through convolution operations; the ECA attention mechanism module assigns weights to the feature maps extracted by the CNN, enhancing the BiGRU's ability to learn key features, enabling the model to focus on features that have a significant impact on energy consumption prediction and suppressing interference from irrelevant information. The integration of these three modules forms an ECA-CNN-BiGRU prediction model, effectively improving the processing capability and prediction accuracy of complex energy datasets, accurately predicting energy demand, and optimizing energy allocation strategies.
[0118] 3.1 CNN layers extract features from the original input features. Convolutional layers extract hierarchical features from the input data by performing convolution operations. A convolution operation consists of element-wise multiplication and summation between the convolution kernel and local regions of the input feature map. Assume there is an input feature map I and a convolution kernel. The size of the nucleus is , and These represent the height and width of the kernel, respectively. The output of the convolution operation... The following formula can be used to calculate:
[0119] ;
[0120] in, Indicates the output feature map at position The value at that location, Indicates that the input feature map is in The value at that location, Indicates the position of the convolution kernel Weight at each location.
[0121] By performing the above operations, all positions can be calculated. The output values are used to form a feature map. If multiple convolutional kernels are used, for example... Each core will produce There are feature maps. Therefore, the complete set of all feature maps can be represented as Convolution operations, such as... Figure 3 As shown.
[0122] 3.2 The ECA attention layer assigns weights to the feature maps extracted by the CNN. First, global average pooling is performed on each channel, transforming its dimensions from (N, C, H, W) to (N, C, 1, 1), where N is the batch size, C is the number of channels, and H and W are the height and width, respectively, to fuse global contextual information. Next, one-dimensional convolution is used to operate along the channel dimension, flexibly capturing channel dependencies at different scales. The size of the convolution kernel... The number of channels C in the input feature map is dynamically determined. The calculation formula is as follows:
[0123]
[0124] in, , These are different hyperparameters.
[0125] Finally, the classic Sigmoid activation function is used for processing. The Sigmoid function is based on its mathematical expression:
[0126] ;
[0127] By smoothly mapping inputs from any real number field to the (0, 1) interval, this property perfectly meets the need for normalizing channel importance scores. Through this mapping process, the weights of the network output are transformed into probability values with clear physical meaning. The closer the value is to 1, the higher the contribution of the features contained in the corresponding channel to the current task; conversely, the closer the value is to 0, the less important the features of that channel are.
[0128] After obtaining the importance score for each channel, a dimensionality expansion operation is performed to achieve effective fusion with the original input feature map. This expands the one-dimensional attention score vector to the same dimensional structure as the original input feature map, ensuring a perfect match in both spatial and channel dimensions. Following this, element-wise multiplication is performed, multiplying each element of the original feature map with the corresponding attention score. This significantly enhances the features of channels with high importance scores, while effectively suppressing the feature responses of low-importance channels. Ultimately, this allows the network to focus on extracting and representing key information, significantly improving the model's feature representation ability and task processing performance.
[0129] 3.3. The BiGRU model learns the temporal features of the data.
[0130] GRU model, such as Figure 4 As shown, it mainly includes two gating units: a reset gate and an update gate. These components work together to control the flow and storage of information. The reset gate controls the degree to which past information affects the current state; the update gate determines how much new information needs to be incorporated into the current state, and also controls the degree to which past state information is forgotten.
[0131] The basic structure of the GRU model can be represented by the following formula:
[0132]
[0133]
[0134]
[0135]
[0136] In the formula, , These represent the outputs of the reset gate and the update gate, respectively. for Activation function Use the Tanh activation function; , These are the weight matrix and bias vector of the reset gate; , It updates the weight matrix and bias vector of the gate; , These are the weight matrix and bias vector of the candidate hidden state; This is the input at time t; express Always hide your status; yes The candidate hidden state at each moment; This indicates element-wise multiplication.
[0137] BiGRU is an improvement on GRU. It captures the bidirectional dependencies in sequential data by running two independent GRU layers simultaneously along the time dimension. One GRU processes the data in forward time sequence, while the other processes it in reverse time sequence. The final output is formed by integrating the features extracted by the forward and reverse GRUs. The BiGRU network structure is shown below. Figure 5 As shown.
[0138] The calculation formula is as follows:
[0139]
[0140]
[0141]
[0142] In the formula, express The hidden layer state that is output forward at any given time; express The hidden layer state that is constantly being reversed and output; This represents the hidden layer state of the final output; , These are the weights of the forward and backward hidden states, respectively. This is the bias vector.
[0143] 3.4. Combine the CNN layer, ECA layer, and BiGRU layer in sequence to form a model, process the data sequentially, and obtain the final ECA-CNN-BiGRU prediction model. The network structure of the ECA-CNN-BiGRU model is as follows: Figure 9 As shown, INPUT is the input and OUPUT is the output.
[0144] 3.4.1 The CNN layer extracts the initial input features to generate a feature map, which is then used as the input to the ECA layer.
[0145] 3.4.2 The ECA attention mechanism assigns weights to each feature map, enabling the model to learn in a focused manner and highlight key channel features.
[0146] 3.4.3 After receiving the flattened feature vector output from the ECA attention layer, BiGRU selectively updates and transmits information through a gating mechanism, effectively capturing the trend of building energy consumption over time. Dropout regularization is also added to prevent overfitting.
[0147] 3.4.4 Finally, the output of the BiGRU layer is processed through a fully connected layer to output the final building energy consumption prediction result.
[0148] 4. During the model training phase, using the training set data, with historical data lag terms and moving average terms, as well as previously determined weather factors as features, the model parameters are fitted through an optimization algorithm to predict energy consumption for the next hour. The validation set is used to evaluate model performance, adjust model parameters, and prevent overfitting. Common evaluation metrics, including mean absolute error (MAE), mean squared error (MSE), root mean square error (RMSE), coefficient of determination (R-squared), and mean absolute percentage error (MAPE), are used to evaluate the model's performance on the test set, comprehensively measuring the model's predictive accuracy and generalization ability.
[0149] 5. After the model parameters are determined, it can be applied to actual forecasting. When an input vector containing historical energy consumption data features and real-time weather data features is input into the model, the model can output the energy consumption forecast for the next hour, providing data support for energy management decisions.
[0150] 6. By plotting line graphs comparing the actual and predicted values on the test set, the comparison between the predicted results and actual data is visually displayed. Based on the comparison results, the accuracy of the model's predictions is analyzed, providing a reference for adjusting and optimizing energy management strategies. This helps users better understand model performance and improve the scientific nature and effectiveness of energy management.
[0151] When this invention is applied:
[0152] 1. For the various energy consumption data of buildings in a certain area, sum them up to form the total energy consumption. Then, apply the grouped box plot method for outlier detection, and use the weighted time similarity imputation method to fill in missing and outlier values. Obtain a preprocessed line chart of the total energy consumption data of buildings in the certain area, as shown below. Figure 6 As shown.
[0153] 2. Using Pearson correlation analysis, obtain a heatmap showing the correlation coefficients between various weather characteristics and total energy consumption characteristics, such as... Figure 7 As shown, appropriate temperature and dew point temperature characteristics are selected as auxiliary factors.
[0154] 3. The application model is instantiated, and a grid search method is used to exhaustively search for hyperparameter combinations within a preset range, selecting the optimal solution based on the validation set performance metrics. Considering computational efficiency, the following key hyperparameters are optimized. The search space and optimal values are shown in Table 1:
[0155] Table 1 Search space and optimal values of model hyperparameters
[0156]
[0157] Based on this, the remaining hyperparameters are determined through human experience. Therefore, combining the grid search results, the hyperparameters and sequential structure of the model in this invention are determined as follows: First, a one-dimensional convolutional layer (Conv1D) with a kernel size of 3 is used to extract combined features from the data feature sequence. Specifically, 64 convolutional kernels are configured, and the padding is set to 1, which can fill the data sequence with a 0 value before and after the data sequence to ensure that the sequence length after the convolution operation remains unchanged and can preserve edge feature information. Therefore, through the convolution operation of CNN, feature information of 64 channels can be obtained. Each channel has 1×11 dimension feature information. Subsequently, feature weights of different channels are assigned through an ECA attention layer, where the hyperparameter b is set to 1 and g is set to 2. Then, a 3-layer BiGRU (Bidirectional Gated Recurrent Unit) is introduced, each with 128 neurons, to learn the temporal dependence and long-term correlation of data from both past and future directions. Finally, a fully connected layer with 256 neurons is used to map the learned features to the regression target, and the output layer directly predicts the energy consumption value for the next hour. To enhance the model's generalization ability, a dropout layer is inserted at the last layer of the BiGRU layer to randomly suppress intermediate feature representations and reduce overfitting. The model is trained with 100 training epochs and 32 batches of samples.
[0158] 4. The predictive performance comparison results of the model in this study are also presented.
[0159] To systematically verify the building energy consumption prediction performance of the ECA-CNN-BiGRU hybrid model and the effectiveness of its individual modules, this invention selected two single models, LSTM and GRU, as benchmarks for comparison to verify the overall advantages of the hybrid model. Simultaneously, two hybrid architectures, CNN-GRU and CNN-BiGRU, were compared. The former extracts spatial features through a CNN and then connects them to a unidirectional GRU without an attention mechanism, while the latter introduces a bidirectional GRU structure to verify the performance improvement effect of the bidirectional structure. Furthermore, the SE-CNN-BiGRU model, which adds a traditional SE attention module after the CNN layer, was selected, and its optimization effect was evaluated through comparative experiments with the ECA mechanism. The prediction performance comparisons of each model on the test set are shown in Table 2.
[0160] Table 2 Comparison of Predictive Performance
[0161]
[0162] In summary, the present invention includes:
[0163] Solving the challenges of data integration and processing:
[0164] Multi-source heterogeneous data fusion: Integrating equipment data and recorded environmental data from the HVAC system breaks down information silos and enables data sharing. It integrates and processes different types of electricity consumption data, such as power consumption, air conditioning consumption, and lighting consumption, to form total energy consumption characteristics. Simultaneously, it crawls weather data in real time, achieving multi-source data fusion. A grouped box plot method is used to clean and calibrate the electricity consumption data collected by sensors, effectively eliminating errors and noise interference, significantly improving data quality, reducing the complexity of subsequent model training, and providing a reliable data foundation for electricity consumption analysis and optimization.
[0165] Solving the challenges of algorithm optimization and application:
[0166] Addressing application challenges: A data-driven prediction method is adopted, which trains a deep learning model based on historical energy consumption data and real-time environmental data (such as temperature and dew point temperature) to predict future energy demand, thus solving the prediction difficulties caused by the difficulty in obtaining building physical parameters.
[0167] Optimize the prediction model:
[0168] In constructing energy demand forecasting models, an innovative ECA (Efficient Channel Attention) mechanism is introduced to optimize deep learning ensemble models. This mechanism is applied to CNN-BiGRU models built based on historical energy consumption data and real-time collected environmental data such as temperature and dew point temperature. The ECA attention mechanism learns the dependencies between different feature channels extracted by the CNN, adaptively adjusting the feature response weights of each channel, enhancing the model's sensitivity to key features, suppressing interference from irrelevant information, and helping the subsequent BiGRU network learn the temporal features of the data. In this way, the model can more accurately focus on data features closely related to energy demand, effectively improving the accuracy and reliability of energy demand forecasting, thereby providing a more scientific basis for the fine allocation and optimized scheduling of energy.
[0169] 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, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A building energy consumption prediction method based on a convolutional bidirectional gated recurrent unit neural network optimized by an efficient channel attention mechanism, characterized in that, include: Based on the grouped box plot method and the weighted time similarity completion method, and combined with the time-based building energy consumption data grouping mechanism, the building energy consumption data is preprocessed. Using correlation analysis, the correlation between the candidate weather features and the preprocessed building energy consumption data is calculated. Combined with partial correlation and feature synergistic gain techniques, several desired weather features are selected. By improving the feature extraction and weight allocation of the neural network structure through convolutional neural networks and attention mechanisms, a building energy consumption prediction model is obtained. By using preprocessed building energy consumption data and required weather characteristics, combined with optimization algorithms, the building energy consumption prediction model is trained and optimized. The building energy consumption value is predicted using the optimized building energy consumption prediction model and input vector; The method of using correlation analysis to calculate the correlation between the candidate weather features and the preprocessed building energy consumption data, and combining partial correlation and feature synergistic gain techniques, selects several desired weather features, including: The correlation coefficient between different candidate weather characteristics and preprocessed building energy consumption data was calculated using the Pearson correlation coefficient method. A correlation judgment threshold is preset, and the correlation of each candidate weather feature is determined based on the comparison between the correlation judgment threshold and the correlation coefficient; using the correlation, several candidate weather features are determined. For each candidate weather feature, after eliminating the influence of other candidate features, the independent correlation value between the corresponding candidate weather feature and the preprocessed building energy consumption data is calculated using the partial correlation coefficient formula. Obtain redundancy-free candidate weather features that meet the partial correlation coefficient threshold requirements, and use each redundancy-free candidate weather feature as a node in the network. The predictive performance of any two nodes when de-redundant candidate weather features are used simultaneously to predict building energy consumption is calculated and compared with the performance of individual de-redundant candidate weather features when used to predict building energy consumption, to obtain the collaborative gain value. A weather feature symbiotic network structure containing nodes, edges, and collaborative gain weights is established by using the collaborative gain as the edge weight between node pairs. In a weather feature symbiotic network structure, calculate the average cooperative gain and degree centrality of each node with other nodes; Select the desired nodes whose average collaborative gain is greater than or equal to the collaborative gain threshold and whose degree centrality ranks high, and use the features corresponding to the desired nodes as the desired weather features. In the building energy consumption prediction model, the convolutional neural network layer is used to extract the initial input features, generate feature maps, and serve as the input to the attention mechanism layer; the initial input features include building energy consumption data and required weather features; The attention mechanism layer is used to assign weights to each feature map to highlight the features of the target channel and output the flattened feature vector. The bidirectional gated cyclic unit layer is used to receive the flattened feature vector, update and transmit information through the gating mechanism to capture the trend of building energy consumption over time, and output the final building energy consumption prediction result. The attention mechanism layer includes: Global average pooling is performed on each channel to fuse global contextual information, and channel-dimensional operations are performed using convolution; the size of the convolution kernel is dynamically determined based on the number of channels in the input feature map. Based on the activation function, the channel importance scores are normalized and their dimensions are expanded; The target channel features are highlighted by multiplying each element of the original feature map with the importance score of the corresponding location.
2. The building energy consumption prediction method based on a highly efficient channel attention mechanism optimized convolutional bidirectional gated recurrent unit neural network according to claim 1, characterized in that, The preprocessing of building energy consumption data based on the grouped box plot method and the weighted time similarity completion method, combined with a time-based building energy consumption data grouping mechanism, includes: Based on the energy station energy management system, building energy consumption data is collected and divided into training set, validation set and test set; The training set is divided into different groups according to a pre-set time interval, and within each group, the boundary values calculated by the box plot method are used to identify and eliminate outliers in the building energy consumption data of the training set. Based on the boundary values of different groups, calculate the boundary average value, and use the boundary average value to identify and eliminate outliers in the validation set and test set. When there are missing values in the building energy consumption data, the distance weight between the valid data points and the missing points is calculated; the weighted mean of the valid data points is calculated based on the distance weight, and the weighted mean is used as the supplementary value for the missing points.
3. The building energy consumption prediction method based on a highly efficient channel attention mechanism optimized convolutional bidirectional gated recurrent unit neural network according to claim 2, characterized in that, The boundary values calculated using the box plot method are used to identify and eliminate outliers in the building energy consumption data of the training set, including: Calculate the first and second quartiles of the building energy consumption data, and subtract the second quartile from the first quartile, multiply by a factor, and add the result to the second quartile to obtain the first boundary value. Subtract the first quartile from the second quartile and then multiply the result by a factor to obtain the second boundary value.
4. The building energy consumption prediction method based on a highly efficient channel attention mechanism optimized convolutional bidirectional gated recurrent unit neural network according to claim 2, characterized in that, When there are missing values in the building energy consumption data, the distance weight between the valid data points and the missing points is calculated. The weighted mean calculation of valid data points based on distance weights includes: Calculate the time distance between each valid data point and the location of the missing value, and combine it with the decay factor to calculate the time decay weight corresponding to each time distance; The weighted mean is calculated based on time decay weights and valid data points, using a weighted averaging method.
5. The building energy consumption prediction method based on a highly efficient channel attention mechanism optimized convolutional bidirectional gated recurrent unit neural network according to claim 1, characterized in that, The improvement of feature extraction and weight allocation of the neural network structure through convolutional neural networks and attention mechanisms, resulting in a building energy consumption prediction model, includes: By running several independent gated recurrent unit layers simultaneously in the time dimension, a bidirectional gated recurrent unit is obtained to capture the bidirectional dependencies of sequence data; A building energy consumption prediction model is formed by sequentially combining convolutional neural network layers, attention mechanism layers, and bidirectional gated recurrent unit layers.
6. The building energy consumption prediction method based on a highly efficient channel attention mechanism optimized convolutional bidirectional gated recurrent unit neural network according to claim 1, characterized in that, The step of training and optimizing the building energy consumption prediction model using preprocessed building energy consumption data and required weather characteristics, combined with an optimization algorithm, includes: Using the training set of preprocessed building energy consumption data, the lagged and moving average terms of historical data, and the required weather features, the parameters of the building energy consumption prediction model are fitted by an optimization algorithm. The performance of the building energy consumption prediction model is evaluated using a validation set in order to adjust the model parameters and prevent overfitting. The performance of the building energy consumption prediction model on the test set is evaluated to measure the prediction accuracy and generalization ability of the building energy consumption prediction model.
7. The building energy consumption prediction method based on a highly efficient channel attention mechanism optimized convolutional bidirectional gated recurrent unit neural network according to claim 1, characterized in that, The process of predicting building energy consumption values using the optimized building energy consumption prediction model and input vector includes: Substitute the input vector into the optimized building energy consumption prediction model and output the building energy consumption value for future time periods; The input vector includes historical energy consumption data features and the required real-time weather data features.
Citation Information
Patent Citations
Ultra-short-term wind power prediction method based on secondary decomposition and TCN-ECA-BiGRU
CN119271971A