A method for improving multi-target error equalization degree by using a GAT-BILSTM&CNN-LSTM model

By combining the GAT-BILSTM and CNN-LSTM models, the problem of error imbalance in multi-object prediction is solved, thereby improving the error balance and prediction performance.

CN118735721BActive Publication Date: 2025-12-19HUBEI CENT CHINA TECH DEV OF ELECTRIC POWER +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410712732.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2025-12-19
Estimated Expiration
2044-06-04

AI Technical Summary

Technical Problem

In existing technologies, multi-objective prediction algorithms for power grid load forecasting have several drawbacks. Firstly, the prediction errors of each objective differ significantly, leading to poor prediction results for some objectives. Secondly, existing multi-objective prediction algorithms primarily consider the overall final error without taking into account the degree of error balance among the individual objectives.

Method used

By combining the GAT-BILSTM model with a convolutional neural network model, and through data cleaning and feature engineering, and by employing graph attention networks and convolutional neural network models, and through data processing and feature extraction, the multi-objective error balance was improved.

Benefits of technology

By combining the GAT-BILSTM and CNN-LSTM models, the balance of multi-objective prediction errors was improved, the standard deviation and average error were reduced, and the prediction performance was enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735721B_ABST
    Figure CN118735721B_ABST
Patent Text Reader

Abstract

A method for improving multi-target error equalization degree by using GAT-BILSTM&CNN-LSTM model, comprising: obtaining load data and air temperature data of a target area; data cleaning is performed on the load data and air temperature data; feature engineering processing is performed on the data cleaned data to obtain historical data; a GAT-BILSTM algorithm network is set and a CNN-LSTM algorithm network is set; model combination: using GAT-BILSTM to train the historical data, calculating the prediction error of each prediction variable of the load rate prediction variable of the target area, then calculating the average error, then combining the load rate prediction variable exceeding the average error with the result of CNN-LSTM, the combination method is weighted by using error reciprocal method, and the remaining load rate prediction variable remains unchanged to output the result. The present application can solve the problem that the prediction errors of each target in the multi-target prediction model are too different, and at the same time, the overall error is reduced as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the field of artificial intelligence algorithms, and particularly relates to a method for improving multi-target error balance degree by using a GAT-BILSTM&CNN-LSTM model. BACKGROUND

[0002] The load rate of a power grid is one of important indexes of power grid safety, and if overloading or overload occurs, the burden of the power grid is increased, the probability of a large-scale power failure accident is increased, and the power consumption of residents and enterprises is affected. Since the prediction involves multiple targets (i.e. the load rates of multiple towns), the single-target cyclic prediction method is too time-consuming and is not considered, and generally, the multi-target prediction algorithm mostly considers the final overall error and does not consider the balance degree of the prediction errors of the targets, and the prediction errors of the targets are too large, which will inevitably cause some targets to have poor prediction effects and some targets to have good prediction effects, but in fact, there is no prediction priority between the targets, and the targets are equally important. SUMMARY

[0003] To solve the problem that the prediction errors of the targets in the multi-target prediction model are too large and to reduce the overall error as much as possible, the application provides a method for improving the multi-target error balance degree by using a GAT-BILSTM&CNN-LSTM model.

[0004] A method for improving the multi-target error balance degree by using a GAT-BILSTM&CNN-LSTM model, comprising the following steps:

[0005] Step 1: obtaining load data and temperature data of a target area, wherein the load data comprises date and the load rate of the target area, and the temperature data comprises date and the temperature of the target area;

[0006] Step 2: performing data cleaning on the load data and the temperature data obtained in step 1;

[0007] Step 3: performing feature engineering processing on the data cleaned in step 2 to obtain historical data, and the historical data specifically comprises:

[0008] (1) splitting and transforming the temperature: splitting the temperature data cleaned in the data cleaning into the highest temperature and the lowest temperature, and transforming the highest temperature and the lowest temperature, and the formula is as follows:

