Power grid stability evaluation training sample processing method considering distribution characteristics
By using the corrected gradient and sample space division methods in the grid stability evaluation model training, the evaluation deviation problem caused by the unbalanced sample set in the prior art is solved, and a more accurate unbalance correction effect is achieved.
Patent Information
- Application Number
- CN202411502592.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-14
AI Technical Summary
When the existing technology uses unbalanced sample sets to train the grid stability evaluation model, evaluation deviation problems are prone to occur, and the existing unbalance correction methods are difficult to accurately reflect the imbalance of sample quantity and quality, and it is difficult to sample with different degrees of influence. Give reasonable cost sensitivity coefficients.
An imbalance correction method considering distribution characteristics is proposed, and the cost-sensitive coefficient is corrected by correcting the gradient, and a more accurate correction effect is obtained by dividing the sample space. This method includes obtaining training samples for grid stability evaluation, calculating spatial distribution information and probability distribution parameters of each sample, dividing the sample set into 3 subsets, calculating the degree of sample imbalance between each subset, and using this information to correct the loss Functions to achieve balanced processing of training samples.
By calculating the gradient of the loss function relative to the model parameters during backpropagation, a coefficient that better reflects the degree of imbalance between the two types of samples is obtained, and the model is corrected according to the probability distribution of the sample failure severity, which significantly improves The model evaluates the bias correction effect.
Smart Images

