Electric energy quality disturbance identification method and system based on convolutional neural network, and medium

The convolutional attention neural network with optimized Kaiser window S transform effectively addresses information loss and low accuracy in power quality disturbance identification, achieving robust and accurate classification of complex signals.

CN119066463APending Publication Date: 2024-12-03GUANGXI POWER GRID CORP +1

Patent Information

Application Number
CN202410993809.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Existing power quality disturbance identification methods suffer from information loss, poor feature significance, and low classification accuracy when dealing with complex signals, and traditional convolutional neural networks have limited network recognition ability.

Method used

A method using a convolutional attention neural network with optimized Kaiser window S transform for time-frequency analysis, combined with parallel convolution layers and attention layers, to extract and fuse low-dimensional and high-dimensional features, eliminating the need for manual feature design.

Benefits of technology

This approach enhances energy concentration in time-frequency analysis, improves classification accuracy, and provides robust noise resistance, enabling efficient detection and classification of complex power quality disturbances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066463A_ABST
    Figure CN119066463A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric energy quality analysis, and particularly discloses an electric energy quality disturbance identification method and system based on a convolutional neural network and a medium, and the method comprises the steps: extracting a time-frequency feature map of an electric energy quality disturbance signal based on Kaiser window S transformation of an optimized window parameter; and inputting the time-frequency characteristic graph into a pre-trained convolutional attention neural network to obtain a power quality disturbance identification result corresponding to the power quality disturbance signal. According to the method, the time-frequency analysis of the disturbance signal is realized by adopting the Kaiser window S transformation of the optimized window parameter, the energy concentration ratio of the time-frequency analysis of the signal can be remarkably improved, the disturbance of the time-frequency characteristic graph of the signal is automatically classified in combination with the convolutional attention neural network, the accurate classification of the power quality disturbance can be realized, and the accuracy of the power quality disturbance is improved. The method can avoid the trouble of manual design of disturbance characteristics, has high noise immunity and classification accuracy, and achieves the efficient detection and classification of complex power quality disturbance in different noise environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power quality analysis, and in particular to a method, system and medium for identifying power quality disturbances based on a convolutional neural network. Background Art

[0002] With the widespread application of renewable energy, a large number of nonlinear loads and impact loads are incorporated into the power system, thereby generating a series of complex power quality disturbance signals, causing serious "pollution" to the modern power grid environment. The existence of these complex power quality disturbance signals has greatly interfered with the safe and stable operation of power equipment in the power grid, thereby triggering a series of power accidents and causing significant economic losses. At present, it is imperative to promote renewable energy and distributed power generation in the power grid, so pollution control of the modern power grid environment is urgent. In real life, these complex power quality disturbance signals are often composed of multiple single transient and steady-state disturbances, and the disturbances are interrelated, which brings major challenges to traditional disturbance detection and classification methods. Therefore, it is urgent to develop a more adaptable new method for identifying complex power quality disturbances.

[0003] The traditional power quality disturbance identification process mainly includes three steps: time-frequency analysis, feature extraction and disturbance classification. Currently popular time-frequency analysis methods include short-time Fourier transform, wavelet transform, and S transform. These methods decompose the disturbance signal of the time series from the perspective of time domain and frequency domain at the same time, thereby promoting the subsequent disturbance feature extraction. However, their respective limitations cannot be ignored. For example, the resolution of short-time Fourier transform is fixed, which is difficult to meet the adaptive analysis requirements of complex disturbances; although the wavelet transform has multi-resolution characteristics, the difficulty in selecting the wavelet basis and the weak anti-interference ability limit its application scenarios; in contrast, the S transform has higher time-frequency resolution and anti-interference performance, but the time-frequency analysis process based on the Gaussian window function makes it have lower energy aggregation, which is easy to cause disturbance information loss when analyzing complex power quality disturbance signals, reducing its accuracy. For the extraction and classification of disturbance features, commonly used feature information includes start and end time, duration, amplitude, phase, etc., and commonly used classifiers include decision trees, support vector machines, random forests, extreme learning machines and other models. Traditional disturbance detection methods require feature design. After these features are designed and selected, they are used to represent a specific disturbance and are then input into the classifier for disturbance detection and classification. The problem is that the existing manual feature selection has no reference standard, and inappropriate feature design can easily cause the loss of disturbance information, which directly affects the recognition results of the classifier. In addition, different features have different matching degrees with the classifier, and the resulting classification results are also different and difficult to measure manually.

[0004] In recent years, with the development and application of convolutional neural networks, the classification process based on automatic feature extraction has become the mainstream development trend in the field of power quality disturbance detection and identification. However, the traditional convolutional neural network model is based on the feature extraction of a single convolution kernel, which is prone to information loss during the feature extraction process, has poor feature significance and network recognition ability, and has low classification accuracy for disturbance features. Summary of the invention

[0005] The technical problem to be solved by the present invention is as follows: In view of the above-mentioned problems in the prior art, a power quality disturbance identification method, system and medium based on a convolutional neural network are provided, which can solve the technical problems that disturbance information loss is easily caused when analyzing complex power quality disturbance signals, feature significance and network recognition ability are poor, and the classification accuracy of disturbance features is low.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for identifying power quality disturbances based on a convolutional attention neural network, comprising the following steps:

