Key transient sample enhancement method and system based on diffusion model

Generating high-fidelity and diverse transient samples through diffusion model and classifier-guided methods solves the problems of time-consuming calculations and insufficient data in traditional evaluation methods, and improves the accuracy and real-time performance of transient stability evaluation in the power system.

CN120449637APending Publication Date: 2025-08-08CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510419382.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The traditional power system transient stability evaluation method has a long calculation time and is difficult to meet the needs of large-scale, multi-scenario and rapid evaluation. The deep learning model lacks sufficient transient scenario data.

Method used

A key transient sample enhancement method based on diffusion model is adopted to generate transient samples through diffusion process and reverse process, and a classifier constraints are added in the reverse process to generate transient samples that meet the constraints, and a classifier-guided diffusion model is used to enhance the key samples.

Benefits of technology

High-fidelity and diverse transient scenario data are generated, covering different types of disturbance and failure scenarios, improving the accuracy and real-timeness of the power system's transient stability evaluation, and solving the problem of insufficient data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449637A_ABST
    Figure CN120449637A_ABST
Patent Text Reader

Abstract

The invention discloses a key transient sample enhancement method and system based on a diffusion model, and the method comprises the steps: generating a transient sample through a diffusion process and a reverse process based on the diffusion model, adding a constraint condition into the reverse process based on a classifier in the reverse process, and generating a transient sample meeting the constraint condition; determining key samples in the transient samples based on a sensitive area of a preset transient stability evaluation classification boundary; and enhancing the key sample based on a classifier-guided diffusion model to generate an enhanced sample. According to the invention, through an innovative model design and data processing method, high-fidelity transient state scene data meeting multi-scene and diversity requirements are generated through an intelligent algorithm, so that powerful support is provided for transient state stability evaluation and optimization of a power system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system transient stability assessment, and more particularly to a key transient sample enhancement method and system based on a diffusion model. Background Art

[0002] In modern power systems, with the increasing penetration of renewable energy, the dynamic behavior of power systems has become increasingly complex. Traditional power systems are mainly powered by conventional energy sources such as coal and gas, and system operation is relatively stable and predictable. However, with the large-scale access to renewable energy, especially wind and solar power, the operation of power systems faces unprecedented challenges. The intermittent and fluctuating nature of renewable energy generation makes the dynamic characteristics and transient stability of power systems more complex. Transient stability is a key indicator for assessing whether the power system can recover to a stable state when subjected to disturbances (such as faults, load fluctuations, or equipment switching). It is directly related to the safety and reliability of the system.

[0003] Traditional transient stability assessment methods are mainly based on physical models and numerical simulations, such as time-domain simulation and frequency-domain analysis. These methods describe the behavior of the system through detailed physical models and use numerical calculations to solve them, with high accuracy. However, these methods usually require a long calculation time, especially when facing large-scale power systems. The computing resources and time consumption are relatively large, making it difficult to meet the needs of large-scale, multi-scenario, and rapid assessment. As the scale of power systems continues to expand, the limitations of traditional assessment methods are becoming increasingly prominent, and they are unable to provide dynamic, real-time assessment results in a timely manner, especially in complex situations such as extreme climate events and sudden failures.

[0004] In recent years, with the rapid development of artificial intelligence technology, deep learning-based models have gradually been applied to the modeling and optimization of power systems. By learning from historical data, deep learning algorithms can extract system features from a large amount of system operation data, capture the underlying laws of the system, and thus achieve rapid prediction of system behavior. Compared with traditional methods, deep learning has stronger adaptability and data processing capabilities, and can complete the processing and analysis of large-scale data in a shorter time, providing strong support for real-time decision-making. However, traditional deep learning methods rely on a large amount of high-quality training data, which poses a great challenge to the generation of transient scenario data for power systems. Transient scenario data for power systems are often constrained by the actual frequency of faults, extreme events, and complex numerical simulation calculations, making it difficult for existing data sets to meet the requirements of deep learning model training. Summary of the Invention

[0005] The technical solution of the present invention provides a key transient sample enhancement method and system based on a diffusion model to solve the problem of how to enhance key transient samples through a diffusion model.

[0006] In order to solve the above problems, the present invention provides a key transient sample enhancement method based on a diffusion model, the method comprising:

[0007] Based on the diffusion model, transient samples are generated through the diffusion process and the reverse process. In the reverse process, constraints are added to the reverse process based on the classifier to generate transient samples that meet the constraints.

[0008] Determine key samples among transient samples based on the preset sensitive areas of transient stability assessment classification boundaries;

[0009] The key samples are enhanced based on a diffusion model guided by a classifier to generate enhanced samples.

[0010] Preferably, the generating of transient samples through a diffusion process and a reverse process based on a diffusion model includes:

[0011] Gaussian noise is added to the original data during the diffusion process and removed during the reverse process to generate transient samples.

[0012] Preferably, Gaussian noise is added to the original data during the diffusion process to generate noise samples x T ,include:

[0013]

[0014] Among them, x0 is the original data distribution; x t ,t=1,...T is the latent variable of the intermediate process, which represents the intermediate state after adding T steps of Gaussian noise; q(x t |x t-1 ) is the diffusion process; β t is a hyperparameter that controls the noise variance; x 1:T are all the intermediate states of T steps from 1 to T; I is the identity matrix.

[0015] Preferably, the noise samples x are removed in the reverse process. T , the Gaussian noise in generates transient samples, including:

[0016]

