Extreme weather scene generation method based on CGAN algorithm, medium and system
By using CGAN algorithm in the generation of extreme weather scenarios combined with convolutional neural network and Transformer self-attention mechanism, the limitations of extreme weather scenario generation in the existing technology are solved, and more efficient and accurate generation of extreme weather scenarios are achieved, and the generalization performance and training stability of the model are improved.
Patent Information
- Application Number
- CN202411872185.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art has limitations in the generation of extreme weather scenarios, which are difficult to converge quickly and have high resource utilization. The interpretability and training stability problems of deep learning generation methods such as CVAE limit their promotion and application in power systems.
The extreme weather scene generation method based on CGAN algorithm is adopted, and a conditional generation adversarial network model is established by combining the convolutional neural network and the Transformer self-attention mechanism. Through the local generalization ability of the convolutional neural network and the global attention mechanism of Transformer, new energy output characteristics in different time and space dimensions are extracted to achieve controllable conditional probability mapping in extreme scenarios.
It significantly improves the automatic feature extraction capability of the conditional generation adversarial network model, reduces artificial intervention, enhances the generalization performance of the model, solves the problems of instability in model training and high resource occupation in the existing technology, and improves the efficiency and accuracy of generation of extreme weather scenarios.
Smart Images

Figure CN119988925A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of scene generation technology, and in particular to a method, medium and system for generating extreme weather scenes based on a CGAN algorithm. Background Art
[0002] In recent years, with the global climate change, extreme weather has become more frequent and has caused large-scale power outages or power shortages many times, seriously affecting the production and living order in some local areas. The main reason for this phenomenon is that the modern power system with new energy as the core is increasingly sensitive to extreme weather conditions.
[0003] To this end, in specific areas, key climate factors such as wind speed, solar irradiance, and temperature show significant time series characteristics. By extracting and clustering the features of massive climate data, a set of wind-light-temperature multi-dimensional coupled weather scenarios is generated. This is the basis for evaluating the resilience of the power system in the face of climate change, optimizing the site selection and sizing of power sources, and is of great significance to improving the resilience of the power grid.
[0004] Among the current existing technologies, modeling of extreme weather scenarios is crucial in power system research. In early studies, domestic and foreign scholars have proposed a variety of methods for scenario modeling problems, including probabilistic model method, classical scenario method, and deep learning generation method.
[0005] The probability model method predicts extreme weather events by establishing a probability distribution model through analyzing historical data. The classic scenario method selects representative extreme weather events for simulation analysis, while the deep learning generation method uses advanced machine learning technology to generate realistic extreme weather scenarios to evaluate their impact on the power system.
[0006] The probability model method relies on statistical experience and probability distribution, combined with sampling techniques such as Monte Carlo to generate wind and solar output or load scenarios. For example, Markov chains have been used to simulate the dynamic changes of wind power, photovoltaics and loads to generate system scheduling plans under multiple scenarios; at the same time, Weibull distribution and Beta distribution are also used to model the probability distribution of wind speed and light, providing a probability model for the combined output of wind and solar power; in addition, some researchers have considered predicting the joint probability distribution of wind speeds in multiple wind farms and combining Monte Carlo sampling technology to generate output scenarios to improve the accuracy of wind power prediction, but Monte Carlo simulation is time-consuming and resource-intensive, and it is difficult to converge quickly; in addition, some researchers have proposed a probabilistic evaluation method that combines spatial correlation modeling and component state temporal connection relationships, as well as a weather scenario construction method based on extreme value theory, but there is a lack of specific scenario modeling and case analysis to verify the effectiveness of the proposed method.
[0007] The deep learning generation rule uses the deep learning framework to deeply mine the data and realize unsupervised scene generation. Compared with the probability model method and the classic scene method, its main advantage is that it can automatically extract features from the data without human intervention, has stronger representation and generalization capabilities, is more stable when processing big data, and can improve computing efficiency through distributed training. However, it has been found that existing attempts to apply conditional variational autoencoders (CVAE) to generate wind power and photovoltaic output scenarios to achieve unsupervised scene generation, but the interpretability and training stability of the CVAE model may be limited in the promotion and application of the power system, and the model output results have a certain degree of randomness, which may pose certain risks.
[0008] It can be seen that the existing means of generating extreme weather scenarios have certain limitations, and there is an urgent need to obtain a new method for generating extreme weather scenarios for power system research. Summary of the invention
[0009] The technical problem to be solved by the present invention is: the present invention discloses a method, medium and system for generating extreme weather scenes based on a conditional generative adversarial network (CGAN) algorithm, which integrates a convolutional neural network and a Transformer self-attention mechanism, can significantly improve the automatic feature extraction capability of the conditional generative adversarial network model, reduce human intervention, and enhance the generalization performance of the model.
[0010] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for generating extreme weather scenes based on the CGAN algorithm, which comprises the steps of: S1: Obtain historical data to extract meteorological indicators and power grid operation status indicators under different types of extreme weather conditions; S2: Establishing statistical characteristic indicators of risk scenarios, and based on the meteorological indicators and the power grid operation status indicators, screening out extreme weather that affects the safety and stability of the power grid according to the statistical characteristic indicators, and forming a training set; S3: Coupling convolutional neural networks with Transformer self-attention mechanisms to build a conditional generative adversarial network model that can generate extreme weather scenarios; S4: Input the training set and random noise into the generator and discriminator of the conditional generative adversarial network model respectively, and realize the generation of extreme weather scenes.
[0011] In the above technical scheme of the present invention, the present invention proposes an optimized design of extreme weather scene generation method based on CGAN algorithm, which improves the conditional generative adversarial network model, which integrates convolutional neural network and Transformer self-attention mechanism. The model couples the local generalization ability of convolutional neural network and the self-attention mechanism of Transformer to establish a conditional generative adversarial network (CGAN) structure suitable for extracting new energy output characteristics in different spatiotemporal dimensions, and realizes the model network architecture of controllable conditional probability mapping in extreme scenarios.
[0012] It should be pointed out that in practical applications, the local generalization ability of convolutional neural networks enables the CGAN model to capture local features of renewable energy output, such as local changes in wind speed and solar radiation. However, convolutional neural networks are prone to losing local details of the discriminator output curve because their convolution kernel feature field of view is limited to a small area; It is precisely to solve this problem that in the extreme weather scene generation method designed by the present invention, Ming Fangcai incorporated the global attention mechanism of Transformer into CGAN, so as to utilize the self-attention mechanism of Transformer to enable the model to process long sequence data and capture the long-distance dependencies between new energy outputs. Therefore, by combining the local feature extraction capability of CNN and the self-attention mechanism of Transformer, the CGAN model can effectively integrate local and global information, and more accurately understand the global characteristics and timing characteristics of new energy output, which has good promotion prospects and application value.
[0013] Furthermore, in a method for generating extreme weather scenes based on a CGAN algorithm described in the present invention, in step S1, the historical data includes: extremely high temperature weather historical data and extreme cold wave weather historical data.
[0014] Furthermore, in the extreme weather scene generation method based on the CGAN algorithm described in the present invention, in step S2, specifically: Analyze the changing characteristics of uncertain factors such as renewable energy output and load demand under extreme weather conditions, and establish statistical characteristic indicators for multi-time scale supply and demand risk scenarios; Based on the meteorological indicators and power grid operation status indicators, extreme weather that affects the safety and stability of the power grid is screened out according to the statistical characteristic indicators, and a training set is formed.
[0015] Furthermore, in the extreme weather scene generation method based on the CGAN algorithm described in the present invention, in step S4, specifically: S41: clustering the training set and setting condition values in sequence according to the characteristics; S42: In the conditional generative adversarial network model, the clustering classification results of the training set are used as the basis for assigning conditional values, the conditional values are vertically spliced with historical data or random noise as model input, and the generator and the discriminator are alternately trained until the model converges; S43: After the training is completed, a controllable condition value is introduced, and the controllable condition value is input into the trained generator to generate a large number of data sets that meet the controllable condition value as an extreme weather scenario set.
[0016] Furthermore, in the extreme weather scene generation method based on the CGAN algorithm described in the present invention, in step S42, when training the generator and the discriminator, the size of the Wasserstein distance is used as the basis for judging whether the model converges.
[0017] Furthermore, in the extreme weather scene generation method based on the CGAN algorithm described in the present invention, the Wasserstein distance Defined as:
[0018] Among them, p x is the probability distribution of the real data x and p g is the probability distribution of the generated data g of the generator; For p x and p g The set of all joint distributions; inf represents the infimum; (x, g)~ From every possible joint distribution Sampling obtains real data x and generated data g; represents the expected value of the distribution; is the distance between the real data x and the generated data g.
[0019] Furthermore, in the extreme weather scene generation method based on the CGAN algorithm described in the present invention, in step S43, specifically: After the training is completed, a controllable condition value is introduced, and the controllable condition value is input into the trained generator to generate a large number of data sets that meet the controllable condition value; The data set is clustered using K-means. For each cluster, the distances from all points belonging to the cluster to the cluster center are calculated, and the point with the closest distance is selected as the representative of the cluster to ultimately form a set of extreme weather scenarios.
[0020] Correspondingly, the present invention also discloses a computer medium, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor; wherein the processor is used to implement a method for generating extreme weather scenes based on the CGAN algorithm as described above in the present invention when executing the computer program, so as to generate extreme weather scenes.
[0021] In addition, the present invention also discloses an extreme weather scene generation system based on the CGAN algorithm, which can be specifically used to implement the above-mentioned extreme weather scene generation method of the present invention, which specifically includes: Data collection module, to obtain historical data; A data processing module, which establishes statistical characteristic indicators of risk scenarios, and based on the meteorological indicators and the power grid operation status indicators, screens out extreme weather that affects the safety and stability of the power grid according to the statistical characteristic indicators, and forms a training set; The scenario generation module couples the convolutional neural network with the Transformer self-attention mechanism to establish a conditional generative adversarial network model that can generate extreme weather scenarios, and inputs the training set and random noise into the generator and discriminator of the conditional generative adversarial network model respectively to generate extreme weather scenarios.
[0022] Furthermore, in an extreme weather scene generation system based on the CGAN algorithm described in the present invention, the generator of the conditional generative adversarial network model has a generator convolution module, and the discriminator of the conditional generative adversarial network model has a discriminator convolution module and a Transformer self-attention mechanism module stacked in it.
[0023] The beneficial effects of the present invention are as follows: the present invention designs a new extreme weather scene generation method, medium and system based on the conditional generative adversarial network (CGAN) algorithm, which shows a number of significant technical advantages compared with the prior art; among them, the extreme weather scene generation method, medium and system designed by the present invention creatively integrate the convolutional neural network and the Transformer self-attention mechanism for application in the conditional generative adversarial network model, which can significantly improve the automatic feature extraction capability of the conditional generative adversarial network model, reduce human intervention, and effectively enhance the generalization performance of the conditional generative adversarial network model.
[0024] It has good promotion prospects and application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a flowchart of the steps of an extreme weather scene generation method based on the CGAN algorithm described in the present invention in one implementation.
[0026] Figure 2 This is a conditional generative adversarial network (CGAN) architecture diagram of an extreme weather scene generation method based on the CGAN algorithm described in the present invention in one implementation manner.
[0027] Figure 3 The network structure diagram of the generator and discriminator in the conditional generative adversarial network algorithm is schematically shown. DETAILED DESCRIPTION
[0028] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0029] Please refer to Figure 1 As shown, in this embodiment, the present invention discloses a method for generating extreme weather scenes based on a conditional generative adversarial network (CGAN) algorithm, which specifically includes the steps of: S1: Obtain historical data to extract meteorological indicators and power grid operation status indicators under different types of extreme weather conditions; S2: Establishing statistical characteristic indicators of risk scenarios, and based on the meteorological indicators and the power grid operation status indicators, screening out extreme weather that affects the safety and stability of the power grid according to the statistical characteristic indicators, and forming a training set; S3: Coupling convolutional neural networks with Transformer self-attention mechanisms to build a conditional generative adversarial network model that can generate extreme weather scenarios; S4: Input the training set and random noise into the generator and discriminator of the conditional generative adversarial network model respectively, and realize the generation of extreme weather scenes.
[0030] That is to say, in this embodiment, the extreme weather scenario generation method disclosed in the present invention can first obtain historical data to extract meteorological indicators and power grid operation status indicators under different types of extreme weather, and then establish statistical characteristic indicators of risk scenarios to screen out extreme weather that affects the safety and stability of the power grid according to the statistical characteristic indicators, and form a training set; and train the constructed conditional generative adversarial network model through the training set and random noise, so as to realize extreme weather scenario generation based on the trained conditional generative adversarial network model, so as to facilitate subsequent researchers to further evaluate the resilience of the power system in the face of climate change, optimize the site selection and sizing of power sources, etc., which has a good implementation effect and is of great significance to improving the resilience of the power grid.
[0031] It should be pointed out that a major feature of the present invention is that an improved conditional generative adversarial network (CGAN) model that integrates a convolutional neural network (CNN) and the Transformer self-attention mechanism is proposed. The model couples the local generalization ability of CNN and the global attention mechanism of Transformer to establish a CGAN structure suitable for extracting new energy output characteristics in different spatiotemporal dimensions, and realizes a model network architecture of controllable conditional probability mapping in extreme scenarios.
[0032] In practical applications, the local generalization ability of CNN enables the CGAN model to capture local features of renewable energy output, such as local changes in wind speed and solar radiation. However, because the field of view of its convolution kernel features is limited to a small area, the convolutional neural network can easily lose local detail information of the discriminator (DG) output curve; precisely to solve this problem, the present invention also incorporates the global attention mechanism of Transformer. The self-attention mechanism of Transformer enables the model to process long sequence data and capture long-distance dependencies between renewable energy outputs. Therefore, by combining the local feature extraction capability of CNN and the self-attention mechanism of Transformer, the CGAN model can effectively fuse local and global information and more accurately understand the global features and timing characteristics of renewable energy output.
[0033] Combined with reference Figure 1 and Figure 2 In this embodiment, in the present invention, in order to facilitate the implementation of the above-mentioned extreme weather scene generation method based on the CGAN algorithm, the present invention also discloses an extreme weather scene generation system based on the CGAN algorithm, which includes: a data acquisition module, a data processing module and a scene generation module; wherein the data acquisition module is used to execute the above-mentioned step S1 of the extreme weather scene generation method of the present invention; the data processing module can be used to execute the above-mentioned step S2; the scene generation module can be used to execute the above-mentioned steps S3 and S4, and finally realize the generation of extreme weather scenes.
[0034] It should be noted that in the above-mentioned extreme weather scenario generation method based on the CGAN algorithm of the present invention, in step S1, it can be specifically as follows: according to the historical data of extreme weather events, new energy output and load demand, the meteorological indicators and power grid operation status indicators of different types of extreme weather are refined.
[0035] The reason for obtaining historical data is that climate factors have a significant impact on electricity demand and supply, and directly determine the power generation efficiency of renewable energy such as hydropower, wind power, and photovoltaic power, as well as the regional load level. At present, according to the development characteristics of the weather, technicians in this field can summarize it into several typical weather processes, mainly including: high temperature, drought, low temperature, and freezing weather.
[0036] Among them, in this embodiment, in step S1 of the extreme weather scene generation method designed by the present invention, the historical data obtained may specifically include: extreme high temperature weather historical data and extreme cold wave weather historical data.
[0037] For easier understanding, the following is an explanation of extreme heat and extreme cold weather: Extremely hot weather: When the maximum temperature of the day exceeds 38°C and the high temperature lasts for more than 3 hours, it can be defined as extremely hot weather. In extremely hot weather, for hydropower systems, high temperatures may accelerate the evaporation of reservoirs, causing water levels to drop, thereby reducing the efficiency of hydropower generation; for wind power systems, high temperatures may cause wind turbines to overheat, requiring the operating power to be reduced to prevent damage; at the same time, high temperatures may also reduce the carrying capacity of transmission lines and increase the risk of distribution transformer failure.
[0038] Extreme cold wave weather: If the maximum daily temperature in a certain place is below 8°C for three consecutive days or more, it can be defined as extreme cold wave weather. In such low temperature and snowy weather, for wind power systems, the blades of wind turbines may freeze, affecting the power generation efficiency of wind farms; for areas that rely on natural gas for heating, the surge in heating demand may also cause the capacity of high-pressure gas pipelines to reach their limits, and indirectly limit the ability to generate gas-fired power.
[0039] Accordingly, in this embodiment, in the extreme weather scenario generation method designed by the present invention, in step S2, based on the historical data obtained in the above step S1, the meteorological indicators and power grid operation status indicators under the respective extreme weather conditions can be obtained, and the changing characteristics of uncertain factors such as new energy output and load demand under the influence of extreme weather conditions can be analyzed, and statistical characteristic indicators of multi-time scale supply and demand risk scenarios can be established, so as to screen extreme weather that affects the safety and stability of the power grid based on the above meteorological indicators and power grid operation status indicators according to the statistical characteristic indicators, thereby forming a training set.
[0040] For ease of understanding, the training set is further described here. In the above step S2 of the present invention, it is possible to screen out representative extreme weather data from the original data set according to meteorological indicators, power grid operation status indicators and statistical characteristic indicators, such as temperature data within a specific time interval, and form a training set. This training set will be used for subsequent CGAN model training to ensure that extreme weather scenarios that threaten power grid stability can be accurately generated.
[0041] At the same time, in this embodiment, in step S3 of the extreme weather scene generation method of the present invention, it is also necessary to establish a conditional generative adversarial network model that can realize the generation of extreme weather scenes. For ease of understanding, the present application can specifically adopt the following steps to establish the model: Currently, the generative adversarial network (GAN) is a model that uses deep neural networks (DNNs) to characterize complex nonlinear relationships (generators) and classify complex signals (discriminators). The key to GAN is to set up a two-person zero-sum game under the minimax problem between the generator neural network and the discriminator neural network to improve the authenticity of the samples generated by the generator. Its objective table function can be expressed as:
[0042] in, G For the generator; D is the discriminator; P r For real data x Distribution of P z is random noise z Distribution of is the discriminator function, is the generator function; for P r expectations; for P z expectations.
[0043] It should be noted that, unlike the unsupervised learning technology of generative adversarial networks (GAN), conditional generative adversarial networks (CGAN) combine supervised learning with unsupervised learning technology. CGAN introduces conditional values in both the generator and discriminator neural networks. y , which enables the network to learn the probability distribution of samples under specified conditions.
[0044] For example: See Figure 2 The network architecture shown defines the real data x Obey probability distribution p x , the generator generates fake samples z Obey probability distribution p z After training the conditional generative adversarial network, the generator of the conditional generative adversarial network aims to establish p z arrive p xThe mapping of , that is, through the minimax two-person zero-sum game function, the CGAN model reaches the Nash equilibrium (the network architecture is as follows Figure 2 As shown), the above minimax two-person zero-sum game function is specifically:
[0045] Among them, G is the generator, D is the discriminator; p x is the probability distribution of the real data x, p z is the probability distribution obeyed by the false sample z; is the discriminator function, is the generator function; Represents the expected value of a distribution. The subscript E is used to specify the random variable of the expected operation and the distribution of the random operation, for example: Refers to specifying random variables x, y to participate in In the operation, the random variables x and y obey p x, p y The probability distribution of .
[0046] However, the inventors also found during execution that the CGAN model has the problem of unstable training, and there are problems of gradient vanishing and mode collapse during training. Considering that the Wasserstein distance can still reflect the distance between two distributions when the support sets of the two distributions do not overlap or overlap very little; therefore, in the CGAN model constructed by the present invention, the Wasserstein distance can also be used instead of the JS divergence to calculate the loss function, so as to solve the problems of gradient vanishing and mode collapse; Among them, Wasserstein distance is defined as:
[0047] Among them, p x is the probability distribution of the real data x and p g is the probability distribution of the generated data g of the generator; For p x and p g The set of all joint distributions; inf represents the infimum; (x, g)~ From every possible joint distribution Sampling obtains real data x and generated data g; is the distance between the real data x and the generated data g.
[0048] Therefore, based on the definition of Wasserstein distance, in practical application, we can get the value of each possible joint distribution from Sampling obtains real data x and generated data g, and calculates the distance between the two Thus, we can obtain the The expectation under the joint distribution is finally obtained, and the maximum lower bound of all joint distribution expectations is p r and p g The Wasserstein distance between them.
[0049] However, since the infimum in the definition formula of the above Wasserstein distance is difficult to solve directly, the Kantorovich-Rubinstein dual form can be used:
[0050] Among them, G is the generator and D is the discriminator; is the discriminator function, is the generator function; K is the first-order Lipschitz constant of the discriminator D; is the K-Lipschitz norm; sup represents the supremum.
[0051] Since the change of K will cause the gradient to change by K times and will not affect the gradient direction, the weight clipping method can be used to make CGAN meet the first-order Lipschitz restriction. At the same time, the introduction of the controllable conditional value y can obtain the objective function of CGAN as follows:
[0052] Among them, in the above formula, is the discriminator function, is the generator function; Indicates about The gradient at a given conditional value 𝑦; λ is the gradient penalty coefficient, which is used to balance the impact of the initial target and the gradient penalty term, Represents the probability distribution p z and p x A data point sampled between .
[0053] Accordingly, in the extreme weather scene generation method based on the CGAN algorithm designed in the present invention, in the subsequent step S4, it is necessary to train the conditional generative adversarial network (CGAN) model obtained in the above step S3. The training process can be seen in Figure 2 As shown; like Figure 2As shown in the figure, during the training process of the CGAN model, the generator and the discriminator compete with each other through adversarial games. According to the feedback of the discriminator on the data generated by the generator, the parameters of the generator and the discriminator are updated respectively using the gradient descent method. Therefore, this paper stacks the convolution module and the Transformer self-attention mechanism module in the discriminator network to realize the discrimination of multiple features in the time series scene. The generator adopts a convolution module with low computational complexity and is optimized through discriminator feedback. The convolution module can quickly process early local patterns and provide effective input representation for the subsequent Transformer module; while the Transformer module can further model global dependencies and improve the model's fitting and generalization capabilities. This combination of discriminators can better cope with complex scene data and improve the performance of the model.
[0054] In the present invention, the network architecture of the generator and the discriminator in the conditional generative adversarial network (CGAN) model can be specifically as follows: Figure 3 As shown. Among them, the Concatenate module is used to convert the conditional value into a vector and concatenate it vertically with z or x; Conv represents a regular convolutional layer module, k3n64p1 indicates that the kernel size of the convolutional layer is 3×3, the output channels are 64, and the padding is 1; Gelu, LeakyRelu and Relu are activation functions; BatchNorm1d is a batch normalization layer; Linear is a linear transformation layer; dropout represents a dropout regularization layer, which is used for regularization and preventing overfitting; Self.Attention represents a Transformer self-attention module; FeedForward is The feedforward network is used to further process features after the self-attention mechanism. The module consists of two linear transformation layers with a Gelu activation function and a dropout layer between the transformation layers. FullyConnected is a fully connected layer that compresses the internal feature representation of the discriminator into a scalar value, which is used to distinguish between real data and false data generated by the generator, and provide a training signal for the model. In addition, in the present invention, residual connections are introduced in each attention module and feedforward network module in the discriminator, which helps alleviate the gradient vanishing problem in deep networks by directly adding the input of the module to the output of the module, and effectively improves the consistency of the model.
[0055] Based on this, in step S4 of the extreme weather scene generation method designed by the present invention, the following steps S41-S43 may be specifically included: S41: clustering the training set and setting condition values in sequence according to the characteristics; S42: In the conditional generative adversarial network model, the clustering classification results of the training set are used as the basis for assigning conditional values, the conditional values are vertically spliced with historical data or random noise as model input, and the generator and the discriminator are alternately trained until the model converges; S43: After the training is completed, a controllable condition value is introduced, and the controllable condition value is input into the trained generator to generate a large number of data sets that meet the controllable condition value as an extreme weather scenario set.
[0056] It should be noted that in the above step S42, when training the generator and the discriminator, the size of the Wasserstein distance can be used as a basis for judging whether the model has converged; and in the subsequent step S43, after the training is completed, a controllable condition value is introduced, and the controllable condition value is input into the trained generator to generate a large number of data sets that meet the controllable condition value; and K-means is used to cluster the data sets, and for each cluster, the distance from all points belonging to the cluster to the cluster center is calculated, and the point with the closest distance is selected as the representative of the cluster, so as to finally form a set of extreme weather scenes.
[0057] For ease of understanding, the inventors have also listed the following specific embodiment 1 to actually execute step S4 of the extreme weather scene generation method described in the present invention and generate an extreme weather scene set.
[0058] Embodiment 1 In the training framework of the conditional generative adversarial network, in order to improve the ability of the conditional generative adversarial network model to capture the characteristics of extreme weather changes, it is necessary to further screen and cluster the training set; in this embodiment, for the training set under extremely hot weather, the lowest temperature is lower than 28°C as the classification threshold to achieve clustering; for the training set under cold wave weather, the lowest temperature is lower than 0°C as the classification threshold to achieve clustering. In addition, after the training set is classified, the conditional values are further set in sequence according to the characteristics.
[0059] In the CGAN model framework, the generator can accept random noise and conditional values as input, while the discriminator accepts historical real data and conditional values in the training set as input. The historical data and random noise input each time have the same dimension, N×T, where N is the batch size, that is, the number of samples for each training, and T is the time step. The classification results of the training set are used as the basis for assigning conditional values, and the conditional values are vertically spliced with historical data or random noise as the input of the conditional generative adversarial network model. The generator and discriminator are trained alternately until the model converges, and the size of the Wasserstein distance is used as the basis for judging whether it converges.
[0060] Generally speaking, in the training dynamics, the training frequency of the discriminator is usually higher than that of the generator. This is because: the discriminator undertakes more complex tasks in the network and needs to update the weights more frequently to effectively guide the learning process of the generator. The number of training iterations of the discriminator is about four times that of the generator, that is, for every training of the generator, the discriminator needs to be trained four times.
[0061] Accordingly, after the training is completed, the controllable condition value is input into the trained generator to generate a large number of extremely hot / cold weather scene generation scenes that meet the characteristics of the condition value. At the same time, in order to further reduce the scale of the scene set while retaining important information, so that the screened scene set is more representative, it can first use K-means to cluster the data set, and then for each cluster, calculate the distance from all points belonging to the cluster to the cluster center, and select the point with the closest distance as the representative of the cluster, and finally form a streamlined but representative set of extremely hot / cold weather scenes.
[0062] From the above, it can be seen that the present invention has designed a new extreme weather scene generation method, medium and system based on the CGAN algorithm, which has demonstrated many significant technical advantages compared with the prior art; among them, the extreme weather scene generation method, medium and system designed by the present invention creatively integrate the convolutional neural network and the Transformer self-attention mechanism for application in the conditional generative adversarial network model, which can significantly improve the automatic feature extraction capability of the conditional generative adversarial network model, reduce human intervention, and effectively enhance the generalization performance of the conditional generative adversarial network model.
[0063] In addition, in practical applications, the extreme weather scene generation method based on the CGAN algorithm of the present invention can also introduce the Wasserstein distance optimization loss function in the conditional generative adversarial network model to alleviate the gradient vanishing and mode collapse problems in the traditional model, and enhance the stability of the model training process. At the same time, the scheme supports distributed training, improves computing efficiency, and reduces resource consumption, especially when processing large-scale climate data.
[0064] In addition, when applying the extreme weather scenario generation method based on the CGAN algorithm of the present invention, it can achieve the simplification and efficiency of the extreme weather scenario set through K-means clustering and the method of selecting representative scenario sets, which provides strong technical support for subsequent power system resilience assessment and optimization, and has good promotion prospects and application value.
[0065] Accordingly, the extreme weather scenario system and computer medium designed by the present invention based on the conditional generative adversarial network (CGAN) algorithm are used to implement and execute the above-mentioned extreme weather scenario generation method of the present invention, which also has the above-mentioned advantages and beneficial effects.
[0066] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for generating extreme weather scenes based on the CGAN algorithm, characterized in that: Includes steps: S1: Obtain historical data to extract meteorological indicators and power grid operation status indicators under different types of extreme weather conditions; S2: Establishing statistical characteristic indicators of risk scenarios, and based on the meteorological indicators and the power grid operation status indicators, screening out extreme weather that affects the safety and stability of the power grid according to the statistical characteristic indicators, and forming a training set; S3: Coupling convolutional neural networks with Transformer self-attention mechanisms to build a conditional generative adversarial network model that can generate extreme weather scenarios; S4: Input the training set and random noise into the generator and discriminator of the conditional generative adversarial network model respectively, and realize the generation of extreme weather scenes.
2. The method for generating extreme weather scenes based on the CGAN algorithm according to claim 1, characterized in that: In step S1, the historical data includes: extremely high temperature weather historical data and extremely cold wave weather historical data.
3. The method for generating extreme weather scenes based on the CGAN algorithm according to claim 2, characterized in that: In step S2, specifically: Analyze the changing characteristics of uncertain factors such as renewable energy output and load demand under extreme weather conditions, and establish statistical characteristic indicators for multi-time scale supply and demand risk scenarios; Based on the meteorological indicators and power grid operation status indicators, extreme weather that affects the safety and stability of the power grid is screened out according to the statistical characteristic indicators, and a training set is formed.
4. The method for generating extreme weather scenes based on the CGAN algorithm according to claim 1, characterized in that: In step S4, specifically: S41: clustering the training set and setting condition values in sequence according to the characteristics; S42: In the conditional generative adversarial network model, the clustering classification results of the training set are used as the basis for assigning conditional values, the conditional values are vertically spliced with historical data or random noise as model input, and the generator and the discriminator are alternately trained until the model converges; S43: After the training is completed, a controllable condition value is introduced, and the controllable condition value is input into the trained generator to generate a large number of data sets that meet the controllable condition value as an extreme weather scenario set.
5. The method for generating extreme weather scenes based on the CGAN algorithm according to claim 4, characterized in that: In step S42, when training the generator and the discriminator, the size of the Wasserstein distance is used as a basis for judging whether the model has converged.
6. The method for generating extreme weather scenes based on the CGAN algorithm according to claim 5, characterized in that: Wasserstein distance Defined as: Among them, p x is the probability distribution of the real data x and p g is the probability distribution of the generated data g of the generator; For p x and p g The set of all joint distributions; inf represents the infimum; (x, g)~ From every possible joint distribution Sampling obtains real data x samples and generated data g samples; represents the expected value of the distribution; is the distance between the real data x sample and the generated data g sample.
7. The method for generating extreme weather scenes based on the CGAN algorithm according to claim 4, characterized in that: In step S43, specifically: After the training is completed, a controllable condition value is introduced, and the controllable condition value is input into the trained generator to generate a large number of data sets that meet the controllable condition value; The data set is clustered using K-means. For each cluster, the distances from all points belonging to the cluster to the cluster center are calculated, and the point with the closest distance is selected as the representative of the cluster to ultimately form a set of extreme weather scenarios.
8. A computer medium, characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor; Wherein, the processor is used to implement a method for generating extreme weather scenes based on a CGAN algorithm as described in any one of claims 1 to 7 when executing the computer program.
9. An extreme weather scene generation system based on the CGAN algorithm, characterized in that: It is used to implement a method for generating extreme weather scenes based on a CGAN algorithm as described in any one of claims 1 to 7, characterized in that it comprises: Data acquisition module, to obtain historical data; A data processing module, which establishes statistical characteristic indicators of risk scenarios, and based on the meteorological indicators and the power grid operation status indicators, screens out extreme weather that affects the safety and stability of the power grid according to the statistical characteristic indicators, and forms a training set; The scenario generation module couples the convolutional neural network with the Transformer self-attention mechanism to establish a conditional generative adversarial network model that can generate extreme weather scenarios, and inputs the training set and random noise into the generator and discriminator of the conditional generative adversarial network model respectively to generate extreme weather scenarios.
10. The extreme weather scene generation system based on the CGAN algorithm according to claim 9, characterized in that: The generator of the conditional generative adversarial network model has a generator convolution module, and the discriminator of the conditional generative adversarial network model has a stacked discriminator convolution module and a Transformer self-attention mechanism module.
Citation Information
Cited By
Method for generating photovoltaic output scene in extreme weather based on deep learning
CN120180927A
A method for generating photovoltaic output scenarios under extreme weather conditions based on deep learning
CN120180927B
CGAN-based power grid critical stable scene generation method and system
CN120262578A
Renewable energy extreme drought monthly scene joint generation method
CN121682466A
Power system source-load disturbance scene generation method in extreme weather scene
CN122045803A