[0007] Collect power quality disturbance signals;

[0008] The time-frequency characteristic diagram of power quality disturbance signal is extracted based on Kaiser window S transform with optimized window parameters;

[0009] Construct a convolutional attention neural network model, use parallel convolution layers to effectively extract and fuse the low-dimensional and high-dimensional features of power quality disturbance signals, and introduce attention layers to achieve the fusion of parallel convolution and attention.

[0010] Train the convolutional attention neural network model and save the neural network model that meets the requirements;

[0011] The time-frequency feature map is input into the pre-trained convolutional attention neural network model to obtain the power quality disturbance recognition result corresponding to the power quality disturbance signal.

[0012] Optionally, the extracting the time-frequency characteristic diagram of the power quality disturbance signal by the Kaiser window S transform based on the optimized window parameters specifically comprises the following steps:

[0013] The power quality disturbance signal x(n) and the Kaiser window function w k Perform discrete Kaiser window S transform;

[0014] The energy concentration is calculated based on the two-dimensional complex matrix obtained by discrete Kaiser window S transform;

[0015] Taking maximizing energy concentration as the optimization goal, construct the Kaiser window function w kThe optimization problem of the window parameters is solved, and the optimal Kaiser window function w is obtained by solving the optimization problem. k Middle window parameters;

[0016] The two-dimensional amplitude matrix of the two-dimensional complex matrix obtained by the discrete Kaiser window S transform is extracted as the feature containing the time domain and frequency domain information of the power quality disturbance signal and a time-frequency feature diagram is generated.

[0017] Optionally, the calculation function expression of the energy concentration is:

[0018]

[0019] In the above formula, E(p1, p2) is the energy concentration, N is the number of sampling points, M=N / 2, DKS(m, n) is the result of discrete Kaiser window S transform, and DKS(m, n) is a two-dimensional complex matrix of size M×N, m is the width number of the two-dimensional amplitude matrix, and n is the height number of the two-dimensional amplitude matrix; p1 and p2 are Kaiser window function w k Middle window parameter, and Kaiser window function W k The calculation function expression is:

[0020]

[0021] In the above formula, w k (t, f) is the Kaiser window function, t is the signal time, T is the signal period, f is the signal frequency, I0 is the first kind of zero-order modified Bessel function, β(f) is the window adjustment function, and β(f)=p1 / (f+p2).

[0022] Optionally, the function expression of the two-dimensional amplitude matrix of the two-dimensional complex matrix obtained by extracting the discrete Kaiser window S transform is:

[0023] DKS A (m,n)=|DKS(m,n)|,

[0024] In the above formula, DKS A (m, n) is a two-dimensional amplitude matrix, |DKS(m, n)| represents the operation of extracting the amplitude of the resultant two-dimensional complex matrix DKS(m, n) obtained by the discrete Kaiser window S transform, and the complex number expression of the resultant two-dimensional complex matrix DKS(m, n) obtained by the discrete Kaiser window S transform is:

[0025] DKS(m,n)=|DKS(m,n)|e jφ(m,n) ,

[0026] In the above formula, j is the imaginary unit, and φ(m,n) is the phase of the two-dimensional complex matrix DKS(m,n).

[0027] Optionally, the convolutional attention neural network model includes an input layer, one or more levels of feature extraction units, one or more levels of fully connected layers, an activation function layer and an output layer connected in sequence; the feature extraction unit includes a parallel convolution layer, a normalization and activation layer, an attention layer and a pooling layer connected in sequence; the parallel convolution layer completes the effective extraction and fusion of low-dimensional and high-dimensional features of complex power quality disturbance signals through a parallel dual-core strategy; the attention layer realizes the fusion of parallel convolution and attention by constructing a convolution-attention-pooling structure.

[0028] Optionally, the parallel convolution layer includes one or more levels of parallel convolution modules, the parallel convolution module includes a fusion layer and two input branches, one input branch includes a convolution module and a pooling module with a convolution kernel size of 3*3 connected in sequence, and the other input branch includes a convolution module and a pooling module with a convolution kernel size of 7*7 connected in sequence, and the fusion layer fuses the output feature maps of the two input branches and outputs them, and the function expression of the fusion layer fusing the output feature maps of the two input branches is:

[0029]

[0030] In the above formula, F is the fused output feature map, and They are the output feature maps of the two input branches respectively.

[0031] Optionally, the attention layer includes a channel attention block and a spatial attention block, and the function expression of the attention layer is:

[0032]

[0033] In the above formula, F′ is the intermediate feature map, M c (F) is the output feature map of the channel attention block, is the dot product, F is the fused output feature map, M s (F′) is the output feature map of the spatial attention block, and F″ is the output feature map of the attention layer.

[0034] Optionally, the processing of the fused output feature map F by the channel attention block includes: performing maximum pooling and average pooling on the output feature map F, respectively, and then summing the feature vectors obtained by the maximum pooling and average pooling after passing through a fully connected layer with a common hidden layer number of 1, and finally obtaining the output feature map M of the channel attention block through the ReLU activation function. c (F);