[0017] Among them, x T ~N(0,I);p θ (x t-1 |x t ) represents the reverse process data distribution; μ θ (x t ,t) and σ θ (x t, t) are parameterized neural network models, respectively expressed as the mean and variance of the reverse process data distribution; p θ (x 0:T ) is the joint probability distribution of the entire reverse process; p(x T ) is the final state of the diffusion process; Represents x t-1 The mean is μ θ (x t ,t) variance is Normal distribution.

[0018] Preferably, in the reverse process, adding constraints to the reverse process based on the classifier to generate transient samples that meet the constraints includes:

[0019] Introduce the constraint y into the classifier p φ (y|x t ), determine the classifier:

[0020]

[0021] in, Indicates the calculation of x t The gradient of p(y|x t ) indicates that category y is in the current state x t The conditional probability under φ (y|x t ) is the category y predicted by the classifier in the current state x t Conditional probability under ; Based on the gradient adjustment of the determined classifier, the reverse process is generated to generate transient samples that meet the constraints:

[0022]

[0023] Among them, p θ (x t-1 |x t , y) is the probability distribution of the reverse process based on condition y, that is, from x under the guidance of the classifier t Generate x t-1 ; η is the weight factor of the classifier gradient, which is used to control the guidance strength; is a normal distribution with a mean of The variance is σ θ (x t Preferably, the step of determining key samples in transient samples based on the sensitive areas of the classification boundaries in the preset transient stability assessment includes:

[0024] For the classification boundary y=f(x), the sample point (x i ,y i) to the classification boundary can be expressed as:

[0025]

[0026] Among them, f(x i ) is the corresponding x on the classification boundary i The predicted value of f′(x i ) is the classification boundary at x i The slope at

[0027] The distance threshold of the sensitive area is set as ε, and the samples with classification boundary distance d≤ε in the transient samples are determined as key samples.

[0028] According to another aspect of the present invention, a key transient sample enhancement system based on a diffusion model is provided, the system comprising:

[0029] An initial unit is used to generate transient samples through a diffusion process and a reverse process based on a diffusion model, and in the reverse process, add constraints to the reverse process based on a classifier to generate transient samples that meet the constraints;

[0030] a determination unit, configured to determine key samples among transient samples based on a preset sensitive area of a transient stability assessment classification boundary;

[0031] A generating unit is configured to enhance the key samples based on a diffusion model guided by a classifier to generate enhanced samples.

[0032] Preferably, the initial unit, which generates transient samples through a diffusion process and a reverse process based on a diffusion model, is further configured to:

[0033] Gaussian noise is added to the original data during the diffusion process and removed during the reverse process to generate transient samples.

[0034] Preferably, the initial unit is used to add Gaussian noise to the original data during the diffusion process to generate a noise sample x T ,, also used for:

[0035]

[0036] Among them, x0 is the original data distribution; x t ,t=1,...T is the latent variable of the intermediate process, which represents the intermediate state after adding T steps of Gaussian noise; q(x t |x t-1 ) is the diffusion process; β t is a hyperparameter that controls the noise variance; x 1:T are all the intermediate states of T steps from 1 to T; I is the identity matrix.

[0037] Preferably, the initial unit is used to remove the noise sample x in the reverse process T , the Gaussian noise in generates transient samples and is also used for:

[0038] In the reverse process, by removing the intermediate state x t Gaussian noise is restored to the original data x0, and the reverse process is:

[0039]

[0040] Among them, x T ~N(0,I);p θ (x t-1 |x t ) represents the reverse process data distribution; μ θ (x t ,t) and σ θ (x t , t) are parameterized neural network models, respectively expressed as the mean and variance of the reverse process data distribution; p θ (x 0:T ) is the joint probability distribution of the entire reverse process; p(x T ) is the final state of the diffusion process; Represents x t-1 The mean is μ θ (x t ,t) variance is Normal distribution;

[0041] Based on the objective function, the original transient sample distribution is restored in the reverse process:

[0042]

[0043] Among them, ε θ It is a parameterized denoising network, x0~q(x0) is the distribution of real data; ε is the noise; ε θ (x t , t) is the denoising neural network with parameter θ.

[0044] Preferably, the initialization unit is used to add constraints to the reverse process based on the classifier in the reverse process to generate transient samples that meet the constraints, and is also used to:

[0045] Introduce the constraint y into the classifier p φ (y|x t ), determine the classifier:

[0046]

[0047] in, Indicates the calculation of x tThe gradient of p(y|x t ) indicates that category y is in the current state x t The conditional probability under φ (y|x t ) is the category y predicted by the classifier in the current state x t The conditional probability under

[0048] Based on the gradient of the determined classifier, the reverse process is adjusted to generate transient samples that meet the constraints:

[0049]

[0050] Among them, p θ (x t-1 |x t , y) is the probability distribution of the reverse process based on condition y, that is, from x under the guidance of the classifier t Generate x t-1 ; η is the weight factor of the classifier gradient, which is used to control the guidance strength; is a normal distribution with a mean of The variance is σ θ (x t ,t)I.

[0051] Preferably, the determining unit is configured to determine key samples in transient samples based on a preset sensitive area of a classification boundary in transient stability assessment, and is further configured to:

[0052] For the classification boundary y=f(x), the sample point (x i ,y i ) to the classification boundary can be expressed as:

[0053]

[0054] Among them, f(x i ) is the corresponding x on the classification boundary i The predicted value of f′(x i ) is the classification boundary at x i The slope at

[0055] The distance threshold of the sensitive area is set as ε, and the samples with classification boundary distance d≤ε in the transient samples are determined as key samples.

[0056] According to another aspect of the present invention, the present invention provides a computer-readable storage medium storing a computer program for executing a diffusion model-based key transient sample enhancement method.

[0057] According to another aspect of the present invention, the present invention provides an electronic device, comprising: a processor and a memory; wherein,

[0058] The memory is a memory for storing instructions executable by the processor;

[0059] The processor is configured to read the executable instructions from the memory and execute the instructions to implement a key transient sample enhancement method based on a diffusion model.

[0060] The technical solution of the present invention provides a method and system for enhancing key transient samples based on a diffusion model, wherein the method includes: generating transient samples through a diffusion process and a reverse process based on the diffusion model, and in the reverse process, adding constraints to the reverse process based on a classifier to generate transient samples that meet the constraints; determining key samples in the transient samples based on the sensitive area of the preset transient stability assessment classification boundary; and enhancing the key samples based on the diffusion model guided by the classifier to generate enhanced samples. The present invention proposes a transient scene intelligent generation technology based on deep learning. Through innovative model design and data processing methods, the present invention can generate high-fidelity transient scene data that meets multiple scenarios and diversity requirements through intelligent algorithms in the absence of a large amount of real data. The data provided by the present invention can not only cover different types of disturbance and fault scenarios, but also simulate the dynamic behavior of the power system under the penetration of new energy, thereby providing strong support for the transient stability assessment and optimization of the power system. The technical solution of the present invention ensures that the generated data has high authenticity and diversity by simulating complex disturbance conditions in the actual power system, which can effectively supplement the shortcomings of traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:

[0062] Figure 1 This is a flow chart of a key transient sample enhancement method based on a diffusion model according to a preferred embodiment of the present invention;

[0063] Figure 2 Flow chart of a key transient sample enhancement method based on a diffusion model according to a preferred embodiment of the present invention;

[0064] Figure 3 A schematic diagram of a diffusion model according to a preferred embodiment of the present invention; and

[0065] Figure 4 4 is a structural diagram of a key transient sample enhancement system based on a diffusion model according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0066] Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings. However, the present invention may be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to provide a thorough and complete disclosure of the present invention and to fully convey the scope of the present invention to those skilled in the art. The terminology used in the exemplary embodiments shown in the accompanying drawings is not intended to limit the present invention. In the accompanying drawings, identical elements are denoted by the same reference numerals.

