Power system transient stability assessment method based on BP-Transform-DGNN semi-supervised learning
By employing the BP-Transformer-DGNN semi-supervised learning method, combined with Fisher score feature selection and spatiotemporal feature fusion, the problems of insufficient spatiotemporal feature fusion, strong dependence on label data, and insufficient decision transparency in power system transient stability assessment are solved, achieving high-precision and high-reliability transient stability assessment.
Patent Information
- Application Number
- CN202511711828.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-17
Smart Images

Figure CN121543005A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power system transient stability evaluation, and particularly relates to a power system transient stability evaluation method based on BP-Transformer-DGNN semi-supervised learning. BACKGROUND
[0002] With the construction of new power systems dominated by new energy, China's power grid presents a new network form. The wide access of high-proportion renewable energy and power electronic equipment has brought major changes to the operation characteristics of the power grid, posing a severe test to system transient stability evaluation. Traditional transient stability evaluation methods mainly include time-domain simulation method and direct method. However, both methods are difficult to balance timeliness and accuracy at the same time. Therefore, the applicability of traditional methods is severely challenged in the current situation. Data-driven evaluation methods that can quickly and accurately make judgments provide an effective way to solve the above real-time problems. However, the existing mainstream data-driven methods still face new bottlenecks in engineering applications.
[0003] Firstly, power system transient stability is a complex spatio-temporal dynamic process, whose evolution depends not only on the time series changes of electrical quantities at each monitoring point, but also on the topological structure and electrical parameters of the power grid. Existing methods often fail to effectively fuse the spatio-temporal coupling characteristics in the dynamic process, and are not adaptive to the dynamic changes in network topology caused by line maintenance, fault removal, etc., affecting the generalization ability of the model. Therefore, it is urgent to develop an evaluation model that can deeply fuse spatio-temporal features and adapt to topological changes.
[0004] Secondly, most existing data-driven methods use supervised learning, and their evaluation performance is highly dependent on a large amount of high-quality labeled data. However, in actual power systems, the cost of obtaining a large number of labeled samples through simulation is high, resulting in the inability to effectively utilize a large amount of easily accessible unlabeled operation data. Therefore, it is urgent to develop an evaluation method that can make full use of unlabeled data to reduce the dependence of the model on labeled samples.
[0005] In addition, the inherent "black box" characteristics of existing deep learning evaluation models make their decision-making process lack transparency and physical credibility, making it difficult to meet the strict requirements of power system dispatching and operating personnel for the basis of model decision-making. Although some studies attempt to conduct explainability analysis, the relevance of their conclusions to the physical mechanism of the power system is not strong, making it difficult to form clear and reliable decision-making basis. Therefore, it is urgent to provide an effective explainability analysis method for the evaluation model to enhance its credibility in engineering applications. SUMMARY
[0006] In order to overcome the defects of the existing research, such as the insufficient adaptability of the model to the change of power grid topology, the insufficient fusion of space-time characteristics, the strong dependence on massive label data, and the lack of transparency and explainability in the model decision process, the present application proposes a power system transient stability evaluation method based on BP-Transformer-DGNN semi-supervised learning. The method constructs a new type of space-time feature fusion network, combines semi-supervised learning and explainability analysis process, and aims to realize high-precision, high-robustness and high-credibility transient stability evaluation in the scene of a small amount of labels. While improving the evaluation accuracy and reliability, the generalization ability and engineering practical value of the model under variable working conditions are significantly enhanced.
[0007] The technical scheme adopted by the present application is:
[0008] The power system transient stability evaluation method based on BP-Transformer-DGNN semi-supervised learning comprises the following steps:
[0009] Step 1: Build a comprehensive feature set representing the transient stability of the power system, and use a feature selection method based on Fisher Score to reduce the dimension of the original high-dimensional time series electrical quantity measurement data features, and select the optimal feature subset with the highest identification degree for transient stability state, so as to reduce the model calculation complexity;
[0010] Step 2: Build a BP-Transformer-DGNN space-time feature fusion evaluation model, use a Binary Partitioning Transformer (BP-Transformer) module to capture the long time series dependence in the optimal feature subset, and use a Dynamic Graph Neural Network (DGNN) module to deeply fuse the dynamic features of the nodes with the static physical properties of the network;
[0011] Step 3: Build a confidence-aware semi-supervised learning framework, use Monte Carlo Dropout to quantify the uncertainty of model prediction, actively select high-confidence unlabeled samples to generate pseudo-labels, and design a hierarchical confidence-aware loss function (HCAL) to iteratively optimize the semi-supervised transient stability evaluation model based on BP-Transformer-DGNN;
[0012] Step 4: Constructing the BP-Transformer-DGNN-based semi-supervised transient stability assessment model, and using the trained BP-Transformer-DGNN-based semi-supervised transient stability assessment model to evaluate the transient stability state of the power system;
[0013] Step 5: Combining attention weight visualization and SHAP (shapley additive explanations) to verify the explainability of the BP-Transformer-DGNN-based semi-supervised transient stability assessment model.
[0014] In step 1, to achieve in-depth analysis of the spatiotemporal coupling characteristics of the transient process, the time series evolution characteristics and network topology constraint characteristics of the transient response of the power system are considered, and the dynamic measurement data of each electrical node in the transient process and the topology data representing the connection relationship and electrical parameters of the power grid are integrated to form a comprehensive feature set that can represent the transient state of the system, which includes time series electrical measurement data features and spatial data features.
[0015] In step 1, the time series electrical measurement data features in the comprehensive feature set mainly include three categories:
[0016] The first category is the generator-related features, including G ω , G δ , G Δf , G pm , G P , and G Q , which represent the angular velocity, power angle, frequency deviation, mechanical power, active power, and reactive power of different generators, respectively.
[0017] The second category is the bus-related features, including B u and B θ , which represent the voltage amplitude and phase angle of all buses, respectively.
[0018] The third category is the line-related features, including L P and L Q , which represent the active power and reactive power of all lines, respectively.
[0019] The input time series electrical measurement data features X are shown in formula (1):
[0020]
[0021] In formula (1), x1 is the feature vector at the first time step, x2 is the feature vector at the second time step, and x Tis the feature vector at the Tth time step; T is the time series length; D is the feature dimension; f1is the 1th feature in the feature vector x; f2is the 2th feature in the feature vector x; f J is the Jth feature in the feature vector x; f D is the Dth feature in the feature vector x; T is the transpose operation of the matrix.
[0022] In step 1, the spatial data features in the comprehensive feature set are integrated, and the electrical distance between any two nodes in the electrical system graph structure is selected as the spatial correlation feature, which is used to reflect the electrical coupling strength of each node in the network. The electrical distance is calculated as shown in formula (2):
[0023] d ij = |Z ii + Z jj - 2Z ij | (2);
[0024] In formula (2): d ij is the electrical coupling degree between two nodes, that is, the electrical distance; Z ii is the self-impedance of node i; Z jj is the self-impedance of node j; Z ij is the mutual impedance between nodes.
[0025] In step 1, the Fisher score method is used to quantitatively evaluate and screen the time series electrical measurement data features. For the feature f J , the Fisher score S J is calculated as shown in formula (3):
[0026]
[0027] In formula (3): S J is the Fisher score of the Jth feature; f J is the Jth feature in the feature vector x; c is the number of categories, c = 2 in the present application, corresponding to two categories of “stable” and “unstable” samples; n c is the number of samples in the cth category; μ cJ is the mean of the feature f J in the cth category of samples; is the variance of the feature f J in the cth category of samples; μ J is the overall mean of the feature f J in all samples.
[0028] In step 1, in order to determine the optimal feature subset, a forward search sequence is used to screen the feature subset:
[0029] First, the Fisher scores of the time-series electrical measurement data characteristics are calculated one by one using Equation (3) and arranged from high to low;
[0030] Then, starting with the feature ranked first, the candidate feature set F is added sequentially in ascending order. candidate After each feature is added, the updated feature set F is used. candidate Train a semi-supervised transient stability evaluation model of BP-Transformer-DGNN and record the evaluation accuracy and training time on an independent validation set.
[0031] Finally, the optimal feature subset is obtained by balancing training time and evaluation accuracy, and its index is shown in equation (4) below:
[0032]
[0033] In equation (4): R is the measure feature set F candidate The smaller the value of the index, the better the balance between training time and evaluation accuracy is achieved; α is a tradeoff coefficient that adjusts the relative importance of training time and evaluation accuracy; F candidate For the candidate feature set; T(F) candidate ) is in the candidate feature subset F candidate Training time required for intermediate training; Acc(F) candidate ) is in the candidate feature subset F candidate The evaluation accuracy obtained after training; Normalization training takes time; T represents the normalized accuracy. min T represents the minimum training time after traversing all features; max This represents the maximum training time after traversing all features; Acc min Acc represents the minimum evaluation accuracy after traversing all features. max This represents the maximum evaluation accuracy after traversing all features.
[0034] In step 2, a BP-Transformer-DGNN spatiotemporal feature fusion evaluation model is built to learn the spatiotemporal features of transient processes. To fully explore the spatiotemporal coupling mechanism of transient processes, this invention designs a deep neural network model with parallel temporal feature extraction and spatial feature extraction modules; specifically as follows:
[0035] S2.1: First, use a Transformer with binary partitioning to extract features from time series data;
[0036] S2.2: Then, through Dynamic Graph Neural Network (DGNN), the dynamic features of the nodes are deeply fused with the static physical properties of the network to extract spatial data features;
[0037] S2.3: Finally, the above BP-Transformer module and the features extracted by the DGNN network are spliced and input into a multi-layer perceptron (MLP) classifier in parallel to obtain the evaluation result.
[0038] In S2.1, the standard Transformer needs to calculate the correlation between any two time points in the sequence, and the calculation complexity is proportional to the square of the sequence length, which leads to a calculation bottleneck when processing long sequence data of power system transient. The sparse attention mechanism is introduced in the application, which structures the original one-dimensional long time sequence into a hierarchical sparse graph structure, called binary partitioning graph, to reduce the attention calculation complexity. The binary partitioning graph structure is shown in formula (5):
[0039] G bp =(V bp ,E bp )(5);
[0040] In formula (5), G bp represents the binary partitioning graph; V bp is the node set of the binary partitioning graph, and E bp is the edge set of the binary partitioning graph.
[0041] The binary partitioning graph construction process is divided into two steps:
[0042] Firstly, the original time sequence with length T is recursively bisected until all sub-sequences have length 1; a hierarchical time scale structure is formed, and the bottom layer (level L=0) of the structure is composed of T fine scale nodes, which correspond to the T time points of the original time sequence. Let the node set of the 0th layer be:
[0043]
[0044] In formula (6), V (0) is the node set of the 0th layer; T is the length of the original time sequence; is the first fine scale node; is the second fine scale node; is the Tth fine scale node.
[0045] On this basis, the coarse scale nodes are recursively constructed from bottom to top. Let the kth node in the lth layer be Agg (·) is the aggregation function.
[0046]
[0047] In formula (7) : is the kth node in the lth layer, representing the aggregated representation of the coarser time granularity; represents the left child node in the (l-1)th layer corresponding to the kth node in the lth layer, covering the time segments contained in the first half of the subsequence in the current time segment; represents the right child node in the (l-1)th layer corresponding to the kth node in the lth layer, covering the time segments contained in the second half of the subsequence in the current time segment.
[0048] All hierarchical nodes together constitute the node set V of the binary partition graph bp as shown in formula (8) :
[0049]
[0050] In formula (8) : V bp is the set of all time nodes in the binary partition graph; V (l) is the set of all nodes in the lth layer; L is the total number of layers.
[0051] Secondly, the edge set E of the binary partition graph bp is composed of two types of connections: one is the vertical connection, which is used to connect the nodes between different time scale levels, reflecting the aggregation and refinement relationship in the scale, as shown in formula (9) :
[0052]
[0053] In formula (9) : E vertical is the set of vertical connection edges of the binary partition graph; is the kth node in the lth layer; represents the left child node in the (l-1)th layer corresponding to the kth node in the lth layer, covering the time segments contained in the first half of the subsequence in the current time segment; represents the right child node in the (l-1)th layer corresponding to the kth node in the lth layer, covering the time segments contained in the second half of the subsequence in the current time segment.
[0054] The other is the horizontal connection within the same time scale level, which connects the spatially adjacent nodes of each node to capture the local time dependence in the same scale, as shown in formula (10) :
[0055]
[0056] E horizontal is the set of horizontal connection edges (intra-layer adjacent edges) of the binary partition graph; is the kth node in the lth layer; is the k+δth node in the lth layer; δ is the distance offset; Q is the predefined distance set; denotes the index boundary condition, which ensures that k+δ does not exceed the total number of nodes in the lth layer; is the number of nodes in the layer; T is the length of the original time series.
[0057] The edge set of the complete binary partition graph is shown by the following formula (11):
[0058] E bp = E vertical ∪ E horizontal (11);
[0059] E bp is the edge set of the binary partition graph; E vertical is the set of vertical connection edges of the binary partition graph; E horizontal is the set of horizontal connection edges (intra-layer adjacent edges) of the binary partition graph.
[0060] In S2.1, on the constructed binary partition graph G bp , a multi-head relational graph attention mechanism is used for information aggregation, which enables the BP-Transformer to learn diverse feature representations from different subspaces by projecting node features to multiple independent attention heads. The overall computational framework is shown in the following formula (12) and formula (13):
[0061] M ultiHead (Q,K,V)=C oncat (h ead1 ,h ead2 ,…,h eadn )W O (12);
[0062]
[0063] In the above formula: M ultiHead (·) is the overall mapping function of the multi-head attention module; h eadn is the output of the nth attention head; C oncat(·) represents the concatenation operation along the last dimension; Q is the Query matrix; K is the Key matrix; V is the Value matrix; A ttention (·) represents the scaling dot product attention function; The Q-projection weights of the nth attention head; The K-projection weights of the nth attention head; The V projection weights for the nth attention head; W O Output projection matrix.
[0064] Within each attention head, this invention introduces a relational bias term to distinguish different types of edges in a binary partition graph, where the relational type R(a,b) of the edge is defined as follows (14):
[0065]
[0066] In formula (14): l a Let l be the level of node a in the binary partition graph; b Let be the level of node b in the binary partition graph.
[0067] Attention score e from node b to node a ab It consists of two parts: content information and relational information, as shown in the following formula (15):
[0068]
[0069] In equation (15): x a Input vector for node a; x b Input vector for node b; d k Feature dimensions for each head; The Q-projection weights of the nth attention head; The K-projection weights of the nth attention head; r R(a,b) It is the learnable relation embedding vector corresponding to the relation type R(a,b); T is the matrix transpose operation.
[0070] To obtain the attention weights of each node, Softmax normalization is used, as shown in equation (16) below:
[0071]
[0072] In equation (16): α ab N represents the normalized attention coefficient. a G is a binary partition graph bp The set of neighbors of node a; e ab Let e be the attention weight of node b to node a; ak Let exp(e be the attention weight from node a to its neighbor node k) ab) represents the attention weight e ab The exponential value; exp(e ak ) represents the attention weight e ak The exponential value; k represents the neighboring node.
[0073] Using the normalized attention weight α ab The features of all neighboring nodes are weighted and aggregated to update the node representation. Assume the graph attention network has multiple independent attention heads. Under the nth attention head, the updated feature vector of node a is shown in equation (17):
[0074]
[0075] In equation (17): This represents the updated features of node a under the nth attention head; This represents the V transformation matrix of the nth attention head; x represents the influence weight of node b on node a in the nth attention head; b N is the input feature vector of node b; a For graph G bp The set of neighbors of node a.
[0076] For a multi-head attention mechanism containing H attention heads, the output features of all heads are concatenated and fed into a linear transformation, resulting in the output of node a in the current layer as shown in equation (18):
[0077]
[0078] In equation (18): Concat(·) represents concatenating the outputs of all attention heads; W O To output a linear mapping matrix, used for dimension reduction; x′ a The features of node a after the current layer is updated; This represents the updated features of node a under the first attention head; This represents the updated features of node a under the second attention head; This represents the updated features of node a under the H-th attention head.
[0079] Subsequently, after passing through a feed-forward network (FFN) and layer normalization (LayerNorm) operations, as shown in equation (19):
[0080]
[0081] In equation (19): The feature of node a in the l-th layer; x′ ais the feature of node a after the layer is updated; FFN(·) is the feedforward network layer function; LayerNorm(·) is the layer normalization.
[0082] Finally, by aggregating the outputs of all layers, the final embedding vector of node a in the time dimension is obtained as shown in equation (20):
[0083]
[0084] In equation (20): This represents the final temporal embedding vector of node a in the output of the BP-Transformer module; L represents the output of node a in the last layer; L is the number of Transformer stacking layers.
[0085] In step S2.2, a dynamic graph neural network (DGNN) is used to learn the spatial structure relationship of the system. The power grid topology diagram is shown in equation (21) below:
[0086] G = (V, E) (21);
[0087] In equation (21): G represents the power grid topology graph; V represents the set of nodes in the topology graph; E represents the set of edges in the topology graph. A Dynamic Graph Neural Network (DGNN) is composed of several stacked graph convolutional layers. Let the feature of node i in the k-th layer be... The features of node i in the next layer are obtained by weighted aggregation of its neighbor information;
[0088] First, the attention score between node pairs is calculated using the edge attention mechanism, as shown in Equation (22):
[0089]
[0090] In equation (22): This represents the attention weight of edge (i,j) in the k-th layer; Feature representation of node i in the k-th layer; W g W represents the node feature mapping matrix; e w represents the edge feature mapping matrix; ij Let (i,j) represent the electrical parameters carried by the edge; p represents the learnable weights for attention calculation; || represents the vector concatenation operation; T is the matrix transpose operation;
[0091] Next, the attention weights of the edges are obtained by Softmax normalization, as shown in equation (23):
[0092]
[0093] In equation (23): This represents the normalized attention weights; This represents the attention weight of edge (i,j) in the k-th layer; N represents the attention weight of edge (i,m) in the k-th layer; i Represents the set of adjacent nodes of node i; Represents attention weights The index value; Represents attention weights The exponential value; m represents the index variable of the adjacent node.
[0094] Using normalized attention weights The features of neighboring nodes are weighted and aggregated to calculate the next-level representation of node i, as shown in equation (24):
[0095]
[0096] In equation (24): This represents the next level of node i; W represents the normalized attention weights. u The transformation matrix is updated for each node; σ(·) is the nonlinear activation function; N represents the neighboring node at the next higher level. i Let i represent the set of adjacent nodes of node i.
[0097] After L g After stacking the layers, the final embedding of node i in the spatial structure is obtained, as shown in equation (25):
[0098]
[0099] In equation (25): This represents the final embedding feature of node i in the DGNN module; For stacking L g After the layer, the final embedding vector of node i in the spatial structure.
[0100] In S2.3, the BP-Transformer module and the DGNN module are spliced and fused after extracting the spatiotemporal features to form a unified node-level joint feature, as shown in the following equation (26):
[0101]
[0102] In equation (26): h d This represents the feature representation after spatiotemporal feature concatenation; || represents the vector concatenation operation. The time dimension is used to represent the features; It represents the features of the spatial dimension.
[0103] After obtaining the joint features of all nodes, a graph-level aggregation strategy is used to extract the system-level representation. Specifically, the features of all nodes are first weighted and aggregated using an attention weight function, as shown in equation (27):
[0104]
[0105] In equation (27): E represents the global representation vector of the entire power system after disturbance; d is the system node; g(·) is a single-layer feedforward neural network used to generate node attention weights; Softmax(·) is the activation function; h d is the feature representation after spatiotemporal feature splicing; N is the total number of system nodes.
[0106] Finally, the global representation vector E is input into a multi-layer fully connected classification network, and the system outputs the predicted transient stable state after perturbation, as shown in Equation (28):
[0107]
[0108] In equation (28): is the predicted probability of system stability; MLP(·) is a discriminator composed of a multi-layer fully connected network; Sigmoid(·) is a nonlinear activation function; E represents the global representation vector of the entire power system after disturbance.
[0109] In step 3, a confidence-aware semi-supervised learning framework is constructed. This framework plays a guiding role in the overall modeling process for unlabeled samples under the condition of scarce labels. It can make full use of unlabeled data for training, while suppressing the interference caused by low-quality pseudo-labels, thereby enhancing the stability and generalization ability of the model.
[0110] In step 3, firstly, during the sample set construction process, let the entire sample set be D, of which a portion has manually labeled results, denoted as the labeled sample subset D. L ={(x i ,y i )}, containing input features x of labeled samples i and its real label y i The other part is the unlabeled sample subset D. U ={x u Input features x containing unlabeled samples u .
[0111] The above division will serve as the basic input structure for semi-supervised learning.
[0112] For samples in the unlabeled subset, this invention introduces a Monte Carlo Dropout mechanism for confidence quantification. Specifically, for any unlabeled sample x...u ∈D U During the inference phase, Dropout is enabled and M independent forward propagations are performed to obtain multiple prediction outputs of the sample under perturbation, as shown in equation (29) below:
[0113]
[0114] In equation (29): Represents unlabeled sample x u The output result of the m-th prediction; This represents the m-th inference process of the neural network model under Dropout activation; M is the number of samples in the forward inference; x u These are unlabeled samples.
[0115] The results of multiple inferences are averaged to obtain the pseudo-label prediction results for unlabeled samples, as shown in equation (30) below:
[0116]
[0117] In equation (30): The mean of the predicted labels for unlabeled samples; This represents the m-th prediction output for the unlabeled sample; M is the number of samples in the forward inference; and m is the current sampling number.
[0118] To ensure the quality of pseudo-labels and avoid the negative impact of low-confidence samples on model training, a confidence screening mechanism is introduced. A confidence threshold τ is defined; if the prediction variance of a sample satisfies σ... u If the value is less than τ, the sample is considered to have high credibility and can be retained for training; otherwise, it is discarded. After filtering all unlabeled samples, a pseudo-label set U is obtained. c The prediction variance is shown in equation (31) below:
[0119]
[0120] In equation (31): σ u This represents the variance of the predicted value, reflecting the prediction stability of the sample under multiple Dropout perturbations. The smaller the value, the more reliable the judgment result of the semi-supervised transient stability evaluation model of BP-Transformer-DGNN is, and vice versa. The mean of the predicted labels for unlabeled samples; For unlabeled sample x u The m-th prediction output result; M is the number of samples in the forward inference; m is the current sampling number.
[0121] In step 3, the confidence-aware loss function (HCAL) comprehensively considers the supervised loss of labeled samples, the pseudo-supervised loss of unlabeled samples, and the entropy minimization regularization term to ensure the stability and effectiveness of the training of the semi-supervised transient stability evaluation model based on BP-Transformer-DGNN. The specific formula is shown in equation (32) below:
[0122]
[0123] In equation (32): L1 is the supervised loss for labeled samples; D L For a labeled sample set; |D L | represents the number of labeled samples; (x) i ,y i Let ) be one of the sample pairs, containing the input feature x. i and its real label y i ; L2 is the model's predicted probability for labeled samples; L2 is the pseudo-supervision loss for unlabeled samples; D U For the unlabeled sample set in the current batch; |D U | represents the number of unlabeled samples; This is an indicator function that takes the value 1 when the condition is true and 0 otherwise; σ u The variance of the predicted values is represented by τ; the confidence threshold is τ; and L3 is the entropy minimization regularization term. For unlabeled sample x u The average of M predictions; p represents the model's prediction results for unlabeled samples. c (x u ) represents the predicted probability of class c; ε is a very small positive number to prevent the value of log(0) from overflowing; c is the number of classes, which in this invention is c=2, corresponding to the "stable" and "unstable" classes of the samples respectively; L is the total loss function, i.e. the confidence-perceived loss function; λ(t) is a dynamic ramp-up function that changes with the training period t, and its value smoothly increases from 0 to a preset upper limit, which is used to suppress the influence of unreliable pseudo-labels in the early stage of training, and to make full use of the information of high-quality pseudo-labels in the later stage; ξ is a fixed hyperparameter used to adjust the strength of the regularization term.
[0124] In step 4, a semi-supervised transient stability evaluation model based on BP-Transformer-DGNN is constructed, which includes: a BP-Transformer module for extracting time dimension features, used to extract the dynamic evolution features of electrical quantities of system nodes in the time dimension, and the specific formulas are shown in equations (5)-(20).
[0125] The DGNN module for extracting spatial dimension features is used to characterize the spatial topological relationship between nodes in the power system and the influence of edge characteristics. The specific formulas are shown in equations (21)-(25).
[0126] The spatiotemporal feature fusion module is a spatiotemporal feature fusion module that splices and fuses the spatiotemporal features extracted by the BP-Transformer module and the DGNN module. The specific formulas are shown in Equations (26)-(28).
[0127] A semi-supervised learning framework that effectively and safely utilizes confidence-aware unlabeled data is used to improve the generalization ability and robustness of transient stability assessment in the presence of a large amount of unlabeled data. The specific formulas are shown in Equations (29) to (32).
[0128] In step 4, the transient stability assessment process is as follows:
[0129] S4.1: Construction of sample sets for temporal and spatial data:
[0130] This invention performs high-frequency sampling of transient disturbance signals, setting the sampling interval to 0.01s, and constructs a fixed time window sample centered on the fault initiation time. This time window covers the time series before and after the disturbance, ensuring the capture of the complete transient change process of each node in the system, wherein the time series characteristics contained in each node are as shown in formula (1). In the spatial dimension, the electrical distance between nodes in the power system is used as the power system graph topology data. Finally, the time series samples and node topology information are fused to form the input sample set;
[0131] The transient stability index (TSI) is used as the basis for judging whether the system is stable or not, as shown in equation (33) below:
[0132]
[0133] In equation (33): γ TSI The transient stability exponent; Δδ max This represents the maximum power angle difference between any two generators in the system during simulation. If |Δδ max | Less than 360°, i.e., γ TSI When the value is positive, the system is considered stable and the current sample is labeled as 1; otherwise, it is considered unstable and the sample is labeled as 0.
[0134] S4.2: Optimal Feature Subset Selection and Data Preprocessing:
[0135] After completing the sample construction, in order to reduce the data dimensionality and eliminate redundancy in the samples, this invention uses the Fisher score algorithm to evaluate the correlation between each original feature and the system steady state, and selects and constructs the optimal feature subset accordingly. In order to improve the model processing efficiency and enhance the training stability, this invention performs feature selection and normalization processing on the features of time-series electrical measurement data, and unifies the data distribution through the Z-score method to eliminate the influence of dimensional differences. The Z-score normalization is shown in equation (34):
[0136]
[0137] In equation (34): The data is normalized, where ν is the mean of a feature x in the original data, and ψ is the standard deviation. To minimize the value and prevent the denominator from being zero.
[0138] S4.3: Spatiotemporal Feature Extraction and Fusion:
[0139] The input samples are fed into the BP-Transformer module and the Dynamic Graph Neural Network (DGNN) module respectively, and feature representations are extracted from the perspectives of temporal series changes and spatial node dependencies respectively. The BP-Transformer module learns the dynamic correlation between each time step in the sequence based on the multi-head attention mechanism constructed according to Equations (5)-(20), and the DGNN module describes the topological dependency between nodes according to Equations (21)-(25). Then, the extracted temporal features and spatial features are spliced and fused according to Equations (26)-(28) to form a unified high-dimensional spatiotemporal embedding feature vector, which is used as the input for subsequent stability classification.
[0140] S4.4: Training the model under a semi-supervised framework:
[0141] First, the initial labeled sample set is input into the BP-Transformer-DGNN model, and the model is trained in a supervised manner using the supervised loss function in Equation (32) to optimize the model's initial ability to distinguish transient and stable states.
[0142] After training, unlabeled samples are input into the current BP-Transformer-DGNN model to obtain the label prediction result for each unlabeled sample. The label prediction result for each unlabeled sample is quantified using the Monte Carlo Dropout method according to equations (29) and (30).
[0143] Then, in order to screen for highly reliable pseudo-label samples, the variance σ of the predicted values is calculated using equation (31). u Based on a preset confidence threshold τ, if the prediction variance of a sample satisfies σ... uIf the value is less than τ, the sample is considered to have high credibility and its pseudo-label can be retained for training; otherwise, the sample is discarded. This process is then applied to the unlabeled set D. U The most reliable subset of samples is selected, pseudo-labels are assigned to the samples in the unlabeled set, and they are moved from the unlabeled set to the labeled set to form an expanded training set.
[0144] Finally, the BP-Transformer-DGNN model is trained on the expanded training set, and the learning ability of the BP-Transformer-DGNN model for real labels and pseudo labels is improved by the loss function designed by Equation (32).
[0145] S4.5: Evaluation Results:
[0146] After training, the performance of the trained BP-Transformer-DGNN model is evaluated using a test set. Specifically, test samples are input into the trained model, the predicted results are output, and compared with the true results. The model performance is quantified based on evaluation metrics. To comprehensively evaluate the classification effect, four metrics are used: accuracy, precision, recall, and F1 score, as shown in the following formula (35):
[0147]
[0148] In equation (35): η acc Accuracy reflects the model's overall ability to correctly classify all samples, including both stable and unstable ones; ρ p Precision reflects the reliability of model instability warnings; a higher value indicates fewer false alarms. r Recall reflects the model's ability to capture actual instability events; a higher value means the model misses fewer instability risks. The F1 score is ρ. p and τ r The harmonic mean reflects the comprehensive evaluation of the two indicators; T N For correctly identified stable samples; T P For correctly identified unstable samples; F N For a sample to be identified as a stable unstable sample, F P These are stable samples that are identified as unstable.
[0149] In step 5, to verify the interpretability of the constructed semi-supervised transient stability evaluation model based on BP-Transformer-DGNN, this invention combines attention weight visualization and Shapley additive interpretation (SHAP) analysis to analyze and verify the model's judgment criteria:
[0150] Specifically, by first extracting the attention weight distribution within the BP-Transformer and DGNN modules, the attention allocation of the model in the sample in the time and spatial dimensions is visualized, and an attention heatmap is drawn.
[0151] Among them, the temporal dimension attention reflects the degree of attention that the BP-Transformer-DGNN pays to the perturbation response at each time step during the transient process. The attention weight α is calculated according to equations (15) and (16). ab The influence strength of neighbor node b on node a is represented by the attention coefficient, which is normalized using the Softmax function. The attention coefficients assigned to each neighbor node by node a at each time step during the disturbance response process are visualized, allowing observation of whether the BP-Transformer-DGNN focuses on key periods such as the initial, middle, or recovery phases of the disturbance. The spatial dimension attention reflects the weight allocation of the BP-Transformer-DGNN to different nodes and their connections in the power grid. According to equations (22) and (23) in the DGNN module, the feature aggregation weights of the neighbor nodes on the target node are calculated. This reflects the degree of attention that BP-Transformer-DGNN pays to different neighboring nodes in the spatial structure. By visualizing this attention distribution, we can reveal the ability of BP-Transformer-DGNN to identify key nodes in the topology.
[0152] Secondly, the average marginal contribution of the BP-Transformer-DGNN output to the input features is calculated using the SHAP method. By calculating the SHAP value of each feature on the test set, the direction and intensity of the positive and negative influence of each input feature on the system stability prediction results are quantitatively revealed. The SHAP value of the Jth feature is shown in Equation (36) below:
[0153]
[0154] In equation (36): φ J Let f(C) be the SHAP value of the J-th feature; C be the feature subset that does not contain the J-th feature; |C| be the number of features contained in the feature subset C; D be the total number of features; F(C) be the output of the model on the feature subset C; F(C∪{f}) is the output of the model on the feature subset C. J}) represents the model's output for all features; f J Let f1 be the j-th feature in the feature vector x; F0 represents the baseline output, i.e., the expected output of the model when there are no feature inputs. D} represents the complete set of input features used by the model; f1 is the first feature in feature vector x; f2 is the second feature in feature vector x; f DLet f be the D-th feature in the feature vector x; J Let} be the set of the J-th features in the feature vector x.
[0155] This invention presents a power system transient stability assessment method based on BP-Transformer-DGNN semi-supervised learning, with the following technical advantages:
[0156] 1) This invention introduces a parallel fusion structure of BP-Transformer and Dynamic Graph Neural Network (DGNN) to jointly extract key feature information of disturbance samples in both time and space dimensions. The two types of features are concatenated in parallel and then fed into the classifier, realizing joint modeling of disturbance operating condition features from the spatiotemporal dimensions. This effectively improves the ability to express the nonlinear dynamic processes of the power system, thereby improving the discrimination accuracy of transient stability assessment.
[0157] 2) This invention constructs a confidence-aware semi-supervised learning framework. By introducing a Monte Carlo Dropout mechanism during the model's forward propagation stage, the output distribution is sampled multiple times to estimate the uncertainty of sample predictions, thereby measuring the confidence of pseudo-labels. Only high-confidence unlabeled samples are included in the training process, effectively avoiding noise pollution introduced by low-confidence pseudo-labels. Furthermore, this invention designs a hierarchical confidence-aware loss function, integrating supervised cross-entropy loss, pseudo-label loss, and entropy regularization term, dynamically adjusting pseudo-label weights from multiple levels. This improves the model's learning ability for unlabeled samples and its robustness to uncertain data, enabling high-performance evaluation even under limited labeled sample conditions.
[0158] 3) This invention not only provides transiently stable classification prediction results, but also achieves visualization and interpretability modeling of the model's decision-making process by analyzing the attention weights within the fusion model and using SHAP for global feature parsing. Users can track the contribution of specific input features and key nodes to the model's determination of stability. Attached Figure Description
[0159] The present invention will be further described below with reference to the accompanying drawings and examples;
[0160] Figure 1 A graph showing Fisher Score values for each feature.
[0161] Figure 2 The graph shows the model performance and computation time for different numbers of features.
[0162] Figure 3 This is a diagram of the Transformer architecture.
[0163] Figure 4 This is a diagram of a binary partition structure.
[0164] Figure 5 This is a diagram of the DGNN structure.
[0165] Figure 6 This is a diagram of the spatiotemporal feature fusion framework of BP-Transformer-DGNN.
[0166] Figure 7 This is a flowchart of the transient evaluation process based on a semi-supervised framework.
[0167] Figure 8 Improved IEEE 39-node system topology diagram
[0168] Figure 9 The graph shows the model performance at different thresholds.
[0169] Figure 10 This is a diagram illustrating the model's flexibility.
[0170] Figure 11 To stabilize the temporal attention weight map of the samples.
[0171] Figure 12 To stabilize the spatial attention heatmap of the sample.
[0172] Figure 13 This is the temporal attention weight map for boundary samples.
[0173] Figure 14 Attention heatmap for boundary sample space.
[0174] Figure 15 This is a temporal attention weight map for unstable samples.
[0175] Figure 16 Spatial attention heatmap for unstable samples.
[0176] Figure 17 SHAP value plot for important features.
[0177] Figure 18 For characteristic δ G7 SHAP value graph.
[0178] Figure 19 The topology diagram for the improved IEEE 118-node system. Detailed Implementation
[0179] The proposed method for evaluating the transient stability of power systems based on BP-Transformer-DGNN semi-supervised learning includes the following steps: First, it integrates a set of spatiotemporal features characterizing the transient stability of power systems based on existing research and uses the Fisher score algorithm to select the optimal feature subset. Second, it constructs a BP-Transformer-DGNN model, which captures long-series features in the dynamic response of each bus through BP-Transformer modules and uses a dynamic graph neural network (DGNN) to encode the grid topology and electrical parameters, thereby extracting the spatiotemporal coupling features of the transient process. Further, it constructs a confidence-aware semi-supervised learning framework, using Monte Carlo Dropout to quantify the uncertainty of model predictions, actively selecting high-confidence unlabeled samples to generate pseudo-labels, and designing a hierarchical confidence-aware loss function. Finally, it tests the method on the improved IEEE 39 and IEEE 118 node systems, and analyzes the interpretability of the model based on SHAP and attention mechanisms, verifying that the proposed method has high evaluation accuracy under conditions with only a small amount of initial labeled data, and that the model's decision-making basis is highly consistent with the physical mechanism of the power system.
[0180] The selected examples will be described in detail below with reference to the accompanying drawings:
[0181] (I) Construction of spatiotemporal features and selection of the optimal feature set:
[0182] Transient stability assessment of power systems is characterized by high dimensionality, time-varying nature, and strong nonlinearity, making it difficult to accurately determine the transient voltage stability state of the system after a fault occurs. Changes in generator rotor power angle and node voltage are closely related to their location in the grid topology; nodes at different locations experience different reactive power support, thus the time-series characteristics of electrical quantities at each node are both correlated and different. Integrating the time-series electrical quantity characteristics with the network topology and its data characteristics, taking into account both the dynamic information of the time-series data and the static information of the network structure, can significantly improve the accuracy of transient stability assessment.
[0183] Therefore, this invention simultaneously considers the impact of fusing time-series electrical measurement data features and graph topology data features on transient voltage stability assessment performance, and selects a relatively complete set of integrated features. Among the time-series electrical measurement data features, generator-related features include G... ω G δ G △f G Pm G P G Q These represent the angular velocity, power angle, frequency deviation, mechanical power, active power, and reactive power of different generators, respectively; characteristics related to the busbar include B. u B θ, representing the voltage amplitude and phase angle of all busbars respectively; line-related characteristics include L P L Q , representing the active power and reactive power of all lines respectively. In the graph topology data features, the node degree and electrical distance between nodes in the graph topology are selected. Its input time series measurement data X is shown in equation (1):
[0184]
[0185] In equation (1): x T Let f be the feature vector at time T, containing the three types of electrical measurement data features mentioned above; T is the time series length; D is the feature dimension; f J Let J be the J-th feature in the eigenvector x; T is the transpose of the matrix.
[0186] In terms of spatial characteristics, the electrical distance between nodes in the electrical system diagram topology is selected.
[0187] The Fisher Score method is used to quantify and filter features in the original dataset. For the J-th feature f in feature vector x... J Its Fisher fraction S J The calculation is shown in equation (3):
[0188]
[0189] In equation (3): S J is the Fisher score of the Jth feature; c is the number of categories, in this invention c=2, corresponding to the "stable" and "unstable" categories of the sample respectively; f J n is the J-th feature in the feature vector x; c μ is the number of samples in class c. cJ For feature f J The mean of the c-th class of samples; Feature f J Variance in the c-th sample; μ J For feature f J The population mean over the entire sample.
[0190] To determine the optimal feature subset, this invention employs a forward search sequence to filter the feature subset, that is, the original features are calculated one by one using equation (2) to obtain their Fisher scores, and the Fisher scores of each feature are as follows: Figure 1 As shown, the features are arranged from high to low. Then, the sorted features are added to the feature set incrementally, and the model is trained and evaluated using a subset of features from each dimension. The performance metrics and training time on the independent validation set are recorded. The results are as follows: Figure 2As shown, the accuracy of the model evaluation initially improves rapidly with the increase in the number of features, peaking when the number of features reaches 25. Thereafter, further increases in the number of features result in a slight downward trend in model performance, with computation time continuously increasing. Therefore, to achieve the optimal balance between model evaluation performance and computational efficiency, this invention ultimately selects the top 25 features by Fisher score to form the optimal feature subset for subsequent transient stability evaluation tasks.
[0191] (II) Construction of a transient stability assessment model based on spatiotemporal feature fusion of BP-Transformer-DGNN:
[0192] The constructed model mainly considers temporal and spatial features and improves the shortcomings of traditional models in extracting spatiotemporal features, thus constructing the BP-Transformer-DGNN spatiotemporal feature fusion evaluation model.
[0193] The standard Transformer's self-attention mechanism requires calculating the correlation between any two time points in the sequence. Its computational complexity is proportional to the square of the sequence length, leading to a computational bottleneck when processing long transient data from power systems. The internal structure of the Transformer is as follows: Figure 3 As shown. This invention constructs a binary partition graph by introducing a sparse attention mechanism, the structure of which is as follows. Figure 4 As shown, one-dimensional long-term data is transformed into a hierarchical graph structure, and then information is propagated on this sparse graph through a graph attention network. The binary partitioning graph structure is shown in formula (5):
[0194] G bp =(V bp E bp (5);
[0195] In equation (5): G bp Represents a binary partition graph; V bp Let E be the set of nodes in the graph. bp Let be the edge set of the graph.
[0196] The construction of the binary partitioning graph involves two steps: First, the original time series of length T is recursively bisected until all subsequences have a length of 1. This forms a hierarchical time-scale structure. The lowest level (level L=0) of this structure consists of T fine-scale nodes, each corresponding to one of the T time points of the input sequence. All upper-level nodes are coarse-scale nodes, each representing an aggregate representation of the time intervals covered by the two nodes in its next level. The set of all fine-scale and coarse-scale nodes together constitutes the node set V of the graph. bp Secondly, the edge set E of the graph bpIt consists of two types of connections: one is vertical connections, which are used to connect nodes between different time scale levels, reflecting the aggregation and refinement relationships at the scale; the other is horizontal connections within the same time scale level, which connect each node to its spatially adjacent nodes to capture local time dependencies at the same scale.
[0197] In the constructed binary partition graph G bp The above uses a multi-head relationalgraph attention mechanism for information aggregation. This mechanism enables the model to learn diverse feature representations from different subspaces by projecting node features onto multiple independent attention heads. The overall computational framework is shown in Equations (12) and (13) below.
[0198] M ultiHead (Q,K,V)=C oncat (h ead1 ,h ead2 ,…,h eadn W O (12);
[0199]
[0200] In the above formula: M ultiHead (·) represents the global mapping function of the multi-head attention module; h eadn C is the output of the nth attention head; oncat (·) represents the concatenation operation along the last dimension; Q is the Query matrix; K is the Key matrix; V is the Value matrix; A ttention (·) represents the scaling dot product attention function; The Q-projection weights of the nth attention head; The K-projection weights of the nth attention head; The V projection weights for the nth attention head; W O Output projection matrix.
[0201] Within each attention head, the present invention introduces a relational bias term to distinguish different types of edges in a binary partition graph.
[0202] The relation type R(a,b) of the edge is defined as follows (14):
[0203]
[0204] In formula (14): l a Let l be the level of node a in the binary partition graph; b Let be the level of node b in the binary partition graph.
[0205] Attention score e from node b to node a ab It consists of two parts: content information and relational information.
[0206]
[0207] In equation (15): x a Input vector for node a; x b Input vector for node b; d k Feature dimensions for each head; The Q-projection weights of the nth attention head; The K-projection weights of the nth attention head; r R(a,b) It is the learnable relation embedding vector corresponding to the relation type R(a,b); T is the matrix transpose operation.
[0208] To obtain the attention weights of each node, Softmax normalization is used, as shown in equation (16) below:
[0209]
[0210] In equation (16): α ab N represents the normalized attention coefficient. a For graph G bp The set of neighbors of node a; e ab e represents the weight of the influence of node b on node a. ak Let k be the influence weight of node a to its neighbor node k.
[0211] The features of all neighboring nodes are weighted and aggregated using this weight to form the feature update result of node a under this attention focus. The calculation formula is shown in the following formula (17):
[0212]
[0213] In equation (17): This represents the updated feature representation of node a under the nth attention head; This represents the V transformation matrix of the nth attention head; x represents the influence weight of node b on node a in the nth attention head; b N is the input feature vector of node b; a For graph G bp The set of neighbors of node a.
[0214] For a multi-head attention mechanism with H attention heads, the output features of all heads are concatenated and fed into a linear transformation to obtain the output of node a in the current layer as shown in equation (18):
[0215]
[0216] In equation (18): Concat(·) represents concatenating the outputs of all attention heads; W O To output a linear mapping matrix, used for dimension reduction; x′ a The features of node a after the update of this layer; This represents the updated features of node a under the first attention head, and so on.
[0217] Subsequently, after passing through a feed-forward network (FFN) and layer normalization (LayerNorm) operations, as shown in equation (19):
[0218]
[0219] In equation (19): The feature of node a in the l-th layer; x′ a is the feature of node a after the layer is updated; FFN(·) is the feedforward network layer function; LayerNorm(·) is the layer normalization.
[0220] Finally, by aggregating the outputs of all layers, the final embedding vector of node a in the time dimension is obtained, as shown in equation (20) below:
[0221]
[0222] In equation (20): L is the number of Transformer stacking layers; This represents the output of node a at the last level.
[0223] To learn the spatial structural relationships of the system, a DGNN module is used to deeply fuse the dynamic characteristics of power grid nodes with the static physical properties of the network. Its internal structure is as follows: Figure 5 As shown, the mathematical expression for the power grid topology can be represented by the following equation (21):
[0224] G = (V, E)(21);
[0225] In equation (21): G represents the power grid topology; V represents the set of nodes in the topology; E represents the set of edges in the topology.
[0226] The DGNN module consists of several stacked graph convolutional layers. Let the feature of node i in the k-th layer be... The features of this node in the next layer are obtained by weighted aggregation of its neighbor information. First, the attention score between node pairs is calculated through the edge attention mechanism, as shown in the following equation (22):
[0227]
[0228] In equation (22): This represents the attention weight of edge (i,j) in the k-th layer; Feature representation of node i in the k-th layer; W g W represents the node feature mapping matrix; e w represents the edge feature mapping matrix; ij Let represent the electrical parameters carried by edge (i,j); p represents the learnable weights for attention computation; || represents the vector concatenation operation.
[0229] Next, the attention weights of the edges are obtained by Softmax normalization, as shown in equation (23):
[0230]
[0231] In equation (23): This represents the normalized attention weights; This represents the attention weight of edge (i,j) in the k-th layer; N represents the attention weight of edge (i,m) in the k-th layer; i Let i represent the set of adjacent nodes of node i.
[0232] The attention weights are used to aggregate the features of neighboring nodes in a weighted manner, thereby calculating the next layer representation of node i, as shown in equation (24) below:
[0233]
[0234] In equation (24): This represents the next level of node i; W represents the normalized attention weights. u The transformation matrix is updated for each node; σ(·) is the nonlinear activation function; N represents the neighboring node at the next higher level. i Let i represent the set of adjacent nodes of node i.
[0235] After L g After stacking the layers, the final embedding of node i in the spatial structure is obtained, as shown in equation (25):
[0236]
[0237] In equation (25): For stacking L g After the layer, the final embedding vector of node i in the spatial structure.
[0238] After each module extracts spatiotemporal features, they are spliced and fused to form a unified node-level joint feature, as shown in the diagram below. Figure 6 As shown. The result after splicing is as shown in equation (26):
[0239]
[0240] In equation (26): h d This represents the feature representation after spatiotemporal feature concatenation; || represents the vector concatenation operation. Features are time-dimensional; It is a spatial dimension feature.
[0241] After obtaining the joint features of all nodes, a graph-level aggregation strategy is used to extract the system-level representation. Specifically, the features of all nodes are first weighted and aggregated using an attention weight function, as shown in equation (27):
[0242]
[0243] In equation (27): E represents the global representation vector of the entire power system after disturbance; d is the system node; g(·) is a single-layer feedforward neural network used to generate node attention weights; Softmax(·) is the activation function; h d is the feature representation after spatiotemporal feature splicing; N is the total number of system nodes.
[0244] Finally, the global representation vector E is input into the fully connected classification network, and the system outputs the predicted transient stable state after the perturbation, as shown in Equation (28):
[0245]
[0246] In equation (28): is the predicted probability of system stability; MLP(·) is a discriminator composed of a multi-layer fully connected network; Sigmoid(·) is a nonlinear activation function; E represents the global representation vector of the entire power system after disturbance.
[0247] (III) A semi-supervised learning framework based on confidence awareness:
[0248] This framework serves as a guide for learning unlabeled samples under conditions of scarce labels in the overall modeling process. It can make full use of unlabeled data for training while suppressing interference from low-quality pseudo-labels, thereby enhancing the stability and generalization ability of the model.
[0249] First, in the process of constructing the sample set, let the entire sample set be D, and a portion of it have manually labeled results, denoted as the labeled sample subset D. L ={(x i ,y i )}, containing input features x of labeled samples i and its real label y i D L ={(xi ,y i The other part is the unlabeled sample subset D. U ={x j Input features x containing unlabeled samples u The above division will serve as the basic input structure for semi-supervised learning.
[0250] Secondly, for samples in the unlabeled subset, this invention introduces a Monte Carlo Dropout mechanism for confidence quantification. Specifically, for any unlabeled sample x... u ∈D U x j ∈D U During the inference phase, Dropout is enabled and M independent forward propagations are performed to obtain multiple prediction outputs of the sample under perturbation, as shown in equation (29) below:
[0251]
[0252] In equation (29): Represents unlabeled sample x u The output result of the m-th prediction; This represents the m-th inference process of the neural network model under Dropout activation; M is the number of samples in the forward inference; x u These are unlabeled samples.
[0253] The pseudo-label prediction result of the unlabeled sample is obtained by averaging the results of multiple inferences, as shown in equation (30) below:
[0254]
[0255] In equation (30): The mean of the predicted labels for unlabeled samples; This represents the m-th prediction output for the unlabeled sample; M is the number of samples in the forward inference; and m is the current sampling number.
[0256] To ensure the quality of pseudo-labels and avoid the negative impact of low-confidence samples on model training, a confidence screening mechanism is introduced. A confidence threshold τ is defined; if the prediction variance of a sample satisfies... If it is considered to have high credibility, its pseudo-labels can be retained for training, resulting in a pseudo-label set U. c The prediction variance is shown in equation (31) below:
[0257]
[0258] In equation (31): σ uThis represents the variance of the predicted value, reflecting the prediction stability of the sample under multiple Dropout perturbations. The smaller the value, the more certain the model is in its classification judgment, and vice versa, reflecting a higher degree of uncertainty in the prediction. The mean of the predicted labels for unlabeled samples; This represents the m-th prediction output for the unlabeled sample; M is the number of samples in the forward inference; and m is the current sampling number.
[0259] Finally, to achieve the semi-supervised learning objective, this invention designs a hierarchical confidence-aware loss function, which comprehensively considers the supervised loss of labeled samples, the pseudo-supervised loss of unlabeled samples, and the entropy minimization regularization term to ensure the stability and effectiveness of model training. The specific formula is shown in equation (32) below:
[0260]
[0261] In equation (32): L1 is the supervised loss for labeled samples; D L For a labeled sample set; |D L | represents the number of labeled samples; (x) i ,y i Let ) be one of the sample pairs, containing the input feature x. i and its real label y i ; L2 is the model's predicted probability for labeled samples; L2 is the pseudo-supervision loss for unlabeled samples; D U For the unlabeled sample set in the current batch; |D U | represents the number of unlabeled samples; This is an indicator function that takes the value 1 when the condition is true and 0 otherwise; σ u The variance of the predicted value is represented by τ; the confidence threshold is τ; and L3 is the entropy minimization regularization term. For unlabeled sample x u The average of M predictions; p represents the model's prediction result for unlabeled samples; c represents the number of categories, which in this invention is c=2, corresponding to the "stable" and "unstable" categories of the samples, respectively; c (x u To predict unlabeled sample x u ε is the probability of class c; ε is a very small positive number to prevent the value of log(0) from overflowing; L is the total loss function; λ(t) is a dynamic ramp-up function that changes with the training period t, and its value smoothly increases from 0 to a preset upper limit to suppress the influence of unreliable pseudo-labels in the early stage of training, and to make full use of the information of high-quality pseudo-labels in the later stage; ξ is a fixed hyperparameter used to adjust the strength of the regularization term.
[0262] (iv) Power system transient stability assessment process based on BP-Transformer-DGNN semi-supervised learning:
[0263] 1) Construction of temporal and spatial data sample sets: This invention performs high-frequency sampling of transient disturbance signals, sets the sampling interval to 0.01s, and forms a fixed-time window sample centered on the fault initiation time. Simultaneously, electrical quantities and physical structures of each node in the power network are selected in the spatial dimension to construct the graph structure topology of the system, so as to form an input sample set for spatiotemporal fusion modeling. The transient stability index (TSI) is used as the basis for judging whether the system is stable or not, as shown in the following equation (33):
[0264]
[0265] In equation (33): γ TSI The transient stability exponent; Δδ max This represents the maximum power angle difference between any two generators in the system during simulation. If |Δδ max | Less than 360°, i.e., γ TSI When the value is positive, the system is considered stable and the current sample is labeled as 1; otherwise, it is considered unstable and the sample is labeled as 0.
[0266] 2) Feature subset selection and data preprocessing: This invention uses the Fisher score algorithm to evaluate the correlation between each original feature and the system's steady state, and selects and constructs the optimal feature subset accordingly. To improve the model's processing efficiency and enhance training stability, this invention performs feature selection and normalization on the original sample data, and uses the Z-score method to unify the data distribution and eliminate the influence of dimensional differences. The Z-score normalization is shown in equation (34).
[0267]
[0268] In equation (34): The data is normalized, where ν is the mean of a feature x in the original data, and ψ is the standard deviation. To minimize the value and prevent the denominator from being zero.
[0269] 3) Spatiotemporal feature extraction: The input samples are fed into the BP-Transformer module and the DGNN module respectively to extract features from the perspectives of dynamic changes in time series and interdependence of spatial nodes. The fusion model learns the dynamic interaction relationship between time points in the sequence through a multi-head attention mechanism, and at the same time uses a dynamic graph neural network to mine multi-scale topological information in the system structure. Finally, the two types of feature vectors are concatenated to form a unified high-dimensional tensor as the input for subsequent stability classification.
[0270] 4) Training the model in a semi-supervised framework: First, perform preliminary supervised training on the model using an initial labeled set. Then, input unlabeled samples into the current model, perform predictions, and quantify the confidence of each sample's prediction result using the Monte Carlo Dropout method. Then, based on a preset confidence threshold, perform further training on the unlabeled set D. U The model selects the most reliable subset of samples for prediction, assigns pseudo-labels to the samples in the unlabeled set, and moves them from the unlabeled set to the labeled set to form an expanded training set. Finally, the model is trained on the expanded training set, and the learning of real and pseudo-labels is optimized by the designed HCAL function.
[0271] 5) Evaluation Results: After training, the test set data is fed into the model, and the model performance is evaluated based on the comprehensive evaluation index output by the model.
[0272] (V) Interpretability analysis of the model:
[0273] To verify the interpretability of the constructed model, this invention combines attention weight visualization and Shapley additive interpretation (SHAP) analysis to analyze and verify the model's judgment criteria.
[0274] Specifically, firstly, by extracting the attention weight distribution within the BP-Transformer and DGNN modules, attention visualizations in the temporal and spatial dimensions are created. The temporal attention reflects the model's focus on the disturbance response at each moment during the transient process, while the spatial attention demonstrates the model's weight allocation to different nodes in the power grid and their connections. By comparing the differences in attention distribution between stable and unstable samples, the key time periods and nodes that the model focuses on during stability assessment can be intuitively identified.
[0275] Secondly, the SHAP method is used to calculate the average marginal contribution of the model output to the input features. By calculating the SHAP value of each feature on the test set, the positive and negative influence direction and contribution intensity of each input feature on the system stability prediction results are quantitatively revealed. The SHAP value of the Jth feature is shown in the following equation (36):
[0276]
[0277] In equation (36): φ J Let f(C) be the SHAP value of the J-th feature; C be the feature subset that does not contain the J-th feature; |C| be the number of features contained in the feature subset C; D be the total number of features; F(C) be the output of the model on the feature subset C; F(C∪{f}) is the output of the model on the feature subset C. J}) represents the model's output for all features; f JF0 represents the J-th feature; F0 represents the baseline output, which is the expected output of the model when there are no feature inputs.
[0278] This invention addresses the issues of class imbalance and unequal costs associated with misjudgments and omissions in power system transient stability assessment. This invention employs an evaluation model based on the confusion matrix shown in Table 1 for comprehensive performance evaluation, and uses accuracy (η) as the benchmark. acc Precision (ρ) p ), recall rate (τ) r The four indicators, namely F1 score, F1 score, etc., are used to measure the evaluation effect of the model. The four indicators are shown in equations (37) to (40).
[0279]
[0280] In the above formula: η acc Accuracy reflects the model's overall ability to correctly classify all samples, including both stable and unstable ones; ρ p Precision reflects the reliability of model instability warnings; a higher value indicates fewer false alarms. r Recall reflects the model's ability to capture actual instability events; a higher value means the model misses fewer instability risks. The F1 score is ρ. p and τ r The harmonic average reflects the comprehensive evaluation of the two indicators.
[0281] Table 1 Confusion Matrix
[0282]
[0283] In Table 1, T N and T P These are the correctly identified stable and unstable samples, respectively, F N For a sample to be identified as a stable unstable sample, F P These are stable samples that are identified as unstable.
[0284] In summary, the overall process of the power system transient stability assessment method based on BP-Transformer-DGNN semi-supervised learning proposed in this invention is as follows: Figure 7 As shown.
[0285] The technical effects of the present invention will be further illustrated below through examples:
[0286] An improved 10-unit, 39-node power system was built on the PSASP simulation platform, comprising 6 conventional turbine generators, 2 wind farms, and 2 photovoltaic power plants. The specific system topology is as follows: Figure 8As shown. The system frequency is 50Hz. Wind and solar penetration rates are set to 0%, 20%, and 40%, and the system load level varies from 80% to 120% in 10% increments. Simulations are performed under five different load levels, with each simulation lasting 10 seconds. At each load level, a three-phase short-circuit fault is sequentially introduced into each AC line every 0.5 seconds. The fault locations are set at 2%, 25%, 50%, 75%, and 98% of the line's length. The faulted lines traverse all lines in the system except the transformer, with fault durations of 3, 5, 7, 9, and 11 cycles. The electrical characteristics of the busbars, lines, and generator units are recorded within 10 seconds. A total of 12,750 samples are generated, including 9,114 stable samples and 3,636 unstable samples. Finally, the dataset is divided into training, validation, and test sets in a 7:2:1 ratio. The ratio of labeled to unlabeled samples in the training set is 1:9.
[0287] To verify the performance of the proposed transient evaluation model based on BP-Transformer-DGNN semi-supervised learning, five benchmark methods were selected for comparison, including Support Vector Machine (SVM), Deep Belief Network (DBN), Convolutional Neural Network (CNN), Clustering Adaptive Active Learning (CALL), and a semi-supervised method based on Tri-training-SSAE. For objective comparison, all models were trained and evaluated on the same 10% labeled dataset. The experimental results are shown in Table 2.
[0288] Table 2 Comparison results of different models
[0289]
[0290] As shown in Table 2, the method proposed in this invention demonstrates significant superiority in transient stability assessment tasks, achieving an overall accuracy of 97.33% and an F1 score of 97.76%, outperforming other models across all four metrics. Compared to SVM and other deep learning methods that rely on statistical features, the model in this invention, through deep fusion of temporal dynamics and spatial topological information during transient processes, can more profoundly capture the nonlinear spatiotemporal coupling mechanism of transient instability, effectively reducing the risk of underreporting key instability events.
[0291] To investigate the specific contributions of the pseudo-label unsupervised loss and entropy minimization regularization term in the proposed hierarchical confidence-aware loss function to the performance of semi-supervised learning, two variant loss functions were used under the same setting of 10% labeled proportion: HCAL1 with pseudo-label pseudo-supervised loss and HCAL2 with entropy minimization regularization term. These were compared with the Focal Loss (FL) function. The performance metrics of the different loss functions after training the model are shown in Table 3.
[0292] Table 3 Comparison of Loss Functions
[0293]
[0294] Table 3 shows that the ablation experiments of each component of HCAL verify that removing the pseudo-label loss term or the entropy minimization regularization term leads to varying degrees of performance degradation in the model. This indicates that the direct supervision signal provided by HCAL and the regularization constraints on the decision boundary together constitute a collaborative optimization mechanism. Traditional supervised loss functions, on the other hand, have the lowest evaluation performance because their optimization process is limited to the initial labeled set and they cannot utilize the distribution information inherent in the unlabeled data. Ultimately, the complete HCAL achieved optimal performance on all evaluation metrics, verifying the superiority of the composite loss function proposed in this invention.
[0295] To verify the effectiveness of the pseudo-label strategy proposed in this invention, the experiment first analyzed the impact of different confidence screening thresholds on model performance to determine a reasonable value. Subsequently, the strategy based on this selected threshold was compared with the traditional self-trained pseudo-label strategy in terms of performance. The threshold screening results are as follows: Figure 9 As shown in the figure. Taking into account both the false negative rate and the false positive rate, the experiment ultimately selected 0.75 as the confidence threshold. The comparison results with the self-trained pseudo-label under the same experimental conditions are shown in Table 4 below.
[0296] Table 4 Comparison of different pseudo-label creation strategies
[0297]
[0298] As shown in Table 4, the experimental results demonstrate that all indicators outperform the traditional pseudo-labeling strategy, proving that the proposed strategy is more adaptable to complex scenarios and optimizes resource utilization. Therefore, the proposed strategy has significant potential and practical value in real-world applications.
[0299] To verify that the proposed semi-supervised learning framework still possesses good flexibility under real-world conditions with insufficient labeled data and uncertainty in the ratio of unstable to stable samples within the labeled samples, experiments were designed to test different unstable sample ratios at various labeled data ratios (2%, 5%, 10%, 25%, 50%, 100%), with ratios ranging from 0.1 to 0.9 and a step size of 0.1. For each ratio, a randomly selected labeled dataset was used, and the model's performance on various metrics was evaluated. The results are as follows: Figure 10 As shown.
[0300] Depend on Figure 10It can be seen that the model's evaluation performance steadily improves with the increase of the amount of labeled data. When the labeled proportion increases from 2% to 10%, the accuracy improves rapidly; after the proportion exceeds 10%, the performance improvement tends to level off, remaining steadily above 97%, indicating that the model can quickly learn key discriminative features with a small number of labels. Furthermore, the model exhibits good adaptability to class imbalance in the training set. Under all test instability sample proportions, the model's evaluation accuracy remains at a high level above 90%, especially when the ratio of unstable to stable samples is close to 1:1, where the model performance reaches its optimal level, with an accuracy of up to 98%. The experiments fully demonstrate that the semi-supervised learning framework proposed in this invention has high flexibility and robustness, and can maintain stable and reliable evaluation performance in complex scenarios where there is significant uncertainty in the number of labeled samples and the distribution of categories.
[0301] To verify the computational efficiency of the proposed BP-Transformer module in processing transient long sequences, it was compared with the standard Transformer. Input sequences of the first 200, 500, and 1000 time steps of the original data were used to evaluate the performance of different models when processing data of different lengths. The test results are shown in Table 5.
[0302] Table 5 Comparison of time consumption for different models
[0303]
[0304] As shown in Table 5, the evaluation accuracy of both models slightly improves with increasing sequence length from 200 to 1000, while maintaining comparable performance. However, significant differences exist in computational time. This is primarily due to the quadratic computational complexity of the standard Transformer's global self-attention mechanism, leading to a rapid increase in training and evaluation time with increasing sequence length. In contrast, the BP-Transformer proposed in this invention decomposes global dependencies into sparse multi-scale information interactions through its hierarchical graph structure, resulting in a more gradual increase in computational time. At a sequence length of 1000, the BP-Transformer's single-sample evaluation time is approximately 1 / 5 that of the standard Transformer, while its training efficiency is improved by about 6.3 times. Experimental results demonstrate that the BP-Transformer can achieve comparable evaluation accuracy to the standard Transformer with lower computational cost when processing long sequence data.
[0305] To fully analyze the internal decision-making mechanism of the power system transient stability assessment model based on BP-Transformer-DGNN semi-supervised learning proposed in this invention, the interpretability of the model will be analyzed from two dimensions: attention visualization of the internal mechanism and analysis of global features. Experimental results are as follows: Figures 11-18 As shown.
[0306] Depend on Figure 11 , Figure 12 It can be seen that for stable samples, the model's attention peak is concentrated in the initial stage after fault clearance, indicating that the model can make a decision based on whether the system can quickly suppress initial oscillations; Figures 13-16 It can be seen that for unstable samples and boundary samples, the model's attention focus shifts significantly to the later stages when the system experiences large oscillations. This indicates that the model can dynamically focus its attention on the time-domain segment that is most informative for the final decision, based on the evolutionary characteristics of the transient process. Further spatial attention analysis reveals the focus of DGNN on the power grid topology, showing that lines near the fault point and the electrical connections between them and the critical generator buses are given higher attention weights.
[0307] Figure 17 The graph displays the 20 features with the highest average marginal contribution to the model output, arranged in descending order of their average absolute SHAP values. The horizontal axis represents the SHAP value corresponding to each feature, with positive and negative values indicating the direction of the feature's contribution to the system's tendency towards stability or instability, respectively. Each point represents a test sample, and its color indicates the magnitude of the feature's own value.
[0308] With the power angle δ of generator G7 G7 For example, Figure 18 This demonstrates its nonlinear relationship with system stability. When δ G7 When the power angle is below 90°, its SHAP value is positive, indicating that this feature contributes positively to system stability. When the power angle is greater than 90°, the SHAP value quickly turns negative, becoming the main driving factor for system instability. From a physical mechanism perspective, the generator power angle is an important indicator of the system's synchronization state. The nonlinear relationship revealed in the figure accurately reflects the "power angle loss of synchronization" phenomenon in transient stability. That is, after a disturbance, if the relative power angle of the unit remains within the stability limit, the system can continue to operate synchronously; once this limit is exceeded, loss of synchronization will be inevitable. By analyzing the critical value of the power angle, the key turning points of the system in the dynamic process can be identified, verifying the reliability of the model evaluation results. Similarly, the same method can be used to analyze the positive and negative correlation between residual features and system stability.
[0309] Finally, to test the generalization ability of the proposed power system transient stability assessment method based on BP-Transformer-DGNN semi-supervised learning in large power system scenarios with topology changes, tests were conducted on the improved IEEE 118-node test system. The specific system topology is as follows: Figure 19As shown in the figure, K branches were randomly cut using NK (K=1,2,3). A total of 6000 transient samples were generated through batch time-domain simulation for each new topology. The training set to test set ratio was 4:1, with 10% of the training set containing labeled samples. The transient stability evaluation performance was then compared with that of Support Vector Machine (SVM), Deep Belief Network (DBN), Convolutional Neural Network (CNN), Cluster Adaptive Active Learning (CALL), and a semi-supervised method based on Tri-training-SSAE. The results are shown in Table 6.
[0310] Table 6 Comparison results of models under different topologies
[0311] As shown in Table 6, when facing scenarios involving changes in power grid topology, the performance of SVM, CNN, CALL, and DBN evaluation models all significantly degraded because they could not explicitly perceive changes in system topology. In contrast, the BP-Transformer-DGNN method proposed in this invention exhibits excellent generalization performance because its DGNN module can adaptively perceive real-time changes in system topology, achieving a test accuracy of 96.14%.
Claims
1. A power system transient stability evaluation method based on BP-Transformer-DGNN semi-supervised learning, characterized in that The method comprises the following steps: Step 1: constructing a comprehensive feature set representing the transient stability of a power system, and using a feature screening method based on Fisher score to reduce the dimension of the original high-dimensional time-series electrical quantity measurement data features, and screening out the optimal feature subset with the highest identification degree for the transient stability state; Step 2: constructing a BP-Transformer-DGNN spatio-temporal feature fusion evaluation model, using a binary partitioned Transformer module to capture the long time-series dependence in the optimal feature subset, and using a dynamic graph neural network DGNN to deeply fuse the dynamic features of nodes and the static physical properties of the network; Step 3: constructing a confidence-aware semi-supervised learning framework, using Monte Carlo Dropout to quantify the uncertainty of model prediction, to actively screen high-confidence unlabeled samples to generate pseudo labels, and designing a hierarchical confidence-aware loss function to iteratively optimize the semi-supervised transient stability evaluation model based on BP-Transformer-DGNN; Step 4: constructing a semi-supervised transient stability evaluation model based on BP-Transformer-DGNN, and using the trained semi-supervised transient stability evaluation model based on BP-Transformer-DGNN to evaluate the transient stability state of the power system.
2. The method of claim 1, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In step 1, the time-series evolution characteristics and network topology constraint characteristics of the transient response of the power system are comprehensively considered, the dynamic measurement data of each electrical node in the transient process and the topology data representing the connection relationship and electrical parameters of the power grid are integrated, thereby forming a comprehensive feature set capable of representing the system transient, which includes time-series electrical measurement data features and spatial data features; The time-series electrical measurement data features in the comprehensive feature set include three categories: The first category is the generator-related features including G ω , G δ , G Δf , G pm , G P , G Q , which represent the angular speed, power angle, frequency deviation, mechanical power, active power, and reactive power of different generators, respectively. The second category is bus related features including B u , B θ , which represent all bus voltage magnitudes, phase angles, respectively. The third category is line related features including L P , L Q , which represent the active power and reactive power of all lines, respectively. The input time-series electrical measurement data features X are shown in formula (1): In formula (1): x1 is a feature vector at a first time step; x2 is a feature vector at a second time step; x T is a feature vector at a Tthtime step; T is a time series length; D is a feature dimension; f1 is a first feature in the feature vector x; f2 is a second feature in the feature vector x; f J is a Jthfeature in the feature vector x; f D is a Dthfeature in the feature vector x; T is the transpose operation of the matrix; The spatial data features in the comprehensive feature set are selected as the electrical distance between any two nodes in the electrical system graph structure to reflect the electrical coupling strength of each node in the network, and the electrical distance is calculated as shown in formula (2): d ij = |Z ii + Z jj - 2Z ij | (2); In formula (2): d ij is the degree of electrical coupling between the two nodes, i.e. the electrical distance; Z ii is the self-impedance of node i; Z jj is the self-impedance of node j; Z ij is the mutual impedance between the nodes.
3. The method of claim 2, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In step 1, the time-series electrical measurement data features are quantitatively evaluated and screened using the Fisher score method. For a feature f J The Fisher score S J of the feature f is calculated as shown in equation (3): In equation (3): S J f is the Fisher score for the J-th feature; J Let be the J-th feature in the feature vector x; c is the number of categories, corresponding to the "stable" and "unstable" classes of the sample, respectively; n c μ is the number of samples in class c. cJ For feature f J The mean of the c-th class of samples; For feature f J Variance in the c-th sample; μ J For feature f J The population mean over the entire sample.
4. The method of claim 3, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In step 1, to determine the optimal feature subset, a forward search sequence is used to screen the feature subset: First, calculate the Fisher score of the time-series electrical measurement data features one by one through formula (3) and arrange them from high to low; After that, the candidate feature set F is added in turn from the first ranked feature candidate After adding each feature, the updated feature set F is used candidate The semi-supervised transient stability assessment model of BP-Transformer-DGNN is trained, and the accuracy of the evaluation and the training time are recorded on the independent validation set. Finally, the optimal feature subset is obtained by balancing the training time and evaluation accuracy, and the index is shown in formula (4): In formula (4), R is an index of the feature set F candidate , and the smaller the value is, the better balance between training time consumption and evaluation accuracy is achieved; α is a weighting coefficient, which adjusts the relative importance of training time consumption and evaluation accuracy; F candidate is a candidate feature set; T(F candidate ) is the training time required for training in the candidate feature subset F candidate . Acc(F candidate ) is the evaluation accuracy after training on the candidate feature subset F candidate ; is the normalized training time; is the normalized accuracy; T min is the minimum training time after traversing all features; T max is the maximum training time elapsed after traversing all features; Acc min is the minimum evaluation accuracy after traversing all features; Acc max is the maximum evaluation accuracy after traversing all features.
5. The method of claim 4, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In step 2, the BP-Transformer-DGNN spatio-temporal feature fusion evaluation model is built to learn the spatio-temporal features of the transient process; To fully explore the spatio-temporal coupling mechanism of the transient process, a deep neural network model with parallel time feature extraction module and space feature extraction module is designed; specifically as follows: S2.1: First, use the binary partitioned Transformer to extract the time-series data features; S2.2: Then, through the dynamic graph neural network DGNN, the dynamic features of the nodes are deeply fused with the static physical properties of the network to extract the spatial data features; S2.3: Finally, the features extracted by the BP-Transformer and the DGNN network are spliced and input into a multi-layer perceptron (MLP) classifier in parallel to obtain the evaluation results.
6. The method of claim 5, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In S2.1, a sparse attention mechanism is introduced to structure the original one-dimensional long time series data into a hierarchical sparse graph structure, referred to as a binary partition graph, to reduce the complexity of attention calculation. The binary partition graph structure is shown in equation (5): G bp = (V bp , E bp )(5); In formula (5): G bp denotes a binary split graph; V bp is a set of nodes of the binary split graph, E bp is a set of edges of the binary split graph; The binary partition graph construction process is divided into two steps: First, the original time series sequence of length T is recursively bisected until all sub-sequences have a length of 1; a hierarchical time scale structure is formed, with the bottom layer consisting of T fine scale nodes corresponding one-to-one to the T time points of the original time series sequence. Let the node set of the 0th layer be: In formula (6): V (0) is the 0th layer node set; T is the original time sequence length; is the 1st fine scale node; is the 2nd fine scale node; is the Tth fine scale node; On this basis, the coarse scale nodes are recursively constructed from bottom to top; let the kth node in the lth layer be denoted as Nk,l The expression of the node Nk,lis shown in the following formula (7) by aggregating the adjacent two nodes in its lower layer (L=l-1 layer): In equation (7): The k-th node in the l-th layer represents a coarser-grained aggregate representation. This indicates that in the (l-1)th layer, it is related to the kth node in the lth layer. The corresponding left child node covers the time segments contained in the first half of the subsequence in the current time interval; This indicates that in the (l-1)th layer, it is related to the kth node in the lth layer. The corresponding right child node covers the time segments contained in the second half of the subsequence in the current time interval; Agg(·) is an aggregation function; All hierarchical nodes together form the node set V of the binary split graph bp As shown in the following formula (8): In formula (8): V bp is a set of all time nodes in the binary split graph; V (l) is a set of all nodes of the lth layer; L is the total number of layers; Secondly: the edge set E of the binary partition graph bp There are two types of connections: one is the longitudinal connection, which is used to connect the nodes between different time scale levels, reflecting the aggregation and refinement relationship in scale, as shown in the following formula (9): In equation (9): E vertical Let be the set of vertical connecting edges of a binary partition graph; It is the k-th node in the l-th layer; This indicates that in the (l-1)th layer, it is related to the kth node in the lth layer. The corresponding left child node covers the time segments contained in the first half of the subsequence in the current time interval; This indicates that in the (l-1)th layer, it is related to the kth node in the lth layer. The corresponding right child node covers the time segments contained in the second half of the subsequence in the current time interval; Second, within the same time scale level, each node is connected to its spatially adjacent nodes horizontally to capture local temporal dependencies at the same scale, as shown in equation (10): In formula (10): E horizontal is a set of horizontal connection edges of the binary split graph; is the kth node in the lth layer; is the k+δth node in the lth layer; δ is a distance offset; Q is a predefined distance set; represents an index boundary condition, ensuring that k+δ does not exceed the total number of nodes in the lth layer; is the number of nodes in the layer; T is the length of the original time series sequence; The edge set of the complete binary partition graph is shown in equation (11): E bp = E vertical ∪ E horizontal (11); In formula (11): E bp is the edge set of the binary partition graph; E vertical is the set of vertical connecting edges of the binary partition graph; E horizontal is the set of horizontal connecting edges (same layer adjacent edges) of the binary partition graph; In S2.1, in the constructed binary partition graph G bp In the above, the multi-head relationship graph attention mechanism is used for information aggregation, which enables the BP-Transformer to learn diversified feature representations from different subspaces by projecting node features to multiple independent attention heads; the overall computational framework is shown in the following formula (12) and formula (13): M ultiHead (Q,K,V) = C oncat (h ead1 ,h ead2 ,…,h eadn )W O (12); In the above formula: M ultiHead (·) is the overall mapping function of the multi-head attention module; h eadn is the output of the nth attention head; C oncat (·) is the concatenation operation along the last dimension; Q is the Query matrix; K is the Key matrix; V is the Value matrix; A ttention (·) is the scaled dot-product attention function; is the Q projection weight of the nth attention head; is the K projection weight of the nth attention head; is the V projection weight of the nth attention head; W O output projection matrix; Within each attention head, a relationship bias term is introduced to distinguish different types of edges in the binary partition graph. The relationship type R(a, b) of an edge is defined as equation (14): In formula (14): l a is the level of node a in the binary partition graph; l b is the level of node b in the binary partition graph; Node b to node a attention score e ab The content information and the relationship information are combined as shown in the following equation (15). In formula (15): x a is the input vector for node a; x b is the input vector for node b; d k is the feature dimension for each head; is the Q projection weight for the nth attention head; is the K projection weight for the nth attention head; r R(a,b) is the learnable relation embedding vector corresponding to the relation type R(a, b); T is the transpose operation of a matrix; To obtain the attention weights of each node, Softmax normalization is used, as shown in equation (16): In formula (16): a ab is the normalized attention coefficient; N a is the binary partition graph G bp is the neighbor set of node a; e ab is the attention weight of node b to node a; e ak is the attention weight of node a to neighbor node k; exp(e ab ) represents the exponential value of attention weight e ab ; exp(e ak ) represents the exponential value of attention weight e ak ; k represents the neighbor node; Using the normalized attention weight a ab The weighted aggregation of the features of all neighbor nodes is performed to realize the update of the node representation; assuming that the graph attention network has multiple independent attention heads, under the nth attention head, the updated feature vector of node a is as shown in the following formula (17): In formula (17): denotes the updated feature of node a under the nth attention head; denotes the V transformation matrix of the nth attention head; is the influence weight of node b on node a in the nth attention head;x b is the input feature vector of node b;N a is the neighbor set of node a in graph G bp is the neighbor set of node a in graph G For a multi-head attention mechanism containing H attention heads, the output features of all heads are spliced and sent to a linear transformation. The output of node a at the current layer is shown in equation (18): In formula (18), Concat(·) represents concatenating the outputs of all attention heads; W O is an output linear mapping matrix for dimension reduction; x′ a is the feature of the updated node a of the current layer; represents the updated feature of node a under the 1st attention head; represents the updated feature of node a under the 2nd attention head; represents the updated feature of node a under the Hth attention head; Subsequently, a feedforward neural network and layer normalization (LayerNorm) operation are performed, as shown in equation (19): In formula (19): is the feature of the l-th layer node a; x' is the feature of the (l-1)-th layer node a; x is the feature of the (l+1)-th layer node a; and a is the feature of the updated node a of the layer; FFN(·) is a feedforward network layer function; and LayerNorm(·) is layer normalization. Finally, all layer outputs are aggregated to obtain the final embedding vector of node a in the time dimension, as shown in equation (20): In formula (20): represents the final time-dimension embedding vector output by the BP-Transformer for node a; is the output representation of node a at the last layer; L is the number of stacked Transformer layers.
7. The method of claim 5, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In S2.2, a dynamic graph neural network (DGNN) is used to learn the spatial structural relationships of the system. The power grid topology graph is shown in equation (21): G = (V, E) (21); In equation (21), G represents the power grid topology graph; V represents the set of nodes in the topology graph; E represents the set of edges in the topology graph; A dynamic graph neural network (DGNN) is stacked by several graph convolution layers. In the kth layer, the feature of node i is denoted as The feature of node i in the next layer is obtained by weighted aggregation of its neighbor information. First, the edge attention mechanism is used to calculate the attention score between node pairs, as shown in equation (22): In formula (22): denotes the attention weight of edge (i, j) in the kth layer; feature representation of the kth layer node i; W g denotes the node feature mapping matrix; W e denotes the edge feature mapping matrix; w ij represents the electrical parameter carried by edge (i, j); p represents the learnable weight of attention computation; || represents the vector concatenation operation; T is the transpose operation of matrix; Then, the edge attention weights are obtained through Softmax normalization, as shown in equation (23): In formula (23), denotes the normalized attention weight; denotes the attention weight of edge (i, j) in the kth layer; denotes the attention weight of edge (i, m) in the kth layer;N i denotes the set of adjacent nodes of node i; denotes the exponential value of the attention weight ; m denotes the index variable of the adjacent node; denotes the exponential value of the attention weight ; m denotes the index variable of the adjacent node; Utilizing the normalized attention weights The neighbor node features are weighted aggregated to compute the next layer representation of node i as shown in equation (24) below: In formula (24): represents the next layer for node i; represents the normalized attention weight; W u updating the transformation matrix for the node; σ(·) is a non-linear activation function; is the representation of the neighbor node at the previous layer; N i is the set of neighboring nodes of node i; After L g After the layer stacking, the final embedding of node i on the spatial structure is obtained as follows (25): In formula (25): represents the final embedding feature of node i under the DGNN; is the stack L g layer, the final embedding vector of node i in the spatial structure.
8. The method of claim 5, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In S2.3, after the BP-Transformer module and the DGNN module complete the spatiotemporal feature extraction, the unified node-level joint features are formed, as shown in equation (26): In formula (26): h d is the spatio-temporal feature representation after concatenation; || denotes the vector concatenation operation; is the temporal dimension feature representation; is the spatial dimension feature representation; After obtaining the joint features of all nodes, a graph-level aggregation strategy is used to extract the system-level representation. Specifically, first, the features of all nodes are weighted and aggregated through an attention weight function, as shown in equation (27): In formula (27): E represents the global feature vector after the entire power system disturbance; d is the system node; g(·) is a single-layer feedforward neural network for generating node attention weights; Softmax(·) is an activation function; h d is the spatiotemporal feature spliced feature representation; N is the total number of system nodes; Finally, the global representation vector E is input into a multi-layer fully connected classification network, and the transient stability state prediction result of the system after disturbance is output, as shown in equation (28): In formula (28): is the predicted probability of system stability; MLP(·) is a discriminator composed of a multi-layer fully connected network; Sigmoid(·) is a nonlinear activation function; E represents the global feature vector after the disturbance of the entire power system.
9. The method of claim 8, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In step 3, a confidence-aware semi-supervised learning framework is constructed. First, in the sample set construction process, the entire sample set is denoted as D, where a part has artificial annotation results, denoted as a labeled sample subset D L = {(x i ,y i )}, which contains the input features x i and the real labels y i of the labeled samples; the other part is an unlabeled sample subset D U = {x u}, which contains the input features x u of the unlabeled samples; The above partition will serve as the basic input structure for semi-supervised learning; For the samples in the unlabeled subset, the Monte Carlo Dropout mechanism is introduced for confidence quantification; specifically, for any unlabeled sample x u ∈D U In the inference phase, Dropout is enabled and M independent forward propagations are performed to obtain the multiple prediction outputs of the sample under perturbation, as shown in the following formula (29): In formula (29): represents a no-label sample x u The mth prediction output result; is a neural network model under Dropout activation mth inference process; M is the number of forward inference samples; x u is a no-label sample; The multiple inference results are averaged to obtain the pseudo-label prediction result of the unlabeled samples, as shown in equation (30): In formula (30): is the mean value of the label prediction for the unlabeled sample; is the prediction output result of the mth time for the unlabeled sample; M is the sampling number of the forward inference; m is the current sampling number; In order to guarantee the quality of pseudo labels and avoid the negative impact of low-confidence samples on model training, a confidence screening mechanism is introduced. A confidence threshold τ is defined. If the prediction variance of a sample satisfies σ u <τ, it is considered to have high confidence, and its pseudo label can be retained for training. Otherwise, the sample is discarded. After screening all unlabeled samples, the pseudo label set U c is obtained. The prediction variance is shown in the following formula (31): In formula (31): σ u represents the variance of the prediction value, reflects the prediction stability of the sample under the multiple disturbance of Dropout, and the smaller the value, the more reliable the judgment result of the semi-supervised transient stability evaluation model of BP-Transformer-DGNN, and vice versa. is the mean value of the label prediction of the unlabeled sample; is the mean value of the label prediction of the unlabeled sample; u The mth prediction output result; M is the sampling number of forward reasoning; m is the current sampling number; The confidence-aware loss function HCAL comprehensively considers the labeled sample supervised loss, the unlabeled sample pseudo-supervised loss, and the entropy minimization regularization term to ensure the stability and effectiveness of the BP-Transformer-DGNN-based semi-supervised transient stability evaluation model training. The specific formula is shown in equation (32) as follows: L1 is the supervision loss of labeled samples; D L is the set of labeled samples; |D L | is the number of labeled samples; (x i , y i ) is one of the sample pairs, containing input feature x i and its real label y i ; is the predicted probability of the model on labeled samples; L2 is the pseudo-supervision loss of unlabeled samples; D U is the set of unlabeled samples in the current batch; |D U | is the number of unlabeled samples; is the indicator function, which takes 1 when the condition is true, otherwise 0; σ u represents the variance of the predicted value; τ is the confidence threshold; L3 is the entropy minimization regularization term; is the M times prediction average value of the unlabeled sample x u ; is the prediction result of the model on unlabeled samples; p c (x u ) is the predicted probability of the c-th class; ε is a very small positive number to prevent numerical overflow of log(0); c is the number of classes, corresponding to the "stable" and "unstable" two categories of samples; L is the total loss function, i.e. the confidence-aware loss function; λ(t) is a dynamic ramp-up function that changes with the training period t, whose value increases smoothly from 0 to a preset upper limit, which is used to suppress the influence of unreliable pseudo-labels in the early stage of training, and then fully utilize the information of high-quality pseudo-labels in the later stage. ξ is a fixed hyperparameter used to adjust the strength of the regularization term.
10. The method of claim 9, wherein the method is based on BP-Transformer-DGNN semi-supervised learning. In step 4, the transient stability evaluation process is as follows: S4.1: Construction of sample set of time series and spatial data: High-frequency sampling is performed on the transient disturbance signal, with a sampling interval of 0.01s. A fixed time window sample is constructed with the fault starting time as the center. This time window covers the time series before and after the disturbance, ensuring that the complete transient change process of each node in the system is captured. The time series features of each node are shown in equation (1). In the spatial dimension, the electrical distance between nodes in the power system is used as the topological structure data of the power system graph. Finally, the time series samples and node topological structure information are fused to form the input sample set. The transient stability index TSI is used as the basis for determining whether the system is stable or not, as shown in equation (33) as follows: In formula (33): γ TSI is the transient stability index; Δδ max represents the maximum power angle difference between any two generators in the system in the simulation; If |△δ max | Less than 360°, i.e., γ TSI When the value is positive, the system is considered stable and the current sample is labeled as 1; otherwise, it is considered unstable and the sample is labeled as 0. S4.2: Optimal feature subset selection and data preprocessing: Feature selection and normalization processing are performed on the time series electrical quantity measurement data features. The Z-score method is used to unify the data distribution and eliminate the influence of dimension differences. The Z-score normalization is shown in equation (34) as follows: In formula (34): is the normalized data, v is the mean value of a certain feature x in the original data, and ψ is the standard deviation, is a minimum value to prevent the denominator from being zero; S4.3: Spatio-temporal feature extraction and fusion: The input samples are sent to BP-Transformer and dynamic graph neural network DGNN, respectively, to extract feature representations from the time series change and spatial node dependency angles. BP-Transformer learns the dynamic correlation between each time in the sequence based on the multi-head attention mechanism constructed in equations (5)-(20), and DGNN module describes the topological dependence between nodes based on equations (21)-(25). Then, the extracted time series features and spatial features are concatenated and fused according to equations (26)-(28) to form a unified high-dimensional spatio-temporal embedding feature vector as the input for subsequent stability classification. S4.4: Model training under semi-supervised framework: First, the initial labeled sample set is input into the BP-Transformer-DGNN model, and the supervised loss function in equation (32) is used to supervise the training of the model to optimize the preliminary discrimination ability of the model for transient stability state. After training, the unlabeled samples are input into the current BP-Transformer-DGNN model to obtain the label prediction results of each unlabeled sample. The Monte Carlo Dropout method is used to quantify the label prediction results of each unlabeled sample based on equations (29) and (30). Then, in order to screen high-confidence pseudo-label samples, the variance σ of the predicted value is calculated by formula (31) u According to the preset confidence threshold τ, if the predicted variance σ of a certain sample satisfies u <τ, it is considered that it has high confidence, and its pseudo-label can be retained for training, otherwise it is discarded; further, the most reliable sample subset is screened from the unlabeled set D U The pseudo-labels are assigned to the samples in the unlabeled set, and the samples are moved from the unlabeled set to the labeled set to form an expanded training set; Finally, the BP-Transformer-DGNN model is trained on the expanded training set, and the loss function designed in equation (32) is used to improve the learning ability of the BP-Transformer-DGNN model for real labels and pseudo labels. S4.5: Evaluation results: After the training, the performance of the trained BP-Transformer-DGNN model is evaluated using the test set. Specifically, the test samples are input into the trained model, and the predicted results are output and compared with the true results. The model performance is quantified based on evaluation indicators. To comprehensively evaluate the classification effect, four indicators, including accuracy, precision, recall, and F1 score, are used, as shown in the following formula (35): In formula (35): η acc is the accuracy rate, reflecting the overall ability of the model to correctly classify all samples containing both stable and unstable; p p is the precision rate, reflecting the reliability of the model's instability warning, and the higher the value, the fewer false positives the model has; τ r is the recall rate, reflecting the model's ability to capture actual instability events, and the higher the value, the fewer missed instability risks the model has; F1 score is the harmonic mean of p p and τ r reflects the comprehensive evaluation of both indicators; T N is the correctly identified stable sample; T P is the correctly identified unstable sample; F N is the unstable sample identified as stable, and F P is the stable sample identified as unstable.