[0035] The processing of the intermediate feature map F′ by the spatial attention block includes: performing maximum pooling and average pooling on the intermediate feature map F′, stacking the results of maximum pooling and average pooling on the channel, performing a convolution operation on the stacked feature map, and then activating it through a RELU activation function to obtain an output feature map M of the spatial attention block. s (F′).

[0036] In addition, the present invention also provides a power quality disturbance identification system based on a convolutional attention neural network, including a disturbance signal acquisition module, a disturbance signal extraction module, a neural network model construction module, a neural network model training module and a disturbance signal identification module.

[0037] The disturbance signal acquisition module is used to acquire power quality disturbance signals;

[0038] The disturbance signal extraction module is used to extract the time-frequency characteristic diagram of the power quality disturbance signal based on the Kaiser window S transform with optimized window parameters;

[0039] The neural network model building module is used to build a convolutional attention neural network model, which uses a parallel convolution layer to effectively extract and fuse the low-dimensional and high-dimensional features of the power quality disturbance signal, and introduces an attention layer to realize the fusion of parallel convolution and attention;

[0040] The neural network model training module is used to train the convolutional attention neural network model and save the neural network model that meets the requirements;

[0041] The disturbance signal recognition module is used to input the time-frequency feature map into a pre-trained convolutional attention neural network model to obtain a power quality disturbance recognition result corresponding to the power quality disturbance signal.

[0042] In addition, the present invention also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is used to be programmed or configured by a microprocessor to execute the steps in the above-mentioned power quality disturbance identification method based on convolutional neural network.

[0043] Compared with the prior art, the present invention mainly has the following advantages:

[0044] The method of the present invention comprises extracting a time-frequency feature map of a power quality disturbance signal based on a Kaiser window S transform with optimized window parameters; inputting the time-frequency feature map into a pre-trained convolutional attention neural network to obtain a power quality disturbance recognition result corresponding to the power quality disturbance signal.

[0045] The present invention realizes time-frequency analysis of disturbance signals by adopting Kaiser window S transform with optimized window parameters, which can significantly improve the energy concentration of signal time-frequency analysis, and then automatically classifies disturbances in signal time-frequency feature graph in combination with convolutional attention neural network, which can realize accurate classification of power quality disturbances, avoid the trouble of artificial design of disturbance characteristics, have strong noise resistance and classification accuracy, and realize efficient detection and classification of complex power quality disturbances in different noise environments.

[0046] Therefore, the present invention can solve the technical problems that when analyzing complex power quality disturbance signals, disturbance information loss is easily caused, feature significance and network recognition ability are poor, and the classification accuracy of disturbance features is low. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.

[0048] Figure 2 This is an example of a power quality disturbance signal input in an embodiment of the present invention.

[0049] Figure 3 This is an example of a time-frequency feature graph generated in an embodiment of the present invention.

[0050] Figure 4 Schematic diagram of the network structure of the convolutional attention neural network in an embodiment of the present invention.

[0051] Figure 5 Schematic diagram of the network structure of the parallel convolutional layer in an embodiment of the present invention.

[0052] Figure 6 Schematic diagram of the network structure of the channel attention block in an embodiment of the present invention.

[0053] Figure 7 Schematic diagram of the network structure of the spatial attention block in an embodiment of the present invention.

[0054] Figure 8 Schematic diagram of the training process of the convolutional attention neural network in an embodiment of the present invention.

[0055] Fig. 9 Schematic diagram of the test process of the convolutional attention neural network in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the technical problems solved by the present invention, the technical solutions adopted and the technical effects achieved clearer, the technical solutions of the present invention are further described below in conjunction with the accompanying drawings and through specific implementation methods. It is understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for the convenience of description, only the parts related to the present invention are shown in the accompanying drawings, not all.

[0057] The convolutional neural network model (CNN model) mentioned in the present invention is a deep learning model that performs well in the fields of computer vision and natural language processing. The CNN model is usually composed of a convolutional layer, a pooling layer and a fully connected layer, and the features in the image are automatically extracted through the convolution operation of the convolutional layer. The pooling layer introduces spatial invariance and reduces the memory demand of the model for the image. The CNN model has achieved remarkable results in tasks such as image recognition, object detection, object segmentation and language translation. When processing pictures, the CNN model extracts image features through convolution operations, and these features are crucial for tasks such as image recognition. The convolutional neural network involved in the present invention effectively integrates the feature extraction and classification process into the network model. By setting appropriate network parameters, the automatic detection and classification of power quality disturbance signals can be achieved without the need for feature design. Therefore, by rationally optimizing the traditional convolutional neural network model and enhancing its feature expression performance and network recognition ability, the accurate identification of complex power quality disturbances can be effectively achieved, thereby promoting pollution control in modern power grids.

