Energy system sample generation method based on adversarial-diffusion hybrid model
Through the adversarial-diffusion hybrid model, combining the advantages of GAN and diffusion model, high-quality and uniformly distributed energy system samples are generated, which solves the problem of uneven operating sample space and improves the modeling and prediction capabilities of the energy system.
Patent Information
- Application Number
- CN202411063316.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-08
AI Technical Summary
There is a problem of uneven sample space in modern energy systems, which makes it difficult for sample generation methods to generate high-quality and uniformly distributed samples, limiting its application in energy systems.
Using the energy system sample generation method based on the adversarial-diffusion hybrid model, combined with the advantages of GAN and diffusion model, data preprocessing and diffusion processing are carried out by constructing a working condition library and a feature library, and an adversarial generation network model and predicting noise neural network are constructed. Generate high-quality and evenly distributed samples.
It has achieved the generation of high-quality and evenly distributed operating conditions samples, especially scarce extreme operating conditions samples, which has significantly improved the accuracy and intelligence level of modeling, prediction and optimization of energy systems.
Smart Images

Figure CN118916697A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to data analysis and system decision-making problems, and mainly to an energy system sample generation method based on a countermeasure-diffusion hybrid model. Background Art
[0002] In modern energy systems, data is the basis for decision-making and problem diagnosis, which directly affects the accuracy and reliability of modeling, prediction and optimization. However, most current energy systems have the problem of unbalanced working condition sample space, that is, the lack of extreme working condition samples. The sample generation method balances the working condition sample space by generating corresponding working condition samples. High-quality sample generation can effectively reflect the complex dynamic characteristics of the energy system and support subsequent data-driven decision-making. However, the current sample generation method has some significant shortcomings, which limits its application in energy systems.
[0003] In recent years, Generative Adversarial Networks (GAN) and Diffusion Models (DDPM) as advanced generative models have demonstrated strong sample generation capabilities. GAN can generate high-quality samples through adversarial training of the generator and the discriminator, but its training process is prone to mode collapse and instability. Diffusion models generate data by gradually adding noise and de-noising, with high generation quality and stability, but relatively low generation efficiency.
[0004] In view of the shortcomings of existing technologies and the urgent need for high-quality sample generation in energy systems, a new energy system sample generation method is urgently needed. Summary of the invention
[0005] In order to solve the problem of uneven spatial distribution of operating condition samples in energy systems, the present invention provides a method for generating energy system samples based on an adversarial-diffusion hybrid model. This method combines the advantages of GAN and diffusion models, and can not only generate high-quality and evenly distributed samples, but also effectively capture complex patterns and nonlinear characteristics in energy system data. This innovative method provides more reliable and accurate data support for the modeling, prediction, and optimization of energy systems, and is expected to significantly improve the level of intelligence in energy management and scheduling. This method can generate accurate energy system condition samples based on the existing condition sample association characteristics, thereby expanding the energy system operating condition sample library and improving the energy system operation, scheduling, and prediction process's ability to cope with extreme conditions.
[0006] The present invention is implemented by the following technical solutions:
[0007] A method for generating energy system samples based on an adversarial-diffusion hybrid model, wherein the method for obtaining the adversarial-diffusion hybrid model comprises the following steps:
[0008] Step S1: Construct an energy system operating condition library and a feature library related to the energy system operating conditions. Specifically:
[0009] S11 Construction of the operating condition library: Collect and organize the historical operation data of the energy system, extract key operating condition parameters, and build the operating condition library. The samples in the operating condition library can be expressed as a matrix X, which is in the form of formula (1):
[0010] X=[x1,x2,x3,…,x i ] (1)
[0011] Among them, x i Represents the i-th time series vector in sample X. Taking the boiler system as an example, x1, x2, and x3 can represent the primary air volume, secondary air volume, and furnace temperature, respectively.
[0012] S12 Construction of feature library: Find features related to sample X and construct a feature library. The feature library can be represented as a matrix F, which is in the form of formula (2):
[0013] F=[f1,f2,f3,…,f j ] (2)
[0014] Among them, f j Represents the jth time series vector of F in the feature matrix. Taking the boiler system as an example, f1, f2, and f3 can represent the fuel type, furnace structure, and air volume, respectively.
[0015] S13 Data preprocessing: Preprocess the data in the sample matrix and feature matrix, including missing value filling, data standardization, and outlier detection. The preprocessed sample matrix X' and feature matrix F' are expressed as formulas (3)-(4) respectively.
[0016] X`=[x`1,x`2,x`3,…,x` i ] (3)
[0017] F`=[f`1,f`2,f`3,…,f` j ] (4)
[0018] Its form is the same as the original matrix, but the values have been processed for use in subsequent modeling.
[0019] Step S2: Perform diffusion processing on the samples in the energy system operating condition library constructed in step S1. This step aims to gradually add noise data to the samples so that the samples will eventually approach Gaussian noise, so that the noise addition process can be restored from the random noise data to generate the corresponding samples. Specifically:
[0020] The preprocessed sample X is subjected to diffusion processing. The core of constructing diffusion processing is to gradually add noise to obtain sample distribution under different noise levels.
[0021] S21 constructs a noise matrix N, which is in the form of formula (5).
[0022] N=[n1,n2,n3,…,n i ] (5)
[0023] Among them, n i Represented in the sample matrix X`x` i The corresponding noise data.
[0024] S22 Noise addition: By adding the noise matrix N to the preprocessed sample matrix X', the noisy sample matrix X'' is obtained. The calculation process can be expressed as formula (6).
[0025] X``=X`+αN (6)
[0026] Among them, α represents the noise intensity coefficient, which is equivalent to controlling the strength of each noise addition process.
[0027] S23 diffusion process: Through multiple iterations of the diffusion process, the noise level is gradually increased, and the sample matrix after each iteration can be expressed as formula (7).
[0028] X`` t =X`` t-1 +α t N (7)
[0029] Among them, t represents the number of iterations, which can usually be selected based on experience; α t It represents the noise intensity coefficient of the t-th iteration, which is usually selected using the cosine curve.
[0030] S24 diffusion result: After completing multiple iterations, the final diffusion sample matrix X is obtained. T The diffused intermediate process sample library I is used to construct the training material of GAN, and the process sample library I is shown in formula (8).
[0031] I=[X``1,X``2,X``3,…,X`` t ,…,X`` T ] (8)
[0032] Step S3 constructs a generative adversarial network model for feature extraction, and uses the results of steps S1 and S2 as training data sets to train the generative adversarial network model. This step aims to construct a generative adversarial network that takes the feature matrix F' mentioned in step S13 as input and the process sample library I mentioned in step S24 as the target to output samples I' with feature information. At the same time, since the feature matrix F' is used as input, the generated samples I' contain the features of the feature matrix F'. Specifically:
[0033] S31 builds a generative adversarial network model: The generative adversarial network model is mainly composed of a generator (G) and a discriminator (D). The generator is responsible for extracting useful information from the input and establishing a mapping relationship between the input and the target feature G(z), where z is the external condition of the input. The discriminator is trained to judge the authenticity of the input target feature with a label and provides a score D(G(z)) or D(x) between 0 and 1 to measure the authenticity, where x is the true target feature. The loss function of the generative adversarial network model can be expressed as Equation (9)-Equation (10)
[0034] L(G)=E x~I(x) [1-D(x)] (9)
[0035]
[0036] Among them, L(G) and L(D) are the generator loss and discriminator loss respectively; E x~I(x) [1-D(x)] represents the mathematical expectation of the random variable [1-D(x)], where x follows the I(x) distribution; D(x) and G(z) represent the output of the discriminator and the output of the generator, respectively. z (z) represents the mathematical distribution of random Gaussian noise.
[0037] S32 trains the generative adversarial network model: the constructed generative adversarial network is trained by the gradient descent algorithm; the generator takes the feature matrix F` as input and outputs samples I` with feature information with the process sample library I as the target; the discriminator takes the samples I` with feature information output by the generator and the process sample library I as input, and outputs the authenticity judgment of the process sample library I.
[0038] By inputting the feature matrix F' into the generator, a sample I' with feature information is generated, which can be expressed as formula (11).
[0039] I`=G(F`) (11)
[0040] Step S4: Construct a neural network for predicting noise, and train the neural network for predicting noise using random Gaussian noise as a training data set. The neural network for predicting noise is used to predict the noise data added during the diffusion process so as to reconstruct the working condition sample from any random noise. The neural network predicts the noise data added at each step in the diffusion process and reconstructs the sample from the random Gaussian noise. The input of the neural network for predicting noise is the sample X`` in the diffusion process t , the output is based on the sample X`` t The reconstructed samples obtained. Specifically:
[0041] The loss function of the neural network for predicting noise is expressed as follows:
[0042] L(θ)=E[||∈-∈ θ (X`` t ,t)|| 2 ] (12)
[0043] Where L(θ) represents the prediction noise loss, E[||∈-∈ θ (X`` t ,t)|| 2 ] represents the pair ||∈-∈ θ (X`` t ,t)|| 2 Calculate the expectation, ∈ θ represents the neural network for predicting noise, ∈ represents the noise data, and t represents the tth iteration;
[0044] The neural network for predicting noise is used to generate reconstructed samples. The calculation process is shown in the following formula:
[0045]
[0046] Among them, X``` t Represents the initial reconstruction sample, which is random noise; X``` t-1 represents the reconstructed sample obtained at the t-1th iteration.
[0047] Furthermore, the energy system samples are generated by using the counter-diffusion hybrid model, and the specific steps are as follows:
[0048] The trained adversarial generative network model is used to generate samples I` with feature information, and the trained neural network for predicting noise is used to generate reconstructed samples X```1. The weighted average of the two is used to generate samples. The specific calculation formula is shown in the following formula:
[0049] i``=βI`+(1-β)X```1 (14)
[0050] Among them, i`` represents the final sample obtained, and β is the weighted weight, which is usually selected according to experience.
[0051] The beneficial effects of the present invention are:
[0052] The present invention provides a method for generating energy system samples based on an adversarial-diffusion hybrid model. By deeply integrating the GAN and DDPM networks with the model structure, the advantages of the two models are effectively integrated to obtain an adversarial-diffusion hybrid model that takes into account accuracy, robustness, and effectiveness. This model can generate high-quality, evenly distributed operating condition samples, especially scarce extreme operating condition samples, thereby balancing the sample space and providing data support for energy system operation, scheduling, and prediction. The method of the present invention provides more reliable and accurate data support for the modeling, prediction, and optimization of energy systems, and is expected to significantly improve the level of intelligence in energy management and scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 Shown is a flow chart of the present invention.
[0054] Figure 2 The figure shows the structure of the counter-diffusion hybrid model proposed by the present invention. DETAILED DESCRIPTION
[0055] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0056] The present invention provides a method for generating energy system samples based on a counter-diffusion hybrid model, wherein the method for obtaining the counter-diffusion hybrid model (such as Figure 1 ), specifically including the following steps:
[0057] Step S1: Construct an energy system operating condition library and a feature library related to the energy system operating conditions. Specifically:
[0058] S11 Construction of the operating condition library: Collect and organize the historical operation data of the energy system, extract key operating condition parameters, and build the operating condition library. The samples in the operating condition library can be expressed as a matrix X, which is in the form of formula (1):
[0059] X=[x1,x2,x3,…,x i ] (1)
[0060] Among them, x i Represents the i-th time series vector in sample X. Taking the boiler system as an example, x1, x2, and x3 can represent the primary air volume, secondary air volume, and furnace temperature, respectively.
[0061] S12 Construction of feature library: Find features related to sample X and construct a feature library. The feature library can be represented as a matrix F, which is in the form of formula (2):
[0062] F=[f1,f2,f3,…,f j ] (2)
[0063] Among them, f j Represents the jth time series vector of F in the feature matrix. Taking the boiler system as an example, f1, f2, and f3 can represent the fuel type, furnace structure, and air volume, respectively.
[0064] S13 Data preprocessing: Preprocess the data in the sample matrix and feature matrix, including missing value filling, data standardization, and outlier detection. The preprocessed sample matrix X' and feature matrix F' are expressed as formulas (3)-(4) respectively.
[0065] X`=[x`1,x`2,x`3,…,x` i ] (3)
[0066] F`=[f`1,f`2,f`3,…,f` j ] (4)
[0067] Its form is the same as the original matrix, but the values have been processed for use in subsequent modeling.
[0068] Step S2: Perform diffusion processing on the real working condition library samples constructed in step S1. This step aims to gradually add noise data to the samples so that the samples will eventually approach Gaussian noise, so as to restore the noise addition process from the random noise data and generate the corresponding samples. Specifically:
[0069] S21 constructs a noise matrix N, which is in the form of formula (5).
[0070] N=[n1,n2,n3,…,n i ] (5)
[0071] Among them, n i Represented in the sample matrix X`x` i The corresponding noise data.
[0072] S22 Noise addition: By adding the noise matrix N to the preprocessed sample matrix X', the noisy sample matrix X'' is obtained. The calculation process can be expressed as formula (6).
[0073] X``=X`+αN (6)
[0074] Among them, α represents the noise intensity coefficient, which is equivalent to controlling the strength of each noise addition process.
[0075] S23 diffusion process: Through multiple iterations of the diffusion process, the noise level is gradually increased, and the sample matrix after each iteration can be expressed as formula (7).
[0076] X`` t =X`` t-1 +α t N (7)
[0077] Among them, t represents the number of iterations, which can usually be selected based on experience; α t It represents the noise intensity coefficient of the t-th iteration, which is usually selected using the cosine curve.
[0078] S24 diffusion result: After completing multiple iterations, the final diffusion sample matrix X is obtained. T The diffused intermediate process sample library I is used to construct the training material of GAN, and the process sample library I is shown in formula (8).
[0079] I=[X``1,X``2,X``3,…,X`` t ,…,X`` T ] (8)
[0080] Step S3 constructs a generative adversarial network model for feature extraction, and uses the results of steps S1 and S2 as training data sets to train the generative adversarial network model. This step aims to construct a generative adversarial network that takes the feature matrix F' mentioned in step S13 as input and the process sample library I mentioned in step S24 as the target to output samples I' with feature information. At the same time, since the feature matrix F' is used as input, the generated samples I' contain the features of the feature matrix F'. Specifically:
[0081] S31 builds a generative adversarial network model: The generative adversarial network model is mainly composed of a generator (G) and a discriminator (D). The generator is responsible for extracting useful information from the input and establishing a mapping relationship between the input and the target feature G(z), where z is the external condition of the input. The discriminator is trained to judge the authenticity of the input target feature with a label and provides a score D(G(z)) or D(x) between 0 and 1 to measure the authenticity, where x is the true target feature. The loss function of the generative adversarial network model can be expressed as Equation (9)-Equation (10)
[0082] L(G)=E x~I(x) [1-D(x)] (9)
[0083]
[0084] Among them, L(G) and L(D) are the generator loss and discriminator loss respectively; E x~I(x) [1-D(x)] represents the mathematical expectation of the random variable [1-D(x)], where x follows the I(x) distribution; D(x) and G(z) represent the output of the discriminator and the output of the generator, respectively.z (z) represents the mathematical distribution of random Gaussian noise.
[0085] S32 trains the generative adversarial network model: the constructed generative adversarial network is trained by the gradient descent algorithm; the generator takes the feature matrix F` as input and outputs samples I` with feature information with the process sample library I as the target; the discriminator takes the samples I` with feature information output by the generator and the process sample library I as input, and outputs the authenticity judgment of the process sample library I.
[0086] Generate process samples with features: By inputting the feature matrix F' into the generator, samples I' with feature information are generated, which can be expressed as formula (11).
[0087] I`=G(F`) (11)
[0088] Step S4: Construct a neural network for predicting noise, and train the neural network for predicting noise using random Gaussian noise as a training data set. The neural network for predicting noise is used to predict the noise data added during the diffusion process so as to reconstruct the working condition sample from any random noise. The neural network predicts the noise data added at each step in the diffusion process and reconstructs the sample from the random Gaussian noise. The input of the neural network for predicting noise is the sample X`` in the diffusion process t , the output is based on the sample X`` t The reconstructed samples obtained. Specifically:
[0089] The loss function of the neural network for predicting noise is expressed as follows:
[0090] L(θ)=E[||∈-∈ θ (X`` t ,t)|| 2 ] (12)
[0091] Where L(θ) represents the prediction noise loss, E[||∈-∈ θ (X`` t ,t)|| 2 ] represents the pair ||∈-∈ θ (X`` t ,t)|| 2 Calculate the expectation, ∈ θ represents the neural network for predicting noise, ∈ represents the noise data, and t represents the tth iteration;
[0092] The neural network for predicting noise is used to generate reconstructed samples. The calculation process is shown in the following formula:
[0093]
[0094] Among them, X``` tRepresents the initial reconstruction sample, which is random noise; X``` t-1 represents the reconstructed sample obtained at the t-1th iteration.
[0095] like Figure 2 As shown, the energy system sample is generated by using the counter-diffusion hybrid model of the present invention, and the specific steps are:
[0096] The trained adversarial generative network model is used to generate samples I` with feature information, and the trained neural network for predicting noise is used to generate reconstructed samples X```1. The weighted average of the two is used to generate samples. The specific calculation formula is shown in the following formula:
[0097] i``=βI`+(1-β)X```1 (14)
[0098] Among them, i`` represents the final sample obtained, and β is the weighted weight, which is usually selected according to experience.
Claims
1. A method for generating energy system samples based on a counter-diffusion hybrid model, characterized in that: The method for obtaining the adversarial-diffusion hybrid model comprises the following steps: Step S1: construct an energy system operating condition library and a feature library related to the energy system operating conditions; Step S2: performing diffusion processing on samples in the energy system operating condition library; Step S3: construct a generative adversarial network model, and use the results obtained in steps S1 and S2 as training data sets to train the generative adversarial network model; Step S4: constructing a neural network for predicting noise, and using random Gaussian noise as a training data set to train the neural network for predicting noise; Step S5: The adversarial generative network model and the neural network for predicting noise are fused by weighted averaging to obtain the adversarial-diffusion hybrid model.
2. The energy system sample generation method based on the counter-diffusion hybrid model according to claim 1 is characterized in that: In step S1, the process of constructing the energy system operating condition library and feature library is to first collect real energy system operating condition samples and related features, and obtain the sample matrix X after preprocessing. ` =[x ` 1,x ` 2,x ` 3,…,x i ` ] and the feature matrix F ` , thereby obtaining the energy system operating condition library and the feature library related to the energy system operating condition.
3. The energy system sample generation method based on the counter-diffusion hybrid model according to claim 2 is characterized in that: The step S2 specifically includes the following steps: S21 constructs the noise matrix N, which is in the form of formula (1): <h2 style=";text-align:left;direction:ltr">N = [n1,n2,n3,…,n<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> ] (1) Among them, n i Represented in the sample matrix X ` Medium i ` Corresponding noise data; S22 Noise Addition: By adding the noise matrix N to the sample matrix X ` In the above example, we get the noisy sample matrix X `` , the calculation process can be expressed as formula (2): X”=X'+αN (2) Among them, α represents the noise intensity coefficient, which is used to control the strength of each noise addition process; S23 diffusion process: Through multiple iterations of diffusion process, the noise level is gradually increased. The sample matrix after each iteration can be expressed as formula (3): X t ”=X t-1 "+a" t N (3) Among them, t represents the number of iterations, α t represents the noise intensity coefficient of the tth iteration; S24 diffusion result: After completing multiple iterations, the final diffusion sample matrix X is obtained ` T ` ; And the intermediate process sample library I of diffusion is used to construct the training data set of the adversarial generative network model, as shown in formula (4): I=[X1”,X2”,X3”,…,X t ”,…,X T ”] (4)。 4. The energy system sample generation method based on the counter-diffusion hybrid model according to claim 3 is characterized in that: The step S3 specifically includes: S31 constructs a generative adversarial network model: the generative adversarial network model includes a generator and a discriminator; the loss function of the generative adversarial network model is specifically shown in formula (5)-formula (6): L(G)=E x~I(x) [1-D(x)] (5) Among them, L(G) and L(D) are the generator loss and discriminator loss respectively; E x~I(x) [1-D(x)] represents the mathematical expectation of the random variable [1-D(x)], where x follows the I(x) distribution; D(x) and G(z) represent the output of the discriminator and the output of the generator, respectively. z (z) represents the mathematical distribution of random Gaussian noise; S32 training the adversarial generative network model: the adversarial generative network model is trained by a gradient descent algorithm, the generator takes the feature matrix F' as input, and outputs the sample I' with feature information with the process sample library I as the target; the discriminator takes the sample I' with feature information output by the generator and the process sample library I as input, and outputs the authenticity judgment of the process sample I; Sample I with feature information ` The generation process of is expressed as formula (7): I`=G(F`) (7).
5. The energy system sample generation method based on the counter-diffusion hybrid model according to claim 4 is characterized in that: In step S4, the neural network for predicting noise is used to reconstruct samples from random Gaussian noise, and its input is the sample X in the diffusion process. ` t ` , the output is based on the sample X ` t ` The reconstructed samples obtained; the loss function of the neural network for predicting noise is expressed as follows: L(θ)=E[||∈-∈ θ (X ` t ` ,t)|| 2 ] (8) Where L(θ) represents the prediction noise loss, E[||∈-∈ θ (X ` t ` ,t)|| 2 ] represents the pair ||∈-∈ θ (X ` t ` ,t)|| 2 Calculate the expectation, ∈ θ represents the neural network for predicting noise, ∈ represents the noise data, and t represents the tth iteration; The neural network for predicting noise is used to generate reconstructed samples. The calculation process is shown in the following formula: Among them, X ` t `` represents the initial reconstruction sample, which is random noise; X ` t `` -1 represents the reconstructed sample obtained at the t-1th iteration.
6. The energy system sample generation method based on the counter-diffusion hybrid model according to any one of claims 1 to 5, characterized in that: The energy system samples are generated by using the adversarial-diffusion hybrid model. The specific steps are as follows: Use the trained adversarial generative network model to generate samples with feature information I ` , using the trained neural network to predict noise to generate the reconstructed sample X ` 1 `` , and the weighted average of the two is used to generate samples. The specific calculation formula is as follows: I `` =βI ` +(1-β)X ` 1 `` (10) Among them, i `` represents the final sample obtained, and β is the weighted weight.
Citation Information
Patent Citations
Generative adversarial network method and system for predicting new energy generating capacity
CN117578438A
