Electric power system transient stability analysis method and device based on wavelet transform image
Through the combination of wavelet transform and multi-channel convolutional neural network, the problem of difficult nonlinear relationships and complex patterns in the time sequence data of the power system is solved, and more accurate transient stability analysis and instability pattern recognition are achieved, which improves the transparency and credibility of the model.
Patent Information
- Application Number
- CN202510165264.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art is difficult to fully capture the nonlinear relationships and complex patterns in the timing data of power systems, and it is impossible to accurately analyze transient stability and instability patterns.
The time sequence data of the power system is converted into time-frequency images through wavelet transformation, and a dynamic convolution kernel and pyramid attention mechanism are introduced into the multi-channel convolution neural network, and interpretability analysis is performed in combination with Grad-CAM technology.
It significantly improves the feature expression ability of the system's dynamic behavior, improves the accuracy of transient stability classification and instability pattern recognition, and provides an interpretability analysis of the decision-making process.
Smart Images

Figure CN120107665A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system transient stability analysis, and in particular to a method and device for analyzing power system transient stability based on wavelet transform images. Background Art
[0003] At present, although some studies have tried to use dictionary-based, shapelet-based and other methods to automatically capture the correlation of time series data, such methods cannot fully capture the nonlinear relationships and complex patterns in the data. At the same time, image processing and pattern recognition have achieved remarkable success in many fields such as autonomous driving and medical diagnosis. Power system researchers have begun to explore the conversion of time series data into images and use CNN for analysis, using computer vision technology to fully explore deep dynamic information and quickly and accurately identify potential patterns and anomalies. Compared with other methods, wavelet transform captures time and frequency information simultaneously through multi-scale analysis, which is particularly suitable for analyzing local characteristics and trend changes of non-stationary signals.
[0004] Therefore, how to invent a transient stability analysis method for power systems based on wavelet transform images that can more accurately extract and analyze the dynamic characteristics of the system, perform stability classification and instability mode identification, and perform interpretable analysis of the decision-making process has become an urgent problem to be solved. Summary of the invention
[0005] To this end, the present invention provides a method and device for analyzing transient stability of power systems based on wavelet transform images, which converts the time series signals of the power system into wavelet transform images, effectively captures the time-frequency characteristics of the signals, and significantly improves the characteristic expression ability of the system dynamic behavior. By introducing dynamic convolution kernels and pyramid attention mechanisms in the multi-channel convolutional neural network model, efficient processing of wavelet transform images is achieved, significantly improving classification accuracy and recognition capabilities. The Grad-CAM technology is used to perform interpretable analysis on the decision-making process of the model, intuitively displaying the key time-frequency feature areas that the model focuses on during classification.
[0006] In order to achieve the above object, the present invention provides the following technical solution: a method for analyzing transient stability of a power system based on wavelet transform images, comprising:
[0007] Extracting the time-frequency characteristics of the power system time series data through a wavelet transform strategy, and converting the time series data into a time-frequency image;
[0008] Inputting the video image into a multi-channel convolutional neural network for processing, and outputting a stability classification result and an instability mode identification result of the power system;
[0009] The Grad-CAM technology is used to perform interpretable analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples, and the main characteristic areas that affect the stability prediction of the power system are identified.
[0010] As a preferred solution of the power system transient stability analysis method based on wavelet transform image, in the process of converting the time series data into the time-frequency image through the wavelet transform strategy, the transient stability characteristic quantity sequence of the generator is subjected to continuous wavelet transform to obtain the wavelet coefficient of the transient stability characteristic quantity sequence at the set time and scale, and generate the time-frequency image; the calculation formula of the wavelet coefficient is:
[0011]
[0012] Where W Xi (a, b) are wavelet coefficients; X i (t) is the transient stability characteristic quantity sequence; a is the scale; b is the time; t is the time variable; is the time translation and scale transformation of the wavelet, controlled by a and b.
[0013] As a preferred solution of the power system transient stability analysis method based on wavelet transform image, in the process of inputting the video image into the multi-channel convolutional neural network for processing, the processing steps are:
[0014] Each single channel processes the time-frequency image of the set feature to obtain a single channel set feature map;
[0015] The single-channel set features are integrated through a feature fusion strategy to obtain a fused feature map;
[0016] The fused feature graph is classified by a global average pooling layer and a fully connected layer for stability classification and instability mode identification, and the stability classification result and instability mode identification result of the power system are output.
[0017] As a preferred solution of the transient stability analysis method of the power system based on wavelet transform image, in the process of processing the time-frequency image of the set characteristics by the single channel, the weight of the convolution kernel is dynamically adjusted according to the characteristics of the time-frequency image by the dynamic convolution kernel; the ability of the single channel to understand the fine-grained features and the overall structure of the features of the time-frequency image is improved by the pyramid attention mechanism;
[0018] The formula for weighted adjustment of the convolution kernel weight by the dynamic convolution kernel is:
[0019]
[0020] In the formula, Y is the output after convolution; X is the input feature map; αk (X) is the weight coefficient; W k is the kth convolution kernel; * is the convolution operation;
[0021] The process expression of weighted reorganization of features through the pyramid attention mechanism is:
[0022]
[0023] Where F is the input feature map; Conv s is a convolution operation of size s×s; F s are the generated feature maps of different scales; F g To perform global average pooling on the feature map; is the aggregated global context information; A s is the attention weight; σ is the Sigmoid activation function; ⊙ is the element-by-element multiplication; F s w is the generated weighted feature map; F out is the final output feature map.
[0024] As a preferred solution of the transient stability analysis method of the power system based on wavelet transform image, in the process of processing through the multi-channel convolutional neural network and outputting the stability classification result and the unstable mode identification result of the power system, a binary classification evaluation index is set to evaluate the multi-channel convolutional neural network; the binary classification evaluation index includes accuracy, precision, recall rate and F1 value;
[0025] The calculation formula of the accuracy is:
[0026]
[0027] The calculation formula of the accuracy is:
[0028]
[0029] The calculation formula of the recall rate is:
[0030]
[0031] The calculation formula of the F1 value is:
[0032]
[0033] Where TP is the number of samples correctly predicted as unstable; TN is the number of samples correctly predicted as stable; FP is the number of samples incorrectly predicted as unstable; and FN is the number of samples incorrectly predicted as stable.
[0034] As a preferred solution of the transient stability analysis method of the power system based on wavelet transform image, in the process of interpretable analysis of the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples by the Grad-CAM technology, the importance of each set feature map to the prediction of the category is reflected by calculating the prediction score of the target category relative to the gradient of each feature map of the convolutional layer in the network; the weight of each feature map is obtained by globally averaging the gradient in the spatial dimension;
[0035] The expression of feature map weight is:
[0036]
[0037] In the formula, is the weight of the kth channel associated with category c; Z is the spatial dimension of the feature map, y c is the prediction score of target category c; is the activation value of the kth channel at position (i, j) in the feature map.
[0038] The present invention also provides a power system transient stability analysis device based on wavelet transform images, based on the above power system transient stability analysis method based on wavelet transform images, comprising:
[0039] A wavelet transform processing module, used to extract the time-frequency characteristics of the power system time series data through a wavelet transform strategy, and convert the time series data into a time-frequency image;
[0040] A multi-channel convolutional neural network processing module, used for inputting the video image into the multi-channel convolutional neural network for processing, and outputting a stability classification result and an instability mode identification result of the power system;
[0041] The interpretability analysis module is used to perform interpretability analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples through the Grad-CAM technology, and identify the main characteristic areas that affect the stability prediction of the power system.
[0042] As a preferred solution of the power system transient stability analysis device based on wavelet transform image, in the wavelet transform processing module, in the process of converting the time series data into the time-frequency image through the wavelet transform strategy, the transient stability characteristic quantity sequence of the generator is subjected to continuous wavelet transform to obtain the wavelet coefficient of the transient stability characteristic quantity sequence at the set time and scale, and generate the time-frequency image; the calculation formula of the wavelet coefficient is:
[0043]
[0044] In the formula, is the wavelet coefficient; Xi (t) is the transient stability characteristic quantity sequence; a is the scale; b is the time; t is the time variable; is the time translation and scale transformation of the wavelet, controlled by a and b.
[0045] As a preferred solution of the power system transient stability analysis device based on wavelet transform image, in the multi-channel convolutional neural network processing module, the sub-module of the multi-channel convolutional neural network processing includes:
[0046] A single-channel feature processing submodule is used to process the time-frequency image of the set feature for each single channel to obtain a single-channel set feature map;
[0047] A feature fusion submodule, used to integrate the single-channel set features through a feature fusion strategy to obtain a fused feature map;
[0048] The classification and recognition submodule is used to classify the fused feature graph through a global average pooling layer and a fully connected layer to perform stability classification and unstable mode recognition, and output the stability classification result and unstable mode recognition result of the power system.
[0049] As a preferred solution of the power system transient stability analysis device based on wavelet transform image, in the single-channel feature processing submodule in the multi-channel convolutional neural network processing module, in the process of the single channel processing the time-frequency image of the set feature, the convolution kernel weight is dynamically adjusted according to the characteristics of the time-frequency image through the dynamic convolution kernel; the single channel's ability to understand the fine-grained features and overall structure of the features of the time-frequency image is improved through the pyramid attention mechanism;
[0050] The formula for weighted adjustment of the convolution kernel weight by the dynamic convolution kernel is:
[0051]
[0052] In the formula, Y is the output after convolution; X is the input feature map; α k (X) is the weight coefficient; W k is the kth convolution kernel; * is the convolution operation;
[0053] The process expression of weighted reorganization of features through the pyramid attention mechanism is:
[0054]
[0055] Where F is the input feature map; Conv s is a convolution operation of size s×s; F s are the generated feature maps of different scales; F g To perform global average pooling on the feature map; is the aggregated global context information; A s is the attention weight; σ is the Sigmoid activation function; ⊙ is the element-by-element multiplication; F s w is the generated weighted feature map; F out is the final output feature map.
[0056] As a preferred solution of the power system transient stability analysis device based on wavelet transform image, in the multi-channel convolutional neural network processing module, in the process of processing through the multi-channel convolutional neural network and outputting the stability classification result and the unstable mode identification result of the power system, a binary classification evaluation index is set to evaluate the multi-channel convolutional neural network; the binary classification evaluation index includes accuracy, precision, recall rate and F1 value;
[0057] The calculation formula of the accuracy is:
[0058]
[0059] The calculation formula of the accuracy is:
[0060]
[0061] The calculation formula of the recall rate is:
[0062]
[0063] The calculation formula of the F1 value is:
[0064]
[0065] Where TP is the number of samples correctly predicted as unstable; TN is the number of samples correctly predicted as stable; FP is the number of samples incorrectly predicted as unstable; and FN is the number of samples incorrectly predicted as stable.
[0066] As a preferred solution of the power system transient stability analysis device based on wavelet transform image, in the interpretability analysis module, in the process of interpretability analysis of the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples by using the Grad-CAM technology, the importance of each set feature map to the prediction of the category is reflected by calculating the prediction score of the target category relative to the gradient of each feature map of the convolutional layer in the network; the weight of each feature map is obtained by globally averaging the gradient in the spatial dimension;
[0067] The expression of feature map weight is:
[0068]
[0069] In the formula, is the weight of the kth channel associated with category c; Z is the spatial dimension of the feature map, y c is the prediction score of target category c; is the activation value of the kth channel at position (i, j) in the feature map.
[0070] The present invention has the following advantages: the present invention extracts the time-frequency characteristics of the time series data of the power system through the wavelet transform strategy, and converts the time series data into a time-frequency image; the video image is input into a multi-channel convolutional neural network for processing, and the stability classification result and the unstable mode identification result of the power system are output; wherein each single channel processes the time-frequency image of the set feature to obtain a single-channel set feature map; the single-channel set features are integrated through the feature fusion strategy to obtain a fusion feature map; the fusion feature map is classified through the global average pooling layer and the fully connected layer to perform stability classification and unstable mode identification on the fusion feature map, and the stability classification result and the unstable mode identification result of the power system are output. The Grad-CAM technology is used to perform an interpretable analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples, and the main feature areas that affect the stability prediction of the power system are identified. The present invention first converts the time series signal of the power system into a wavelet transform image, effectively capturing the time-frequency characteristics of the signal, thereby significantly improving the feature expression ability of the system dynamic behavior. Then, the proposed multi-channel convolutional neural network model realizes efficient processing of wavelet transform images by introducing dynamic convolution kernels and pyramid attention mechanism, significantly improving classification accuracy and recognition ability. Finally, the Grad-CAM technology is used to perform interpretable analysis on the decision-making process of the model, intuitively showing the key time-frequency feature areas that the model focuses on during classification. Through visual analysis, the core features that affect the prediction of power system stability are revealed, the transparency and credibility of the model are improved, and a transient stability assessment and interpretability research method for power systems based on wavelet transform images is given, which provides an important basis for researchers to optimize models and discover potential causes of system instability. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0072] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0073] Figure 1 A schematic flow chart of a method for analyzing transient stability of a power system based on wavelet transform images provided in Embodiment 1 of the present invention;
[0074] Figure 2 This is a schematic diagram of a specific implementation process of the power system transient stability analysis method based on wavelet transform image provided in Example 1 of the present invention;
[0075] Figure 3 Schematic diagram of wavelet transform encoding in the power system transient stability analysis method based on wavelet transform image provided in Example 1 of the present invention; wherein (a) is the original periodic signal; (b) is the wavelet transform image;
[0076] Figure 4 A schematic diagram of the structure of a multi-channel convolutional neural network in the power system transient stability analysis method based on wavelet transform images provided in Example 1 of the present invention;
[0077] Figure 5 A schematic diagram of the IEEE39 structure in a possible embodiment provided in Embodiment 1 of the present invention;
[0078] Figure 6 Schematic diagram of a transient stable wavelet transform image in a possible embodiment provided in Embodiment 1 of the present invention; wherein (a) is a stable power angle curve; (b) is a stable wavelet transform image; (c) is an unstable power angle curve; (d) is an unstable wavelet transform image;
[0079] Figure 7 A schematic diagram of the accuracy of different image generation methods in a possible embodiment provided in Embodiment 1 of the present invention as the epoch changes;
[0080] Figure 8 A schematic diagram of performance comparison of different convolutional neural network models in a possible embodiment provided in Embodiment 1 of the present invention;
[0081] Fig. 9 Schematic diagram of layer-by-layer Grad-CAM visualization results of transient stable samples in a possible embodiment provided in Embodiment 1 of the present invention; wherein (a) is a stable sample; (b) is an unstable sample;
[0082] Fig.10 Schematic diagram of the architecture of the power system transient stability analysis device based on wavelet transform image provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0083] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0084] Example 1
[0085] See also Figure 1 and Figure 2 Embodiment 1 of the present invention provides a method for analyzing transient stability of a power system based on a wavelet transform image, comprising the following steps:
[0086] S1. Extracting the time-frequency characteristics of the power system time series data through a wavelet transform strategy, and converting the time series data into a time-frequency image;
[0087] S2, inputting the video image into a multi-channel convolutional neural network for processing, and outputting a stability classification result and an instability mode identification result of the power system;
[0088] S3. The Grad-CAM technology is used to perform an interpretable analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples, and the main characteristic areas that affect the stability prediction of the power system are identified.
[0089] In this embodiment, in step S1, the time-frequency characteristics of the power system time series data are extracted by wavelet transformation strategy, and the time series data are converted into a time-frequency image;
[0090] Specifically, taking the standard sine wave as an example, Figure 3 As shown, the transient stability characteristic quantity sequence of the generator is subjected to continuous wavelet transform to obtain the wavelet coefficients of the transient stability characteristic quantity sequence at a set time and scale, and to generate the time-frequency image;
[0091] For each generator G i (i=1,2,...,n), and the transient stability characteristic quantity X changes with time t as the input of wavelet transform, which is expressed as:
[0092] {X i (t 1 ),X i (t 2),...,X i (t k )},t 1 ≤t≤t e
[0093] X i ={δ i ,α i ,V i ,P i ,Q i}
[0094] Where, X i (t k ) is the characteristic quantity of the i-th generator at the k-th moment; t 1 is the initial time of fault removal; t e The selected frequency is 43 cycles after the fault is removed; i is the power angle; α i is the acceleration; V i is voltage; P i is the electromagnetic power; Q i is the reactive power.
[0095] For the transient stability characteristic quantity sequence X i (t) Perform continuous wavelet transform (CWT) to obtain its wavelet coefficients at different time b and scale a The calculation formula of wavelet coefficients is as follows:
[0096]
[0097] Where W Xi (a, b) are wavelet coefficients; X i (t) is the transient stability characteristic quantity sequence; a is the scale; b is the time; t is the time variable; is the time translation and scale transformation of the wavelet, controlled by a and b.
[0098] In this embodiment, in step S2, the video image is input into a multi-channel convolutional neural network for processing, and a stability classification result and an instability mode identification result of the power system are output;
[0099] Specifically, Figure 4 As shown in the figure, the multi-channel convolutional neural network takes the time series images of power angle, acceleration, voltage, electromagnetic power and reactive power generated by wavelet transform as input, fuses these features through multiple channels, and captures the correlation between various physical quantities in the feature extraction process. The backbone of the multi-channel convolutional neural network adopts the ResNet structure, and combines dynamic convolution with the pyramid attention mechanism (PAM) to enhance the flexibility of feature extraction and multi-scale perception ability, and finally outputs the stability classification results and instability mode identification results of the system.
[0100] Specifically, the multi-channel convolutional neural network processing steps are:
[0101] S21, each single channel processes the time-frequency image of the set feature to obtain a single channel set feature map;
[0102] Specifically, each channel of the multi-channel convolutional neural network is responsible for processing the time-frequency image representation of different features to obtain a single-channel set feature map;
[0103] In order to improve the adaptability of the network to different input features, the present invention introduces dynamic convolution in the convolution layer of ResNet. The core idea is to generate multiple convolution kernels for the convolution layer of each residual block and weight these convolution kernels through adaptive weights. The weighting formula is as follows:
[0104]
[0105] In the formula, Y is the output after convolution; X is the input feature map; α k (X) is the weight coefficient; W k is the kth convolution kernel; * is the convolution operation;
[0106] In order to enhance the network's perception of multi-scale features of wavelet transform images, the present invention introduces a pyramid attention mechanism (PAM) in the residual block. PAM extracts features at different scales and uses the self-attention mechanism to weightedly reorganize the features, further enhancing the network's global information perception. The process is as follows:
[0107]
[0108] Where F is the input feature map; Conv s is a convolution operation of size s×s; F s are the generated feature maps of different scales; F g To perform global average pooling on the feature map; is the aggregated global context information; A s is the attention weight; σ is the Sigmoid activation function; ⊙ is the element-by-element multiplication; F s w is the generated weighted feature map; F out is the final output feature map.
[0109] S22, integrating the single-channel set features through a feature fusion strategy to obtain a fused feature map;
[0110] S23, classifying the fused feature graph through a global average pooling layer and a fully connected layer, and performing stability classification and instability mode identification on the fused feature graph, and outputting stability classification results and instability mode identification results of the power system.
[0111] Specifically, the fused feature map output by the network is classified through the global average pooling layer and the fully connected layer. The calculation formula of the fully connected layer is:
[0112] O = softmax(W f ·Z+b f )
[0113] Where W f and b f They represent the weights and biases of the fully connected layer respectively; softmax is used to convert the network output into category probability distribution.
[0114] In this embodiment, a binary evaluation index is set to evaluate the multi-channel convolutional neural network; the present invention designs the transient stability index (TSI) as a binary index, 0 indicates that the system is stable, and 1 indicates instability. Since the task is to predict the stability of the system, the cross entropy loss function is suitable for this binary classification problem, which measures the difference between the model prediction and the actual label, helping to improve the model accuracy.
[0115]
[0116] In the formula, y i is the true label of the i-th sample (the value is 0 or 1); The model predicts the probability that the i-th sample belongs to category 1; N is the total number of samples.
[0117] In order to comprehensively evaluate the performance of the model in distinguishing between stable and unstable states, common binary classification evaluation indicators were used, including accuracy, precision, recall and F1 value.
[0118] The calculation formula of the accuracy is:
[0119]
[0120] The calculation formula of the accuracy is:
[0121]
[0122] The calculation formula of the recall rate is:
[0123]
[0124] The calculation formula of the F1 value is:
[0125]
[0126] Where TP is the number of samples correctly predicted as unstable; TN is the number of samples correctly predicted as stable; FP is the number of samples incorrectly predicted as unstable; and FN is the number of samples incorrectly predicted as stable.
[0127] In this embodiment, relying solely on the binary discrimination of stability and instability is not enough to conduct transient stability analysis of the power system. In order to effectively prevent instability and formulate precise control strategies, it is necessary to deeply analyze the specific instability mode. Therefore, by converting the problem into a multi-classification task, it is possible to accurately determine which generator groups are the leading instability, provide a targeted basis for system regulation, and improve response capabilities. The dynamic similarity between generators is determined by comparing direction, angle, position, and speed. In the hierarchical clustering process, a suitable threshold is selected for coherent clustering to determine the leading instability group. The average power angle in each group is selected, and the group corresponding to the maximum value is selected as the leading group, and the instability mode label is marked for it to further analyze the overall instability mode.
[0128] Instability mode identification is a multi-classification problem and is suitable for using the multi-classification cross entropy loss function.
[0129]
[0130] Where C is the number of unstable mode categories; y ic is the true category c of sample i (1 if it belongs to the cth category, otherwise 0); p ic Predict the probability that the i-th sample belongs to category c for the model.
[0131] In this embodiment, in step S3, the Grad-CAM technology is used to perform an interpretable analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples, and identify the main characteristic areas that affect the prediction of power system stability.
[0132] Specifically, for the input wavelet transformed image, the gradient of the prediction score of the target category relative to the kth feature map of the convolutional layer in the network is calculated, which reflects the importance of each feature map to the prediction of the category. The weight of each feature map is obtained by globally averaging the gradients in the spatial dimension.
[0133] The expression of feature map weight is:
[0134]
[0135] In the formula, is the weight of the kth channel associated with category c; Z is the spatial dimension of the feature map, y c is the prediction score of target category c; is the activation value of the kth channel at position (i, j) in the feature map.
[0136]
[0137] Where, L c Grad-CAM is the class activation map; ReLu is the nonlinear activation function.
[0138] In a possible embodiment, an example of transient stability assessment analysis of a power system is provided as follows:
[0139] The entire transient stability analysis experiment is carried out on the IEEE 39 standard example. Figure 5 As shown. The PSD-BPA software was called in batches using MATLAB, and the generator output level was set between 85% and 121% (increased by 3% steps). The three-phase short-circuit faults of 34 transmission lines were traversed N-1 times, and the fault removal time was set between 3 and 21 cycles. Finally, 3094 sample data were generated, of which 2475 were used for training sets and 619 for test sets. All experiments were completed on an Intel(R) Core(TM) i7-14700F desktop computer. The convolutional neural network model was implemented and trained using the Pytorch framework, using GPU acceleration, the learning rate was set to 0.001, the optimizer was Adam, the batch size was 64, and the epoch was 200.
[0140] Taking the power angle as an example, the 9 generators G30 and G32-G39 are combined into a 3-row 3-column general diagram, such as Figure 6 As shown. Figure (b) shows the wavelet transform of a stable sample, which is characterized by smooth colors (mainly blue and green, with a small amount of yellow), a large blue area, indicating that low-frequency energy is concentrated, and there is no obvious interference. In contrast, Figure (d) shows an unstable sample, which is characterized by a drastic and complex change in color from blue and green to yellow and red, with fewer blue areas. The energy in the yellow and red areas is highly concentrated, and irregular stripes appear, indicating uneven energy distribution, dominance of high-frequency components, and power angle desynchronization.
[0141] The present invention compares continuous wavelet transform (CWT) with support vector machine (SVM), fast Fourier transform (FFT), Gram angular field (GAF) and recurrence graph (RP). Figure 7 As shown. The results show that machine learning methods such as SVM have low accuracy and large volatility, highlighting the stability and accuracy of image generation methods when processing complex signals. The accuracy of each image generation method in the final stable state is 99.86%, 89.57%, 77.32% and 81.49% respectively. Compared with other image generation methods, the average accuracy of wavelet transform is improved by 17.07%, showing its unique advantage in capturing non-steady transient signals.
[0142] In order to further verify the effectiveness of the model in stability assessment, the present invention compares it with classic convolutional neural networks (including GoogleNet and ResNet) and ResNet with dynamic convolution function, such as Figure 8 As shown. Misclassifying a stable state as an unstable state (false positive) will have a negative impact on precision, while misclassifying an unstable state as a stable state (false negative) will affect recall, and missing an unstable state is considered a more serious error. Therefore, these two indicators were selected as key evaluation criteria. The results show that ResNet outperforms GoogleNet, and both models exhibit wider box plot widths and more dispersed indicator distributions. After adding dynamic convolution to ResNet, the box plot width is significantly reduced, thereby improving precision, recall, and robustness. In addition, after integrating the pyramid attention mechanism, the data distribution is more concentrated. Compared with the original ResNet, the precision and recall rates are increased by 10.96% and 11.03%, respectively, enhancing the model's attention to key areas.
[0143] When the threshold ε of hierarchical clustering is set to 0.8, a total of 8 unstable modes are identified, as shown in Table 1:
[0144] Instability mode number Leading unstable group 1 G30,G32,G33,G34,G35,G36,G37,G38,G39 2 G30, G37, G39 3 G39 4 G32, G33, G34, G35, G36, G37, G38 5 G30,G32,G33,G34,G35,G36,G37,G38 6 G30,G39 7 G32, G38, G39 8 G32,G39
[0145] Table 1 Instability mode identification results
[0146] In the multi-classification task of unstable pattern recognition, the present invention compares four image generation methods, and the results are shown in Table 2. Since this is a multi-classification problem, the overall indicators of each model have declined compared with the stability dichotomy method, but still show good recognition effects. Compared with other image generation methods, the average accuracy of wavelet transform is improved by 16.54%, the precision is improved by 16.91%, the recall rate is improved by 17.99%, and the F1 score is improved by 17.45%. In short, although this is a complex multi-classification problem, wavelet transform shows a strong feature characterization ability in unstable pattern recognition, demonstrating its application potential in this task.
[0147]
[0148]
[0149] Table 2 Performance comparison of different image generation methods in unstable pattern recognition
[0150] Grad-CAM visualization significantly enhances the interpretability of the CNN decision process, showing the key areas that the model focuses on when classifying stable and unstable samples, such as Fig. 9As shown. Overall, GRAD-CAM focuses on the signal gradient areas (such as warm colors such as green, yellow, and red), and pays less attention to the stable blue area. As the CNN processes the data layer by layer, the Grad-CAM visualization results of stable samples remain relatively smooth and unchanged, indicating that the network always pays attention to consistent patterns in the signal during the feature extraction process. In contrast, for unstable samples, the network's attention gradually focuses on the signal mutation area, indicating that the network's feature extraction process is more sensitive to the more complex color and irregular frequency changes of the signal. This gradual focus reflects the interpretability of the model's decision-making process, that is, by gradually narrowing the focus, it eventually locks in the key time-frequency area that causes instability. This focus on key areas not only supports the transparency of model reasoning, but also helps users understand why certain states are classified as stable or unstable.
[0151] In summary, the present invention extracts the time-frequency characteristics of the time series data of the power system through the wavelet transform strategy, and converts the time series data into a time-frequency image; the video image is input into a multi-channel convolutional neural network for processing, and the stability classification result and the unstable mode identification result of the power system are output; wherein each single channel processes the time-frequency image of the set feature to obtain a single-channel set feature map; the single-channel set features are integrated through the feature fusion strategy to obtain a fusion feature map; the fusion feature map is classified through the global average pooling layer and the fully connected layer to perform stability classification and unstable mode identification on the fusion feature map, and the stability classification result and the unstable mode identification result of the power system are output. The Grad-CAM technology is used to perform an interpretable analysis of the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples, and the main feature areas that affect the stability prediction of the power system are identified. The present invention first effectively captures the time-frequency characteristics of the signal by converting the time series signal of the power system into a wavelet transform image, thereby significantly improving the feature expression ability of the system dynamic behavior. Then, the proposed multi-channel convolutional neural network model realizes efficient processing of wavelet transform images by introducing dynamic convolution kernels and pyramid attention mechanism, significantly improving classification accuracy and recognition ability. Finally, the Grad-CAM technology is used to perform interpretable analysis on the decision-making process of the model, intuitively showing the key time-frequency feature areas that the model focuses on during classification. Through visual analysis, the core features that affect the prediction of power system stability are revealed, the transparency and credibility of the model are improved, and a transient stability assessment and interpretability research method for power systems based on wavelet transform images is given, which provides an important basis for researchers to optimize models and discover potential causes of system instability.
[0152] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0153] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0154] Example 2
[0155] See also Fig.10 Embodiment 2 of the present invention also provides a power system transient stability analysis device based on wavelet transform image, comprising:
[0156] The wavelet transform processing module 001 is used to extract the time-frequency characteristics of the power system time series data through the wavelet transform strategy, and convert the time series data into a time-frequency image;
[0157] A multi-channel convolutional neural network processing module 002 is used to input the video image into a multi-channel convolutional neural network for processing, and output a stability classification result and an instability mode identification result of the power system;
[0158] The explainability analysis module 003 is used to perform explainability analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples through the Grad-CAM technology, and identify the main characteristic areas that affect the stability prediction of the power system.
[0159] In this embodiment, in the wavelet transform processing module 001, in the process of converting the time series data into the time-frequency image through the wavelet transform strategy, the transient stability characteristic quantity sequence of the generator is subjected to continuous wavelet transform to obtain the wavelet coefficient of the transient stability characteristic quantity sequence at the set time and scale, and generate the time-frequency image; the calculation formula of the wavelet coefficient is:
[0160]
[0161] In the formula, is the wavelet coefficient; X i(t) is the transient stability characteristic quantity sequence; a is the scale; b is the time; t is the time variable; is the time translation and scale transformation of the wavelet, controlled by a and b.
[0162] In this embodiment, in the multi-channel convolutional neural network processing module 002, the sub-module of the multi-channel convolutional neural network processing includes:
[0163] The single channel feature processing submodule 021 is used for processing the time-frequency image of the set feature for each single channel to obtain a single channel set feature map;
[0164] A feature fusion submodule 022 is used to integrate the single-channel set features through a feature fusion strategy to obtain a fusion feature map;
[0165] The classification and identification submodule 023 is used to classify the fused feature graph through a global average pooling layer and a fully connected layer to perform stability classification and unstable mode identification, and output the stability classification result and unstable mode identification result of the power system.
[0166] In this embodiment, in the single-channel feature processing submodule 021 in the multi-channel convolutional neural network processing module 002, in the process of the single channel processing the time-frequency image of the set feature, the convolution kernel weight is dynamically adjusted according to the characteristics of the time-frequency image through the dynamic convolution kernel; the pyramid attention mechanism is used to improve the single channel's ability to understand the fine-grained features and overall structure of the features of the time-frequency image;
[0167] The formula for weighted adjustment of the convolution kernel weight by the dynamic convolution kernel is:
[0168]
[0169] In the formula, Y is the output after convolution; X is the input feature map; α k (X) is the weight coefficient; W k is the kth convolution kernel; * is the convolution operation;
[0170] The process expression of weighted reorganization of features through the pyramid attention mechanism is:
[0171]
[0172] Where F is the input feature map; Conv s is a convolution operation of size s×s; F s are the generated feature maps of different scales; F g To perform global average pooling on the feature map; is the aggregated global context information; A sis the attention weight; σ is the Sigmoid activation function; ⌒ is the element-by-element multiplication; F s w is the generated weighted feature map; F out is the final output feature map.
[0173] In this embodiment, in the multi-channel convolutional neural network processing module 002, in the process of processing by the multi-channel convolutional neural network and outputting the stability classification result and the instability mode identification result of the power system, a binary classification evaluation index is set to evaluate the multi-channel convolutional neural network; the binary classification evaluation index includes accuracy, precision, recall rate and F1 value;
[0174] The calculation formula of the accuracy is:
[0175]
[0176] The calculation formula of the accuracy is:
[0177]
[0178] The calculation formula of the recall rate is:
[0179]
[0180] The calculation formula of the F1 value is:
[0181]
[0182] Where TP is the number of samples correctly predicted as unstable; TN is the number of samples correctly predicted as stable; FP is the number of samples incorrectly predicted as unstable; and FN is the number of samples incorrectly predicted as stable.
[0183] In this embodiment, in the interpretability analysis module 003, in the process of performing interpretability analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples by using the Grad-CAM technology, the importance of each set feature map to the prediction of the category is reflected by calculating the predicted score of the target category relative to the gradient of each feature map of the convolutional layer in the network; the weight of each feature map is obtained by globally averaging the gradient in the spatial dimension;
[0184] The expression of feature map weight is:
[0185]
[0186] In the formula, is the weight of the kth channel associated with category c; Z is the spatial dimension of the feature map, y cis the prediction score of target category c; is the activation value of the kth channel at position (i, j) in the feature map.
[0187] It should be noted that the information interaction, execution process and other contents between the modules of the above-mentioned system are based on the same concept as the method embodiment in Example 1 of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and will not be repeated here.
[0188] Example 3
[0189] Embodiment 3 of the present invention provides a non-transient computer-readable storage medium, in which the program code of the method for transient stability analysis of an electric power system based on wavelet transform images is stored, and the program code includes instructions for executing the method for transient stability analysis of an electric power system based on wavelet transform images of embodiment 1 or any possible implementation thereof.
[0190] The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0191] Example 4
[0192] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;
[0193] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the power system transient stability analysis method based on wavelet transform image of Example 1 or any possible implementation thereof.
[0194] Specifically, the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor implemented by reading software codes stored in a memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.
[0195] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable systems. The computer instructions can be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
[0196] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing system, they can be concentrated on a single computing system, or distributed on a network composed of multiple computing systems, and optionally, they can be implemented by a program code executable by a computing system, so that they can be stored in a storage system and executed by the computing system, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0197] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A method for analyzing transient stability of power systems based on wavelet transform images, characterized in that: include: Extracting the time-frequency characteristics of the power system time series data through a wavelet transform strategy, and converting the time series data into a time-frequency image; Inputting the video image into a multi-channel convolutional neural network for processing, and outputting a stability classification result and an instability mode identification result of the power system; The Grad-CAM technology is used to perform interpretable analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples, and the main characteristic areas that affect the stability prediction of the power system are identified.
2. The method for analyzing transient stability of a power system based on wavelet transform images according to claim 1 is characterized in that: In the process of converting the time series data into the time-frequency image by the wavelet transform strategy, the transient stability characteristic quantity sequence of the generator is subjected to continuous wavelet transform to obtain the wavelet coefficients of the transient stability characteristic quantity sequence at the set time and scale, and generate the time-frequency image; the calculation formula of the wavelet coefficients is: In the formula, is the wavelet coefficient; X i (t) is the transient stability characteristic quantity sequence; a is the scale; b is the time; t is the time variable; is the time translation and scale transformation of the wavelet, controlled by a and b.
3. The method for analyzing transient stability of a power system based on wavelet transform images according to claim 2 is characterized in that: In the process of inputting the video image into the multi-channel convolutional neural network for processing, the processing steps are: Each single channel processes the time-frequency image of the set feature to obtain a single channel set feature map; The single-channel set features are integrated through a feature fusion strategy to obtain a fused feature map; The fused feature graph is classified by a global average pooling layer and a fully connected layer for stability classification and instability mode identification, and the stability classification result and instability mode identification result of the power system are output.
4. The method for analyzing transient stability of a power system based on wavelet transform images according to claim 3 is characterized in that: In the process of processing the time-frequency image of the set features by the single channel, the weight of the convolution kernel is dynamically adjusted according to the features of the time-frequency image by the dynamic convolution kernel; the ability of the single channel to understand the fine-grained features and the overall structure of the features of the time-frequency image is improved by the pyramid attention mechanism; The formula for weighted adjustment of the convolution kernel weight by the dynamic convolution kernel is: In the formula, Y is the output after convolution; X is the input feature map; α k (X) is the weight coefficient; W k is the kth convolution kernel; * is the convolution operation; The process expression of weighted reorganization of features through the pyramid attention mechanism is: Where F is the input feature map; Conv s is a convolution operation of size s×s; F s are the generated feature maps of different scales; F g To perform global average pooling on the feature map; is the aggregated global context information; A s is the attention weight; σ is the Sigmoid activation function; ⊙ is the element-by-element multiplication; F s w is the generated weighted feature map; F out is the final output feature map.
5. The method for analyzing transient stability of power system based on wavelet transform image according to claim 4 is characterized in that: In the process of processing by the multi-channel convolutional neural network and outputting the stability classification result and the instability mode identification result of the power system, setting a binary classification evaluation index to evaluate the multi-channel convolutional neural network; the binary classification evaluation index includes accuracy, precision, recall rate and F1 value; The calculation formula of the accuracy is: The calculation formula of the accuracy is: The calculation formula of the recall rate is: The calculation formula of the F1 value is: Where TP is the number of samples correctly predicted as unstable; TN is the number of samples correctly predicted as stable; FP is the number of samples incorrectly predicted as unstable; and FN is the number of samples incorrectly predicted as stable.
6. The method for analyzing transient stability of a power system based on wavelet transform images according to claim 5 is characterized in that: In the process of interpretable analysis of the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples by using the Grad-CAM technology, the importance of each set feature map to the prediction of the category is reflected by calculating the gradient of the prediction score of the target category relative to each feature map of the convolutional layer in the network; the weight of each feature map is obtained by globally averaging the gradients in the spatial dimension; The expression of feature map weight is: In the formula, is the weight of the kth channel associated with category c; Z is the spatial dimension of the feature map, y c is the prediction score of target category c; is the activation value of the kth channel at position (i, j) in the feature map.
7. A power system transient stability analysis device based on wavelet transform images, using a power system transient stability analysis method based on wavelet transform images as claimed in any one of claims 1 to 6, characterized in that: include: A wavelet transform processing module, used to extract the time-frequency characteristics of the power system time series data through a wavelet transform strategy, and convert the time series data into a time-frequency image; A multi-channel convolutional neural network processing module, used for inputting the video image into the multi-channel convolutional neural network for processing, and outputting a stability classification result and an instability mode identification result of the power system; The interpretability analysis module is used to perform interpretability analysis on the decision-making process of the multi-channel convolutional neural network in distinguishing stable and unstable samples through the Grad-CAM technology, and identify the main characteristic areas that affect the stability prediction of the power system.
8. The power system transient stability analysis device based on wavelet transform image according to claim 7 is characterized in that: In the wavelet transform processing module, in the process of converting the time series data into the time-frequency image through the wavelet transform strategy, the transient stability characteristic quantity sequence of the generator is subjected to continuous wavelet transform to obtain the wavelet coefficients of the transient stability characteristic quantity sequence at the set time and scale, and generate the time-frequency image; the calculation formula of the wavelet coefficients is: In the formula, is the wavelet coefficient; X i (t) is the transient stability characteristic quantity sequence; a is the scale; b is the time; t is the time variable; is the time translation and scale transformation of the wavelet, controlled by a and b.
9. The power system transient stability analysis device based on wavelet transform image according to claim 8, characterized in that: In the multi-channel convolutional neural network processing module, the sub-module of the multi-channel convolutional neural network processing includes: A single-channel feature processing submodule is used to process the time-frequency image of the set feature for each single channel to obtain a single-channel set feature map; A feature fusion submodule, used to integrate the single-channel set features through a feature fusion strategy to obtain a fused feature map; The classification and recognition submodule is used to classify the fused feature graph through a global average pooling layer and a fully connected layer to perform stability classification and unstable mode recognition, and output the stability classification result and unstable mode recognition result of the power system.
10. The power system transient stability analysis device based on wavelet transform image according to claim 9, characterized in that: In the single-channel feature processing submodule in the multi-channel convolutional neural network processing module, during the process of the single channel processing the time-frequency image of the set feature, the convolution kernel weight is dynamically adjusted according to the features of the time-frequency image through the dynamic convolution kernel; the single channel's ability to understand the fine-grained features and overall structure of the features of the time-frequency image is improved through the pyramid attention mechanism; The formula for weighted adjustment of the convolution kernel weight by the dynamic convolution kernel is: In the formula, Y is the output after convolution; X is the input feature map; α k (X) is the weight coefficient; W k is the kth convolution kernel; * is the convolution operation; The process expression of weighted reorganization of features through the pyramid attention mechanism is: Where F is the input feature map; Conv s is a convolution operation of size s×s; F s are the generated feature maps of different scales; F g To perform global average pooling on the feature map; is the aggregated global context information; A s is the attention weight; σ is the Sigmoid activation function; ⊙ is the element-by-element multiplication; F s w is the generated weighted feature map; F out is the final output feature map.