[0058] The Kaiser window mentioned in the present invention is a single-parameter window function group, which is usually used in digital signal processing. S-transform is a time-frequency analysis tool that allows us to observe the energy distribution of a signal from both the time domain and the frequency domain. S-transform is closely related to Fourier transform and wavelet transform, and can be regarded as a deformation of continuous wavelet transform. S-transform has a wide range of applications in the field of signal processing, especially in the classification of power quality disturbances, and the pattern classification method combined with artificial neural network is widely used. This method can extract the characteristic quantity of the signal and realize the identification of single disturbance and compound disturbance. Although the extracted characteristic quantity may be large, by optimizing the selection of characteristic quantity, the complexity of the algorithm can be reduced without losing the classification accuracy. Kaiser window S-transform has a higher energy concentration and can effectively reduce the information loss in the time domain and frequency domain.

[0059] The present invention provides a method, system and medium for identifying power quality disturbances based on convolutional neural networks. The time-frequency feature graph of power quality disturbance signals is extracted based on Kaiser window S transform with optimized window parameters; the time-frequency feature graph is input into a pre-trained convolutional attention neural network to obtain a power quality disturbance identification result corresponding to the power quality disturbance signal. The present invention realizes the time-frequency analysis of disturbance signals by adopting Kaiser window S transform with optimized window parameters, which can significantly improve the energy concentration of signal time-frequency analysis, and then automatically classifies disturbances in the signal time-frequency feature graph in combination with the convolutional attention neural network, which can realize accurate classification of power quality disturbances, avoid the trouble of artificial design of disturbance features, have strong noise resistance and classification accuracy, and realize efficient detection and classification of complex power quality disturbances under different noise environments. Therefore, the present invention can solve the technical problems of easy loss of disturbance information, poor feature significance and network recognition ability, and low classification accuracy of disturbance features when analyzing complex power quality disturbance signals.

[0060] The technical solution of the present invention is further described below in conjunction with the accompanying drawings:

[0061] like Figure 1 As shown, this embodiment provides a method for identifying power quality disturbances based on a convolutional attention neural network, comprising the following steps:

[0062] S101, collecting power quality disturbance signals;

[0063] S102, extracting a time-frequency characteristic diagram of the power quality disturbance signal based on a Kaiser window S transform (hereinafter referred to as KS transform) with optimized window parameters;

[0064] S103, constructing a convolutional attention neural network model, using parallel convolution layers to effectively extract and fuse low-dimensional and high-dimensional features of power quality disturbance signals, and introducing an attention layer to achieve fusion of parallel convolution and attention;

[0065] S104, training a convolutional attention neural network model, and saving a neural network model that meets the requirements;

[0066] S105, inputting the time-frequency feature map into a pre-trained convolutional attention neural network to obtain a power quality disturbance recognition result corresponding to the power quality disturbance signal.

[0067] Step S102 is the process of adaptive KS transform time-frequency analysis. In this embodiment, step S102 includes:

[0068] S201, power quality disturbance signal x(n) and Kaiser window function w k Perform discrete KS transformation;

[0069] S202, calculating the energy concentration degree for the two-dimensional complex matrix obtained by the discrete KS transformation;

[0070] S203, taking maximizing energy concentration as the optimization goal, constructing a Kaiser window function w k The optimization problem of the window parameters is solved, and the optimal Kaiser window function w is obtained by solving the optimization problem. k Middle window parameters;

[0071] S204, extracting a two-dimensional amplitude matrix of the resultant two-dimensional complex matrix obtained by discrete KS transformation as a feature containing time domain and frequency domain information of the power quality disturbance signal and generating a time-frequency feature diagram.

[0072] In this embodiment, the input power quality disturbance signal containing sudden drops, harmonics, and peaks is as follows: Figure 2 As shown in Figure 3 As shown, a is the graphical part of the sudden drop, b is the graphical part of the harmonics, and c is the graphical part of the peak.

[0073] Referring to steps S201 to S204, it can be seen that when the Kaiser window S transform based on the optimized window parameters is used to extract the time-frequency characteristic diagram of the power quality disturbance signal, the maximum energy concentration criterion is used to realize the adaptive setting of the window function parameters in the traditional KS transform analysis. The time-frequency diagram generated based on the adaptive KS transform has the optimal energy concentration performance while taking into account the time and frequency resolution, which can effectively improve the robustness (i.e., stability and accuracy) of the disturbance detection result.

[0074] In this embodiment, the calculation function expression of the energy concentration in step S202 is:

[0075]

[0076] In the above formula, E(p1, p2) is the energy concentration, N is the number of sampling points, M=N / 2, DKS(m, n) is the result of discrete KS transformation, and DKS(m, n) is a two-dimensional complex matrix of size M×N, m is the width number of the two-dimensional amplitude matrix, and n is the height number of the two-dimensional amplitude matrix; p1 and p2 are Kaiser window functions w k The window parameter and Kaiser window function w k The calculation function expression is:

[0077]

[0078] In the above formula, w k(t, f) is the Kaiser window function, t is the signal time, T is the signal period, f is the signal frequency, I0 is the first kind of zero-order modified Bessel function, β(f) is the window adjustment function, and β(f)=p1 / (f+p2).

