A missing value filling method for power system based on Bi-GAN
Through the game between the Bi-GAN network generator and the discriminator and the two-way learning of the encoder, the problem of data loss in the power system is solved, higher reconstruction accuracy and resource efficiency are achieved, and the degradation of data quality and timing in traditional methods are solved. The problem of insufficient information utilization.
Patent Information
- Application Number
- CN202210555802.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-08-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Data loss in existing power systems due to equipment failure, insufficient coverage of acquisition equipment, or operator errors leads to a decline in data quality and affects the accuracy of power consumption prediction, and traditional methods fail to effectively utilize timing information.
Using the power system missing value filling method based on Bi-GAN, the generator G, the discriminator D, and the encoder E are generated through a two-way adversarial adversarial network, and the game between the generator and the discriminator is used to generate a complete data set that obeys the distribution of the original data set. And perform data filling through loss function and filling loss function, and use Wasserstein distance to optimize the training process to improve stability.
It achieves higher reconstruction accuracy, reduces the dependence on a large amount of complete historical data and the use of computing resources, and improves the efficiency and accuracy of data filling.
Smart Images

Figure CN114860709B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent power systems, and specifically to a method for filling missing values in a power system based on Bi-GAN. Background Art
[0002] With the construction of intelligent power systems, the exploding amount of data has brought new challenges. Improper measurement sampling, information transmission and data storage will lead to data loss, thereby destroying data integrity, reducing data quality and affecting the accuracy of power consumption prediction.
[0003] At present, the methods for filling missing values in power systems at home and abroad are mainly divided into direct deletion method, data filling method based on statistical analysis, and data filling method based on machine learning. The direct deletion method mainly deletes missing data to make the data complete. When the number of missing samples is relatively large, it is not conducive to mining the implicit development law of power consumption forecasting. The data filling method based on statistical analysis fills the missing values according to the statistical information of the original data, mainly including average filling, hot card filling, cold card filling, special value filling, regression and other methods. This type of filling method lacks consideration of the independent characteristics of each sample. The data filling method based on machine learning uses machine learning algorithms including K-Nearest Neighbor (KNN), Autoencoder (AE), etc. Although these methods have high accuracy, they do not consider the time series information between two adjacent data.
[0004] The present invention provides a method for filling missing values in a power system based on Bi-GAN, which will improve the problem of reduced data quality caused by loss of collected data in the power system due to equipment failure, insufficient coverage of acquisition equipment or operator errors. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides a method for filling missing values in an electric power system based on Bi-GAN, which solves the problem of reduced data quality caused by loss of collected data in the electric power system due to equipment failure, insufficient coverage of collection equipment or operator errors proposed in the above background technology.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a method for filling missing values in a power system based on Bi-GAN, comprising the following steps:
[0007] Step 1: Collect power data containing missing values, first perform normalization preprocessing and special value processing on the data, and construct a missing position encoding vector;
[0008] Step 2: Bi-GAN is a generative model that can generate new samples that obey the distribution of the original data set. It consists of a generator G, a discriminator D, and an encoder E. When the preprocessed data is passed into the Bi-GAN network, through the game between the generator G and the discriminator D, a complete data set with the same distribution as the original data set is finally generated;
[0009] Step 3: Use the loss function to reduce the difference between the newly generated sample G(E(x)) and the original data x;
[0010] Step 4: Use the filling loss function to fill in the missing data in the power system.
[0011] Preferably, in step 1, power data containing missing values are obtained from the power system, normalized so that the data is between 0 and 1, the null values in the data are replaced with the special symbol NULL, discrete numerical variables are encoded using one hot encoding, and a missing value position encoding vector is constructed.
[0012] Preferably, in step 2, through the game between the generator and the discriminator Where V(D,E,G) is calculated by the following formula:
[0013]
[0014] Where G is the generator, D is the discriminator, E is the encoder, x represents the real sample in the power system containing missing values, z is the random sampling of the prior distribution, G(z) represents the sample generated by z, y is the data source, if the data to be discriminated comes from the real sample x, then y=1; if it comes from the produced sample G(z), then y=0, Bi-GAN binds the original data x with other extracted features E(x), and the generated sample G(z) with its prior distribution sample z, and then marks the two pairs as 1 and 0;
[0015] Training the discriminator in the BI-WAN network: Map the power data X with missing values to E(x) through the encoder, and map the arbitrary noise z sampled from any distribution to G(z) through the generator. Then send the synthesized data (G(z), z) and (x, E(x)) to the discriminator for learning. Optimize the generator and encoder through back propagation. Train the generator and encoder in the BI-WAN network at the same time: input the training data into the encoder and output the hidden variables; input the hidden variables into the generator and output the feature representation of the real space. Reconstruct the training data to obtain the newly generated samples G(E(x)) to form two-way learning.
[0016] During the training process, the encoder E and the generator G are trained simultaneously, so that while the generator G is trained to realize the mapping from the encoding to the latent space, the encoder E also realizes the inverse mapping from the data space to the latent space, so that the reconstruction error can be calculated quickly and accurately.
[0017] Preferably, in step 3, in order to make the joint distribution of the generator close to the joint distribution of the encoder, the KL divergence is used in the Bi-GAN network to measure the difference between the two distributions. As long as the KL divergence converges to the minimum, BI-GAN reaches the optimal solution. However, KL divergence may cause gradient explosion in some cases. To solve this problem, Wasserstein distance is used in this patent to optimize the optimization target in the original GAN and enhance the stability during the training process. The mathematical definition of Wasserstein distance is as follows:
[0018]
[0019] Among them, ∏(p r ,p g ) is p r and p g is the set of all possible joint probability distributions γ of marginal distributions, E (x,y)~γ [||xy||] is the expected value of the joint distribution γ(x,y), W(p r ,p g ) means to convert p r Move to p g The minimum distance x needs to be moved to, Wasserstein uses gradient descent to optimize the parameter model.
[0020] Preferably, in step 4, since data normalization is used when predicting and processing data, the final filling result should be restored according to the maximum and minimum values of the recorded attributes when filling. If the data prediction to be filled is a classification problem, the cross entropy is used as the loss function; for the normalization problem, the L2 norm is used as the loss function.
[0021] The present invention provides a method for filling missing values in a power system based on Bi-GAN, which has the following beneficial effects:
[0022] The Bi-GAN-based power system missing value filling method reconstructs complete data by utilizing a bidirectional generative adversarial network. Compared with the traditional missing value filling algorithm, the invention has better reconstruction accuracy and does not require a large amount of complete historical data. It can greatly reduce the data resources and computing power resources occupied during use. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1It is a flow chart of a missing value filling method for power system based on Bi-GAN;
[0024] Figure 2 This is the structural diagram of the Bi-GAN model. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0026] See also Figure 1 to Figure 2 The present invention provides a technical solution: a method for filling missing values in a power system based on Bi-GAN, characterized in that it comprises the following steps:
[0027] Step 1: Collect power data containing missing values, first perform normalization preprocessing and special value processing on the data, and construct a missing position encoding vector;
[0028] Electricity data containing missing values are obtained from the power system. After normalization, the data are between 0 and 1. The empty values in the data are replaced with the special symbol NULL. Discrete numerical variables are encoded using one hot encoding to construct the missing value position encoding vector.
[0029] Step 2: Bi-GAN is a generative model that can generate new samples that obey the distribution of the original data set. It consists of a generator G, a discriminator D, and an encoder E. When the preprocessed data is passed into the Bi-GAN network, through the game between the generator G and the discriminator D, a complete data set with the same distribution as the original data set is finally generated;
[0030] Through the game between the generator and the discriminator Where V(D,E,G) is calculated by the following formula:
[0031]
[0032] Where G is the generator, D is the discriminator, E is the encoder, x represents the real sample in the power system containing missing values, z is the random sampling of the prior distribution, G(z) represents the sample generated by z, y is the data source, if the data to be discriminated comes from the real sample x, then y=1; if it comes from the produced sample G(z), then y=0, Bi-GAN binds the original data x with other extracted features E(x), and the generated sample G(z) with its prior distribution sample z, and then marks the two pairs as 1 and 0;
[0033] Training the discriminator in the BI-WAN network: Map the power data X with missing values to E(x) through the encoder, and map the arbitrary noise z sampled from any distribution to G(z) through the generator. Then send the synthesized data (G(z), z) and (x, E(x)) to the discriminator for learning. Optimize the generator and encoder through back propagation. Train the generator and encoder in the BI-WAN network at the same time: input the training data into the encoder and output the hidden variables; input the hidden variables into the generator and output the feature representation of the real space. Reconstruct the training data to obtain the newly generated samples G(E(x)) to form two-way learning.
[0034] During the training process, the encoder E and the generator G are trained simultaneously, so that while the generator G is trained to realize the mapping from the encoding to the latent space, the encoder E also realizes the inverse mapping from the data space to the latent space, so that the reconstruction error can be calculated quickly and accurately.
[0035] Step 3: Use the loss function to reduce the difference between the newly generated sample G(E(x)) and the original data x;
[0036] In order to make the joint distribution of the generator close to the joint distribution of the encoder, the KL divergence is used in the Bi-GAN network to measure the difference between the two distributions. As long as the KL divergence converges to the minimum, BI-GAN reaches the optimal solution. However, KL divergence may cause gradient explosion in some cases. To solve this problem, this patent uses Wasserstein distance to optimize the optimization target in the original GAN and enhance the stability during training. The mathematical definition of Wasserstein distance is as follows:
[0037]
[0038] Among them, ∏(p r ,p g ) is p r and p g is the set of all possible joint probability distributions γ of marginal distributions, E (x,y)~γ [||xy||] is the expected value of the joint distribution γ(x,y), W(p r ,p g ) means to convert p r Move to p g The minimum distance x needs to be moved to, Wasserstein uses gradient descent to optimize the parameter model.
[0039] Step 4: Use the filling loss function to fill in the missing data in the power system;
[0040] Since data normalization is used when predicting data, the final filling result must be restored based on the maximum and minimum values of the recorded attributes when filling. If the data prediction to be filled is a classification problem, cross entropy is used as the loss function; for normalization problems, L2 norm is used as the loss function.
[0041] In summary, the missing value filling method of the power system based on Bi-GAN is used.
[0042] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for filling missing values in a power system based on Bi-GAN, characterized by: The following steps are involved: Step 1: Collect power data containing missing values, first perform normalization preprocessing and special value processing on the data, and construct a missing position encoding vector; Step 2: Bi-GAN is a generative model that can generate new samples that obey the distribution of the original data set. It consists of a generator G, a discriminator D, and an encoder E. When the preprocessed data is passed into the Bi-GAN network, through the game between the generator G and the discriminator D, a complete data set with the same distribution as the original data set is finally generated; Step 3: Use the loss function to reduce the difference between the newly generated sample G(E(x)) and the original data x; Step 4: Use the filling loss function to fill in the missing data in the power system; In step 2, the game between the generator and the discriminator Where V(D,E,G) is calculated by the following formula: Where G is the generator, D is the discriminator, E is the encoder, x represents the real sample in the power system containing missing values, z is the random sampling of the prior distribution, G(z) represents the sample generated by z, y is the data source, pE(·|x) represents the latent space vector generated by the real data x input to the encoder, pG(·|z) represents the distribution of the generated data vector obtained by the noise z input to the generator, if the data to be discriminated comes from the real sample x, then y=1; if it comes from the produced sample G(z), then y=0, Bi-GAN binds the original data x to other extracted features E(x), and the generated sample G(z) to its prior distribution sample z, and then marks the two pairs as 1 and 0; Training the discriminator in the BI-WAN network: Map the power data X with missing values to E(x) through the encoder, and map the arbitrary noise z sampled from any distribution to G(z) through the generator. Then send the synthesized data (G(z), z) and (x, E(x)) to the discriminator for learning. Optimize the generator and encoder through back propagation. Train the generator and encoder in the BI-WAN network at the same time: input the training data into the encoder and output the hidden variables; input the hidden variables into the generator and output the feature representation of the real space. Reconstruct the training data to obtain the newly generated samples G(E(x)) to form two-way learning. During the training process, the encoder E and the generator G are trained simultaneously, so that while the generator G is trained to realize the mapping from the encoding to the latent space, the encoder E also realizes the inverse mapping from the data space to the latent space, so that the reconstruction error can be calculated quickly and accurately; In step 3, in order to make the joint distribution of the generator close to the joint distribution of the encoder, the KL divergence is used in the Bi-GAN network to measure the difference between the two distributions. As long as the KL divergence converges to the minimum, BI-GAN reaches the optimal solution. The Wasserstein distance is used to optimize the optimization target in the original GAN to enhance the stability of the training process. The mathematical definition of the Wasserstein distance is as follows: Among them, ∏(p r ,p g ) is p r and p g is the set of all possible joint probability distributions γ of marginal distributions, E (x,y)~γ [||xy||] is the expected value of the joint distribution γ(x,y), W(p r ,p g ) means to convert p r Move to p g The minimum distance x needs to be moved to, Wasserstein uses gradient descent to optimize the parameter model.
2. The method for filling missing values in a power system based on Bi-GAN according to claim 1, characterized in that: In step 1, power data containing missing values are obtained from the power system, and the data are normalized so that the data is between 0 and 1. The null values in the data are replaced with the special symbol NULL, and discrete numerical variables are encoded using one hot encoding to construct a missing value position encoding vector.
3. The method for filling missing values in a power system based on Bi-GAN according to claim 1, characterized in that: In step 4, since data normalization is used when predicting and processing data, the final filling result should be restored according to the maximum and minimum values of the recorded attributes when filling. If the data prediction to be filled is a classification problem, cross entropy is used as the loss function; The normalization problem uses the L2 norm as the loss function.