[0067] Unless otherwise specified, the terms used herein (including technical terms) have the meanings commonly understood by those skilled in the art. In addition, it is understood that terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.

[0068] Figure 1 4 is a flow chart of a key transient sample enhancement method based on a diffusion model according to a preferred embodiment of the present invention.

[0069] The present invention provides a deep learning-based intelligent generation technology for transient scenarios. Through innovative data generation methods, it efficiently generates diversified, high-fidelity power system transient scenario data, thereby improving the accuracy and real-time performance of power system transient stability assessment, and solving the problems of long calculation time and insufficient data in traditional assessment methods.

[0070] The present invention proposes a key transient sample enhancement technology based on a diffusion model, which enhances key sample data in power system transient stability assessment by introducing the generation capability of the diffusion model.

[0071] like Figure 1 As shown, the present invention provides a key transient sample enhancement method based on a diffusion model, the method comprising:

[0072] Step 101: generating transient samples through a diffusion process and a reverse process based on a diffusion model, and in the reverse process, adding constraints to the reverse process based on a classifier to generate transient samples that meet the constraints;

[0073] Preferably, generating transient samples through a diffusion process and a reverse process based on a diffusion model includes:

[0074] Gaussian noise is added to the original data during the diffusion process:

[0075]

[0076] Among them, x0 is the original data distribution; x t ,t=1,...T is the latent variable of the intermediate process, which represents the intermediate state after adding T steps of Gaussian noise; q(x t|x t-1 ) is the diffusion process; β t is a hyperparameter that controls the noise variance; x 1:T is all the intermediate states of T steps from 1 to T; I is the identity matrix;

[0077] Any intermediate state x in the diffusion process t Calculate from the original data x0:

[0078]

[0079] in: And α t =1-β t ; is standard Gaussian noise.

[0080] Preferably, generating transient samples through a diffusion process and a reverse process based on a diffusion model includes:

[0081] In the reverse process, by removing the intermediate state x t Gaussian noise is restored to the original data x0, and the reverse process is:

[0082]

[0083] Among them, x T ~N(0,I);p θ (x t-1 |x t ) represents the reverse process data distribution; μ θ (x t ,t) and σ θ (x t , t) are parameterized neural network models, respectively expressed as the mean and variance of the reverse process data distribution; p θ (x 0:T ) is the joint probability distribution of the entire reverse process; p(x T ) is the final state of the diffusion process; Represents x t-1 The mean is μ θ (x t ,t) variance is Normal distribution;

[0084] Based on the objective function, the original transient sample distribution is restored in the reverse process:

[0085]

[0086] Among them, ε θ It is a parameterized denoising network, x0~q(x0) is the distribution of real data; ε is the noise; ε θ (xt , t) is the denoising neural network with parameter θ.

[0087] Preferably, in the reverse process, constraints are added to the reverse process based on the classifier to generate transient samples that meet the constraints, including:

[0088] Introduce the constraint y into the classifier p φ (y|x t ):

[0089]