[0079] In this embodiment, in step S203, maximizing the energy concentration is used as the optimization goal to construct a Kaiser window function W k After solving the optimization problem of the window parameters, a genetic algorithm is used to solve the optimization problem and obtain the best Kaiser window function w k The window parameters can also be based on other optimization problem solving algorithms. It should be noted that using a genetic algorithm to solve the optimization problem is a basic application of the genetic algorithm. This embodiment does not involve improvements to the genetic algorithm, so its specific implementation details are not described in detail here.

[0080] In this embodiment, the function expression of the two-dimensional amplitude matrix of the two-dimensional complex matrix obtained by the discrete KS transformation in step S204 is:

[0081] DKS A (m,n)=|DKS(m,n)|,

[0082] In the above formula, DKS A (m, n) is a two-dimensional amplitude matrix, |DKS(m, n)| represents the operation of extracting the amplitude of the resultant two-dimensional complex matrix DKS(m, n) obtained by the discrete KS transform, and the complex number expression of the resultant two-dimensional complex matrix DKS(m, n) obtained by the discrete KS transform is:

[0083] DKS(m,n)=|DKS(m,n)|e jφ(m,n) ,

[0084] In the above formula, j is the imaginary unit, and φ(m,n) is the phase of the two-dimensional complex matrix DKS(m,n).

[0085] like Figure 4 As shown, the convolutional attention neural network used in step S103 of this embodiment includes a sequentially connected input layer, one or more levels of feature extraction units (which can be set as needed, for example, two levels in this embodiment), one or more levels of fully connected layers (which can be set as needed, for example, three levels in this embodiment), an activation function layer and an output layer. The feature extraction unit includes sequentially connected parallel convolution layers, normalization and activation layers, attention layers and pooling layers. The parallel convolution layer completes the effective extraction and fusion of low-dimensional and high-dimensional features of complex power quality disturbance signals through a parallel dual-core strategy; the attention layer realizes the fusion of parallel convolution and attention by constructing a convolution-attention-pooling structure.

[0086] The input layer passes the data to the parallel convolution layer of the feature extraction unit in a specific format (such as a two-dimensional image matrix, a one-dimensional text vector, etc.). Each convolution kernel in the parallel convolution layer independently performs convolution operations with the local area of ​​the input data to extract different features. The attention layer receives the output of the parallel convolution layer as input and readjusts the weight distribution of the feature map by calculating the attention weight. The pooling layer is usually located after the parallel convolution layer to perform dimensionality reduction processing on the output of the parallel convolution layer or the attention layer. The channel attention block performs maximum pooling and average pooling on the fused output feature map, and then sums the feature vectors obtained by maximum pooling and average pooling after passing through a shared fully connected layer. Finally, the output feature map of the channel attention block is obtained through the activation function layer, and the power quality disturbance recognition result corresponding to the power quality disturbance signal is obtained through the output layer.

[0087] The convolutional attention neural network used in step S103 of this embodiment, on the one hand, uses a parallel convolution layer to replace the feature extraction based on a single convolution kernel in the traditional convolution process, and through a parallel dual-core strategy, simultaneously completes the effective extraction and fusion of low-dimensional and high-dimensional features of complex power quality disturbance signals, thereby reducing information loss; on the other hand, in order to improve the representation of disturbance fusion features, an attention layer is introduced into the previous convolution-pooling structure, and a convolution-attention-pooling structure is constructed to highlight the important components in the disturbance and ignore irrelevant information to enhance detection efficiency. By integrating parallel convolution and attention, the classification accuracy of the network model can be greatly improved. In particular, compared with traditional disturbance detection methods, the method of this embodiment does not require a feature design link, effectively simplifies the classification steps, and has the characteristics of high recognition accuracy and strong robustness.

[0088] like Figure 5 As shown, the parallel convolution layer in this embodiment includes one or more levels of parallel convolution modules, and the parallel convolution module includes a fusion layer and two input branches. The two input branches are composed of two parallel convolution channels with different convolution kernel sizes, which are used to extract high-dimensional features and low-dimensional features of the time-frequency feature map and fuse them respectively; one input branch includes a convolution module and a pooling module with a convolution kernel size of 3*3 connected in sequence, and the other input branch includes a convolution module and a pooling module with a convolution kernel size of 7*7 connected in sequence, and the output feature maps of the two input branches are fused and output by the fusion layer, and the function expression of the fusion layer fusing the output feature maps of the two input branches is:

[0089]

[0090] In the above formula, F is the fused output feature map, and are the output feature maps of the two input branches respectively. Through the above method, the fused output feature map F satisfies:

[0091]

[0092] In this embodiment, the attention layer includes a channel attention block and a spatial attention block, and the function expression of the attention layer is:

[0093]

[0094] In the above formula, F′ is the intermediate feature map, M c (F) is the output feature map of the channel attention block, is the dot product, F is the fused output feature map, M s (F′) is the output feature map of the spatial attention block, and F″ is the output feature map of the attention layer. By fusing the channel attention module with the spatial attention module and combining it with point product fusion, the specific features of different dimensions in the disturbance signal can be fully extracted, significantly increasing the overall representation ability of the disturbance features, thereby achieving efficient and accurate disturbance recognition.