[0009] Highest temperature = Highest temperature + 50

[0010] Lowest temperature = Lowest temperature + 50

[0011] (2) 0-1 standardization of the features: performing 0-1 standardization on the load rate of the target area, the highest temperature and the lowest temperature;

[0012] Step four, setting GAT-BILSTM algorithm network and setting CNN-LSTM algorithm network;

[0013] Step five, model combination: using GAT-BILSTM to train historical data, calculating the prediction error of each prediction variable of the target area load rate, and then calculating the average error, and then combining the load rate prediction variables exceeding the average error with the results of CNN-LSTM, the combination method is to use error reciprocal method for weighting, and the remaining load rate prediction variables remain unchanged.

[0014] Further, the data cleaning in step two includes outlier deletion, missing value processing, numerical value processing and splicing data.

[0015] Further, setting GAT-BILSTM algorithm network in step four includes: constructing the graph structure required by GAT algorithm, including the nodes and edges of the graph; setting BILSTM network, inputting the extracted features of different times into the bidirectional long short-term memory neural network in time sequence by graph attention network to learn time features, using ReLU as activation function, batch_size is 30, 14 consecutive days as a history period, 10 fully connected layers as synchronous output of 10 variables per day, and daily single-step rolling prediction.

[0016] Further, setting CNN-LSTM algorithm network in step four includes setting CNN network and setting LSTM network, wherein setting CNN network includes: using one-dimensional convolution Conv1D, using pooling layer downsampling, pooling kernel size is [1,2], adjusting channel function before inputting feature data from CNN to LSTM, fusing channel information, reducing channel number to 1, and then squeezing out channel dimension; the network setting of LSTM is similar to that of BILSTM, the difference is that LSTM is a unidirectional network, and the parameter "bidirectional" is False, while in BILSTM it is True; secondly, the fully connected layer of LSTM is 1, only 1 variable output, and finally the prediction result is output through 1 fully connected layer.

[0017] Further, in step five, the load rate prediction variables far exceeding the average error are combined with the results of CNN-LSTM, specifically including: using CNN-LSTM to predict the load rate prediction variables exceeding the average error, and then weighting the load rate prediction variables exceeding the average error predicted by GAT-BILSTM.

[0018] Further, the principle of the error reciprocal method is that the error is small to obtain high weight, and the error is large to obtain low weight.

[0019] The application combines a multi-target image attention network GAT-BILSTM (note: also called GAT-MultiTask-BILSTM, which can perform multi-target prediction because of MultiTask-BILSTM, not BILSTM) and a convolutional neural network CNN-LSTM, takes mape as the error, and takes the standard deviation as the balance degree between the errors of each prediction target, so as to evaluate the prediction effect of the model. Compared with the prior art based on the GAT-LSTM algorithm, the GAT-BILSTM algorithm is first proposed and applied to power grid load rate prediction. For a multi-target prediction model, not only the overall error should be considered, but also the balance degree between each target error should be paid attention to. Therefore, the application combines GAT-BILSTM and CNN-LSTM to become a GAT-BILSTM&CNN-LSTM algorithm, and compared with the pure GAT-BILSTM, the error balance degree between multi-targets is improved, and the standard deviation is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1 is a flowchart of the method for improving the multi-target error balance degree by the GAT-BILSTM&CNN-LSTM model according to the embodiment of the application;

[0021] Figure 2 is a schematic diagram of the final prediction result according to the embodiment of the application. DETAILED DESCRIPTION

[0022] To make the purpose, technical scheme and advantages of the embodiments of the application clearer, the technical scheme in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.

[0023] Please refer to Figure 1 The embodiment of the application provides a method for improving the multi-target error balance degree by using a GAT-BILSTM&CNN-LSTM model. The embodiment of the application takes S area as an observation object, and actually predicts the daily load rate of eight towns under S area, Figure 1 The left side is a multi-target prediction model GAT-BILSTM, and the right side is CNN-LSTM. The method comprises the following steps:

[0024] Step one, obtain the load data and air temperature data of the target area (for example, S area), wherein the data set is derived from a data center and a meteorological website, and the time granularity is daily; the load data includes date, load rate of 8 towns under the target area S area, and the air temperature data includes date and air temperature of S area.

[0025] Step two, data cleaning is performed on the load data and air temperature data obtained in step one, and the specific steps are as follows:

[0026] (1) Abnormal value deletion: through previewing data, it is found that the load rate of 10 days from 20220101 to 20220110 is abnormally high, which is about 10 times of the following 10 days, and is deleted;

[0027] (2) Missing value processing: two ways are adopted to process the missing values in the embodiment of the application. Firstly, the previous value filling method is used to fill the missing values (i.e. the previous non-missing value fills the missing value), and secondly, for each segment of multiple continuous missing values, the maximum 3 times of the previous value filling method is used to fill the missing values in this segment, and the remaining part of the segment of continuous missing values more than 3 is filled with the mean value filling method.

[0028] (3) Numerical value processing: the calculation of the load rate has been generated in the database, but it still needs to be converted from decimal form to percentage form;

[0029] (4) Splicing data: the load data and the air temperature data are spliced horizontally according to date.

[0030] Step three, feature engineering processing to obtain historical data

[0031] Since the field about weather in the original data only has air temperature, it needs to be split into maximum temperature and minimum temperature. However, the minimum temperature of S area in winter is mostly between -10 and 0 degrees, in order to avoid the influence of negative numbers on 0-1 standardization, a large value is added, so that the transformed temperature is always positive at any time.

[0032] (1) Splitting air temperature and transformation: the air temperature data after data cleaning is split into maximum temperature and minimum temperature, and is transformed, and the formula is as follows:

[0033] Maximum temperature 1 = maximum temperature + 50

[0034] Minimum temperature 1 = minimum temperature + 50

[0035] (2) 0-1 standardization of features: the load rates of town 1 to town 8, maximum temperature 1 and minimum temperature 1 are 0-1 standardized, and after the air temperature transformation in the last stage, the field minimum temperature 1 does not have negative numbers, which does not affect the standardization result.

[0036] Step four, setting model parameters

[0037] (1) Setting GAT-BILSTM algorithm network

[0038] The graph attention network GAT algorithm is a derivative of the graph neural network GNN algorithm, and belongs to the same series as the GNN and GCN algorithms, and is similar in structure. Setting the GAT-BILSTM algorithm network mainly includes setting the GAT network and setting the BILSTM network two parts.

[0039] First, the graph structure required by the GAT algorithm is constructed, including the nodes and edges of the graph. In the process of constructing the graph nodes, in the embodiment of the application, since there are 8 towns, each town is set as a graph node, and there are 8 graph nodes in total, plus 2 virtual nodes of the highest temperature and the lowest temperature, a total of 10 nodes. Next, the 10 graph nodes are Pearson correlated two by two, and the correlation greater than 0.5 is taken as the edge between the two graph nodes. If the correlation between two nodes is less than 0.5, there is no connecting edge between the two graph nodes. In addition, each node has an attention score for measuring the degree of association between it and its neighbor nodes. These attention scores are obtained through learning and can be dynamically adjusted according to the features between nodes.

[0040] Then, the BILSTM network is set. The features extracted by the graph attention network at different times are input into the bidirectional long short-term memory neural network in a time sequence to learn the time features, ReLU is used as the activation function, batch_size is 30, 14 consecutive days are taken as a history period, and 10 fully connected layers are taken as synchronous output of 10 variables per day, for daily single-step rolling prediction.

[0041] (2) Setting CNN-LSTM algorithm network

[0042] Setting the CNN-LSTM algorithm network mainly includes setting the CNN network and setting the LSTM network two parts.