[0090] in, Indicates the calculation of x t The gradient of p(y|x t ) indicates that category y is in the current state x t The conditional probability under φ (y|x t ) is the category y predicted by the classifier in the current state x t The conditional probability under

[0091] Gradient-adjusted backward process based on the classifier:

[0092]

[0093] Among them, p θ (x t-1 |x t , y) is the probability distribution of the reverse process based on condition y, that is, from x under the guidance of the classifier t Generate x t-1 ; η is the weight factor of the classifier gradient, which is used to control the guidance strength; is a normal distribution with a mean of The variance is σ θ (x t ,t)I.

[0094] The diffusion model of the present invention is an advanced deep generation method, which is essentially a parameterized Markov chain, including a diffusion process and a reverse process. Figure 3 As shown in Figure 1, the diffusion model first gradually introduces noise into the data through a diffusion process, mapping the original data distribution to a simple Gaussian distribution. Then, through a reverse process, the added noise is predicted at each step and the data is gradually denoised to recover the noise-free data. Through these two processes, the diffusion model can generate samples that are consistent with the original data distribution.

[0095] In the process of generating power system transient scenario data, the diffusion model first diffuses historical transient data, gradually transforming complex scenario disturbances into Gaussian noise; then, in the reverse denoising process, the model introduces key feature information of the power system to gradually recover physically meaningful transient samples from the Gaussian noise. This method can not only generate high-fidelity and highly diverse transient scenario data but also effectively cover key scenario data such as extreme faults or rare disturbances, thus providing sufficient training data for transient stability assessment. Due to its nature of gradual training, the diffusion model has more advantages in capturing complex data distributions, generating more diverse and high-quality transient samples, and maintaining a more stable training process.

[0096] The diffusion process of the diffusion model involves continuously adding Gaussian noise to the original data until it finally becomes pure Gaussian noise. This process can be formalized as:

[0097]

[0098] x0 is the original data distribution; x t ,t = 1,...T are the latent variables in the intermediate process, representing the intermediate state after adding Gaussian noise for T steps; q(x t |x t-1 ) is the diffusion process; β t is the hyperparameter that controls the noise variance.

[0099] An important property of the diffusion process is that the state x t at any intermediate step can be calculated from x0:

[0100]

[0101] where: and α t = 1 - β t ; 騈~(0, I) is the sampled standard Gaussian noise.

[0102] The role of the reverse process is to gradually denoise x t to recover the original data x0. This process is achieved through a parameterized denoising neural network. Similar to the diffusion process, the reverse process can be formalized as:

[0103]

[0104] where x T ~N(0, I); p θ (x t-1 |x t ) represents the reverse process data distribution; μ θ (x t ,t) and σ θ (xt ,t) are two parameterized neural network models, representing the mean and variance of the distribution respectively.

[0105] The diffusion model includes a forward process (Formula (1)) and a reverse process (Formula (3)). By combining these two processes, the diffusion model can generate realistic transient samples.

[0106] Formula (1) mainly describes the forward process of the diffusion model. The forward process refers to the process of gradually adding noise to the data so that the original data gradually transforms into a noise distribution. In the forward process, the original data x0 is gradually noised until a completely random noise sample x is generated. T Specifically, the first line of the formula q(x 1:T |x0) represents the entire forward process as the product of multiple conditional probabilities (i.e., the right side of the equation), revealing that from x0 to x T The second row of formulas is the right side of the first row of formulas q(x t |x t-1 ) is expanded to define the conditional probability at each time step t, that is, under the given condition x t-1 When x t The mean is The variance is β t Normal distribution of I. This is a Markov process, that is, the state x at the current time step t Only the state x of the previous time step t-1 It is related to the state, but not to other states.

[0107] Formula (2) describes the noise addition mechanism of the forward process (i.e., Formula (1)), that is, for any noise sample x at any time step t , can be obtained by adding a Gaussian noise to the original data x0 This provides a theoretical basis for the denoising of the reverse process, that is, by simply predicting the noise added at each step, the original data x0 can be gradually restored.

[0108] Formula (3) mainly describes the reverse process of the diffusion model. The reverse process refers to the final step data x of the forward process. T The process of gradually denoising and finally recovering the original data from the noise. The first line of the formula describes the overall form of the reverse process, indicating that the starting point of the reverse process is the noise sample x T , through the conditional probability p at each time step θ (x t-1 |x t ), to recursively generate the data x of the previous moment step by step t-1 The second row of formula is the right side of the first row of formula θ (xt-1 |x t ) describes how, for each time step t, the current sample x t Generate the previous moment x t-1 Specifically, the reverse process needs to predict the noise added at each time step in the forward process to achieve x t to x t-1 The recovery process. θ (x t ,t) represents the mean of normal distribution, represents the variance of the normal distribution, which is calculated by the denoising neural network with parameter θ. The denoising neural network takes the noise sample x at the current time step as t and time step t as input, and output the last moment x t-1 The core idea of the reverse process is to gradually restore the noisy samples to the original data by gradually removing the noise and using the output of the denoising neural network.