[0095] like Figure 6 As shown, the processing of the fused output feature map F by the channel attention block in this embodiment includes: the output feature map F is respectively subjected to maximum pooling and average pooling, and then the feature vectors obtained by the maximum pooling and average pooling are summed after passing through a fully connected layer with a common hidden layer number of 1, and finally the output feature map M of the channel attention block is obtained by the ReLU activation function. c (F)( Figure 6 Indicated as M c ), and there is M c (F)∈R C×1×1 , R is a real number, C is the number of channels, and its function expression is:

[0096] M c (F)=r(FC(AvgP(F))+FC(MaxP(F))),

[0097] In the above formula, AvgP and MaxP represent average pooling and maximum pooling respectively, FC is a fully connected layer with 1 hidden layer, r represents the ReLU function, and F is the fused output feature map.

[0098] like Figure 7 As shown, the processing of the intermediate feature map F′ by the spatial attention block in this embodiment includes: performing maximum pooling and average pooling on the intermediate feature map F′, stacking the results of maximum pooling and average pooling on the channel, performing a convolution operation on the stacked feature map, and then activating it through the ReLU activation function to obtain the output feature map M of the spatial attention block. s (F′)( Figure 7 Indicated as M s ), its function expression is:

[0099] M s (F′)=r(C([AvgP(F′);MaxP(F′)])),

[0100] In the above formula, AvgP and MaxP represent average pooling and maximum pooling respectively, C is the convolution operation, r represents the ReLU function, and F′ is the intermediate feature map.

[0101] Finally, after the full connection process of the fully connected layer of the convolutional attention neural network, the output result contains the score value S of each power quality disturbance signal, which is mapped into a probability distribution between 0 and 1 using the activation function layer, indicating the probability that the detected power quality disturbance signal belongs to each classification category.

[0102] In this embodiment, the activation function layer adopts the softmax function, which maps the score value S to a probability distribution with values ​​between 0 and 1 as follows:

[0103]

[0104] In the above formula, p j is the probability that the power quality disturbance signal belongs to the jth classification category, exp is the exponential relationship, S j is the score of the power quality disturbance signal belonging to the jth classification category, S i is the score of the power quality disturbance signal belonging to the i-th classification category, i, j are both positive real numbers, and I represents the total number of classification categories.

[0105] like Figure 8As shown, when training the convolutional attention neural network model in step S104 of this embodiment, the power quality disturbance signal generated by MATLAB simulation is included. Specifically, in this embodiment, 15 power quality disturbance signal models are established according to the IEEE1159 standard, including 9 single disturbances of normal signal, voltage sag, voltage swell, voltage interruption, harmonic, voltage transient oscillation, voltage flicker, voltage notch, and voltage spike, and 6 complex disturbance signals mixed by these single disturbances, including voltage sag + harmonic, voltage swell + harmonic, voltage sag + voltage transient oscillation, voltage spike + harmonic, voltage sag + harmonic + voltage spike, voltage flicker + harmonic + voltage transient oscillation. The signal frequency is 50Hz, the sampling rate is 3200Hz, the sampling period is 10 cycles, and the sampling time length is 0.2s. MATLAB is used to generate 3000 samples for each type of disturbance, which are divided into training set, validation set and test set in a ratio of 6:2:2. The number of training iterations of the convolutional attention neural network is set to 50, and the initial learning rate is 0.001. In this embodiment, one-hot encoding is performed for the classification category, and the loss function of the convolutional attention neural network uses the cross entropy loss function to calculate the training loss, and the expression is:

[0106]

[0107] In the above formula, p i is the probability that the power quality disturbance signal belongs to the i-th classification category, r i is the true classification category label of the power quality disturbance signal, and I represents the total number of classification categories.

[0108] Based on the loss function loss, back propagation is used to update the network weights and biases until the number of training times reaches the threshold, and the model that meets the requirements (optimal model) can be saved as the trained convolutional attention neural network model.

[0109] like Fig. 9 As shown, in step S105 of this embodiment, the power quality disturbance signal data in the test set is input into the trained convolutional attention neural network model, and the output result is compared with the true label through the output layer, and the classification accuracy is calculated to evaluate the actual performance of the model. In order to further verify the actual classification performance of the convolutional attention neural network in this embodiment, the convolutional attention neural network training process is completed on a GPU, and the GPU model is NVIDIA GeForce GTX 1650. The model is experimentally tested for disturbance classification performance under 20dB, 30dB, and 40dB Gaussian white noise, and the experimental results are shown in Table 1.

[0110] Table 1: Experimental results of classification performance with different perturbations.

[0111]

[0112]

[0113] As shown in Table 1, the classification results under different noise levels show that the recognition accuracy of the convolutional attention neural network in this embodiment is higher than 99%. Even in the case of 20dB Gaussian white noise, the perturbation recognition accuracy of the convolutional attention neural network model is still as high as 99.28%. The results show that the convolutional attention neural network combined with the adaptive KS transformation in this embodiment has superior feature extraction and perturbation classification performance, while also having satisfactory noise resistance.

