New energy output uncertainty scene generation and evaluation method based on generative adversarial network
By generating an adversarial network deep learning architecture, building generators and discriminators, and defining Wasserstein loss function, the problem that traditional methods are difficult to describe high-dimensional nonlinear characteristics of new energy output is solved, and comprehensive modeling and scenarios of uncertainty in new energy output is achieved. Generation improves the stability analysis and control capabilities of the power system.
Patent Information
- Application Number
- CN202411291539.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-09-14
AI Technical Summary
Traditional scenario generation methods are difficult to describe the high-dimensional nonlinear characteristics of new energy output, and cannot comprehensively model the uncertainty of output.
Using a deep learning architecture based on generative adversarial networks, the Wasserstein loss function is defined by building generators and discriminators, and the neural network is trained using Adam optimizer. The generator generates quantitative scenarios, and evaluates scene quality through kernel density estimation and autocorrelation analysis. .
It can fully describe the uncertainty and volatility of new energy output, provide more accurate scenario generation, and improve the stability analysis and control of the power system.
Smart Images

Figure CN119180310A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of renewable energy power systems, and in particular relates to a method for generating and evaluating renewable energy output uncertainty scenarios based on a generative adversarial network. Background Art
[0002] Under the background of "dual carbon goals" and energy transformation, building a new power system with new energy as the main body has become a key goal for the development of my country's power industry. With the continuous increase in the penetration rate of new energy power generation, the inherent properties of its output randomness and volatility seriously affect the stable operation of the power system. How to accurately describe the uncertainty of new energy output is crucial. Scenario generation describes the output characteristics of new energy by generating scenarios that meet the required number. Based on this, calculations and analyses of various problems including power balance, optimal scheduling, and safety and stability verification are performed. This is an effective method to characterize the uncertainty of its output. For the uncertainty scenario of new energy output, it is necessary to consider its random characteristics and conform to its real statistical characteristics. Therefore, how to model the output characteristics of new energy is a key problem in scenario generation.
[0003] Traditional scenario generation usually uses statistical methods to model the uncertainty of renewable energy output. The specific parameters of the model are solved through historical data and combined with Monte Carlo sampling or Latin hypercube sampling to obtain specific output scenarios. Such methods mainly include Markov chain method and time series method. However, traditional statistical models are difficult to describe the high-dimensional nonlinear characteristics of output and difficult to model the uncertainty of output in a more comprehensive way. In recent years, with the development of artificial intelligence technology, generative models using deep learning have been applied in renewable energy scenario generation. Summary of the invention
[0004] In order to solve the problem that the above-mentioned traditional scenario generation method is difficult to describe the high-dimensional nonlinear characteristics of new energy output and cannot model the output uncertainty more comprehensively, the purpose of the present invention is to provide a new energy output uncertainty scenario generation and evaluation method based on a generative adversarial network. Based on the existing new energy historical output data, the present invention establishes a scenario generation model based on the deep learning architecture of a generative adversarial network, couples a variety of neural network mechanisms to build a generator and a discriminator, defines the Wasserstein loss function, uses the training data set to train the neural network multiple times, calculates the gradient information of the loss function, and uses the Adam optimizer to update the parameters. Finally, the generator is fixed and a quantitative scenario is generated. The quality of the generated scenario is compared and evaluated through kernel density estimation and autocorrelation analysis, which can fully describe the uncertainty and volatility of the new energy output.
[0005] In order to achieve the above object, the present invention adopts the following technical scheme:
[0006] The generation and evaluation method of new energy output uncertainty scenarios based on generative adversarial networks includes the following steps:
[0007] Step 1: The existing new energy historical output scenario data is constructed into a training data set through data conversion operations, namely, shuffle and batch operations;
[0008] Step 2: Construct the generator in a linear stacking manner. The generator includes a fully connected layer, a batch normalization layer, an advanced activation function, a fully connected layer, a batch normalization layer, a reshaping layer, a convolutional layer, a batch normalization layer, an advanced activation function, a convolutional layer, and a reshaping layer in sequence.
[0009] Step 3: Construct the discriminator in a linear stacking manner. The discriminator includes a flattening layer, a fully connected layer, a random dropout layer, a batch normalization layer, a high-level activation function, a fully connected layer, a random dropout layer, a batch normalization layer, a high-level activation function, and a fully connected layer in sequence;
[0010] Step 4: Define the Wasserstein loss function of the discriminator and the generator, and define the training process of the established generative adversarial network GAN deep learning architecture: instruct to generate noise that obeys the normal distribution, input the noise into the generator to obtain the generated scene data, call the discriminator to calculate the output value of the training data set and the generated scene data, thereby calculating the loss function of the discriminator and the generator respectively, and calculate the gradient of the discriminator loss function relative to the model parameters in the discriminator and the gradient of the generator loss function relative to the model parameters in the generator in turn, and finally use the Adam optimizer to update the trainable variables in the discriminator and the generator;
[0011] Step 5: Repeat the training N times and save the generator to generate n set New energy output scenarios;
[0012] Step 6: Use kernel density estimation to obtain the probability density distribution of the generated scene data and the training data set and compare and analyze them to verify the generated n set The quality of the new energy output scenario data is considered to be good when the Euclidean distance between the probability density distribution curve of the generated scenario data and the training data set is less than 0.1. set The quality of the data for each new energy output scenario meets the requirements;
[0013] Step 7: Calculate and compare the autocorrelation coefficient curves of the generated scene data and the training data set to further verify the generated n set The quality of the new energy output scenario data is considered to be good when the Euclidean distance between the autocorrelation coefficient curves of the generated scenario data and the training data set with a lag order ranging from 0 to 20 hours is less than 0.4. set The quality of the data for each new energy output scenario meets the requirements.
[0014] The Wasserstein loss function is used as the loss function of the generator and the discriminator to effectively measure the distance between the probability distribution of the generated scene data output by the generator and the probability distribution of the real training data set, providing more stable gradient information. The Wasserstein loss function of the discriminator is Loss D =E[D(G(z))]-E[D(x)](1)
[0015] The Wasserstein loss function of the generator is
[0016] Loss G = -E[D(G(z))] (2)
[0017] Where: E represents expectation; D represents the discriminator; G represents the generator; z represents random noise; G(z) represents the generated scene data; E[D(G(z))] represents the expectation of the discriminator's output for the generated scene data; x is the training data set; D(x) represents the output of the discriminator for the real training data set; E[D(x)] represents the expectation of the discriminator's output for the real training data set.
[0018] The kernel density estimation KDE is used to obtain the probability distribution of the generated scene data and the training data set. The kernel density estimation KDE searches for the best kernel function and the best bandwidth value through the GridSearchCV class object. The calculation of the kernel density estimation is as follows:
[0019]
[0020] Where: f(x) is the probability density function estimated by sample x; n is the number of samples; h is the set bandwidth value; K is the kernel function; x i is the sample point.
[0021] Calculate and compare the autocorrelation coefficient curves of the generated scenario data and the training data set, and analyze the internal correlation of the generated new energy output scenario. The calculation formula is as follows:
[0022]
[0023] Where: ρ(k) represents the autocorrelation coefficient at the lag time interval k; X t represents the output value of new energy at time t; X t-k represents the output value of the renewable energy at time tk; μ and σ 2 are the mean and variance of renewable energy output respectively.
[0024] The method of the present invention constructs the existing new energy historical output scene data as a training data set; secondly, a generator is constructed in a linear stacking manner, and the generator includes a fully connected layer, a batch normalization layer, an advanced activation function, a fully connected layer, a batch normalization layer, a reshaping layer, a convolution layer, a batch normalization layer, an advanced activation function, a convolution layer and a reshaping layer in sequence; a discriminator is constructed in a linear stacking manner, and the discriminator includes a flattening layer, a fully connected layer, a random inactivation layer, a batch normalization layer, an advanced activation function, a fully connected layer, a random inactivation layer, a batch normalization layer, an advanced activation function and a fully connected layer in sequence; then, the Wasserstein loss function of the discriminator and the generator is defined; then, the training process is defined: Let the noise that obeys normal distribution be generated, input the noise into the generator to obtain the generated scene data, call the discriminator to calculate the output value of the training data set and the generated scene data, thereby respectively calculating the loss function of the discriminator and the generator, and successively calculating the gradient of the discriminator loss function relative to the model parameters in the discriminator, and the gradient of the generator loss function relative to the model parameters in the generator, and finally using the Adam optimizer to update the trainable variables in the discriminator and the generator; finally, after repeating the training for N cycles, the generator is saved, and the probability density distribution of the generated scene data and the training data set is obtained by kernel density estimation, and the autocorrelation coefficient curves of the two are calculated and compared to test the quality of the generated new energy output scene data. The method of the present invention builds a scene generation model based on a generative adversarial network, uses the historical output data of new energy for training, and adaptively mines the high-dimensional feature distribution of historical data through a deep learning network to generate a large number of scenes that can fully reflect the uncertainty and volatility of new energy output, which is of great significance for the uncertainty risk assessment of new energy and the stability analysis and control of power systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart for implementing the method of the present invention.
[0026] Figure 2 This is a schematic diagram of the principle of generating adversarial networks.
[0027] Figure 3 is the neural network architecture of the designed generator and discriminator.
[0028] Figure 4 It is the changing curve of the loss function during the training process.
[0029] Figure 5 It is the comparison of probability density distribution between generated scene data and training data set.
[0030] Figure 6 It is the comparison of the autocorrelation curves of the generated scene data and the training data set. DETAILED DESCRIPTION
[0031] The present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0032] like Figure 1 As shown, the method for generating and evaluating new energy output uncertainty scenarios based on a generative adversarial network of the present invention includes the following steps:
[0033] Step 1: The existing new energy historical output scenario data is constructed into a training data set through data conversion operations, namely, shuffle and batch operations;
[0034] Step 2: Construct the generator in a linear stacking manner. The generator includes a fully connected layer, a batch normalization layer, an advanced activation function, a fully connected layer, a batch normalization layer, a reshaping layer, a convolutional layer, a batch normalization layer, an advanced activation function, a convolutional layer, and a reshaping layer in sequence.
[0035] Step 3: Construct the discriminator in a linear stacking manner. The discriminator includes a flattening layer, a fully connected layer, a random dropout layer, a batch normalization layer, a high-level activation function, a fully connected layer, a random dropout layer, a batch normalization layer, a high-level activation function, and a fully connected layer in sequence;
[0036] Step 4: Define the Wasserstein loss function of the discriminator and the generator, and define the training process of the established generative adversarial network GAN deep learning architecture: instruct to generate noise that obeys the normal distribution, input the noise into the generator to obtain the generated scene data, call the discriminator to calculate the output value of the training data set and the generated scene data, thereby calculating the loss function of the discriminator and the generator respectively, and calculate the gradient of the discriminator loss function relative to the model parameters in the discriminator and the gradient of the generator loss function relative to the model parameters in the generator in turn, and finally use the Adam optimizer to update the trainable variables in the discriminator and the generator;
[0037] Step 5: Repeat the training N times and save the generator to generate n set New energy output scenarios;
[0038] Step 6: Use kernel density estimation to obtain the probability density distribution of the generated scene data and the training data set and compare and analyze them to verify the generated n set The quality of the new energy output scenario data is considered to be good when the Euclidean distance between the probability density distribution curve of the generated scenario data and the training data set is less than 0.1. set The quality of the data for each new energy output scenario meets the requirements;
[0039] Step 7: Calculate and compare the autocorrelation coefficient curves of the generated scene data and the training data set to further verify the generated n setThe quality of the new energy output scenario data is considered to be good when the Euclidean distance between the autocorrelation coefficient curves of the generated scenario data and the training data set with a lag order ranging from 0 to 20 hours is less than 0.4. set The quality of the data for each new energy output scenario meets the requirements.
[0040] Example:
[0041] The feasibility of the solution of the present invention is verified and analyzed using the field measurement data of a wind farm provided by the State Grid. The data set includes power generation-related data collected every 15 minutes over two years (2019-2020). The generative adversarial network (GAN) model is built using the deep learning framework TensorFlow, and its principle is shown in the following figure. Figure 2 As shown, the neural network architecture of the designed generator and discriminator is as follows Figure 3 As shown in the figure, the GPU is called for accelerated training. The computer CPU is Intel Core i7 13700kF, and the GPU is NVIDIA RTX 4060.
[0042] The learning rate is set to 0.001, and a batch of 100 is randomly selected from the dataset for each training, and the training number is 5000. The loss function of the generator and the discriminator changes as follows Figure 4 As shown in , as the training progresses, the loss function tends to be stable and the GAN training converges. The probability density function of the generated scene data and the real training data set is obtained by using the kernel density estimation method as shown in Figure 5 As shown in the figure, the horizontal axis is the wind turbine output power and the vertical axis is the probability density. The autocorrelation curves of the generated data and the real data are shown in the figure Figure 6 As shown, the horizontal axis is the lag time interval and the vertical axis is the autocorrelation coefficient. Figure 5 and 6 The generated data curve and the real data curve are basically consistent, which shows that the generated scenario fully conforms to the real new energy output distribution and can describe the uncertainty and volatility characteristics of its output.
Claims
1. A method for generating and evaluating scenarios of uncertain new energy output based on generative adversarial networks, characterized by: The following steps are involved: Step 1: The existing new energy historical output scenario data is constructed into a training data set through data conversion operations, namely, shuffle and batch operations; Step 2: Construct the generator in a linear stacking manner. The generator includes a fully connected layer, a batch normalization layer, an advanced activation function, a fully connected layer, a batch normalization layer, a reshaping layer, a convolutional layer, a batch normalization layer, an advanced activation function, a convolutional layer, and a reshaping layer in sequence. Step 3: Construct the discriminator in a linear stacking manner. The discriminator includes a flattening layer, a fully connected layer, a random dropout layer, a batch normalization layer, a high-level activation function, a fully connected layer, a random dropout layer, a batch normalization layer, a high-level activation function, and a fully connected layer in sequence; Step 4: Define the Wasserstein loss function of the discriminator and the generator, and define the training process of the established generative adversarial network GAN deep learning architecture: instruct to generate noise that obeys the normal distribution, input the noise into the generator to obtain the generated scene data, call the discriminator to calculate the output value of the training data set and the generated scene data, thereby calculating the loss function of the discriminator and the generator respectively, and calculate the gradient of the discriminator loss function relative to the model parameters in the discriminator and the gradient of the generator loss function relative to the model parameters in the generator in turn, and finally use the Adam optimizer to update the trainable variables in the discriminator and the generator; Step 5: Repeat the training N times and save the generator to generate n set New energy output scenarios; Step 6: Use kernel density estimation to obtain the probability density distribution of the generated scene data and the training data set and compare and analyze them to verify the generated n set The quality of the new energy output scenario data is considered to be good when the Euclidean distance between the probability density distribution curve of the generated scenario data and the training data set is less than 0.
1. set The quality of the data for each new energy output scenario meets the requirements; Step 7: Calculate and compare the autocorrelation coefficient curves of the generated scene data and the training data set to further verify the generated n set The quality of the new energy output scenario data is considered to be good when the Euclidean distance between the autocorrelation coefficient curves of the generated scenario data and the training data set with a lag order ranging from 0 to 20 hours is less than 0.
4. set The quality of the data for each new energy output scenario meets the requirements.
2. The method for generating and evaluating new energy output uncertainty scenarios based on a generative adversarial network as claimed in claim 1, characterized in that: Step 4 defines the Wasserstein loss function as the loss function of the generator and the discriminator, which effectively measures the distance between the probability distribution of the generated scene data output by the generator and the probability distribution of the real training data set, and provides more stable gradient information. The Wasserstein loss function of the discriminator is Loss D =E[D(G(z))]-E[D(x)] (1) The Wasserstein loss function of the generator is Loss G =-E[D(G(z))] (2) Where: E represents expectation; D represents the discriminator; G represents the generator; z represents random noise; G(z) represents the generated scene data; E[D(G(z))] represents the expectation of the discriminator's output for the generated scene data; x is the training data set; D(x) represents the output of the discriminator for the real training data set; E[D(x)] represents the expectation of the discriminator's output for the real training data set.
3. The method for generating and evaluating new energy output uncertainty scenarios based on a generative adversarial network as claimed in claim 1, characterized in that: Step 6 uses kernel density estimation KDE to obtain the probability distribution of the generated scene data and training data set. KDE searches for the best kernel function and the best bandwidth value through the GridSearchCV class object. The calculation of kernel density estimation is as follows: Where: f(x) is the probability density function estimated by sample x; n is the number of samples; h is the set bandwidth value; K is the kernel function; x i is the sample point.
4. The method for generating and evaluating new energy output uncertainty scenarios based on a generative adversarial network as claimed in claim 1, characterized in that: Step 7 Calculate and compare the autocorrelation coefficient curves of the generated scenario data and the training data set, and analyze the internal correlation of the generated new energy output scenario. The calculation formula is as follows Where: ρ(k) represents the autocorrelation coefficient at the lag time interval k; X t represents the output value of new energy at time t; X t-k represents the output value of the renewable energy at time tk; μ and σ 2 are the mean and variance of renewable energy output respectively.
Citation Information
Patent Citations
New energy output scene generation method based on deep learning and data driving
CN112232488A
Renewable energy power generation scene generation method based on conditional generative adversarial network
CN117852419A
Machine learning method and system for restoring contaminated regions of image through unsupervised learning based on generative adversarial network
KR102288645B1
Progressive modification of generative adversarial neural networks
US20190130278A1
System and methods for iterative synthetic data generation and refinement of machine learning models
US20210049455A1
Cited By
Power system renewable energy scene generation method based on quantum generative adversarial network
CN120542247A