[0109] Formula (3) describes the reverse process of restoring the original data by gradually denoising. The core of the reverse process of restoring the original data is to estimate the noise through the denoising neural network. The training of the denoising neural network requires a loss function to measure the difference between the network output and the target result. Formula (4) is this loss function. The training process of the denoising neural network is to compare the noise ε predicted by the denoising network. θ (x t The training goal is to minimize the difference between the noise and the real noise ε. This training process forces the network to learn how to predict the noise as accurately as possible at each time step, so that the final recovered sample is as close as possible to the real original data distribution.

[0110] In power system transient sample enhancement, the forward process simulates different system disturbance and fault scenarios by gradually adding noise to the original power system samples. This process generates samples that conform to a predetermined noise distribution by gradually adding noise to the original samples (such as transient data such as voltage and current). This allows the model to learn the potential variations and uncertainties in the transient data through repeated training. This process increases the diversity of the dataset. Especially in data-scarce scenarios, it can generate samples that resemble real-world fault or disturbance conditions, thereby improving the model's generalization and robustness. The reverse process recovers the original power system state from the noisy samples. In transient sample enhancement, the reverse process gradually removes noise to recover the power system state before and after the fault. Specifically, at each time step, the reverse process uses a neural network to predict the noise added to the current sample, thereby inferring the sample at the previous time step. This process enables the model to generate samples that conform to power system laws from completely random noise.

[0111] To recover the original distribution from the backward process, the following objective function can be used:

[0112]

[0113] Among them θ It is a parameterized denoising network that predicts the noise and recovers the original data distribution.

[0114] (2) Classifier-guided generation

[0115] The present invention is based on the diffusion model generation method in (1) and uses a classifier-guided generation technology to integrate conditional information (such as category labels) into the generation process, thereby controlling the generation of transient scene data of a specific category.

[0116] The key idea of classifier-guided generation is to use the gradient information of the classifier to generate samples to adjust the reverse process of the diffusion model, so that the generated data not only conforms to the overall data distribution, but also meets the conditional constraints of the target category.

[0117] In order to incorporate the category condition y, the classifier-guided generation is achieved by introducing a classifier p φ (y|x t ), calculate the log probability of the classifier and adjust the reverse process of the diffusion model:

[0118]

[0119] Combined with the gradient adjustment of the classifier, the reverse process becomes:

[0120]

[0121] The present invention uses the guidance of the classifier and the reverse generation process to incorporate the gradient into the sampling of each step to adjust the generation path.

[0122] Formula (5) describes how to guide the process of conditional generation in the back diffusion process. In the diffusion model, the goal of conditional generation is to generate samples that meet these labels based on specific labels (such as the stability and instability of transient samples). By using a classifier p(y|x t ), the classifier is based on the current sample x t The features of the classifier predict which category it belongs to (for example, label y = 0 indicates stability and y = 1 indicates instability). Then, by passing the gradient information output by the classifier to the diffusion model, it is prompted to generate samples that meet the requirements of a specific label, thereby guiding the generation process towards samples of a specific label.

[0123] Specifically, for example, the features of the generated samples are voltage and reactive power, which usually reflect the operating state of the power system, such as stable or unstable state. By introducing classifier guidance, the generated samples will be affected by label information. Assuming that we want to generate unstable samples (i.e., label y = 1), we can use the classifier to calculate the probability distribution of the current sample under this label, and use its gradient information in the generation process to guide the generated samples towards the instability direction. In this way, the voltage and reactive power of the generated samples will meet the instability criteria.

[0124] In power system transient sample enhancement, unstable samples are typically scarcer than stable samples, making the generation of unstable samples crucial for improving model performance. By guiding the generation of samples with instability labels, the diffusion model can generate more samples that match actual power system instability conditions, thereby providing more unstable samples for the transient stability assessment model. This not only helps balance the dataset but also improves the accuracy of the transient stability assessment model in identifying unstable samples. In this way, classifier-guided conditional generation enables the diffusion model to generate targeted samples that meet specific conditions, thereby enhancing the classification model's ability to discriminate against unstable samples.

[0125] Formula (6) is actually a variation of Formula (3), which describes the reverse process with classifier guidance (i.e., Formula (5)). The difference between Formula (6) and Formula (3) is that the reverse process of Formula (6) adds the label information y as a condition to guide the generation process towards samples with specific labels. In the second line of the formula, the expression of the mean becomes That is more This item. This item is the adjustment item of classification guidance, which contains the gradient information of the classifier. η is the weight factor of the classifier gradient, which is used to control the guidance strength. The larger η is, the stronger the influence of the classifier guidance on the generation process. By introducing This adjustment, in the reverse process, not only considers the noise distribution of the diffusion model itself but also utilizes the label information provided by the classifier to optimize the generated samples, ensuring that they conform to the characteristics of the target label y. The purpose of transient sample enhancement is to generate unstable sample types. This classifier-guided generation method allows the diffusion model to consider the conditions of unstable labels during the generation process, thereby ensuring that the generated samples conform to the characteristics of instability.

[0126] Step 102: determining key samples among transient samples based on a preset sensitive area of a transient stability assessment classification boundary;

[0127] Preferably, based on the sensitive areas of the classification boundaries in the preset transient stability assessment, determining the key samples in the transient samples includes:

[0128] For the classification boundary y=f(x), the sample point (x i ,y i ) to the classification boundary can be expressed as:

[0129]

[0130] Among them, f(x i ) is the corresponding x on the classification boundary i The predicted value of f′(x i ) is the classification boundary at x i The slope at

[0131] The distance threshold of the sensitive area is set as ε, and the samples with classification boundary distance d≤ε in the transient samples are determined as key samples.

[0132] The present invention selects key samples. The selection of key samples is crucial in transient stability assessment. These samples are typically located at critical points in the system state or under complex disturbance conditions, and can reflect the most challenging characteristics of the power system under dynamic changes. Through in-depth analysis of key samples, the essence of transient stability issues can be more effectively captured, improving the model's adaptability to extreme scenarios.

[0133] This invention utilizes a key sample selection method based on classification boundaries. Key samples are selected based on their distribution and characteristics relative to the classification boundaries. For sensitive areas near classification boundaries in transient stability assessments, this method combines classification boundary distance calculations to scientifically select key samples that are most representative of model decisions and have a significant impact on assessment results. These key samples are then targeted for enhancement, further improving the accuracy and reliability of the assessment.

[0134] For the classification boundary y=f(x), any sample point (x i ,yi ) to the classification boundary can be expressed as:

[0135]

[0136] where f(x i ) is the corresponding x on the classification boundary i The predicted value of f′(x i ) is the classification boundary at x i The slope at ; a distance threshold ε can be set to filter out samples that meet d≤ε as key samples.

[0137] Step 103: Enhance the key samples based on the diffusion model guided by the classifier to generate enhanced samples.

[0138] The present invention can effectively identify key samples near the classification boundary through the combination of diffusion model, classifier-guided generation and key sample selection, ensure that the model focuses on sensitive areas in transient stability assessment, and improve the classification accuracy of the model for boundary samples.

[0139] (2) The key transient sample enhancement method proposed in this paper generates high-fidelity, diverse samples while preserving the characteristics of key samples. This method significantly increases the number and diversity of instability samples, particularly in power systems, where there are fewer and more unbalanced samples. The enhanced key sample data significantly improves the generalization and robustness of the model, enabling it to more accurately judge transient stability in complex scenarios and extreme operating conditions.

[0140] Through innovative designs in data enhancement, key sample screening, and classification model optimization, the present invention comprehensively improves the efficiency and reliability of power system transient stability analysis, and fills the shortcomings of traditional methods in sample imbalance and classification accuracy.

[0141] The present invention is simulated and verified with the IEEE10 machine 39 node standard system, and the transient time domain simulation is performed using BPA software. The load level is set between 70% and 120% with a step interval of 5%, and 11 load conditions are obtained. Three-phase short-circuit faults are set at the head end, 20%, 40%, 60%, and 80% positions of all lines. The starting time of the fault is the 50th cycle, and the duration of the fault is 15 cycles. The simulation obtains 3455 transient samples, of which 2483 are stable samples and 972 are unstable samples. In order to simulate the situation where the proportion of transient samples in the actual power system is small, some unstable samples are randomly deleted, so that the proportion of unstable samples is about 5%. The training set and test set are divided into 8:2.

[0142] The following metrics are used to evaluate the classification results:

[0143]

[0144] Where TS represents the number of samples that are actually stable and are judged as stable; TU represents the number of samples that are actually unstable and are judged as unstable; FS represents the number of samples that are actually unstable but are judged as stable; FU represents the number of samples that are actually stable but are judged as unstable; TSR is the recall rate of stable samples, which is defined as the ratio of the number of samples correctly classified as stable samples to the total number of actual stable samples; TFR is the recall rate of unstable samples, which is defined as the ratio of the number of samples correctly classified as unstable samples to the total number of actual unstable samples; G-mean is λ TSR and λ TFR The geometric mean reflects the classification balance of the model between the two types of samples; ACC is the overall classification accuracy of the model.

[0145] like Figure 2 As shown in Figure 1, after screening the key samples in the training set, the present invention uses a diffusion model guided by a classifier to enhance the key samples to obtain an enhanced training set. In order to compare the enhancement effect, SMOTE, ROS and ADASYN methods are also used for enhancement. SMOTE and ADASYN are enhancement methods based on linear interpolation, and ROS is an enhancement method that simply copies a few sample classes from the original data. The decision tree (DT) classifier is trained using the enhanced training set and verified on the test set. The results are shown in Table 1.

[0146] Table 1 Performance comparison of enhancement methods

[0147] Enhancement Method <![CDATA[λ TSR %]]> <![CDATA[λ TFR %]]> <![CDATA[λ G-mean %]]> <![CDATA[λ ACC %]]> Raw data 99.59% 60.00% 77.30% 96.95% SMOTE 96.73% 82.86% 89.52% 95.80% ROS 99.59% 77.14% 87.65% 98.09% ADASYN 96.32% 77.14% 86.20% 95.04% The method proposed by the present invention 97.14% 91.43% 94.24% 98.76%

[0148] As can be seen from Table 1, the classifier-guided diffusion model proposed in this paper shows significant advantages in enhancing key transient samples, especially in the recall rate λ of unstable samples. TFR It achieves 91.43% on the CNN, significantly outperforming other methods while maintaining a high stable sample recall λ. TSR and classification balance λ G-mean This feature is particularly important in power system transient stability analysis, as missing unstable samples may lead to serious safety risks. In contrast, although traditional methods such as SMOTE, ROS, and ADASYN have improved in balancing data distribution, their recall rates of unstable samples are relatively low. In particular, SMOTE and ADASYN fail to fully cover complex samples near the classification boundaries. The method proposed in this invention not only significantly improves the imbalance problem of transient sample data in power systems, but also effectively improves classification accuracy, providing more reliable technical support for power system transient stability analysis.

[0149] Figure 4 4 is a structural diagram of a key transient sample enhancement system based on a diffusion model according to a preferred embodiment of the present invention.

[0150] like Figure 4 As shown, the present invention provides a key transient sample enhancement system based on a diffusion model, the system comprising:

[0151] The initialization unit 401 is configured to generate transient samples through a diffusion process and a reverse process based on a diffusion model, and in the reverse process, add constraints to the reverse process based on a classifier to generate transient samples that meet the constraints;

[0152] Preferably, the initialization unit 401 is configured to generate transient samples through a diffusion process and an inverse process based on a diffusion model, and is further configured to:

[0153] Gaussian noise is added to the original data during the diffusion process:

[0154]

[0155] Among them, x0 is the original data distribution; x t ,t=1,...T is the latent variable of the intermediate process, which represents the intermediate state after adding T steps of Gaussian noise; q(x t |x t-1 ) is the diffusion process; β t is a hyperparameter that controls the noise variance; x 1:T is all the intermediate states of T steps from 1 to T; I is the identity matrix;

[0156] Any intermediate state x in the diffusion process t Calculate from the original data x0:

[0157]

[0158] in: And α t =1-β t ; is standard Gaussian noise.

[0159] Preferably, the initialization unit 401 is configured to generate transient samples through a diffusion process and an inverse process based on a diffusion model, and is further configured to:

[0160] In the reverse process, by removing the intermediate state x t Gaussian noise is restored to the original data x0, and the reverse process is:

[0161]

[0162] Among them, xT ~N(0,I);p θ (x t-1 |x t ) represents the reverse process data distribution; μ θ (x t ,t) and σ θ (x t , t) are parameterized neural network models, respectively expressed as the mean and variance of the reverse process data distribution; p θ (x 0:T ) is the joint probability distribution of the entire reverse process; p(x T ) is the final state of the diffusion process; Represents x t-1 The mean is μ θ (x t ,t) variance is Normal distribution;

[0163] Based on the objective function, the original transient sample distribution is restored in the reverse process:

[0164]

[0165] Among them, ε θ It is a parameterized denoising network, x0~q(x0) is the distribution of real data; ε is the noise; ε θ (x t ,t) is the denoising neural network with parameter θ.

[0166] Preferably, the initialization unit 401 is configured to add constraints to the reverse process based on the classifier in the reverse process to generate transient samples that meet the constraints, and is further configured to:

[0167] Introduce the constraint y into the classifier p φ (y|x t ):

[0168]

[0169] in, Indicates the calculation of x t The gradient of p(y|x t ) indicates that category y is in the current state x t The conditional probability under φ (y|x t ) is the category y predicted by the classifier in the current state x t The conditional probability under

[0170] Gradient-adjusted backward process based on the classifier:

[0171]

[0172] Among them, p θ (x t-1 |x t ,y) is the probability distribution of the reverse process based on condition y, that is, from x under the guidance of the classifier t Generate x t-1 ; η is the weight factor of the classifier gradient, which is used to control the guidance strength; is a normal distribution with a mean of The variance is σ θ (x t ,t)I.

[0173] A determination unit 402 is configured to determine key samples in transient samples based on a preset sensitive area of a transient stability assessment classification boundary;

[0174] Preferably, the determining unit 402 is configured to determine key samples in transient samples based on a preset sensitive area of a classification boundary in transient stability assessment, and further configured to:

[0175] For the classification boundary y=f(x), the sample point (x i ,y i ) to the classification boundary can be expressed as:

[0176]

[0177] Among them, f(x i ) is the corresponding x on the classification boundary i The predicted value of f′(x i ) is the classification boundary at x i The slope at

[0178] The distance threshold of the sensitive area is set as ε, and the samples with classification boundary distance d≤ε in the transient samples are determined as key samples.

[0179] The generating unit 403 is configured to enhance the key samples based on the diffusion model guided by the classifier to generate enhanced samples.

[0180] A key transient sample enhancement system based on a diffusion model in a preferred embodiment of the present invention corresponds to a key transient sample enhancement method based on a diffusion model in a preferred embodiment of the present invention, and will not be described in detail here.

[0181] The present invention provides a computer-readable storage medium storing a computer program for executing a key transient sample enhancement method based on a diffusion model.

[0182] The present invention provides an electronic device, which includes: a processor and a memory; wherein,

[0183] Memory for storing processor-executable instructions;

[0184] The processor is configured to read executable instructions from the memory and execute the instructions to implement a key transient sample enhancement method based on a diffusion model.

[0185] It will be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention may be implemented in various computer languages, for example, the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0186] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0189] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0190] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