[0114] In summary, in view of the complex and changeable power quality disturbance signals in modern power grids, in order to improve the adaptability of the existing KS algorithm, this embodiment uses the principle of maximum energy concentration, introduces an intelligent optimization algorithm, and realizes adaptive adjustment of KS window parameters, thereby enhancing its disturbance detection robustness; in order to improve the detection accuracy of the network model, in view of the problem of information loss that is easily caused by the single convolution kernel of the traditional CNN model in the feature extraction process, this embodiment uses parallel double-size convolution kernels to achieve accurate extraction and fusion of low-dimensional and high-dimensional feature information of disturbances. In addition, an attention layer is introduced in the middle of the traditional convolution pooling operation process, a convolution-attention-pooling structure is built, and the attention layer is used to realize disturbance feature reconstruction, which greatly enhances the feature significance, and then realizes the classification accuracy of the network model for the disturbance feature. The power quality disturbance identification method based on the convolutional attention neural network in this embodiment realizes the automatic detection and accurate identification of complex power quality disturbance signals. It is worth mentioning that the entire classification process completely eliminates the cumbersome manual feature design link, making it more flexible. At the same time, the anti-noise experimental results verify its excellent robust performance, which can realize accurate identification of power quality disturbance signals in different noise environments, and provide a practical solution for the detection and identification of complex and changeable disturbance signals in modern power grid environments. The method of this embodiment can complete the automatic detection and classification of complex power quality disturbance signals, and at the same time has strong anti-noise performance, which can meet the classification accuracy of disturbance signals in different noise environments.

[0115] It should be understood that the specific order or hierarchy of steps in the process disclosed in the present invention is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described. The present invention also provides a power quality disturbance identification system based on a convolutional attention neural network, including a disturbance signal acquisition module, a disturbance signal extraction module, a neural network model construction module, a neural network model training module and a disturbance signal identification module,

[0116] The disturbance signal acquisition module is used to acquire power quality disturbance signals;

[0117] The disturbance signal extraction module is used to extract the time-frequency characteristic diagram of the power quality disturbance signal based on the Kaiser window S transform with optimized window parameters;

[0118] The neural network model building module is used to build a convolutional attention neural network model, which uses a parallel convolution layer to effectively extract and fuse the low-dimensional and high-dimensional features of the power quality disturbance signal, and introduces an attention layer to realize the fusion of parallel convolution and attention;

[0119] The neural network model training module is used to train the convolutional attention neural network model and save the neural network model that meets the requirements;

[0120] The disturbance signal recognition module is used to input the time-frequency feature map into a pre-trained convolutional attention neural network model to obtain a power quality disturbance recognition result corresponding to the power quality disturbance signal.

[0121] In addition, the present invention also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is used to be programmed or configured by a microprocessor to execute the steps in the above-mentioned power quality disturbance identification method based on convolutional neural network.

[0122] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0123] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. Power quality disturbance identification method based on convolutional attention neural network, It is characterized in that The following steps are involved: Collect power quality disturbance signals; The time-frequency characteristic diagram of power quality disturbance signal is extracted based on Kaiser window S transform with optimized window parameters; Construct a convolutional attention neural network model, use parallel convolution layers to effectively extract and fuse the low-dimensional and high-dimensional features of power quality disturbance signals, and introduce attention layers to achieve the fusion of parallel convolution and attention. Train the convolutional attention neural network model and save the neural network model that meets the requirements; The time-frequency feature map is input into the pre-trained convolutional attention neural network model to obtain the power quality disturbance recognition result corresponding to the power quality disturbance signal.

2. The method for identifying power quality disturbances based on convolutional neural network according to claim 1, It is characterized in that The method of extracting the time-frequency characteristic diagram of the power quality disturbance signal based on the Kaiser window S transform with optimized window parameters specifically includes the following steps: The power quality disturbance signal x(n) and the Kaiser window function w k Perform discrete Kaiser window S transform; The energy concentration is calculated based on the two-dimensional complex matrix obtained by discrete Kaiser window S transform; Taking maximizing energy concentration as the optimization goal, construct the Kaiser window function w k The optimization problem of the window parameters is solved, and the optimal Kaiser window function w is obtained by solving the optimization problem. k Middle window parameters; The two-dimensional amplitude matrix of the two-dimensional complex matrix obtained by the discrete Kaiser window S transform is extracted as the feature containing the time domain and frequency domain information of the power quality disturbance signal and a time-frequency feature diagram is generated.

3. The method for identifying power quality disturbances based on convolutional neural network according to claim 2, It is characterized in that The calculation function expression of the energy concentration is: In the above formula, E(p 1 , p 2 ) is the energy concentration, N is the number of sampling points, M=N / 2, DKS(m,n) is the result of discrete Kaiser window S transform, and DKS(m,n) is a two-dimensional complex matrix of size M×N, m is the width number of the two-dimensional amplitude matrix, and n is the height number of the two-dimensional amplitude matrix; p 1 and p 2 is the Kaiser window function w k The window parameter and Kaiser window function w k The calculation function expression is: In the above formula, w k (t, f) is the Kaiser window function, t is the signal time, T is the signal period, f is the signal frequency, I 0 is the first kind of zero-order modified Bessel function, β(f) is the window adjustment function, and β(f) = p 1 / (f+p 2 ).

