Local classification method of power quality disturbance based on dual attention mechanism
Through a deep learning model based on Hilbert transform and channel attention mechanism, the envelope and local characteristics of the power quality disturbance signal are extracted, and the local category of power quality disturbance is realized, which solves the difficulty in classifying complex power in the prior art. The problem of electrical energy quality disturbance in the system improves classification accuracy and system stability.
Patent Information
- Application Number
- CN202210597045.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2042-05-30
AI Technical Summary
The existing technology is difficult to accurately and quickly to accurately and quickly classify the power quality disturbances. Especially in complex power system environments, time-frequency domain analysis methods are difficult to meet the classification needs of power quality composite disturbances, and deep learning methods are mainly aimed at overall type classification. , lack the ability to identify and classify local perturbations.
Using a deep learning classification model based on Hilbert's transform local attention mechanism and channel attention mechanism, the envelope and local attention mechanism of the electrical energy quality perturbation signal are extracted, combined with convolutional neural network and SENet, Realize local categories of disturbances to power quality.
It improves the local accuracy and performance of the power quality disturbance signal, enhances the operating stability of the power system, and can accurately identify and classify the local characteristics of power quality disturbance in complex environments.
Smart Images

Figure CN114936579B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power quality disturbance signal detection and classification, and in particular relates to a power quality disturbance local classification method based on a dual attention mechanism. Background Art
[0002] While a large number of clean energy sources such as hydropower, wind power, biomass energy, solar energy, and geothermal energy are being connected to the grid, the power system is also affected by the popularization of electric vehicle charging piles, the electrification of rail transportation, and the power electronics of the power system. Various power equipment is increasingly affected by power quality. At this time, the generation of power quality disturbances will bring varying degrees of economic losses and safety hazards to the power system, making the power system face higher power quality risks.
[0003] When the power system is operating normally, the voltage will be transmitted in the form of rated amplitude and rated frequency, and its ideal waveform is a sine wave. Power quality disturbance is the power quality disturbance phenomenon that occurs when the power system is disturbed by various external factors during actual operation and changes with the ideal operating state. The occurrence of power quality disturbance will affect the normal operation of electrical equipment and cause damage to sensitive components. At the same time, various power electronic equipment has extremely high requirements for power quality. Therefore, accurate and rapid classification of power quality disturbances is the basic prerequisite for ensuring stable, safe and efficient operation of the power grid.
[0004] When classifying power quality disturbances, the use of time-frequency domain analysis methods such as Fourier transform, S transform, wavelet transform, empirical mode decomposition, and variational mode decomposition can achieve high-precision classification of power quality disturbances, but the process is heavily dependent on expert experience, and the types of disturbances that can be distinguished are limited. In addition, the feature detection model and feature classification model used in this method will affect the classification accuracy, and when the disturbance parameters of the power quality disturbance change, it is necessary to re-select parameters and adjust the structure of the two models, which requires high labor costs. And with the increasing complexity of power quality disturbances, such as the widespread appearance of various power quality composite disturbances caused by the grid connection of new energy and the periodic voltage gap caused by power electronic equipment, the time-frequency domain analysis method is difficult to meet the classification requirements of power quality disturbances in various environments. The use of deep learning instead of manual screening to complete the power quality disturbance classification task has higher flexibility and accuracy. At present, deep learning classification methods mainly use convolutional neural networks (CNN) and recurrent neural networks (RNN) to extract features of power quality disturbances, and through deep learning training, the potential connections between signal spatial features and temporal features are explored to achieve power quality disturbance classification. Summary of the invention
[0005] Considering that the power quality classification methods in the prior art are mainly aimed at the classification problem of the overall type of power quality disturbances, that is, the entire set of input power quality disturbance signals are classified, but the identification and classification of the intervals where the power quality disturbances occur are not considered, that is, no local disturbance classification of the input power quality signals is performed. The present invention proposes a local classification method for power quality disturbances based on a dual attention mechanism, which is used to realize the classification of the disturbance intervals and categories of power quality disturbances, that is, local classification of power quality disturbances. It solves the increasingly complex power quality disturbance classification problem in the current power system.
[0006] It mainly consists of a signal processing method based on the Hilbert transform local attention mechanism and a deep learning classification model based on the channel attention mechanism. The former uses the Hilbert transform to extract the envelope of the power quality disturbance signal, and introduces a local attention mechanism to the signal and its envelope to achieve the effect of enhancing the local disturbance characteristics of the signal; the latter introduces a channel attention mechanism in the deep learning model to improve the accuracy and performance of local classification of power quality disturbances. This method realizes local classification of power quality disturbance signals through the joint action of the dual attention mechanism.
[0007] The present invention specifically adopts the following technical solutions:
[0008] A method for local classification of power quality disturbances based on a dual attention mechanism is characterized in that the power quality disturbance signal is subjected to data preprocessing and model training according to the following steps:
[0009] Firstly, the signal processing method based on the Hilbert transform local attention mechanism is used to preprocess the power quality disturbance signal so that the local disturbance of the signal can be enhanced.
[0010] Secondly, a deep learning classification model is built using the channel attention mechanism, and the classification model is used to train the power quality disturbance signal so that it has the ability to locally classify the power quality disturbance.
[0011] Furthermore, the envelope of the power quality disturbance signal is extracted using Hilbert transform, and the signal is attention calculated based on the envelope, so that the local disturbance characteristics of the signal are enhanced.
[0012] The channel attention mechanism is introduced into the deep learning classification model to make the model focus on the channels that are more effective for the task in learning.
[0013] A method for local classification of power quality disturbances based on a dual attention mechanism, characterized by comprising the following steps:
[0014] Step S1: performing per-unit calculation on the input power quality disturbance signal according to the per-unit value of the power quality to obtain a per-unit signal, and considering the signal as a function f(t);
[0015] Step S2: Use Hilbert transform on f(t) to calculate its instantaneous amplitude, i.e., envelope A(t);
[0016] Step S3: Take A(t) as the attention weight of f(t), perform weighted calculation on f(t) and obtain the local attention signal L(t):
[0017] L(t)=A(t)·f(t) (4)
[0018] Step S4: Use convolutional neural network CNN and SENet to build a local classification model for power quality disturbances: Use the convolutional layer Conv and SENet in the convolutional neural network CNN to build a deep learning classification model based on the channel attention mechanism. The importance of each convolution kernel channel in the convolutional layer Conv is obtained through SENet, and the channel is assigned a weight;
[0019] Step S5: Input the local attention signal L(t) obtained in step S3 into the power quality disturbance local classification model in step S4, and output the power quality disturbance local classification result after deep learning training.
[0020] Furthermore, step S2 specifically includes the following steps:
[0021] Step S21: X i Perform Hilbert transform H(t) on f(t):
[0022]
[0023] pv in formula (1) is the Cauchy principal value integral;
[0024] Step S22: Using H(t), the analytical signal f of the input signal f(t) can be calculated a (t):
[0025] f a (t) = f(t) + iH(t) = A(t)e iθ(t) (2)
[0026] Step S23: According to f a (t) Calculate the instantaneous amplitude A(t) of the input signal f(t):
[0027]
[0028] Furthermore, step S4 specifically includes the following steps:
[0029] Step S41: For an input signal X of length n, the c convolution kernels in the convolutional neural network obtain a matrix X of dimension n×1×c after each convolution. c , at this time X c The weights of each channel in are the default weights;
[0030] Step S42: F in SENet sq X c The n elements in each convolution kernel of are globally averaged and the matrix X c Compressed to 1×1×c feature matrix X sq :
[0031] X sq =F sq (X c )=Avg([x1,x2...x n ]) (5)
[0032] Step S43: F in SENet ex The weight W obtained by training the fully connected neural network FC is used to calculate the feature matrix X sq Perform nonlinear transformation to obtain the corresponding channel weight W of each convolution kernel c :
[0033] W c =F ex (X sq ,W)=W·X sq (6)
[0034] Step S44: F in SENet sc The input matrix X and channel weight W c Multiply them together to get the channel attention matrix Y c , at this time Y c Each channel is assigned its own weight:
[0035] Y c =F sc (X,W c )=W c ·X (7);
[0036] In each SENet module in the deep learning model, a fully connected layer FC is used to obtain the correlation between channels. The first FC uses ReLU as the activation function to extract the nonlinear weights between channels. τ is a scaling factor to reduce the amount of calculation between channels. The second FC uses Sigmoid as the activation function to standardize the obtained weights. Finally, the obtained vectors are multiplied by the Scale layer, and the standardized weights are weighted to each convolution kernel channel to finally obtain the channel attention matrix Y. c .
[0037] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for local classification of power quality disturbances based on the dual attention mechanism as described above is implemented.
[0038] A computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the method for local classification of power quality disturbances based on a dual attention mechanism as described above is implemented.
[0039] Compared with the prior art, the present invention and its preferred embodiments have at least the following outstanding advantages:
[0040] 1. Use the signal processing method based on the Hilbert transform local attention mechanism to weight the input power quality disturbance signal to enhance the local characteristics of the power quality disturbance.
[0041] 2. Use the channel attention mechanism to build a deep learning model for local classification of power quality disturbances, and assign the weights of the convolution kernel channels in the model to achieve accurate and efficient local classification of power quality disturbances. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The figure is a schematic diagram of the overall flow of the method according to the embodiment of the present invention.
[0043] Figure 2 Schematic diagram of a signal processing method based on the Hilbert transform local attention mechanism according to an embodiment of the present invention.
[0044] Figure 3 Schematic diagram of the SENet module principle of an embodiment of the present invention.
[0045] Figure 4 Schematic diagram of the SENet module structure results according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the features and advantages of this patent more obvious and easy to understand, the following embodiments are specifically described in detail as follows:
[0047] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0048] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0049] like Figure 1-Figure 4 As shown, the power quality disturbance local classification method based on the dual attention mechanism provided in this embodiment can be described as the following steps:
[0050] Step S1: Figure 2 As shown, the input power quality disturbance signal is normalized and calculated according to the normalized value of the power quality to obtain a normalized signal, which is regarded as a function f(t).
[0051] Step S2: Figure 2 As shown, Hilbert transform is used on f(t) to calculate its instantaneous amplitude, i.e., envelope A(t). It specifically includes the following steps:
[0052] Step S21: Performing Hilbert transform H(t) on f(t) yields:
[0053]
[0054] pv in formula (1) is the Cauchy principal value integral.
[0055] Step S22: Using H(t), the analytical signal f of the input signal f(t) can be calculated a (t):
[0056] f a (t) = f(t) + iH(t) = A(t)e iθ(t) (2)
[0057] Step S23: According to f a (t) can calculate the instantaneous amplitude A(t) of the input signal f(t):
[0058]
[0059] Step S3: Figure 2 As shown, A(t) is used as the attention weight of f(t), and f(t) is weighted to obtain the local attention signal L(t):
[0060] L(t)=A(t)·f(t) (4)
[0061] Step S4: Figure 1As shown in the figure, the convolution layer (Conv) and SENet in CNN are used to build a deep learning classification model based on the channel attention mechanism. The core step is to obtain the importance of each convolution kernel channel in Conv through SENet and assign weights to the channels. The specific steps are as follows:
[0062] Step S41: Figure 3 As shown in the figure, for an input signal X of length n, the c convolution kernels in Conv will obtain a matrix X with a dimension of (n×1×c) after each convolution. c , at this time X c The weights of each channel in are the default weights;
[0063] Step S42: Figure 3 As shown, F in SENet sq X c The n elements in each convolution kernel of are globally averaged and the matrix X c Compressed to the feature matrix X of (1×1×c) sq :
[0064] X sq =F sq (X c )=Avg([x1,x2...x n ]) (5)
[0065] Step S43: Figure 3 As shown, F in SENet ex The weight W obtained by training the fully connected neural network (FC) is used to calculate the feature matrix X sq Perform nonlinear transformation to obtain the corresponding channel weight W of each convolution kernel c :
[0066] W c =F ex (X sq ,W)=W·X sq (6)
[0067] Step S44: Figure 3 As shown, F in SENet sc The input matrix X and channel weight W c Multiply them together to get the channel attention matrix Y c , at this time Y c Each channel has its own weight:
[0068] Y c =F sc (X,W c )=W c ·X (7)
[0069] In this embodiment, the structure of each SENet module in the deep learning model is as follows: Figure 4 As shown in the figure, the module uses the fully connected layer FC to obtain the correlation between channels. The first FC uses ReLU as the activation function to extract the nonlinear weights between channels. τ is the scaling factor to reduce the amount of calculation between channels. The second FC uses Sigmoid as the activation function to standardize the obtained weights. Finally, the obtained vectors are multiplied by the Scale layer, and the standardized weights are weighted to each convolution kernel channel, and finally the channel attention matrix Y is obtained. c .
[0070] Step S5: Figure 1 As shown, the local attention signal L(t) obtained in step S3 is input into the deep learning model in step S4, and after deep learning training, the local classification result of the power quality disturbance is output.
[0071] In summary, the embodiments of the present invention are helpful to realize the local disturbance feature enhancement and local disturbance classification of power quality disturbance, thereby increasing the operation stability of the power system and ensuring the safe operation of the power grid.
[0072] The above-mentioned program design scheme involving the algorithm provided in this embodiment can be stored in a computer-readable storage medium in a coded form, and implemented in the form of a computer program, and the basic parameter information required for the calculation is input through computer hardware, and the calculation result is output.
[0073] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, 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. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0074] The present invention is described with reference to flowcharts of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process in the flowchart, as well as the combination of processes in the flowchart, can be implemented by computer program instructions. These computer program instructions can 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 process in the flowchart. Figure 1 A device that specifies functions in a process or multiple processes.
[0075] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple functions specified in a flowchart.
[0076] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.
[0077] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
[0078] This patent is not limited to the above-mentioned optimal implementation mode. Anyone can derive other forms of local classification methods of power quality disturbances based on the dual attention mechanism under the inspiration of this patent. All equal changes and modifications made according to the scope of the patent application of the present invention should be covered by this patent.
Claims
1. A local classification method for power quality disturbances based on a dual attention mechanism, characterized in that: The following steps are involved: Step S1: performing per-unit calculation on the input power quality disturbance signal according to the per-unit value of the power quality to obtain a per-unit signal, and considering the signal as a function f(t); Step S2: Use Hilbert transform on f(t) to calculate its instantaneous amplitude, i.e., envelope A(t); Step S3: Take A(t) as the attention weight of f(t), perform weighted calculation on f(t) and obtain the local attention signal L(t): L(t)=A(t)·f(t) (4) Step S4: Use convolutional neural network CNN and SENet to build a local classification model for power quality disturbances: Use the convolutional layer Conv and SENet in the convolutional neural network CNN to build a deep learning classification model based on the channel attention mechanism. The importance of each convolution kernel channel in the convolutional layer Conv is obtained through SENet, and the channel is assigned a weight; Step S5: inputting the local attention signal L(t) obtained in step S3 into the power quality disturbance local classification model in step S4, and outputting the power quality disturbance local classification result after deep learning training; Step S2 specifically includes the following steps: Step S21: X i Perform Hilbert transform H(t) on f(t): pv in formula (1) is the Cauchy principal value integral; Step S22: Calculate the analytical signal f of the input signal f(t) using H(t) a (t): f a (t)=f(t)+iH(t)=A(t)e iθ(t) (2) Step S23: According to f a (t) Calculate the instantaneous amplitude A(t) of the input signal f(t): Step S4 specifically includes the following steps: Step S41: For an input signal X of length n, the c convolution kernels in the convolutional neural network obtain a matrix X of dimension n×1×c after each convolution. c , at this time X c The weights of each channel in are the default weights; Step S42: F in SENet sq X c The n elements in each convolution kernel of are globally averaged and the matrix X c Compressed to 1×1×c feature matrix X sq : X sq =F sq (X c )=Avg([x1,x2...x n ]) (5) Step S43: F in SENet ex The weight W obtained by training the fully connected neural network FC is used to calculate the feature matrix X sq Perform nonlinear transformation to obtain the corresponding channel weight W of each convolution kernel c : W c =F ex (X sq ,W)=W·X sq (6) Step S44: F in SENet sc The input matrix X and channel weight W c Multiply them together to get the channel attention matrix Y c , at this time Y c Each channel is assigned its own weight: Y c =F sc (X,W c )=W c ·X (7); In each SENet module in the deep learning model, a fully connected layer FC is used to obtain the correlation between channels. The first FC uses ReLU as the activation function to extract the nonlinear weights between channels. τ is a scaling factor to reduce the amount of calculation between channels. The second FC uses Sigmoid as the activation function to standardize the obtained weights. Finally, the obtained vectors are multiplied by the Scale layer, and the standardized weights are weighted to each convolution kernel channel to finally obtain the channel attention matrix Y. c .
2. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for local classification of power quality disturbances based on the dual attention mechanism as described in claim 1 is implemented.
3. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for local classification of power quality disturbances based on a dual attention mechanism as described in claim 1 is implemented.