[0191] The invention has been described above with reference to a few embodiments. However, it is readily apparent to a person skilled in the art that other embodiments than the ones disclosed above are equally within the scope of the invention, as defined by the appended patent claims.

[0192] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a / the [means, component, etc.]" are to be interpreted openly as referring to at least one instance of the means, component, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not necessarily need to be performed in the exact order disclosed, unless explicitly stated otherwise.

Claims

1. A key transient sample enhancement method based on a diffusion model, the method comprising: Based on the diffusion model, transient samples are generated through the diffusion process and the reverse process. In the reverse process, constraints are added to the reverse process based on the classifier to generate transient samples that meet the constraints. Determine key samples among transient samples based on the preset sensitive areas of transient stability assessment classification boundaries; The key samples are enhanced based on a diffusion model guided by a classifier to generate enhanced samples.

2. The method according to claim 1, wherein generating transient samples through a diffusion process and a reverse process based on a diffusion model comprises: Gaussian noise is added to the original data during the diffusion process and removed during the reverse process to generate transient samples.

3. The method according to claim 2, wherein Gaussian noise is added to the original data during the diffusion process to generate noise samples x T ,include: Among them, x0 is the original data distribution; x t , t=1,...T is the latent variable of the intermediate process, which represents the intermediate state after adding T steps of Gaussian noise; q(x t |x t-1 ) is the diffusion process; β t is a hyperparameter that controls the noise variance; x 1:T are all the intermediate states of T steps from 1 to T; I is the identity matrix.