[0043] In the CNN convolution network setting, one-dimensional convolution Conv1D is used, and the pooling layer is down-sampled with a pooling kernel size of [1, 2], i.e. only down-sampling in the feature dimension, and the sequence window remains unchanged. Before the feature data is input to the LSTM, the channel function needs to be adjusted, the channel information is fused, the channel number is reduced to 1, and then the channel dimension is squeezed out, so as to facilitate subsequent processing in the time sequence layer.

[0044] The network setting of LSTM is similar to the previous BILSTM network setting. The main difference is that LSTM is a unidirectional network, and the parameter "bidirectional" is False, while in BILSTM it is True; secondly, the fully connected layer of LSTM is 1, only 1 variable output. Other network settings are the same as BILSTM. Finally, a fully connected layer is used to output the prediction results.

[0045] Step five, model combination and result analysis

[0046] (1) Combination

[0047] After setting the parameters of the two algorithms, we can start the combination. Since GAT-BILSTM is a multi-objective prediction algorithm, it can predict 8 variables (the highest and lowest temperatures are virtual nodes, ignoring these 2 predicted variables, leaving 8 predicted variables Y1-Y8), while CNN-LSTM is a single-objective prediction algorithm that can only predict 1 variable. If we use CNN-LSTM to predict 8 variables (from Y1 to Y8) in turn and then combine them with the 8 predicted variables of GAT-BILSTM, it will be time-consuming and laborious. If CNN-LSTM is only combined with the part of the 8 predicted variables of GAT-BILSTM that performs poorly, it will save time and effort. The method to determine them is mainly based on the average value.

[0048] First, use GAT-BILSTM to train the historical data and calculate the prediction error of Y1-Y8, then calculate the average error. Second, for a certain Y that is far beyond the average error, combine it with the result of CNN-LSTM, and the main combination method is to use the error reciprocal method for weighting (small error gets high weight, large error gets low weight), and the remaining Y remains unchanged. After combination, the average error of the whole model decreases. More importantly, the standard deviation of the error between each predicted variable (Y1-Y8) also decreases (i.e. the error balance degree improves).

[0049] For example, GAT-BILSTM predicts Y1-Y8 simultaneously, but finds that the errors of Y2 and Y7 are much higher than the average error. Use CNN-LSTM to predict Y2 and Y7 respectively, and then weight Y2 and Y7 of GAT-BILSTM. Due to the randomness of data, calculate the historical average error of CNN-LSTM Y2 and Y7 multiple times, and calculate the historical average error of GAT-BILSTM Y2 and Y7 multiple times. According to their historical average error, use the error reciprocal method for weighted combination. The remaining variables (Y1, Y3-Y6, Y8) are normally output.

[0050] (2) Result analysis

[0051] The data set date is S area 20220101-20230731, the ratio of training set: test set: correction set is 6:2:2, and the actual prediction date is 20230801-20230807 (the August data is not added to the data set in advance, and is added afterwards for the calculation of mape)

[0052] Wherein the mean absolute percentage error mape is represented by W Y , and the calculation formula is:

[0053]

[0054] The calculation formula of the average mape error is:

[0055]

[0056] Take the 100 days before 20230801 as the test set for training, and the calculated historical prediction target results are shown in Table 1 and Figure 2 .

[0057] Table 1 Historical prediction results

[0058]

[0059] It can be seen that the errors of town 2 and town 7 are larger and far exceed the average error. In the final prediction, these two towns need to be combined with CNN-LSTM, and the remaining towns do not need to be combined. The weight is calculated by the inverse error method of the historical average error, which avoids the randomness of the data.

[0060] The final prediction results are shown in Table 2:

[0061] Table 2 Final prediction results (20230801-20230807)

[0062]

[0063] From the above results, it can be seen that the standard deviation of the error of the eight target prediction results of GAT-BILSTM is large, reaching 0.073. After the combination of the present application by introducing CNN-LSTM, firstly, the error standard deviation is reduced to 0.024, and the reduction of the error standard deviation means that the error balance is also improved. Secondly, the average error also decreases, and the average error decreases from 11.6% to 8.4%.