4. The method for identifying power quality disturbances based on convolutional neural network according to claim 3, It is characterized in that The function expression of the two-dimensional amplitude matrix of the two-dimensional complex matrix obtained by extracting the discrete Kaiser window S transform is: DKS A (m,n)=|DKS(m,n)|, In the above formula, DKS A (m, n) is a two-dimensional amplitude matrix, |DKS(m, n)| represents the operation of extracting the amplitude of the resultant two-dimensional complex matrix DKS(m, n) obtained by the discrete Kaiser window S transform, and the complex number expression of the resultant two-dimensional complex matrix DKS(m, n) obtained by the discrete Kaiser window S transform is: DKS(m,n)=|DKS(m,n)|e jφ(m,n) , In the above formula, j is the imaginary unit, and φ(m,n) is the phase of the two-dimensional complex matrix DKS(m,n).

5. The method for identifying power quality disturbances based on convolutional neural network according to claim 1, It is characterized in that The convolutional attention neural network model includes an input layer, one or more levels of feature extraction units, one or more levels of fully connected layers, an activation function layer and an output layer connected in sequence; the feature extraction unit includes a parallel convolution layer, a normalization and activation layer, an attention layer and a pooling layer connected in sequence; the parallel convolution layer completes the effective extraction and fusion of low-dimensional and high-dimensional features of complex power quality disturbance signals through a parallel dual-core strategy; the attention layer realizes the fusion of parallel convolution and attention by constructing a convolution-attention-pooling structure.

6. The method for identifying power quality disturbances based on convolutional neural network according to claim 5, It is characterized in that The parallel convolution layer includes one or more levels of parallel convolution modules, and the parallel convolution module includes a fusion layer and two input branches, one input branch includes a convolution module and a pooling module with a convolution kernel size of 3*3 connected in sequence, and the other input branch includes a convolution module and a pooling module with a convolution kernel size of 7*7 connected in sequence, and the fusion layer fuses the output feature maps of the two input branches and outputs them, and the fusion layer fuses the output feature maps of the two input branches. The function expression of the fusion layer fusing the output feature maps of the two input branches is: In the above formula, F is the output feature map after fusion, and They are the output feature maps of the two input branches respectively.

7. The method for identifying power quality disturbances based on convolutional neural network according to claim 5, It is characterized in that The attention layer includes a channel attention block and a spatial attention block, and the function expression of the attention layer is: In the above formula, F′ is the intermediate feature map, M c (F) is the output feature map of the channel attention block, is the dot product, F is the fused output feature map, M s (F′) is the output feature map of the spatial attention block, and F″ is the output feature map of the attention layer.

8. The method for identifying power quality disturbances based on convolutional neural network according to claim 7, It is characterized in that The processing of the fused output feature map F by the channel attention block includes: performing maximum pooling and average pooling on the output feature map F, and then summing the feature vectors obtained by the maximum pooling and average pooling after passing through a fully connected layer with a common hidden layer number of 1, and finally obtaining the output feature map M of the channel attention block through the ReLU activation function. c (F); The processing of the intermediate feature map F′ by the spatial attention block includes: performing maximum pooling and average pooling on the intermediate feature map F′, stacking the results of maximum pooling and average pooling on the channel, performing a convolution operation on the stacked feature map, and then activating it through a RELU activation function to obtain an output feature map M of the spatial attention block. s (F′).

9. Power quality disturbance identification system based on convolutional attention neural network, It is characterized in that It includes disturbance signal acquisition module, disturbance signal extraction module, neural network model construction module, neural network model training module and disturbance signal recognition module. The disturbance signal acquisition module is used to acquire power quality disturbance signals; The disturbance signal extraction module is used to extract the time-frequency characteristic diagram of the power quality disturbance signal based on the Kaiser window S transform with optimized window parameters; The neural network model building module is used to build a convolutional attention neural network model, which uses a parallel convolution layer to effectively extract and fuse the low-dimensional and high-dimensional features of the power quality disturbance signal, and introduces an attention layer to realize the fusion of parallel convolution and attention; The neural network model training module is used to train the convolutional attention neural network model and save the neural network model that meets the requirements; The disturbance signal recognition module is used to input the time-frequency feature map into a pre-trained convolutional attention neural network model to obtain a power quality disturbance recognition result corresponding to the power quality disturbance signal.

10. A computer-readable storage medium having a computer program stored therein. It is characterized in that The computer program is used to be programmed or configured by a microprocessor to execute the steps in the power quality disturbance identification method based on convolutional neural network as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for extracting time-frequency parameters of power quality disturbance signals on basis of fast K-S (Kaiser-S) transformation

    CN103308804A

  • Fan power quality disturbance monitoring method based on two-dimensional image coding characteristics

    CN114036977A

Cited By

  • Artificial intelligence-based implantation regulation electroencephalogram signal enhancement method and computer system

    CN120030320A

  • Electric energy quality disturbance identification method based on artificial intelligence

    CN120354182A

  • Power quality disturbance identification method based on multi-feature fusion, terminal equipment and storage medium

    CN121434871A