Transient evaluation method based on SHAP
By constructing a transient assessment method based on SHAP, embedding a deep neural network with a Shapley module and using three-dimensional tensor input, the problem of insufficient model interpretability in power systems is solved, achieving fast and accurate transient stability assessment and feature attribution, thereby improving the safety and control efficiency of the power grid.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-21
AI Technical Summary
Existing data-driven transient stability assessment models in power systems suffer from insufficient interpretability, making it difficult to balance accuracy and interpretability. Furthermore, their high computational cost and long inference time limit their online application.
A transient evaluation method based on SHAP is constructed. By embedding a deep neural network with a Shapley module, feature attribution and prediction are executed simultaneously. A deep SHAP network is designed with time-space-feature three-dimensional tensor input. The influence of features on stability is analyzed by combining Shapley values to achieve transparent interpretation.
It enables rapid, accurate, and interpretable transient stability assessment of the power grid, reduces inference time, identifies key characteristics and dominant unstable generator groups, and provides guidance for safety control.
Smart Images

Figure CN121903009A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system transient stability, specifically a transient assessment method based on SHAP. Background Technology
[0002] With the increasing complexity of power grids, transient stability analysis based on electromagnetic transient simulation faces the problem of excessive time consumption, making it difficult to meet the timeliness requirements of dispatching terminals for minute-level safety and stability scans. Against this backdrop, data-driven transient stability assessment (TSA) technology, by constructing a nonlinear mapping relationship between "transient characteristics and transient stability," breaks through the dimensionality limitations of traditional mechanism modeling, providing a new paradigm for rapid safety early warning during system operation. Meanwhile, the continuous expansion of power grid scale leads to an exponential increase in the features characterizing the system's dynamic processes. How to effectively quantify the contribution of various electrical features to transient stability, and thus uncover key features that highly encompass power system safety and stability information, is a pressing problem that needs to be solved.
[0003] Existing data-driven TSA models often exhibit "black box" characteristics in their end-to-end prediction process, with their internal decision-making mechanisms difficult to interpret intuitively. Insufficient interpretability has become a major obstacle limiting their online application in power system transient stability assessment. Machine learning interpretability aims to reveal the core features extracted from data by the model in a human-understandable way and their correlation with the physical mechanisms of the power system, achieving a mapping from the decision space to the interpretation space. Appropriate model interpretability is crucial for improving the reliability and credibility of TSA models in practical applications. Existing posterior SHAP methods, which focus on feature interpretation, rely on shallow machine learning models, lacking sufficient ability to extract time-series information from the power system, making it difficult to achieve a balance between accuracy and interpretability. Furthermore, posterior interpretation methods are independent of the model training process, failing to provide strong support for learning model rules, and suffer from high computational costs and long inference times when applied online, limiting their practicality. Summary of the Invention
[0004] The purpose of this invention is to solve the problems mentioned in the background section by proposing a transient evaluation method based on SHAP.
[0005] The objective of this invention can be achieved through the following technical solution: a transient evaluation method based on SHAP, comprising:
[0006] S1. Construct a prediction-explanation synchronous framework: Embed the Shapley module, which supports parallel computing, into a deep neural network to achieve synchronous execution of transient stability evaluation and feature attribution during forward propagation;
[0007] S2. Design of the spatiotemporal feature fusion architecture: Using a three-dimensional tensor of time-space-feature as input, and drawing on the idea of convolutional neural networks to construct a deep SHAP network;
[0008] S3. Establish a quantitative decision support mechanism: Based on the quantitative impact of Shapley value analysis characteristics on stability, achieve transparent interpretation of evaluation results.
[0009] In a preferred embodiment of the present invention, Shapley values are embedded as learnable latent representations into a deep model for fusion modeling to achieve the inherent interpretability of the model, including:
[0010] S11. Design a Shapley module that can be computed in parallel using the feature activation set mechanism. Calculate the marginal contribution of each Shapley module to its corresponding local feature subset in parallel, and then linearly superimpose the attribution representations of their outputs to achieve efficient aggregation of global feature attribution values.
[0011] S12. Treat the neural network as a "black box" model interpreted by the Shapley module, and use the Shapley module to calculate the marginal contribution of the input features to its predicted value. Finally, through the parameter optimization process of the neural network, the Shapley module can learn the SHAP attribution representation Z of the input feature vector, thereby achieving the unification of feature attribution and predictive modeling.
[0012] As a preferred embodiment of the present invention, a deep SHAP interpretation network is constructed based on SHAP embedding. By passing SHAP attribution representations layer by layer between network layers, accurate evaluation and interpretability analysis of transient stable states are ultimately achieved, including:
[0013] S21. Extract the power angle of each generator in the system within 8 power frequency cycles before and after fault clearing. Frequency deviation Active power P and reactive power Q, along with the amplitude V of the generator terminal bus voltage and the phase angle ε, construct a feature space characterizing the dynamic operation of the system. The characteristic matrix of the system of generators at time t is (G represents the generator index; M represents the feature index):
[0014]
[0015] S22. Based on the convolutional neural network architecture paradigm, a deep SHAP network is constructed to achieve feature extraction of 3D tensors. The deep SHAP network replaces convolutional kernels with Shapley modules; local blocks are flattened and input into an MLP layer, which is then used as a wrapper function for the Shapley module. The attribution representation for each output dimension can be calculated; all Shapley values are reshaped into a tensor structure of "interpretable dimension × output dimension" and used as input to the next layer of the network; after passing through c layers of the SHAP network, the model finally outputs the attribution representation of the interpretable dimension. With transient stability assessment results :
[0016]
[0017]
[0018] This represents the Shapley value of the m-th feature in the g-th generator.
[0019] In a preferred embodiment of the present invention, the marginal contribution of the corresponding activated feature subset can be calculated in parallel, specifically using the following formula:
[0020]
[0021] In the formula, Representation of features Shapley values; S represents all values that do not contain A subset of features; This represents the model's predicted output under the feature subset S; Indicates features Add it to the feature subset S to form a new feature set; This represents the combined weight in the Shapley value, used to measure the average marginal contribution of a feature across all possible orders.
[0022] As a preferred embodiment of the present invention, the distribution patterns of eigenvalues and their corresponding Shapley values in the overall sample and typical local sample are explored by combining global-local dual-scale feature analysis, and electrical features that have a key impact on transient stability and generator groups that dominate instability are identified.
[0023] Compared with the prior art, the beneficial effects of the present invention are:
[0024] 1. The transient assessment method based on SHAP in this invention breaks through the limitations of traditional artificial intelligence methods in feature interpretation, achieves a balance between transparency and accuracy, and can provide the power grid with fast, accurate and interpretable transient stability assessment results;
[0025] 2. This invention constructs an input feature tensor from three dimensions: time, space, and features. By analogy with the architecture paradigm of convolutional neural networks, a deep SHAP network is designed to extract features from the three-dimensional tensor, thereby improving the model's ability to capture spatiotemporal feature information.
[0026] 3. This invention, based on the embedded interpretation mechanism of the Shapley module, achieves simultaneous output of transient evaluation results and feature attribution representations. Compared with the traditional posterior SHAP interpretation method, it significantly reduces the average inference time.
[0027] 4. This invention effectively identifies key features affecting the transient stability of the power grid and the dominant generator groups that lead to transient instability by analyzing the contribution of global features and tracing the causes of local prediction results. It quantitatively reveals the positive and negative correlations between each feature and transient stability, providing guidance and basis for the safe control of the system. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a flowchart illustrating the implementation of a SHAP-based transient assessment method for power system transient stability assessment in this embodiment.
[0030] Figure 2 This is a graph showing the changing trends of evaluation indicators for this embodiment and other models under multi-condition fault scenarios.
[0031] Figure 3 This is a graph showing the change in power angle after a rapid generator tripping process for a generator exhibiting dominant transient instability, used in this embodiment for local sample attribution. Detailed Implementation
[0032] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] Please see Figure 1 A transient evaluation method based on SHAP includes the following steps:
[0034] S1: By embedding the Shapley module, which supports parallel computing, into a deep neural network structure, the model can simultaneously complete transient stability evaluation and feature attribution representation during forward propagation. This breaks through the traditional "predict first, explain later" separation framework and achieves inherent interpretability of the model. Specifically, this includes:
[0035] S11. Sparsity in Shapley value calculation is achieved using an activation set mechanism. The Shapley module encapsulates an arbitrary function f, calculating its Shapley value only for a subset of activated features, thereby achieving local feature attribution. Specifically, it is calculated as follows:
[0036]
[0037] In the formula, Representation of features Shapley values; S represents all values that do not contain A subset of features; This represents the model's predicted output under the feature subset S; Indicates features Add it to the feature subset S to form a new feature set; This represents the combined weight in the Shapley value, used to measure the average marginal contribution of a feature across all possible orders.
[0038] S12. Treat the neural network as a "black box" model interpreted by the Shapley module, and use the Shapley module to calculate the marginal contribution of the input features to its predicted value, thereby embedding the Shapley value as a learnable latent representation into the deep model.
[0039] S2. Using a time-space-feature three-dimensional structure tensor as the model input, a deep SHAP network was designed, analogous to a convolutional neural network, effectively improving the ability to model dynamic features during transient processes; specifically including:
[0040] S21: Extract the power angle of each generator in the system within 8 power frequency cycles before and after fault clearing. Frequency deviation Active power P and reactive power Q, along with the amplitude V of the generator terminal bus voltage and the phase angle ε, are used to construct a feature space characterizing the dynamic operation of the system. This space has n... g The characteristic matrix of the system of generators at time t is Where G represents the generator index and M represents the feature index.
[0041]
[0042] S22: Based on the architectural paradigm of convolutional neural networks, a deep SHAP network is constructed to achieve feature extraction of three-dimensional tensors.
[0043] Deep SHAP networks replace convolutional kernels with Shapley modules; flattened local blocks are input into MLP layers, and parameterized MLP layers are used as wrapper functions for Shapley modules. The attribution representation for each output dimension can be calculated; all Shapley values are reshaped into a tensor structure of "interpretable dimension × output dimension" and used as input to the next layer of the network; after passing through c layers of the SHAP network, the model finally outputs the attribution representation of the interpretable dimension. With transient stability assessment results :
[0044]
[0045]
[0046] In the formula, This represents the Shapley value of the m-th feature in the g-th generator.
[0047] S3. Based on the Shapley value, quantitatively analyze the impact of various features on transient stability, achieving transparent interpretation of model evaluation results and providing a reference for the formulation of pre-emptive prevention and control strategies and the deployment of post-event emergency control measures. Based on the Shapley value output by the model, conduct quantitative analysis of the interpretability of the decision-making process and evaluation results of the data-driven model, including: S31. The model is interpreted globally from the perspective of global samples. The overall impact of each electrical feature on the transient stability state is qualitatively compared. The statistical distribution of the feature value-Shapley value on the global test sample set is quantitatively analyzed. For transient stability problems, the global interpretation can provide a basis for formulating pre-emptive prevention and control strategies.
[0048] S32. Local attribution is conducted on typical samples to quantitatively assess the marginal contribution of each electrical characteristic to the assessment results, thereby qualitatively identifying the dominant generator group causing transient instability. For transient stability issues, local interpretation helps to assist in deploying targeted emergency control measures when specific instability scenarios occur in the power grid. To further visualize the model interpretation based on Shapley values, a dominant generator index is defined to analyze the transient stability assessment rules learned by the TSA model. Specifically, it is calculated according to the following formula:
[0049]
[0050] In the formula, This represents the marginal contribution of the g-th generator to the model's prediction results.
[0051] To verify the effectiveness of this invention, the method is applied to the transient stability assessment of the IEEE-39 Node system. Multi-condition fault simulations are performed on the IEEE-39 Node system using PowerFactory. Figure 2 The calculation results of evaluation indicators from different models were compared to verify the accuracy of transient stability assessment. Figure 3The power angle change curve after rapid generator tripping for the dominant transient instability generator in the local sample tracing is shown, which verifies the accurate identification capability of the out-of-step source and the effectiveness of the rapid generator tripping control measures of the present invention.
[0052] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A transient evaluation method based on SHAP, characterized in that, The method includes: S1. Construct a prediction-explanation synchronous framework: Embed the Shapley module, which supports parallel computing, into the deep neural network model to achieve synchronous execution of transient stability assessment and feature attribution during forward propagation; S2. Design of a spatiotemporal feature fusion architecture: Using a three-dimensional tensor of time-space-feature as input, a deep SHAP network is constructed based on a convolutional neural network; S3. Establish a quantitative decision support mechanism: Based on the quantitative impact of Shapley value analysis characteristics on stability, achieve transparent interpretation of evaluation results.
2. The transient evaluation method based on SHAP according to claim 1, characterized in that, In step S1, the Shapley module, which supports parallel computing, is embedded in a deep neural network model, specifically as follows: By embedding Shapley values as learnable latent representations into deep neural network models for fusion modeling, the inherent interpretability of deep neural network models is achieved, including: S11. Construct multiple parallel-computing Shapley modules using the feature activation set mechanism, calculate the marginal contribution of each Shapley module to its corresponding local feature subset in parallel, and linearly superimpose their output attribution representations to achieve efficient aggregation of global feature attribution value calculation. S12. Treat the deep neural network model as a black box model interpreted by the Shapley module, and use the Shapley module to calculate the marginal contribution of the input features to its predicted value; through the parameter optimization process of the deep neural network model, the Shapley module learns the SHAP attribution representation Z of the input feature vector, thereby achieving the unification of feature attribution and prediction modeling.
3. The transient evaluation method based on SHAP according to claim 1, characterized in that, In step S2, a deep SHAP network is constructed based on a convolutional neural network, specifically as follows: A deep SHAP network is constructed based on embedded SHAP, and SHAP attribution representations are passed layer by layer between network layers to achieve accurate evaluation and interpretability analysis of transient stable states, including: S21. Extract the power angle of each generator within 8 power frequency cycles before and after fault clearing. Frequency deviation Active power P and reactive power Q, along with the amplitude V of the generator terminal bus voltage and the phase angle e, are used to construct a feature space characterizing the dynamic operation of the system; the feature matrix at time t is... G represents the generator index; M represents the feature index. ; S22. Based on the convolutional neural network architecture paradigm, a deep SHAP network is constructed to achieve feature extraction of three-dimensional tensors; the deep SHAP network uses Shapley modules to replace convolutional kernels; local blocks are flattened and input into an MLP layer, and the parameterized MLP layer is used as a wrapper function for the Shapley module. The attribution representation for each output dimension is calculated; all Shapley values are reshaped into a tensor structure of interpretable dimension × output dimension, which is then used as input to the next layer of the network; after passing through c layers of the SHAP network, the final output is the attribution representation of the interpretable dimension. With transient stability assessment results : ; ; in, This represents the Shapley value of the m-th feature in the g-th generator.
4. The transient evaluation method based on SHAP according to claim 2, characterized in that, In step S11, the marginal contribution of the corresponding activated feature subset is calculated in parallel, specifically as follows: ; In the formula, Representation of features Shapley values; S represents all values that do not contain A subset of features; This represents the model's predicted output under the feature subset S. Indicates features Add it to the feature subset S to form a new feature set; This represents the combined weights in the Shapley value.
5. The transient evaluation method based on SHAP according to claim 1, characterized in that, The quantitative impact of Shapley value analytical features on stability includes: combining global-local dual-scale feature analysis, exploring the distribution patterns of feature values and their corresponding Shapley values in the overall sample and typical local samples, and identifying electrical features that have a key impact on transient stability and the generator clusters that dominate instability.