Figure CN119441879A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for processing training samples for power grid stability assessment taking distribution characteristics into consideration, and belongs to the technical field of power systems. Background Art
[0002] Due to the inherent robustness of the power system, the number of stable samples is significantly greater than that of unstable samples. However, when using such an unbalanced sample set for model training, the model may encounter serious evaluation bias problems because the misclassification cost of unstable samples is much higher than that of stable samples. Therefore, during the model training process, an effective imbalance correction method is urgently needed. At present, the cost-sensitive method has shown a good correction effect on the imbalance problem, but it faces two major challenges in its application: first, it is difficult to obtain the cost sensitivity coefficient, and second, it is difficult to assign a reasonable cost sensitivity coefficient to samples with different degrees of influence.
[0003] Most of the existing sample imbalance correction cost coefficients are based on the prior probability of the sample set or the trial and error method, but the cost coefficients obtained by these methods often cannot accurately reflect the imbalance between the two types of samples in quantity and quality, so the correction effect is random. Although some studies have considered both the quantity and quality imbalances, they lack theoretical derivation. In addition, most existing methods assign the same cost coefficient to all samples, which is unreasonable in power systems. Because the type, location, and duration of the fault are variable during the operation of the power system, the fault severity varies, which in turn has different effects on the correction of model parameters.
[0004] In order to overcome the imbalance between the two types of samples in quantity and quality, the present invention proposes an imbalance correction method that takes distribution characteristics into consideration; this method uses a modified gradient to correct the cost sensitivity coefficient in view of the imbalance between the two types of samples; at the same time, a more accurate correction effect is obtained by dividing the sample space in view of the different impacts of different samples in the set on the model. Summary of the invention
[0005] The present invention provides a method for processing training samples for power grid stability assessment taking distribution characteristics into consideration, which can effectively solve the above problems.
[0006] The present invention is achieved in that:
[0007] A method for processing training samples for power grid stability assessment considering distribution characteristics comprises the following steps:
[0008] S1, obtain the training samples for grid stability assessment, and use the idea of support vector machine to calculate the spatial distribution information of each sample;
[0009] S2, using the natural distribution probability calculation method, calculate the probability distribution parameters of each sample and divide the sample set into three subsets;
[0010] S3, calculate the degree of sample imbalance between each corresponding subset respectively;
[0011] S4, using the degree of sample imbalance between corresponding subsets to correct the loss function in each round of training, so as to achieve balanced processing of training samples.
[0012] As a further improvement, in step S1, the specific steps of obtaining training samples for power grid stability assessment include:
[0013] S11, obtaining the power angle, angular velocity, unbalanced power, voltage, and voltage phase angle of each generator node in the power grid, and the power, frequency, voltage, and voltage phase angle of each bus node;
[0014] S12, extract the characteristic data of five sampling cycles before the fault occurs, the fault occurs, the fault is cleared, and after the fault is cleared, as well as the result of stability. The stable sample label is 1, and the unstable sample label is 0, thereby forming a training sample set X = {x i}.
[0015] As a further improvement, in step S1, the classification hyperplane obtained by training the support vector machine SVM is shown in formula (1);
[0016] w T X+b=0 (1)
[0017] Among them, w is the weight coefficient and b is the bias.
[0018] As a further improvement, the spatial information of the stable sample and the unstable sample can be calculated by the Euclidean distance from the sample to the classification hyperplane; the spatial information Dist of the stable sample s (x i ) As shown in formula (2), the spatial information Dist of unstable samples u (x j ) As shown in formula (3), after obtaining the spatial information of each sample, Dist s (x i ) and Dist u (x j ) for standardization;
[0019]
[0020] Among them, {X s} and {X u} are stable sample sets and unstable sample sets respectively, and ||·||2 is the L2 norm.
[0021] As a further improvement, the probability distribution parameter σ of the stable samples and the probability distribution parameter σ of unstable samples u As shown in formula (4) and formula (5);
[0022]
[0023] Among them, n s and n u represent the number of stable samples and unstable samples respectively, is the mean of all samples.
[0024] As a further improvement, in step S2, the method of dividing the sample set into three subsets is to decompose the stable sample set according to the 3σ principle, and decompose them into [0, 2σ s ),[2σ s ,3σ s ) and [3σ s ,1] three sets, named {X s,1}, {X s,2} and {X s,3}, the number of samples in the set is n s,1 , n s,2 and n s,3 ; Similarly, the unstable sample set is decomposed into [0,2σ u ),[2σ u ,3σ u ) and [3σ u ,1] three sets, named {X u,1}, {X u,2} and {X u,3}, the number of samples in the set is n u,1 , n u,2 and n u,3 .
[0025] As a further improvement, in step S4, during each round of training, the sum of the gradients of stable samples and unstable samples in different sets is calculated respectively, as shown in equations (6) and (7);
[0026]
[0027] Where S s,k represents the sum of the gradients in the kth stable sample set; S u,k represents the sum of the gradients in the kth unstable sample set; y(x i ) represents the predicted label of the i-th sample, y(x j ) represents the predicted label of the jth sample.
[0028] As a further improvement, the correction coefficient Imb of the kth sample set isk As shown in formula (8).
[0029]
[0030] As a further improvement, the sum of the gradients of stable and unstable samples after each round of training is brought into the loss function, and the results of each round of training are obtained by Imb k The coefficient is corrected to achieve the result of imbalanced training samples.
[0031] Loss(x i )=l i lny(x i )+Imb k (1-l i )ln(1-y(x i )) (9)
[0032] Where Loss(x i ) represents the calculated value of the loss function of the i-th sample, l i represents the true label of the i-th sample, y(x i ) represents the predicted label of the i-th sample.
[0033] The beneficial effects of the present invention are as follows: by calculating the gradient of the loss function relative to the model parameters in the back-propagation process, the present invention can obtain a coefficient that better reflects the degree of imbalance between the two types of samples; at the same time, according to the probability distribution of the severity of the sample faults, the samples with similar impact on the model are divided into the same subset; by using the corresponding cost coefficients to correct different subsets, a better model evaluation deviation correction effect can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 It is a model space division diagram provided by an embodiment of the present invention.
[0036] Figure 2 This is a wiring diagram of an IEEE 39-node system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention claimed for protection, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0038] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0039] Reference Figure 1-Figure 2 As shown, this embodiment provides a specific implementation method for a training sample processing method for power grid stability assessment considering distribution characteristics, including the following steps:
[0040] S1, obtain the training samples for grid stability assessment, and use the idea of support vector machine to calculate the spatial distribution information of each sample;
[0041] S2, using the natural distribution probability calculation method, calculate the probability distribution parameters of each sample and divide the sample set into three subsets;
[0042] S3, calculate the degree of sample imbalance between each corresponding subset respectively;
[0043] S4, using the degree of sample imbalance between corresponding subsets to correct the loss function in each round of training, so as to achieve balanced processing of training samples.
[0044] In some embodiments, in step S1, the specific steps of obtaining training samples for power grid stability assessment include:
[0045] S11, obtaining the power angle, angular velocity, unbalanced power, voltage, and voltage phase angle of each generator node in the power grid, and the power, frequency, voltage, and voltage phase angle of each bus node;
[0046] S12, extract the characteristic data of five sampling cycles before the fault occurs, the fault occurs, the fault is cleared, and after the fault is cleared, as well as the result of stability. The stable sample label is 1, and the unstable sample label is 0, thereby forming a training sample set X = {x i}.
[0047] As a further improvement, in step S1, the classification hyperplane obtained by training the support vector machine SVM is shown in formula (1);
[0048] w T X+b=0 (1)
[0049] Among them, w is the weight coefficient and b is the bias.
[0050] In some embodiments, the spatial information of the stable sample and the unstable sample can be calculated by the Euclidean distance from the sample to the classification hyperplane; the spatial information Dist of the stable sample s (x i ) As shown in formula (2), the spatial information Dist of unstable samples u (x j ) As shown in formula (3), after obtaining the spatial information of each sample, Dist s (x i ) and Dist u (x j ) for standardization;
[0051]
[0052] Among them, {X s} and {X u} are stable sample sets and unstable sample sets respectively, and ||·||2 is the L2 norm.
[0053] In some embodiments, the probability distribution parameter σ of the stable sample s and the probability distribution parameter σ of unstable samples u As shown in formula (4) and formula (5);
[0054]
[0055] Among them, n s and n u represent the number of stable samples and unstable samples respectively, is the mean of all samples.
[0056] In some embodiments, in step S2, the method of dividing the sample set into three subsets is to decompose the stable sample set according to the 3σ principle, and decompose them into [0, 2σ s ),[2σ s,3σ s ) and [3σ s ,1] three sets, named {X s,1}, {X s,2} and {X s,3}, the number of samples in the set is n s,1 , n s,2 and n s,3 ; Similarly, the unstable sample set is decomposed into [0,2σ u ),[2σ u ,3σ u ) and [3σ u ,1] three sets, named {X u,1}, {X u,2} and {X u,3}, the number of samples in the set is n u,1 , n u,2 and n u,3 .
[0057] In some embodiments, in step S4, during each round of training, the sum of the gradients of stable samples and unstable samples in different sets is calculated respectively, as shown in equations (6) and (7);
[0058]
[0059] Where S s,k represents the sum of the gradients in the kth stable sample set; S u,k represents the sum of the gradients in the kth unstable sample set; y(x i ) represents the predicted label of the i-th sample, y(x j ) represents the predicted label of the jth sample.
[0060] Furthermore, the correction coefficient Imb of the kth sample set is k As shown in formula (8).
[0061]
[0062] In some embodiments, the sum of the gradients of the stable samples and the unstable samples after each round of training is brought into the loss function, and the result of each round of training is obtained by Imb k The coefficient is corrected to achieve the result of imbalanced training samples.
[0063] Loss(x i )=l i lny(x i )+Imb k (1-l i )ln(1-y(x i)) (9)
[0064] Where Loss(x i ) represents the calculated value of the loss function of the i-th sample, l i represents the true label of the i-th sample, y(x i ) represents the predicted label of the i-th sample.
[0065] Test Trial:
[0066] The IEEE 39-bus system is one of the standard systems for power system stability analysis. This paper will use this system to verify the model. The wiring diagram of the IEEE 39-bus system is as follows: Figure 2 As shown, G represents the generator and the number is the bus node number.
[0067] The IEEE 39-bus system consists of 10 synchronous generators, 39 buses, 34 transmission lines and 17 load nodes. Except for bus16-bus19 lines, N-1 transient stability experiments are conducted on other transmission lines. Permanent three-phase short-circuit faults with different load levels, fault locations and fault durations are considered to generate data sets. The test system load levels consider 90%, 95%, 100%, 105%, and 110%. The fault locations are set at 10%, 50%, and 90% of the line respectively. The system frequency is 60Hz, the fault duration is selected as 6 to 18.5 cycles, and sampling is performed every 0.5 cycle. According to the set fault conditions, this simulation generates a total of 12,870 samples, including 6,960 stable samples and 5,910 unstable samples.
[0068] The correction effects of the cost-sensitive method of the sample shock norm based on the SSAE model of the present invention are compared with those of the imbalance correction method based on RUS, ROS, the oversampling technology SMOTE for processing data imbalance problems, the adaptive synthetic sampling method ADASYN for imbalanced learning, the traditional cost-sensitive method (CCS), and the cost-sensitive method based on the loss function ratio (CSBLF).
[0069] Specifically, 1000 unstable samples and 5000 stable samples were randomly selected as training sets. 1000 samples from each category were randomly selected as test sets. In order to improve the reliability of the comparison results, all the following experiments were conducted using 5 random tests. The average of the 5 results was taken as the final result, as shown in Table 1.
[0070] Table 1 Comparison results of different methods
[0071]
[0072]
[0073] As shown in Table 1, the imbalance correction method based on RUS may not be effective because it may exclude key samples; the oversampling method balances the prior probability of the training set, but the generated samples may not conform to the original sample space distribution; the highest ACC is only 97.20%; compared with the sample generation method, the ACC of the cost-sensitive method is significantly improved; among the three cost-sensitive methods, the accuracy of the method of the present invention is the highest at 97.85% and the lowest at 2.08%. The results show that this method can effectively correct the imbalance between the two types of samples.
[0074] 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 flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, 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 flowchart and / or block diagram. 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.
[0075] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate 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 A function specified in one or more boxes.
[0076] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0077] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0078] 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.
[0079] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0080] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0081] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
Claims
1. A method for processing training samples for power grid stability assessment considering distribution characteristics, characterized in that: The following steps are involved: S1, obtain the training samples for grid stability assessment, and use the idea of support vector machine to calculate the spatial distribution information of each sample; S2, using the natural distribution probability calculation method, calculate the probability distribution parameters of each sample and divide the sample set into three subsets; S3, calculate the degree of sample imbalance between each corresponding subset respectively; S4, using the degree of sample imbalance between corresponding subsets to correct the loss function in each round of training, so as to achieve balanced processing of training samples.
2. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 1, characterized in that: In step S1, the specific steps of obtaining training samples for power grid stability assessment include: S11, obtaining the power angle, angular velocity, unbalanced power, voltage, and voltage phase angle of each generator node in the power grid, and the power, frequency, voltage, and voltage phase angle of each bus node; S12, extract the characteristic data of five sampling cycles before the fault occurs, the fault occurs, the fault is cleared, and after the fault is cleared, as well as the result of stability. The stable sample label is 1, and the unstable sample label is 0, thereby forming a training sample set X = {x i }.
3. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 1, characterized in that: In step S1, the classification hyperplane obtained by training the support vector machine SVM is shown in formula (1); w T X+b=0 (1) Among them, w is the weight coefficient and b is the bias.
4. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 2, characterized in that: The spatial information of the stable sample and the unstable sample can be calculated by the Euclidean distance from the sample to the classification hyperplane; the spatial information Dist of the stable sample s (x i ) As shown in formula (2), the spatial information Dist of unstable samples u (x j ) As shown in formula (3), after obtaining the spatial information of each sample, Dist s (x i ) and Dist u (x j ) for standardization; Among them, {X s } and {X u } are stable sample sets and unstable sample sets respectively, and ||·||2 is the L2 norm.
5. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 2, characterized in that: The probability distribution parameter σ of the stable sample s and the probability distribution parameter σ of unstable samples u As shown in formula (4) and formula (5); Among them, n s and n u represent the number of stable samples and unstable samples respectively, is the mean of all samples.
6. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 1, characterized in that: In step S2, the method of dividing the sample set into three subsets is to decompose the stable sample set into [0,2σ s ),[2σ s ,3σ s ) and [3σ s ,1] three sets, named {X s,1 }, {X s,2 } and {X s,3 }, the number of samples in the set is n s,1 , n s,2 and n s,3 ; Similarly, the unstable sample set is decomposed into [0,2σ u ),[2σ u ,3σ u ) and [3σ u ,1] three sets, named {X u,1 }, {X u,2 } and {X u,3 }, the number of samples in the set is n u,1 , n u,2 and n u,3 .
7. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 1, characterized in that: In step S4, during each round of training, the sum of the gradients of stable samples and unstable samples in different sets is calculated, as shown in equations (6) and (7); Where S s,k represents the sum of the gradients in the kth stable sample set; S u,k represents the sum of the gradients in the kth unstable sample set; y(x i ) represents the predicted label of the i-th sample, y(x j ) represents the predicted label of the jth sample.
8. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 7, characterized in that: in, Correction coefficient Imb of the kth sample set k As shown in formula (8).
9. A method for processing training samples for power grid stability assessment considering distribution characteristics according to claim 7, characterized in that: The sum of the gradients of stable and unstable samples after each round of training is brought into the loss function, and the results of each round of training are obtained by Imb k The coefficient is corrected to achieve the result of imbalanced training samples. Loss(x i )=l i lny(x i )+Imb k (1-l i )ln(1-y(x i )) (9) Where Loss(x i ) represents the calculated value of the loss function of the i-th sample, l i represents the true label of the i-th sample, y(x i ) represents the predicted label of the i-th sample.