Integrated evaluation method for transient stability of power system based on CBAM-ConvGRU
Through the CBAM-ConvGRU multi-task transient stability integrated evaluation method, combined with the comprehensive feature set and improved loss function, the problem of separation between power angle and voltage stability in traditional methods is solved, the efficient integration of power system transient stability evaluation is achieved, and the evaluation accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202510644106.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-09-09
AI Technical Summary
Traditional power system transient stability assessment methods consume large computing resources and have low assessment efficiency when facing complex power systems. In addition, the separated power angle and voltage stability assessments cannot effectively share key features, resulting in low assessment accuracy and efficiency.
A multi-task transient stability integrated evaluation method based on CBAM-ConvGRU is adopted. By constructing a comprehensive feature set, an improved binary cross entropy loss function and a convolutional attention mechanism, combined with a convolutional gated recurrent unit, the integrated evaluation of power angle and voltage stability is realized.
It significantly improves the accuracy and efficiency of transient power angle and voltage stability assessment, reduces the risk of missed judgment, and enhances the model's ability to identify key instability events.
Smart Images

Figure CN120613751A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system transient stability assessment, and in particular to a power system transient stability integrated assessment method based on CBAM-ConvGRU. Background Art
[0002] With the formation of my country's ultra-large AC / DC hybrid power grid, the country's power grid is taking on a completely new form. Its characteristics and operational features will undergo significant changes, and its low fault tolerance will severely challenge the system's stable operation. Among traditional transient stability assessment methods, time-domain simulation offers high accuracy but consumes a long computational time. Direct methods can quickly provide transient stability assessment results, but they can only produce approximate results and are difficult to apply to complex power systems. Therefore, the applicability of traditional time-domain simulation and direct methods in the current situation is challenged.
[0003] In recent years, wide area measurement systems (WAMS) and phase measurement units (PMUs) have been widely used. Data-driven artificial intelligence methods have provided new solutions and research directions for power system transient stability assessment. Transient power angle stability and transient voltage stability are two major issues facing power systems during operation. When the system loses stability, power angle instability can cause voltage collapse, and voltage collapse can also cause power angle instability. These two issues are often intertwined, but most current analyses separate the power angle issue from the voltage issue.
[0004] Although the above studies have achieved good results in evaluation, from a systems perspective, transient power angle evaluation and transient voltage evaluation are different manifestations of the same nonlinear dynamic system. In terms of transient processes, the two are on the same time scale. Separating the evaluation is not conducive to protecting the overall safety of the system. From an algorithmic perspective, separating the two not only consumes computing resources, but also hinders the model from exploring the complex relationship between power angle and voltage.
[0005] Current research on feature sampling often uses a multi-point, non-continuous approach. While this approach offers advantages in theoretical analysis and model building, it faces challenges in practical engineering applications. The large-scale, continuous influx of data in real-world scenarios makes it difficult to extract irregular data, making it difficult to meet the requirements for rapid and accurate smart grid assessments.
[0006] Previous research on stability assessment has typically used single-task learning models. However, because transient power angle stability and voltage stability are mechanistically inseparable, information sharing between these tasks is difficult to achieve in single-task learning models, resulting in inefficient assessment of multiple stability issues. Multiple single-task learning models not only increase storage and computing resource consumption but also limit the accuracy and efficiency of assessments. Summary of the Invention
[0007] To analyze the key electrical characteristics that jointly influence power angle and voltage issues within a single framework and implement an integrated assessment of power system transient power angle and transient voltage stability, this paper proposes an integrated power system transient stability assessment method based on CBAM-ConvGRU. This method can effectively alleviate the problem of sample imbalance and improve the integrated assessment of transient power angle and transient voltage stability.
[0008] The technical solution adopted by the present invention is:
[0009] The integrated evaluation method for power system transient stability based on CBAM-ConvGRU includes the following steps:
[0010] Step 1: Construct a comprehensive feature set to characterize transient power angle stability and transient voltage stability, select dynamic time series feature quantities for evaluating transient stability, and determine the category labels corresponding to the dynamic time series feature quantity samples;
[0011] Step 2: Propose an improved binary cross-entropy loss function that can dynamically adjust weights, allowing the model to pay more attention to unstable samples during training. Analyze the impact of the classification decision threshold on model performance and determine the optimal classification decision threshold suitable for transient stability assessment. This reduces the risk of the model misjudging key instability events and further improves its ability to identify unstable samples.
[0012] Step 3: Combine the convolutional gated recurrent unit with the convolutional block attention module to build a multi-task transient stability integrated evaluation model. Through the dual attention mechanism of space and channel, the model's attention to key features is enhanced, and the ability to distinguish features is improved.
[0013] Step 4: Use the multi-task transient stability integrated assessment model constructed in step 3 to achieve an integrated assessment of transient power angle stability and transient voltage stability.
[0014] In step 1, the transient power angle stability problem and the transient voltage stability problem are studied together, and a comprehensive and integrated feature set is constructed by considering the time series sampling characteristics of data in actual engineering.
[0015] In the comprehensive feature set, the features related to the generator include G ω , G δ , GΔf , G Pm , G P , G Q , respectively represent the angular velocity, power angle, frequency deviation, mechanical power, active power, and reactive power of different generators;
[0016] Features related to busbars include B u 、B θ , respectively represent the voltage amplitude and phase angle of all buses;
[0017] Line-related features include C P 、C Q , respectively represent the active power and reactive power of all lines.
[0018] In step 1, in the feature selection process, the dynamic time series of the characteristic quantities in the power system is the key. Therefore, the dynamic time series characteristics can form a multidimensional time series (MTS) composed of a univariate time series (UTS). The multidimensional time series can be expressed as a D×L matrix, as shown in formula (1):
[0019]
[0020] In formula (1), T MTS is a matrix of mostly time series; is the time series data corresponding to the d-th feature, D is T MTS The feature dimension in the matrix is the total number of features; L is the length of the time series data segment, is the measured value of feature d at time l; C is T MTS The category label corresponding to the matrix; is the correspondence between the matrix and the category label;
[0021] The selection of sampling intervals for multidimensional time series features is crucial in the evaluation process because the data changes significantly around the time of fault occurrence and fault removal, reflecting the impact of the fault on the system. Therefore, to more realistically reflect the actual situation in the project, this paper adopts a multi-point continuous sampling method to construct time series features, as follows:
[0022] In the process of extracting features from time series data, multi-dimensional data sampling of the system is performed around two key nodes: the moment of fault occurrence and the moment of fault removal. According to the different sampling time ranges, the entire process is divided into three stages: the stable period, the fault period, and the period after the fault is removed. The data before the fault occurs is used to provide the steady-state information of the system, while the data after the fault is removed reflects the process of the system recovering to a steady state and fully reflects the dynamic response process of the system. However, different removal moments will lead to differences in the fault period. In order to ensure that the data input into the model has a unified time dimension and make full use of the information in the time series data, an adaptive filling steady-state data method is adopted. Specifically, for each fault removal moment, the corresponding sampling interval can be expressed as [t c -32T,t c +8T], t c is the fault removal moment, T is the sampling period, and in practical applications, the model detection time can be adjusted according to specific needs to further reduce the risk of missed detection.
[0023] In step 1, the power angle stability is the synchronous stability. An important sign of the normal operation of the power system is that all synchronous generators in the system are operating synchronously. Therefore, the present invention uses the transient angle stability index (TASI) η TASI The power angle stability is judged as shown in formula (2):
[0024]
[0025] In formula (2), Δδ max represents the maximum power angle difference between any two generators during the simulation time; when η TASI >0 is considered stable, and the corresponding category label is 1; otherwise, it is considered unstable, and the corresponding category label is 0.
[0026] In step 1, the transient voltage stability is judged using practical engineering criteria:
[0027] The bus node voltage is below 0.75 pu for no more than 1 second after a fault. Without considering partitioning, the present invention assumes that if one of the monitored buses meets the voltage instability criterion, the system is judged to be unstable and the corresponding category label is 0; otherwise, it is judged to be stable and the corresponding category label is 1.
[0028] In step 2, the traditional binary cross-entropy loss function (BCE Loss) is improved;
[0029] In the first stage, the main focus is on addressing the model evaluation bias caused by unbalanced training samples. Considering that although the number of unstable samples is small, their classification importance is higher, the model bias caused by sample imbalance is reduced by dynamically increasing the loss weight. The improved cross loss function is shown in formula (3):
[0030]
[0031] In formula (3), Loss balance is the improved loss function of the first stage; N is the total number of small batch samples, that is, the number of samples that are simultaneously input into the model in the current training; y i ∈{0,1}, is the true label of the sample, 1 is a stable sample, and 0 is an unstable sample; p i is the probability that the model predicts that the sample is a stable class; α is the weight coefficient of the stable sample, α = 1 maintains the standard weight; β is the weight coefficient of the unstable sample;
[0032]
[0033] In formula (4), N s and N u Respectively represent the number of stable samples and unstable samples in the current batch so that the loss function automatically adapts to the sample distribution within the batch. The fewer the number of unstable samples, N u <<N s , the greater the loss weight of the unstable sample, the more the model focuses on learning the minority class features.
[0034] In the second stage, in order to further reduce the number of missed unstable samples and improve the practicality of the evaluation model, the missed judgment cost λ is introduced based on formula (3), as shown in formula (5):
[0035]
[0036] In formula (5), Loss cost is the improved loss function of the second stage; λ is the missed detection cost coefficient, which is used to adjust the penalty intensity for misclassification of unstable samples; λ provides a flexible penalty mechanism. When λ = 1, it degenerates to the loss function of the first stage; when λ > 1, the misclassification loss of unstable samples by the model increases linearly, significantly reducing the missed detection rate; by adjusting λ, it can adapt to the needs of different scenarios. In transient stability assessment, a larger λ can be set to prioritize the identification accuracy of unstable samples.
[0037] In step 2, transient stability assessment is often classified as a binary classification problem. Defining a threshold δ is a key step in converting the model output probability into a specific class label. Typically, the model output is a probability value between 0 and 1, indicating the likelihood that a sample belongs to transient stability. To convert these probability values into clear class labels, a threshold δ is required.
[0038] By default, the threshold δ is usually set to 0.5. This means that if the probability value output by the model is greater than 0.5, the sample is classified as transient stability with label 1; if the probability value is less than 0.5, it is classified as transient instability with label 0. This conversion is shown in Equation (6):
[0039]
[0040] In formula (6), δ is the classification threshold; y i is the output probability of the model for the i-th sample, y pred (i) is the corresponding class label; choosing different thresholds δ will affect the classification results. For example, if δ is set to a higher value, such as 0.7, the model requires a higher confidence level to classify a sample as positive, which may reduce missed detections, i.e., misclassifying unstable samples as stable; but may increase false positives, i.e., misclassifying stable samples as unstable. Conversely, lowering δ to 0.3 may increase missed detections but reduce false positives. Therefore, choosing an appropriate threshold δ is an important step in optimizing model performance.
[0041] In step 3, the Convolution Gated Recurrent Unit (ConvGRU) is an improvement of the GRU. Its gated recurrent mechanism remains unchanged and still includes an update gate and a reset gate. However, in order to fully capture the spatial correlation between local pixels in the data, the Convolution Gated Recurrent Unit (ConvGRU) uses a convolutional network structure to replace the fully connected network structure of the ordinary GRU to achieve feature calculation; while considering the spatial characteristics (across features) and temporal characteristics in time series data, the calculation formula of the Convolution Gated Recurrent Unit (ConvGRU) is shown in Equations (7) to (10):
[0042] R t =σ(W xr *X t +W hr *H t-1 ) (7);
[0043] Z t =σ(W xz *X t +W hz *H t-1 ) (8);
[0044]
[0045] The above formula ignores the bias vector. In equations (7) to (10), σ and tanh are activation functions; W xr For input X t To reset gate R t The convolution weights W hr H is the hidden state at the previous moment t-1 To reset gate R t The convolution weights W xz For input X t Go to Update Gate Z t The convolution weights W hz H is the hidden state at the previous moment t-1 Go to Update Gate Z t The convolution weights W xh For input X t To the current candidate hidden state The convolution weights W hh is the historical hidden state H t-1 To the current candidate hidden state The convolution weight; * is the convolution operation; ⊙ is the Hadamard product; R t With Z t Reset gate and update gate at time t respectively; X t is the input data at the current moment; Indicates the current candidate value; H t With H t-1 Represent the hidden states at time t and the previous time respectively.
[0046] In step 3, the Convolutional Block Attention Module (CBAM) is a lightweight attention mechanism. It weights the input features through two modules: the Channel Attention Module (CAM) and the Spatial Attention Module (SAM), allowing the model to focus on more important features. The Channel Attention Module (CAM) and the Spatial Attention Module (SAM) of the Convolutional Block Attention Module (CBAM) calculate the weights of the input features in the channel and spatial dimensions respectively, and multiply these weights with the original features to produce enhanced features;
[0047] In the convolutional block attention module CBAM, the input feature F with dimension Z×H×W is first combined with the channel attention weight M C(F) multiplies the same-position elements to obtain the output F′; F′ is then multiplied by the spatial attention weight M S (F′) is multiplied with the same position elements to obtain the final output F″ of CBAM, as shown in formula (11):
[0048]
[0049] In formula (11), F is the input feature; M C (F) is the channel attention weight; F′ is the result of element-wise multiplication of the input feature and the channel attention weight; M S (F′) is the spatial attention weight; F″ is the result of element-wise multiplication of F′ and the spatial attention weight;
[0050] The channel attention module CAM obtains the global information of each channel through average pooling and maximum pooling, and performs feature fusion through a shared multi-layer perceptron to obtain the attention weight of each channel. The input feature F is respectively subjected to average pooling, multi-layer perceptron operation and maximum pooling, multi-layer perceptron operation, and the sum of the results is then passed through the sigmoid activation function to generate a channel attention weight M with a dimension of Z×1×1. C (F), as shown in formula (12):
[0051]
[0052] In formula (12), F is the input feature; σ is the sigmoid function; W1 and W0 are the output weights of the fully connected layer; MLP represents the multi-layer perceptron; AvgPool represents the global average pooling calculation; MaxPool represents the global maximum pooling calculation; and Respectively represent the results of F after global average pooling and global maximum pooling calculation; is the channel feature after average pooling The first layer of fully connected operations performed; is the channel feature after average pooling The second layer of fully connected operations performed; For the channel features after maximum pooling The first layer of fully connected operations performed; For the channel features after maximum pooling The second layer of fully connected operations.
[0053] The spatial attention module SAM obtains a two-dimensional feature map through maximum pooling and average pooling along the channel dimension, and calculates the attention weight of the spatial dimension through convolution. The input feature map is first averaged and maxed out along the channel dimension, and then merged to obtain a convolution layer. Finally, through a convolution operation, a spatial attention weight M with a dimension of 1×H×W is obtained. S (F′), as shown in formula (13):
[0054]
[0055] In formula (13), σ is the sigmoid function; f γ [] is the convolution calculation with a convolution kernel size of γ; AvgPool represents the global average pooling calculation; MaxPool represents the global maximum pooling calculation; and are the results obtained after average pooling and maximum pooling of F′ respectively;
[0056] The two attention mechanisms form two transformation spaces through the training process, which are used to identify the specific locations of target features and at the same time increase the proportion of useful features in the overall features, providing more detailed and accurate information for subsequent network layers, thereby effectively enhancing the network's ability to extract information and ultimately improving the overall performance of the model.
[0057] In step 3, the transient power angle stability assessment is taken as task 1, and the transient voltage stability assessment is taken as task 2, and a multi-task transient stability integrated assessment model is constructed. The model uses the CBAM-ConvGRU network to enhance and extract local spatial features, while establishing temporal relationships and fully exploring the dynamic change characteristics of the system. The CBAM module can dynamically adjust the attention mechanism in both spatial and channel dimensions, highlighting key information and suppressing irrelevant features, further improving the expressiveness of features. The ConvGRU module can effectively process time series data and retain temporal information by capturing the dependencies between different time steps. The features processed by the CBAM-ConvGRU module are respectively input into the classifiers of task 1 and task 2 to obtain the stability assessment results of the system. Under this framework, the learning processes of task 1 and task 2 are associated through multi-task learning, so that the model can simultaneously complete the assessment tasks of transient power angle stability and transient voltage stability.
[0058] In step 4, the training and testing process of the CBAM-ConvGRU multi-task transient stability integrated assessment model is as follows: in the electrical measurement phase, raw electrical data of the power system is collected through sensors or monitoring equipment;
[0059] Subsequently, the collected time series data is labeled to indicate whether it is stable: the stable label is 1 and the unstable label is 0, providing label support for subsequent model learning.
[0060] Next, data preprocessing is performed to form structured data suitable for model training;
[0061] The preprocessed training set is input into the CBAM-ConvGRU multi-task transient stability integrated assessment model. This model dynamically focuses on key features through the CBAM module, combines ConvGRU to capture the spatiotemporal dependencies in time series data, and synchronously evaluates the power angle stability and voltage stability of the power system based on a multi-task learning framework.
[0062] During the model training process, parameters need to be adjusted according to the performance of the training set, including the learning rate, attention weight allocation strategy, and multi-task loss function weights. If the accuracy of the training set does not meet the requirements, the model parameters are iteratively optimized until the accuracy requirements are met; finally, the trained model is used to perform parallel evaluation tasks on real-time or newly input test set data, and the dual judgment results of whether the power angle is stable and whether the voltage is stable are output, forming a complete transient stability integrated evaluation process from data acquisition, data processing, model training to closed-loop feedback optimization.
[0063] In step 4, the performance of the multi-task transient stability integrated assessment model can be quantitatively analyzed using the confusion matrix shown in Table 1. The resulting model effect evaluation indicators are shown in formulas (14) to (16):
[0064] Table 1 Confusion matrix
[0065]
[0066] In Table 1, TP and TN are the number of correctly classified stable samples and unstable samples, respectively; FN is the number of stable samples misclassified as unstable samples; FP is the number of unstable samples missed as stable samples.
[0067]
[0068] In formulas (14) to (16), P A is the accuracy; P L is the missed judgment rate; P Ris the misclassification rate; TP and TN are the number of correctly classified stable samples and unstable samples respectively; FN is the number of stable samples misclassified as unstable samples; FP is the number of unstable samples missed as stable samples. These indicators together provide a multi-dimensional basis for evaluating the classification performance of the model. The present invention provides an integrated evaluation method for transient stability of power systems based on CBAM-ConvGRU, and the technical effects are as follows: 1) In order to alleviate the negative impact of sample imbalance, the present invention improves the traditional loss function structure and proposes an improved loss function method based on dynamic weight adjustment. This method adjusts the weight coefficients of each category in the loss function in real time during the model training process based on the recognition difficulty and actual importance of different categories, thereby effectively improving the contribution of unstable samples to the model optimization process in the model learning stage, and significantly reducing the risk of missed judgment of key minority categories by the model.
[0069] 2) The present invention explores the impact of the setting of the classification decision threshold on the model classification results, and through the sensitivity analysis of the model classification effect under different thresholds, finds the optimal decision threshold that can balance the misjudgment losses of different categories. Through the sensitivity analysis results, it is clear that the threshold adjustment strategy is necessary and important for improving the model classification performance in the actual transient stability assessment. 3) In response to the common sample imbalance problem in the transient stability assessment process of the power system, the present invention proposes a convolutional gated recurrent unit multi-task transient stability integrated assessment model combined with a convolutional attention module, and comprehensively improves the loss function and classification threshold selection. By introducing the attention mechanism, the model dynamically learns important information in the input data from the two dimensions of channel and space, highlights the key features that are highly related to transient stability, and alleviates the classification difficulty of unstable samples due to the small amount of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The present invention will be further described below with reference to the accompanying drawings and examples:
[0071] Figure 1 Schematic diagram of time series data sampling.
[0072] Figure 2 It is the internal unit structure of ConvGRU.
[0073] Figure 3 This is the structure diagram of the convolution block attention module.
[0074] Figure 4 This is the structure diagram of the channel attention module.
[0075] Figure 5 This is the structural diagram of the spatial attention module.
[0076] Figure 6 This is the CBAM-ConvGRU multi-task transient stability integrated evaluation model diagram.
[0077] Figure 7 Flowchart of the CBAM-ConvGRU multi-task transient stability integrated evaluation method.
[0078] Figure 8 This is the IEEE standard 10-machine 39-node system topology diagram.
[0079] Figure 9 Comparison chart of the effects of different classification thresholds.
[0080] Figure 10 This is the power grid topology map of a certain area in Hebei Province. DETAILED DESCRIPTION
[0081] This integrated transient stability assessment method for power systems based on CBAM-ConvGRU first integrates a set of comprehensive features representing power angle stability and voltage stability based on existing research. To address the sample imbalance problem in power system transient stability assessment, an improved binary cross-entropy loss function with dynamic weight adjustment is proposed. This dynamically assigns weights based on class difficulty and importance, enhancing the model's focus on minority classes and reducing the risk of missed classifications. Furthermore, through analysis of classification thresholds, the decision strategy is optimized to further enhance classification performance. Secondly, a multi-task integrated transient stability assessment model based on CBAM-ConvGRU combined with a convolutional attention module is proposed, effectively improving the ability to identify unstable samples. The model introduces channel and spatial attention mechanisms to enhance the extraction of key features related to transient stability and alleviate the difficulty in classifying unstable samples. Finally, analysis is conducted on the IEEE standard 10-machine, 39-bus New England system and a real-world power grid, verifying the proposed method's ability to effectively reduce the risk of missed classifications of unstable samples and its effectiveness and practicality in the integrated transient stability assessment task of power systems.
[0082] Below in conjunction with accompanying drawing, preferred embodiment is described in detail:
[0083] (I) Construction of comprehensive characteristics of transient power angle and transient voltage stability:
[0084] Research on power system transient stability assessment typically considers power angle and voltage separately. Because power angle and voltage are tightly coupled during power system transients, characteristics related to power angle indirectly affect voltage stability, and characteristics closely related to voltage stability also indirectly affect power angle.
[0085] Therefore, the present invention considers both transient power angle and transient voltage problems and selects a relatively complete set of comprehensive features. In the feature set, the features related to the generator are G ω , G δ , G Δf , GPm , G P , G Q , which represent the angular velocity, power angle, frequency deviation, mechanical power, active power and reactive power of different generators respectively; the bus-related characteristics are B u 、B θ , respectively represent the voltage amplitude and phase angle of all buses; the line-related characteristics are C P 、C Q , respectively represent the active power and reactive power of all lines.
[0086] In terms of feature sampling, current research often uses a multi-point, non-continuous approach. While this approach offers certain advantages in theoretical analysis and model building, it faces challenges in practical engineering applications. Because data in real-world scenarios is characterized by large-scale, continuous influx, extracting irregular data becomes difficult, making it difficult to meet the requirements for rapid and accurate smart grid assessments. To fully utilize the time series data of power systems under disturbance, this paper investigates transient stability feature selection based on time series data, aiming to improve the effectiveness of data-driven transient stability assessment models.
[0087] In the feature selection process, the dynamic temporal nature of the characteristic quantities in the power system is the key. Therefore, its characteristic quantities can form a multidimensional time series (MTS) composed of a univariate time series (UTS). The multidimensional time series can be expressed as a D×L matrix, as shown in formula (1):
[0088]
[0089] In formula (1), is the time series data corresponding to the d-th feature, D is T MTS The feature dimension in the matrix is the total number of features; L is the length of the time series data segment, is the measured value of feature d at time l; C is T MTS The matrix corresponds to the category labels.
[0090] The transient stability assessment of power systems is usually classified as a supervised classification problem. The time series data of various electrical characteristic quantities collected during the fault process are classified according to T MTS The matrix is arranged in a matrix format, which is called a sample. Each sample contains D electrical feature quantities. The system stability result corresponding to the sample is the category label C, which is used to describe its category.
[0091] exist Figure 1 In the multi-dimensional time series feature sampling interval shown, the fault occurs at time tf and the fault clearing time t c Significant data fluctuations near these two time points directly reflect the impact of the fault on the system. This data is crucial in the evaluation process. Therefore, to more realistically reflect actual engineering conditions, this paper uses a multi-point continuous sampling method to construct time series features.
[0092] Figure 1 In the equation, U and θ represent bus voltage and phase angle respectively. s 、T f and T c They are the steady-state period, fault period and period after fault removal respectively. f and t c The data before the fault occurs are used to provide the steady-state information of the system, while the data after the fault is removed reflects the process of the system recovering to the steady state and fully reflects the dynamic response process of the system. However, different fault removal times t c Will cause the failure period T f To ensure that the data input to the model has a unified time dimension, simplify the model training process, and make full use of the effective information in the time series data, the method of adaptive filling of steady-state data is adopted. The PMU sampling period T is 0.01 seconds, the total length of the time series data is set to 0.4 seconds, and the length after the fault removal in the total length is 0.08 seconds. For each different fault removal time t c , we use the fault period T f The actual length of the data is filled by selecting the steady-state data of the corresponding length. Specifically, for each resection time t c , and its corresponding sampling interval can be expressed as [t c -32T,t c +8T], in actual applications, the model detection time can be adjusted according to specific needs to further reduce the risk of missed detection.
[0093] Power angle stability is synchronous stability. An important sign of normal operation of the power system is that all synchronous generators in the system are running synchronously. Therefore, the present invention uses the transient angle stability index (TASI) η TASI The power angle stability is judged as shown in formula (2):
[0094]
[0095] In formula (2), Δδ max It represents the maximum power angle difference between any two generators during the simulation time. TASI>0 is considered stable, and the corresponding category label is 1; otherwise, it is considered unstable, and the corresponding category label is 0.
[0096] Transient voltage stability is determined using a practical engineering criterion: the busbar node voltage must remain below 0.75 pu for no more than 1 second after a fault. Without considering zoning, this method assumes that if one of the monitored buses meets the voltage instability criterion, the system is considered unstable and assigned a class label of 0. Otherwise, the system is considered stable and assigned a class label of 1.
[0097] (2) Improvement of loss function and impact of classification threshold:
[0098] This paper improves the traditional binary cross-entropy loss function (BCELoss). In the first stage, the main focus is on solving the problem of model evaluation bias caused by unbalanced training samples. Considering that although the number of unstable samples is small, their classification importance is higher, we dynamically increase their loss weight, thereby alleviating the model bias problem caused by sample imbalance. The improved cross-entropy loss function is shown in formula (3):
[0099]
[0100]
[0101] In formula (3), N is the total number of mini-batch samples, that is, the number of samples that are simultaneously input into the model in the current training; y i ∈{0,1}, is the true label of the sample (1 is a stable sample, 0 is an unstable sample); p i is the probability that the model predicts that the sample is a stable class; α is the weight coefficient of the stable sample, α=1 maintains the standard weight, and β is the weight coefficient of the unstable sample.
[0102] In formula (4), N s and N u The number of stable samples and unstable samples in the current batch makes the loss function automatically adapt to the sample distribution in the batch. The smaller the number of unstable samples (N u <<N s ), the greater the loss weight of the unstable sample, the more the model focuses on learning the minority class features.
[0103] In the second stage, in order to further reduce the number of missed unstable samples and improve the practicality of the evaluation model, the missed judgment cost λ is introduced based on formula (3), as shown in formula (5):
[0104]
[0105] In formula (5), N is the total number of mini-batch samples, that is, the number of samples that are simultaneously input into the model in the current training; y i ∈{0,1}, is the true label of the sample (1 is a stable sample, 0 is an unstable sample); p i is the probability that the model predicts a sample as stable; α is the weight coefficient for stable samples, where α=1 maintains standard weights; β is the weight coefficient for unstable samples; λ is the miss penalty coefficient, which is used to adjust the penalty for misclassifying unstable samples. λ provides a flexible penalty mechanism. When λ=1, it degenerates to the first-stage loss function; when λ>1, the model's misclassification loss for unstable samples increases linearly, significantly reducing the miss rate. Adjusting λ can adapt to different scenarios. In transient stability assessment, a larger λ can be set to prioritize the accuracy of identifying unstable samples.
[0106] Transient stability assessment is often categorized as a binary classification problem. Defining a threshold δ is a key step in converting model output probabilities into specific class labels. Typically, the model output is a probability value between 0 and 1, indicating the likelihood that a sample is transiently stable. To convert these probabilities into clear class labels, a threshold δ is required.
[0107] By default, the threshold δ is usually set to 0.5. This means that if the probability value output by the model is greater than 0.5, we classify it as transient stability (label 1); if the probability value is less than 0.5, it is classified as transient instability (label 0). This conversion is shown in Equation (6):
[0108]
[0109] In formula (6), δ is the classification threshold; y i is the output probability of the model for the i-th sample, y pred (i) is the corresponding category label.
[0110] Choosing different thresholds δ will affect the classification results. For example, if we set δ to a higher value (such as 0.7), the model needs a higher confidence level to classify the sample as positive, which may reduce missed detection (i.e., misclassifying unstable samples as stable ones), but may increase false positives (i.e., misclassifying stable samples as unstable ones). On the contrary, lowering the δ value (such as 0.3) may increase missed detection but reduce false positives. Therefore, choosing an appropriate threshold δ is an important step in optimizing model performance;
[0111] (III) Integrated evaluation model of power system transient stability based on CBAM-ConvGRU:
[0112] The Convolution Gated Recurrent Unit (ConvGRU) is an improved version of the GRU. Its gated recurrent mechanism remains unchanged and still contains update gates and reset gates. However, in order to fully capture the spatial correlation between local pixels in the data, ConvGRU uses a convolutional network structure to replace the fully connected network structure of the ordinary GRU to implement feature calculation, while considering the spatial characteristics (across features) and temporal characteristics in time series data. The internal unit structure of ConvGRU is as follows: Figure 2 The calculation formula of ConvGRU is shown in formula (7) to formula (10):
[0113] R t =σ(W xr *X t +W hr *H t-1 ) (7);
[0114] Z t =σ(W xz *X t +W hz *H t-1 ) (8);
[0115]
[0116] The above formula ignores the bias vector. In equations (7) to (10), σ and tanh are activation functions; W xr For input X t To reset gate R t The convolution weights W hr H is the hidden state at the previous moment t-1 To reset gate R t The convolution weights W xz For input X t Go to Update Gate Z t The convolution weights W hz H is the hidden state at the previous moment t-1 Go to Update Gate Z t The convolution weights W xh For input X t To the current candidate hidden state The convolution weights W hh is the historical hidden state H t-1 Current candidate hidden state The convolution weight; * is the convolution operation; ⊙ is the Hadamard product; R t With Z t is the reset gate and update gate at time t; X t is the input data at the current moment; Indicates the current candidate value; H t With H t-1 Represents the hidden state at time t and the previous time.
[0117] Convolutional Block Attention Module (CBAM) is a lightweight attention mechanism with the following structure: Figure 3 As shown in Figure 2, it weights the input features through two modules: Channel Attention Module (CAM) and Spatial Attention Module (SAM), allowing the model to focus on more important features. The two modules of CBAM calculate the weights of the input features in the channel and spatial dimensions respectively, and multiply these weights with the original features to produce enhanced features.
[0118] In the CBAM module, the input feature F with dimension Z×H×W is first combined with the channel attention weight M C (F) multiplies the same-position elements to obtain the output F′; F′ is then multiplied by the spatial attention weight M S (F′) is multiplied with the same position elements to obtain the final output F″ of CBAM, as shown in formula (11):
[0119]
[0120] In formula (11), F is the input feature; M C (F) is the channel attention weight; F′ is the result of element-wise multiplication of the input feature and the channel attention weight; M S (F′) is the spatial attention weight; F″ is the result of element-wise multiplication of F′ and the spatial attention weight;
[0121] Channel attention module CAM, its structure is as follows Figure 4 As shown in the figure, the global information of each channel is obtained by average pooling and maximum pooling, and the feature fusion is performed through a shared multi-layer perceptron to obtain the attention weight of each channel. The input feature F is respectively subjected to average pooling, multi-layer perceptron operation and maximum pooling, multi-layer perceptron operation, and the results are summed and then activated by the sigmoid function to generate the channel attention weight M with a dimension of Z×1×1. C (F), as shown in formula (12):
[0122]
[0123] In formula (12), F is the input feature; σ is the sigmoid function; W1 and W0 are the output weights of the fully connected layer; MLP represents the multi-layer perceptron; AvgPool represents the global average pooling calculation; MaxPool represents the global maximum pooling calculation; and Respectively represent the results of F after global average pooling and global maximum pooling calculation; is the channel feature after average pooling The first layer of fully connected operations performed; is the channel feature after average pooling The second layer of fully connected operations performed; For the channel features after maximum pooling The first layer of fully connected operations performed; For the channel features after maximum pooling The second layer of fully connected operations.
[0124] The spatial attention module SAM has the following structure: Figure 5 As shown in the figure, a two-dimensional feature map is obtained by performing maximum pooling and average pooling along the channel dimension, and the attention weight of the spatial dimension is calculated through convolution. The input feature map is first averaged and maximized along the channel dimension, and then merged to obtain a convolution layer. Finally, a convolution operation is performed to obtain a spatial attention weight M with a dimension of 1×H×W. S (F′), as shown in formula (13):
[0125]
[0126] In formula (13), σ is the sigmoid function; f γ [] is the convolution calculation with a convolution kernel size of γ; AvgPool represents the global average pooling calculation; MaxPool represents the global maximum pooling calculation; and are the results of F′ after average pooling and maximum pooling, respectively.
[0127] The two attention mechanisms form two transformation spaces through the training process, which are used to identify the specific locations of target features and at the same time increase the proportion of useful features in the overall features, providing more detailed and accurate information for subsequent network layers, thereby effectively enhancing the network's ability to extract information and ultimately improving the overall performance of the model.
[0128] Taking transient power angle stability assessment as task 1 and transient voltage stability assessment as task 2, a multi-task transient stability integrated assessment model is constructed. The structure of the CBAM-ConvGRU multi-task transient stability integrated assessment model is as follows: Figure 6As shown in the figure. The model uses the CBAM-ConvGRU network to enhance and extract local spatial features, while establishing temporal relationships and fully exploring the dynamic change characteristics of the system. The CBAM module can dynamically adjust the attention mechanism in both spatial and channel dimensions, highlighting key information and suppressing irrelevant features, further improving the expressiveness of features. The ConvGRU module can effectively process time series data and retain temporal information by capturing the dependencies between different time steps. The features processed by the CBAM-ConvGRU module are input into the classifiers of Task 1 and Task 2 respectively to obtain the stability evaluation results of the system. Under this framework, the learning processes of Task 1 and Task 2 are linked through multi-task learning, so that the model can simultaneously complete the evaluation tasks of transient power angle stability and transient voltage stability.
[0129] The training and testing process of the CBAM-ConvGRU multi-task transient stability integrated evaluation model is as follows: Figure 7 As shown in the figure, during the electrical measurement phase, raw electrical data from the power system is collected through sensors or monitoring equipment. The collected time series data is then labeled with stability (stable label = 1, unstable label = 0), providing label support for subsequent model learning. Data preprocessing then occurs to generate structured data suitable for model training. The preprocessed training set is then fed into the CBAM-ConvGRU multi-task integrated transient stability assessment model. This model dynamically focuses on key features using the CBAM module and combines it with the ConvGRU to capture spatiotemporal dependencies in the time series data. Based on a multi-task learning framework, it simultaneously assesses the power angle stability and voltage stability of the power system. During model training, parameters (such as the learning rate, attention weight allocation strategy, and multi-task loss function weights) are adjusted based on the training set performance. If the training set accuracy does not meet the required accuracy, the model parameters are iteratively optimized until the required accuracy is met. Finally, the trained model is used to perform parallel evaluation tasks on real-time or newly input test data, outputting dual judgment results on power angle stability and voltage stability. This completes the integrated transient stability assessment process from data acquisition, data processing, model training, to closed-loop feedback optimization.
[0130] The performance of the CBAM-ConvGRU multi-task transient stability integrated evaluation model can be quantitatively analyzed through the confusion matrix shown in Table 1. The resulting model effect evaluation indicators are shown in Equations (14) to (16):
[0131] Table 1 Confusion matrix
[0132]
[0133] In Table 1, TP and TN are the number of correctly classified stable samples and unstable samples, respectively; FN is the number of stable samples misclassified as unstable samples; FP is the number of unstable samples missed as stable samples.
[0134]
[0135] In formulas (14) to (16), P A is the accuracy; P L is the missed judgment rate; P R is the false positive rate; TP and TN are the number of correctly classified stable and unstable samples, respectively; FN is the number of stable samples misclassified as unstable; and FP is the number of unstable samples missed as stable. These indicators together provide a multi-dimensional basis for evaluating the classification performance of the model.
[0136] The technical effects of the present invention will be further illustrated by examples below:
[0137] Based on the IEEE standard 10-machine 39-bus system example, the generator at bus 34 is replaced with a wind turbine. The topology diagram is as follows: Figure 8 As shown in the figure. A doubly fed wind turbine model was used, a 4th-order generator model was used, and all loads used a constant impedance model. PSASP software was used to perform transient stability simulations to obtain experimental samples. To make the sample data set more comprehensive and diverse, the specific fault settings were as follows:
[0138] ① Consider wind power penetration rates of 5%, 10%, and 15%;
[0139] ② The tide levels are 90%, 95%, 100%, 105%, and 110%;
[0140] ③ The most serious three-phase short circuit fault occurs in the AC line;
[0141] ④The fault locations are at 2%, 50%, and 98% of the AC line respectively;
[0142] ⑤ In actual situations, the fault clearing time is generally greater than or equal to three cycles, so the fault duration is set to 3 to 11 cycles. The experiment generated 13,365 samples, corresponding to 26,730 classification labels for transient power angle stability and transient voltage stability. Of these, there were 11,291 samples with transient power angle stability and 2,074 samples with instability; and 9,616 samples with transient voltage stability and 3,749 samples with instability. The dataset was randomly split into a training set and a test set ratio of 4:1.
[0143] To verify the effectiveness of the ConvGRU multi-task integrated transient stability assessment model used in this paper, we compared the performance of various transient stability assessment models on a test set, including the Gated Recurrent Unit (GRU), Bidirectional Long Short-Term Memory (BiLSTM), Convolutional Neural Networks (CNN), and the K-Nearest Neighbor (KNN) algorithm. The results were averaged across multiple experiments, and are detailed in Table 2.
[0144] Table 2 Performance comparison of commonly used stability evaluation models
[0145]
[0146] As shown in Table 2, ConvGRU performs well in terms of evaluation results. It inherits the high-precision advantage of BiLSTM, but significantly reduces computational time during training through structural simplification, meeting the real-time requirements of online evaluation. In comparison, CNN loses feature associations due to flattening time series data, and KNN lacks time series modeling capabilities, and their accuracy is significantly limited. Therefore, the present invention selects ConvGRU as the classifier in the multi-task transient stability assessment model, which not only improves evaluation accuracy but also meets evaluation efficiency, providing strong support for accuracy and speed in practical applications.
[0147] In order to verify the effectiveness of the CBAM module in transient stability assessment tasks, the classification performance of different models in power angle stability assessment and voltage stability assessment was compared. The main measurement indicators included accuracy, false positive rate and missed positive rate. This paper focuses on the performance differences between ConvGRU and CBAM-ConvGRU in different tasks to evaluate the impact of spatial attention and temporal modeling methods on feature extraction capabilities. During the experiment, all models were based on the same data set and objective function, and repeated experiments were performed under the same experimental conditions to obtain stable statistical results. The experimental results are shown in Table 3, which further verify the contribution of the CBAM module in improving classification accuracy.
[0148] Table 3 Comparison of model performance with and without the CBAM module
[0149]
[0150] Experimental results show that the introduction of the CBAM module improves classification performance in both transient power angle stability assessment and transient voltage stability assessment tasks, primarily through improved accuracy and reduced false positive rates. For transient power angle stability assessment, the baseline ConvGRU model achieves an accuracy of 97.41%, a false positive rate of 2.25%, and a false negative rate of 4.13%. With the introduction of the CBAM module, the model's accuracy improves to 98.28%, with a significant decrease in false positive rate to 0.71%, but a slight increase in false negative rate from 4.13% to 7.29%. This improvement demonstrates that the CBAM module, primarily through its attention mechanism, enhances the model's feature representation of stable samples, resulting in more accurate classification of stable states and a reduction in false positive rates. However, this enhancement may result in insufficiently capturing the features of some unstable samples, leading to a slight increase in false positive rates. The CBAM module's optimization effect on the power angle stability assessment task is more focused on reducing false positives—that is, reducing the misclassification of stable states as unstable. However, this can affect the correct identification of unstable samples with blurred boundaries.
[0151] In the transient voltage stability assessment task, the CBAM module provides a more comprehensive optimization effect, enhancing the model's ability to distinguish between both types of samples. The baseline ConvGRU model achieves 96.43% accuracy, 3.09% false positive rate, and 5.53% false negative rate on this task. With the introduction of CBAM, the accuracy further improves to 98.68%, the false positive rate decreases to 0.70%, and the false negative rate drops from 5.53% to 4.13%. Compared to the power angle stability assessment task, the CBAM module improves the voltage stability assessment task not only by reducing the false positive rate but also by reducing the false negative rate. This demonstrates that the CBAM module, through its spatial and channel-wise attention mechanisms, enhances the model's ability to identify unstable states. Given the complex influence of load characteristics, grid topology, and disturbance conditions on voltage stability, the CBAM module plays a more significant role in feature selection in this assessment task, resulting in clearer classification boundaries and significant optimization results in the identification of both stable and unstable states.
[0152] In order to study the impact of classification threshold on transient stability assessment tasks, the experiment compared the model performance under different threshold settings. The experiment tested the power angle stability assessment and voltage stability assessment tasks respectively. When the classification threshold increased from 0.1 to 0.9, the accuracy, false positive rate and missed positive rate corresponding to different thresholds were statistically analyzed, and the corresponding change trend curves were drawn. All experiments were based on the CBAM-ConvGRU multi-task transient stability integrated assessment model. Multiple repeated tests were carried out under the same experimental conditions, and the results were statistically analyzed. The experimental results are shown in the figure. Figure 9 Figure 3 is used to evaluate the impact of the choice of classification threshold on the transient stability assessment task.
[0153] First, from Figure 9 As shown in the accuracy curve of sub-figure a, the model's accuracy gradually improves initially as the classification threshold increases, reaching a peak around a threshold of 0.5. Subsequently, as the threshold continues to increase, the accuracy decreases slightly. This trend indicates that when the classification threshold is low, the model is more likely to classify samples as unstable, potentially misclassifying some stable samples and reducing overall accuracy. Conversely, when the classification threshold is high, the model is more likely to classify samples as stable, potentially overlooking some unstable samples and affecting classification performance.
[0154] Secondly, Figure 9 Subfigure b of Figure 2 further confirms this trend. It is clear that the missed detection rate shows a continuously decreasing trend as the classification threshold increases. This is because a lower classification threshold makes it easier for the model to misclassify unstable samples as stable, thereby increasing the missed detection rate. As the threshold increases, the model more rigorously identifies unstable samples, resulting in a gradual decrease in the missed detection rate. In practical applications, an excessively high missed detection rate may cause an unstable system state to be mistaken for a stable state, posing a significant risk to the safe operation of the power grid.
[0155] Finally, from Figure 9 As shown in sub-graph c, the trend of the false positive rate is exactly the opposite of the missed positive rate. As the classification threshold increases, the false positive rate gradually increases. This is because a higher classification threshold makes it more difficult for the model to identify samples as unstable, resulting in more stable samples being mistaken for unstable samples, and the false positive rate increases. When the classification threshold exceeds 0.6, the upward trend in the false positive rate becomes more pronounced, reaching its peak at higher thresholds (above 0.8). In practical applications, an excessively high false positive rate may lead to excessive warnings, resulting in unnecessary control operations.
[0156] As can be seen from the missed judgment rate curve, as the classification threshold increases, the missed judgment rate continues to decline and tends to a lower level in the range of 0.7 to 0.9. From the accuracy curve, the accuracy reaches a peak near 0.5 to 0.6, and then slowly declines, indicating that a too high classification threshold may affect the overall classification performance. As can be seen from the false positive rate curve, when the threshold exceeds 0.7, the false positive rate rises rapidly, indicating that the number of stable samples being misjudged as unstable has increased significantly. Therefore, the present invention selects a classification threshold of 0.7, which can effectively reduce the missed judgment rate and avoid the actual application effect of the model affected by the excessively high false positive rate.
[0157] To compare the impact of different loss functions on transient stability assessment tasks, experiments were conducted on power angle and voltage assessment tasks, testing model performance before and after improving the loss function. Based on the CBAM-ConvGRU multi-task evaluation model, the experiments were trained using the same dataset and experimental conditions. The performance of the models before and after the improvement in the loss function was compared, and key metrics such as classification accuracy, false positive rate, and missed positive rate were analyzed. The experimental results, shown in Table 4, evaluate the applicability of different loss functions for transient stability assessment.
[0158] Table 4 Comparison of the effects of different loss functions
[0159]
[0160] Table 4 shows that, with the classification threshold fixed at 0.7, the choice of different loss functions significantly impacts the model's classification performance, especially in reducing the false negative rate. Compared to CBAM-ConvGRU-BCE, the improved BCE loss function demonstrates superior performance on both the power angle stability assessment and voltage stability assessment tasks. For power angle stability assessment, CBAM-ConvGRU-BCE achieves an accuracy of 98.33%, a false positive rate of 0.83%, and a false negative rate of 6.32%. Using CBAM-ConvGRU-Improved BCE, the accuracy increases slightly to 98.38%, the false positive rate increases slightly to 1.50%, and the false negative rate decreases significantly to 2.27%. This demonstrates that the optimized loss function plays a significant role in reducing the risk of unstable samples being misclassified as stable, significantly reducing the risk of false negatives. For voltage stability assessment, the CBAM-ConvGRU-BCE achieved an accuracy of 98.70%, a false positive rate of 1.00%, and a false negative rate of 2.62%. The CBAM-ConvGRU-Improved BCE further improved the accuracy to 98.75%, with a slight increase in the false positive rate to 1.34%, but a significant decrease in the false negative rate to 0.83%. This demonstrates that the optimized loss function is also effective in reducing false negatives in voltage stability assessment. Overall, while the improved BCE scheme exhibits a slight increase in the false positive rate, it is particularly effective in reducing the false negative rate, which is crucial for power system security. A false negative rate can result in an unstable system state being misidentified as stable, leading to potential safety risks. In summary, the CBAM-ConvGRU-Improved BCE scheme, evaluated at a classification threshold of 0.7, effectively reduces false negatives while maintaining high classification accuracy, meeting the requirements of power grid security assessment.
[0161] The power grid in a certain area of Hebei Province is a receiving-end power grid with a high penetration rate of wind and solar power. The regional power grid includes 6 thermal power plants, 3 photovoltaic power plants, 2 wind farms, 4 500kV substations and their equivalent circuits, 49 220kV substations and their equivalent circuits, and 17 110kV substations and their equivalent circuits. Its topology is shown in the figure below. Figure 10 As shown in the figure. During sample collection, based on the specific configuration of a regional power grid in Hebei Province, a three-phase short-circuit fault was simulated on one of two lines in a single-circuit and double-circuit system. Specifically, the fault location was set at 2%, 50%, and 98% of the line length to simulate the impact of different locations on grid stability. Three load levels of 80%, 100%, and 120% were considered, along with six fault durations ranging from 5 to 11 cycles. 6,000 samples were randomly generated, including 5,173 samples with stable power angles and 927 samples with unstable power angles. Furthermore, 5,057 samples showed stable voltage and 943 showed unstable voltage.
[0162] The collected sample set was randomly divided into training set and test set according to the ratio of 4:1. The experiment was based on the ConvGRU model and trained under the same data set and experimental conditions. The overall comparison was made between the effects of the models with and without the CBAM module and under the loss function before and after the improvement. The key indicators such as classification accuracy, false positive rate and missed positive rate were statistically analyzed, and the results are listed in Table 5.
[0163] Table 5 Comparison of power grid stability assessment results in a certain region of Hebei Province
[0164]
[0165] Table 5 shows that the introduction of the CBAM module significantly improves the model's accuracy and false positive rate. In the power angle stability assessment task, the accuracy increased from 96.63% to 98.38%, and the false positive rate decreased from 3.30% to 1.29%. This demonstrates that the CBAM module, through its attention mechanism, enhances the classification of stable samples, significantly reducing the false positive rate. However, the false negative rate only decreased from 3.72% to 3.08%. In the voltage stability assessment task, the CBAM module's optimization is more comprehensive, with the accuracy increasing from 96.68% to 98.50%, the false positive rate decreasing from 3.44% to 1.31%, and the false negative rate decreasing from 2.75% to 3.34%. The optimization effect is limited, indicating that the CBAM module primarily improves the model's recognition of stable samples, while the classification of unstable samples still needs improvement.
[0166] Although the CBAM module significantly reduced the false positive rate, the false negative rate remained high, indicating that its ability to classify unstable states requires further optimization. Therefore, based on the CBAM-ConvGRU-BCE algorithm, the BCE loss function was further improved to make the model more attentive to unstable samples. In the power angle stability assessment task, the improved BCE model achieved an improvement in accuracy to 98.43%, a slight increase in the false positive rate to 1.56%, and a decrease in the false negative rate from 3.08% to 1.62%, a 1.46% reduction compared to the original model, further optimizing the ability to identify unstable samples. In the voltage stability assessment task, the proposed scheme achieved an improvement in accuracy to 98.63%, a slight increase in the false positive rate to 1.37%, and a decrease in the false negative rate from 2.34% to 1.38%, a 0.96% reduction compared to the original model. This demonstrates that the improved BCE loss function effectively reduces the misclassification of unstable samples as stable, improving the overall reliability of the model.
Claims
1. An integrated evaluation method for transient stability of power systems based on CBAM-ConvGRU, characterized by The following steps are involved: Step 1: Construct a comprehensive feature set to characterize transient power angle stability and transient voltage stability, select dynamic time series feature quantities for evaluating transient stability, and determine the category labels corresponding to the dynamic time series feature quantity samples; Step 2: Propose an improved binary cross entropy loss function, analyze the impact of the classification decision threshold on model performance, and determine the optimal classification decision threshold suitable for transient stability assessment; Step 3: Combine the convolutional gated recurrent unit with the convolutional block attention module to build a multi-task transient stability integrated assessment model; Step 4: Use the multi-task transient stability integrated assessment model constructed in step 3 to achieve an integrated assessment of transient power angle stability and transient voltage stability.
2. The integrated evaluation method for transient stability of power systems based on CBAM-ConvGRU according to claim 1 is characterized by: In step 1, in the comprehensive feature set, the features related to the generator include G ω , G δ , G Δf , G Pm , G P , G Q , respectively represent the angular velocity, power angle, frequency deviation, mechanical power, active power, and reactive power of different generators; Features related to busbars include B u 、B θ , respectively represent the voltage amplitude and phase angle of all buses; Line-related features include C P 、C Q , respectively represent the active power and reactive power of all lines.
3. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 2 is characterized by: In step 1, in the feature selection process, the dynamic time series of the characteristic quantity in the power system is the key. Therefore, the dynamic time series characteristic quantity can form a multidimensional time series composed of a single-dimensional time series. The multidimensional time series is expressed as a D×L matrix, as shown in formula (1): In formula (1), T MTS is a matrix of mostly time series; is the time series data corresponding to the d-th feature, D is T MTS The feature dimension in the matrix is the total number of features; L is the length of the time series data segment, is the measured value of feature d at time l; C is T MTS The category label corresponding to the matrix; is the correspondence between the matrix and the category label.
4. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 3 is characterized by: In step 1, the transient power angle stability index η TASI The power angle stability is judged as shown in formula (2): In formula (2), Δδ max represents the maximum power angle difference between any two generators during the simulation time; when η TASI >0 is considered stable, and the corresponding category label is 1; otherwise, it is considered unstable, and the corresponding category label is 0.
5. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 1 is characterized by: In step 2, the binary cross-entropy loss function (BCE Loss) is improved; In the first stage, the problem of model evaluation bias caused by unbalanced training samples is solved; the improved cross loss function is shown in formula (3): In formula (3), Loss balance is the improved loss function of the first stage; N is the total number of small batch samples, that is, the number of samples that are simultaneously input into the model in the current training; y i ∈{0,1}, is the true label of the sample, 1 is a stable sample, and 0 is an unstable sample; p i is the probability that the model predicts that the sample is a stable class; α is the weight coefficient of the stable sample, α = 1 maintains the standard weight; β is the weight coefficient of the unstable sample; In formula (4), N s and N u Respectively represent the number of stable samples and unstable samples in the current batch so that the loss function automatically adapts to the sample distribution within the batch. The fewer the number of unstable samples, N u < <N s , the greater the loss weight of the unstable sample, the more the model focuses on learning the minority class features; In the second stage, in order to further reduce the number of missed unstable samples and improve the practicality of the evaluation model, the missed judgment cost λ is introduced based on formula (3), as shown in formula (5): In formula (5), Loss cost is the improved loss function of the second stage; λ is the missed detection cost coefficient, which is used to adjust the penalty intensity for misclassification of unstable samples; λ provides a flexible penalty mechanism. When λ = 1, it degenerates to the loss function of the first stage; when λ > 1, the misclassification loss of the model for unstable samples increases linearly, reducing the missed detection rate.
6. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 5 is characterized by: In step 2, the transient stability assessment problem is classified as a binary classification problem. A threshold δ is defined to convert the model output probability into a specific class label. A threshold δ is set to 0.
5. This means that if the probability value of the model output is greater than 0.5, the sample is classified as transient stability with label 1; if the probability value is less than 0.5, it is classified as transient instability with label 0. This conversion is shown in formula (6): In formula (6), δ is the classification threshold; y i is the output probability of the model for the i-th sample, y pred (i) is the corresponding category label.
7. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 1 is characterized by: In step 3, the convolutional gated recurrent unit (ConvGRU) uses a convolutional network structure to replace the fully connected network structure of the ordinary gated recurrent unit to achieve feature calculation. At the same time, considering the spatial and temporal characteristics in the time series data, the calculation formula of the convolutional gated recurrent unit (ConvGRU) is shown in formulas (7) to (10): R t =σ(W xr *X t +W hr *H t-1 ) (7); Z t =σ(W xz *X t +W hz *H t-1 ) (8); In formulas (7) to (10), σ and tanh are activation functions; W xr For input X t To reset gate R t The convolution weights W hr H is the hidden state at the previous moment t-1 To reset gate R t The convolution weights W xz For input X t Go to Update Gate Z t The convolution weights W hz H is the hidden state at the previous moment t-1 Go to Update Gate Z t The convolution weights W xh For input X t To the current candidate hidden state The convolution weights W hh is the historical hidden state H t-1 To the current candidate hidden state The convolution weight; * is the convolution operation; ⊙ is the Hadamard product; R t With Z t Reset gate and update gate at time t respectively; X t is the input data at the current moment; Indicates the current candidate value; H t With H t-1 Represent the hidden states at time t and the previous time respectively.
8. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 7 is characterized by: The channel attention CAM and spatial attention SAM modules of the convolutional block attention module CBAM calculate the weights of the input features in the channel and spatial dimensions respectively, and multiply these weights with the original features to produce enhanced features; In the convolutional block attention module CBAM, the input feature F with dimension Z×H×W is first combined with the channel attention weight M C (F) multiplies the same-position elements to obtain the output F′; F′ is then multiplied by the spatial attention weight M S (F′) is multiplied with the same position elements to obtain the final output F″ of CBAM, as shown in formula (11): In formula (11), F is the input feature; M C (F) is the channel attention weight; F′ is the result of element-wise multiplication of the input feature and the channel attention weight; M S (F′) is the spatial attention weight; F″ is the result of element-wise multiplication of F′ and the spatial attention weight; The channel attention module CAM obtains the global information of each channel through average pooling and maximum pooling, and performs feature fusion through a shared multi-layer perceptron to obtain the attention weight of each channel; The input feature F is respectively subjected to average pooling, multi-layer perceptron operation and maximum pooling, multi-layer perceptron operation, and the results are summed and then activated by sigmoid function to generate the channel attention weight M with dimension Z×1×1 C (F), as shown in formula (12): In formula (12), F is the input feature; σ is the sigmoid function; W1 and W0 are the output weights of the fully connected layer; MLP represents multi-layer perceptron; AvgPool represents global average pooling calculation; MaxPool represents global maximum pooling calculation; and Respectively represent the results of F after global average pooling and global maximum pooling calculation; is the channel feature after average pooling The first layer of fully connected operations performed; is the channel feature after average pooling The second layer of fully connected operations performed; For the channel features after maximum pooling The first layer of fully connected operations performed; For the channel features after maximum pooling The second layer of fully connected operations performed; The spatial attention module SAM obtains a two-dimensional feature map through maximum pooling and average pooling along the channel dimension, and calculates the attention weight of the spatial dimension through convolution. The input feature map is first averaged and maximized from the channel dimension, and then merged to obtain a convolution layer. Finally, a convolution operation is performed on the input feature map to obtain the spatial attention weight M with a dimension of 1×H×W. S (F′), as shown in formula (13): In formula (13), σ is the sigmoid function; f γ [] is the convolution calculation with a convolution kernel size of γ; AvgPool represents the global average pooling calculation; MaxPool represents the global maximum pooling calculation; and are the results obtained after average pooling and maximum pooling of F′ respectively.
9. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 1 is characterized by: In step 4, the training and testing process of the CBAM-ConvGRU multi-task transient stability integrated evaluation model is as follows: The electrical measurement stage collects raw electrical data from the power system through sensors or monitoring equipment; Subsequently, the collected time series data is labeled to indicate whether it is stable: the stable label is 1, and the unstable label is 0, providing label support for subsequent model learning; Next, data preprocessing is performed to form structured data suitable for model training; The preprocessed training set is input into the CBAM-ConvGRU multi-task integrated transient stability assessment model. This model dynamically focuses on key features through the CBAM module, combines it with the ConvGRU module to capture the spatiotemporal dependencies in time series data, and simultaneously assesses the power angle stability and voltage stability of the power system based on a multi-task learning framework. During the model training process, parameters need to be adjusted according to the performance of the training set, including the learning rate, attention weight allocation strategy, and multi-task loss function weights. If the accuracy of the training set does not meet the requirements, the model parameters are iteratively optimized until the accuracy requirements are met; finally, the trained model is used to perform parallel evaluation tasks on real-time or newly input test set data, and the dual judgment results of whether the power angle is stable and whether the voltage is stable are output.
10. The integrated evaluation method for power system transient stability based on CBAM-ConvGRU according to claim 9 is characterized in that: In step 4, the performance of the multi-task transient stability integrated assessment model is quantitatively analyzed through the confusion matrix, and the resulting model effect evaluation index is shown in formulas (14) to (16): In formulas (14) to (16), P A is the accuracy; P L is the missed judgment rate; P R is the misclassification rate; TP and TN are the number of correctly classified stable samples and unstable samples respectively; FN is the number of stable samples misclassified as unstable samples; FP is the number of unstable samples missed as stable samples.