[0064] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any changes or replacements within the technical scope disclosed by the present application, which can be easily thought by any person skilled in the art, should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for improving multi-target error equalization degree by using a GAT-BILSTM&CNN-LSTM model, characterized in that, The method comprises the following steps: Step one, obtaining load data and air temperature data of a target area, the load data comprising date and load rate of the target area, and the air temperature data comprising date and air temperature of the target area; Step two, data cleaning of the load data and the air temperature data obtained in step one; Step three, feature engineering processing of the data after data cleaning in step two to obtain historical data, specifically comprising: (1) splitting and transforming air temperature: splitting the air temperature data after data cleaning into maximum temperature and minimum temperature, and transforming, with the formula as follows: Maximum temperature = maximum temperature + 50 Minimum temperature = minimum temperature + 50 (2) 0-1 standardization of features: 0-1 standardization of the load rate of the target area, the maximum temperature and the minimum temperature; Step four, setting a GAT-BILSTM algorithm network and a CNN-LSTM algorithm network; Step five, model combination: training the historical data using the GAT-BILSTM to calculate the prediction error of each load rate prediction variable of the target area, then calculating the average error, and then combining the load rate prediction variables exceeding the average error with the results of the CNN-LSTM by using the error reciprocal method for weighting, and keeping the remaining load rate prediction variables unchanged to output the results.

2. The method for improving multi-target error equalization degree by using a GAT-BILSTM&CNN-LSTM model according to claim 1, characterized in that: The data cleaning in step two comprises outlier deletion, missing value processing, numerical value processing and data splicing. 3.The method of claim 1, wherein the GAT-BILSTM&CNN-LSTM model is used to improve the multi-target error equalization degree. The setting of the GAT-BILSTM algorithm network in step four comprises: constructing a graph structure required by the GAT algorithm, including nodes and edges of the graph; setting a BILSTM network, inputting the features extracted at different times into the bidirectional long short-term memory neural network in a time sequence manner to learn time features, using ReLU as an activation function, using batch_size as 30, using 14 consecutive days as a history period, using 10 fully connected layers as synchronous output of 10 variables per day, and performing daily single-step rolling prediction.

4. The method for improving multi-target error equalization degree by using a GAT-BILSTM&CNN-LSTM model according to claim 3, characterized in that: The setting of the CNN-LSTM algorithm network in step four comprises setting a CNN network and setting an LSTM network, wherein the setting of the CNN network comprises: using one-dimensional convolution Conv1D, using a pooling layer for downsampling, using a pooling kernel size of [1, 2], adjusting a channel function before inputting the feature data from the CNN to the LSTM, fusing channel information, reducing the channel number to 1, and then squeezing out the channel dimension; the network setting of the LSTM is similar to that of the BILSTM network, with the difference that the LSTM is a unidirectional network, and the parameter "bidirectional" is False, while the BILSTM is True; secondly, the LSTM has only one fully connected layer with only one variable output, and finally outputs the prediction result through one fully connected layer.

5. The method for improving multi-target error equalization degree by using a GAT-BILSTM&CNN-LSTM model according to claim 4, characterized in that: In step five, the combination of the load rate prediction variables exceeding the average error with the results of the CNN-LSTM comprises: predicting the load rate prediction variables exceeding the average error using the CNN-LSTM, and then weighting the load rate prediction variables exceeding the average error predicted by the GAT-BILSTM.

6. The method for improving multi-target error equalization degree by using a GAT-BILSTM&CNN-LSTM model according to claim 1 or 5, characterized in that: The principle of the error reciprocal method is that a small error obtains a high weight and a large error obtains a low weight.

Citation Information

Patent Citations

  • Ultra-short-term wind power combined prediction method and system

    CN113505938A

  • Power load prediction method based on neural network and random forest method

    CN116050605A