4. The method according to claim 2, wherein the noise samples x are removed in the reverse process. T , the Gaussian noise in generates transient samples, including: Among them, x T ~N(0,I);p θ (x t-1 |x t ) represents the reverse process data distribution; μ θ (x t ,t) and σ θ (x t , t) are parameterized neural network models, respectively expressed as the mean and variance of the reverse process data distribution; p θ (x 0:T ) is the joint probability distribution of the entire reverse process; p(x T ) is the final state of the diffusion process; Represents x t-1 The mean is μ θ (x t ,t) variance is Normal distribution.

5. The method according to claim 4, wherein in the reverse process, adding constraints to the reverse process based on the classifier to generate transient samples that meet the constraints comprises: Introduce the constraint y into the classifier p φ (y|x t ), determine the classifier: in, Indicates the calculation of x t The gradient of p(y|x t ) indicates that category y is in the current state x t The conditional probability under φ (y|x t ) is the category y predicted by the classifier in the current state x t Conditional probability under ; Based on the gradient adjustment of the determined classifier, the reverse process is generated to generate transient samples that meet the constraints: Among them, p θ (x t-1 |x t , y) is the probability distribution of the reverse process based on condition y, that is, from x under the guidance of the classifier t Generate x t-1 ; η is the weight factor of the classifier gradient, which is used to control the guidance strength; is a normal distribution with a mean of The variance is σ θ (x t ,t)I.

6. The method according to claim 1, wherein determining key samples in transient samples based on sensitive areas of classification boundaries in a preset transient stability assessment comprises: For the classification boundary y=f(x), the sample point (x i ,y i ) to the classification boundary can be expressed as: Among them, f(x i ) is the predicted value corresponding to xi on the classification boundary; f′(x i ) is the classification boundary at x i The slope at The distance threshold of the sensitive area is set as ε, and the samples with classification boundary distance d≤ε in the transient samples are determined as key samples.

7. A key transient sample enhancement system based on a diffusion model, the system comprising: An initial unit is used to generate transient samples through a diffusion process and a reverse process based on a diffusion model, and in the reverse process, add constraints to the reverse process based on a classifier to generate transient samples that meet the constraints; a determination unit, configured to determine key samples among transient samples based on a preset sensitive area of a transient stability assessment classification boundary; A generating unit is configured to enhance the key samples based on a diffusion model guided by a classifier to generate enhanced samples.

8. The system according to claim 7, wherein the initial unit is further configured to: Gaussian noise is added to the original data during the diffusion process and removed during the reverse process to generate transient samples.

9. The system according to claim 8, wherein the initialization unit is configured to add Gaussian noise to the original data during the diffusion process to generate a noise sample x T : in, x0 is the original data distribution; x t ,t=1,...T is the latent variable of the intermediate process, which represents the intermediate state after adding T steps of Gaussian noise; q(x t |x t-1 ) is the diffusion process; β t is a hyperparameter that controls the noise variance; x 1:T are all the intermediate states of T steps from 1 to T; I is the identity matrix.

10. The system according to claim 8, wherein the initial unit is further configured to: In the reverse process, by removing the intermediate state x t Gaussian noise is restored to the original data x0, and the reverse process is: in, x T ~N(0,I);p θ (x t-1 |x t ) represents the reverse process data distribution; μ θ (x t ,t) and σ θ (x t , t) are parameterized neural network models, respectively expressed as the mean and variance of the reverse process data distribution; p θ (x 0:T ) is the joint probability distribution of the entire reverse process; p(x T ) is the final state of the diffusion process; Represents x t-1 The mean is μ θ (x t ,t) variance is Normal distribution; Based on the objective function, the original transient sample distribution is restored in the reverse process: Among them, ε θ It is a parameterized denoising network, x0~q(x0) is the distribution of real data; ε is the noise; ε θ (x t , t) is the denoising neural network with parameter θ.

11. The system according to claim 10, wherein the initial unit is further configured to: Introduce the constraint y into the classifier p φ (y|x t ), determine the classifier: in, Indicates the calculation of x t The gradient of p(y|x t ) indicates that category y is in the current state x t The conditional probability under φ (y|x t ) is the category y predicted by the classifier in the current state x t The conditional probability under Based on the gradient of the determined classifier, the reverse process is adjusted to generate transient samples that meet the constraints: Among them, p θ (x t-1 |x t , y) is the probability distribution of the reverse process based on condition y, that is, from x under the guidance of the classifier t Generate x t-1 ; η is the weight factor of the classifier gradient, which is used to control the guidance strength; is a normal distribution with a mean of The variance is σ θ (x t ,t)I.

12. The system according to claim 7, wherein the determining unit is further configured to: For the classification boundary y=f(x), the sample point (x i ,y i ) to the classification boundary can be expressed as: in, f(x i ) is the corresponding x on the classification boundary i The predicted value of f′(x i ) is the classification boundary at x i The slope at The distance threshold of the sensitive area is set as ε, and the samples with classification boundary distance d≤ε in the transient samples are determined as key samples.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.

14. An electronic device, characterized in that: The electronic device includes: a processor and a memory; wherein, The memory is a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Method, device and equipment for optimizing power grid security domain based on de-noising diffusion model

    CN122118886A