Electric energy quality disturbance identification method based on Gramb angle field and improved lightweight residual network
By converting the power quality disturbance signal into a two-dimensional image and using an improved lightweight residual network and convolutional attention mechanism, the spatiotemporal correlation and complexity processing limitations of traditional ResNet in power quality disturbance signal processing are solved, achieving It achieves more efficient feature extraction and classification, reducing computational complexity and training time.
Patent Information
- Application Number
- CN202410864766.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-29
AI Technical Summary
Existing technology has limitations in the processing of spatiotemporal correlation and complex signal patterns of power quality disturbance signals. The traditional ResNet network structure is huge and the number of parameters is large, resulting in low feature extraction efficiency and long training time.
Convert the one-dimensional power quality disturbance signal into a two-dimensional image, use an improved lightweight residual network combined with Gram angle field and convolution attention mechanism (CBAM), and extract features through image processing technology to improve robustness and Classification accuracy.
It effectively retains the spatial information of the signal, reduces the computational complexity, increases the learning speed, significantly improves the classification performance, reduces the amount of parameters and training time, and achieves more efficient power quality disturbance identification.
Smart Images

Figure CN118863631A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of power quality disturbance identification, and in particular to a power quality disturbance identification method based on a Gram angular field and an improved lightweight residual network. Background Art
[0002] In order to keep up with the rapidly developing technological era, the demand for electricity has grown exponentially, which has promoted the promotion and application of multi-energy grid connection and microgrids, and accompanied by the operation of various power electronic equipment in the grid. The widespread use of complex networks and power electronic equipment has brought major challenges to power quality while meeting the growing demand for electricity. Therefore, the detection, analysis, and management of power quality have more practical significance. To ensure the stable operation of the power system, it is necessary to pay attention to power quality disturbances in all aspects of the power system. Accurate identification of power quality disturbances is the cornerstone of ensuring the safe and reliable operation of the power grid system, and it is also an urgent task to improve power quality and reduce the negative impact of disturbance events.
[0003] The power quality disturbance signal is a one-dimensional signal. There are some limitations in directly using one-dimensional convolution to extract features from the disturbance signal, especially in capturing the temporal and spatial correlation of the signal and processing complex signal patterns. As a classic architecture for deep learning, ResNet has excellent performance in image classification tasks. However, the traditional ResNet network structure is large, the number of parameters is large, the training time is long, and the feature extraction efficiency is low. Summary of the invention
[0004] 1. Technical problem to be solved by the invention
[0005] In order to solve the deficiencies in the above-mentioned background technology, the present invention provides a method for identifying power quality disturbances based on Gram angular field and improved lightweight residual network. The present invention converts a one-dimensional power quality disturbance signal into a two-dimensional image, retaining more spatial information, including changes in time and amplitude, so as to more comprehensively express the characteristics of the signal. Based on the converted image, an improved lightweight residual network is used to automatically extract the features of the image. By combining power quality analysis with image processing technology, the present invention is more robust in a noisy environment and can achieve accurate classification for a variety of complex power quality disturbance signals.
[0006] 2. Technical solution
[0007] In order to achieve the above object, the technical solution provided by the present invention is:
[0008] The present invention provides a method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network, the steps of which are as follows:
[0009] S1: Obtain experimental power quality disturbance data and normalize time series data;
[0010] S2: Map the normalized data to the polar coordinate system, calculate the Gram matrix, and convert it into an image;
[0011] S3: Build an improved lightweight residual network model and train the network model;
[0012] S4: Acquire actual power quality disturbance data to process steps S1 and S2, and use the trained lightweight residual network to extract and classify image features to obtain recognition results.
[0013] Furthermore, step S1 establishes 24 power quality disturbance signal models according to the definition of power quality disturbance signals in the IEEE1159 standard, and generates 24 disturbance signal data through MATLAB, including 8 single disturbance signals, namely, sinusoidal wave signals, voltage sags, voltage swells, voltage interruptions, transient oscillations, transient pulses, flickers, and harmonics, and 16 composite disturbance signals composed of multiple single disturbance signals.
[0014] Furthermore, step S1 adds white noise with signal-to-noise ratios of 20 dB, 30 dB, 40 dB, and 50 dB to the generated disturbance signal respectively.
[0015] Furthermore, step S1 uses a maximum-minimum calibrator to normalize the disturbance signal data and scale the time series to the interval [-1,1].
[0016] Furthermore, the lightweight residual network model constructed in the image input step S3 first passes through the Conv1 convolution block and the maximum pooling operation layer Maxpool, then passes through four network layers consisting of stage1, stage2, stage3, and stage4, and then passes through the CBAM module. The feature map output by the CBAM module is subjected to global average pooling and Dropout operations and then input into the fully connected layer for classification.
[0017] Furthermore, the stage1, stage2, stage3, and stage4 network layers are composed of 3, 4, 6, and 3 basic residual blocks, respectively.
[0018] Furthermore, the basic residual block includes a 3*3 convolutional layer, a batch normalization layer, and an ELu activation function layer connected in sequence, and L2 regularization is introduced in the convolutional layer.
[0019] Furthermore, the CBAM module includes a spatial attention module and a channel attention module. The feature maps output by the stage4 network layer are subjected to maximum pooling and average pooling to obtain two one-dimensional feature maps, and then the two one-dimensional feature maps are passed into the multi-layer perceptron MLP for corresponding element addition and activation, and then multiplied with the feature map output by stage4 to obtain a channel attention feature map, and then the channel attention feature map is subjected to maximum pooling and average pooling in the channel dimension to obtain two two-dimensional feature maps, and the two two-dimensional feature maps are dimensionally spliced. The spliced feature map is passed through a convolutional layer to generate a spatial attention feature map, which is then multiplied with the channel attention feature map to obtain the feature map finally output by the CBAM module.
[0020] Furthermore, step S3 uses the Adam algorithm as the optimizer with a learning rate of 0.0001, calculates the output through forward propagation, calculates the loss based on the cross entropy loss function, and then uses back propagation to update the parameters of the model to achieve the optimal hyperparameters of the model.
[0021] 3. Beneficial effects
[0022] Compared with the existing known technologies, the technical solution provided by the present invention has the following significant effects:
[0023] (1) The present invention discloses a power quality disturbance identification method based on the Gram angular field and the improved lightweight residual network. The original one-dimensional disturbance signal is converted through the Gram angular field, and the target information contained in the one-dimensional signal is effectively mapped into features on a two-dimensional image. Compared with the one-dimensional signal, the two-dimensional image can retain more spatial information, including changes in time and amplitude, thereby more comprehensively expressing the characteristics of the signal.
[0024] (2) A power quality disturbance identification method based on Gram angular field and improved lightweight residual network of the present invention is combined with image processing method to extract features and classify the converted image. The core of the original ResNet34 network model is its residual structure, but the original residual structure has too many layers and a large number of parameters, which makes training time-consuming. The present invention is guided by improving classification performance, reducing the number of parameters and the total training time, and improves the original residual structure, thereby reducing computational complexity and improving learning speed. In order to ensure that the improved model can better focus on key features, dynamically adjust the importance of each channel and spatial position in the feature map, and consider the computational efficiency problem, the present invention introduces the convolutional attention mechanism CBAM. CBAM combines channel attention and spatial attention to achieve double refinement of input features. CBAM concentrates computing resources on useful features and ignores useless features. Its feature extraction capability can be significantly improved. At the same time, through global pooling and simple convolution operations, CBAM can bring performance improvement while maintaining low computational complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is the waveform diagram of 8 single disturbance signals;
[0026] Figure 2 It is a two-dimensional image after the one-dimensional disturbance signal is transformed by the Gram angle field;
[0027] Figure 3 This is a diagram of an improved lightweight residual network model in the present invention;
[0028] Figure 4 Schematic diagram of a simplified basic residual block structure in the present invention;
[0029] Figure 5 It is a structural diagram of the convolutional attention CBAM module in the present invention;
[0030] Figure 6 Schematic diagram of the structure of the channel attention module in the present invention;
[0031] Figure 7 Schematic diagram of the structure of the spatial attention module in the present invention;
[0032] Figure 8 It is a comparison diagram of the results of the embodiments;
[0033] Fig. 9 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0034] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments.
[0035] Example 1
[0036] Combination Fig. 9 , a method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network in this embodiment includes the following steps:
[0037] S1: According to the definition of power quality disturbance signal in IEEE1159 standard, 24 power quality disturbance signal models are established, and 24 disturbance signal data are generated by MATLAB, including 8 single disturbance signals, namely sinusoidal wave signal, voltage sag, voltage swell, voltage interruption, transient oscillation, transient pulse, flicker, and harmonic, and 16 composite disturbance data samples composed of multiple single disturbance signals. The waveforms are as follows: Figure 1As shown (only a single disturbance signal is shown). The sampling period is 10 cycles, the length is 0.2 seconds, the sampling frequency is 3915Hz, the number of sampling points is 784, and white noise with signal-to-noise ratios of 20dB, 30dB, 40dB, and 50dB is added to the signal. A total of 120,000 data samples are generated, and each disturbance signal corresponds to 1,000 samples of the four different noises and the noise-free environment.
[0038] Normalize the sample data and use the maximum-minimum calibrator to scale the time series to the [-1,1] interval:
[0039]
[0040] Where X is a given time series, x i is the sampling value of the i-th point, x~ i is the normalized value.
[0041] S2: Map the normalized data in step S1 to the polar coordinate system:
[0042]
[0043] in, For normalized time series, each time point data contains two pieces of information: one is the normalized value x of the data point The other is its temporal position t i , φ is the angle mapped to polar coordinates, N is the number of time points contained in the time series data, the time dependence of the sequence is maintained by the radius r, and the polar angle φ retains the numerical relationship.
[0044] After mapping the time series data to the polar coordinate system, the Gram angle field defines its own inner product,<x1,x2> =cos(φ1+φ2), the inner product between two time points is the cosine of the sum of the polar angles of the two time points after polar coordinate transformation. The Gram matrix is calculated by cosine:
[0045]
[0046] Call the matplotlib.pyplot function in Python to convert the Gram matrix into a two-dimensional image with an image size of 224*224*3. The converted image is as follows Figure 2 shown.
[0047] The converted images are divided into training set and test set in a ratio of 8:2. 800 images of each perturbation type are used for training and 200 images are used for testing. It is ensured that the data used for the test set does not exist in the training set and does not participate in any model training process.
[0048] S3: Build an improved lightweight residual network model, such as Figure 3 As shown in the figure, the network model first passes through the Conv1 convolution block including 7×7 convolution and the 3×3 maximum pooling operation layer Maxpool; then passes through 4 network layers consisting of stage1, stage2, stage3, and stage4, where each network layer consists of 3, 4, 6, and 3 basic residual blocks respectively. The basic residual block is shown in Figure 4 As shown in Figure 1, it consists of a 3*3 convolutional layer, a batch normalization layer, and an ELu activation function layer. L2 regularization is introduced in the convolutional layer. Then it passes through the CBAM module, the module structure is as follows Figure 5 As shown in Figure 1, it mainly includes two parts: spatial attention module and channel attention module. Figure 6 and Figure 7 , the feature maps output by stage4 are subjected to maximum pooling and average pooling to obtain two one-dimensional feature maps, and then these two one-dimensional feature maps are passed to the multi-layer perceptron MLP for corresponding element addition and activation, and then multiplied with the feature map output by stage4 to obtain the channel attention feature map, and then the channel attention feature map is subjected to maximum pooling and average pooling in the channel dimension to obtain two two-dimensional feature maps, and the two two-dimensional feature maps are spliced in dimension. The spliced feature map is passed through a 7x7 convolution layer to generate a spatial attention map, and then multiplied with the channel attention feature map to obtain the feature map finally output by the CBAM module. Finally, the feature map output by the CBAM module is subjected to global average pooling and Dropout operations and then input into the fully connected layer for classification. The features extracted by the CBAM module are converted into a fixed-length vector by calculating the average value of all elements through global average pooling, and finally classified by the classification layer.
[0049] It is worth noting that the core of the original ResNet34 model is its residual structure. However, the residual structure in the ResNet34 network has too many layers and a large number of parameters, which makes training time-consuming. Therefore, the present invention is guided by reducing the number of parameters and training time, and optimizes its residual structure, simplifying the original multi-layer convolution to a single-layer convolution. The adjustment includes removing a convolution layer of size 3*3, a batch normalization layer, and an activation function layer.
[0050] Compared with the ReLu function, the ELu function is continuous and differentiable at all points, the gradient is non-zero for all negative values, and there is no neuron death problem. Therefore, the ELu function is used to replace the ReLu function in the ResNet34 network, so that the model can converge faster during training and achieve higher accuracy.
[0051] The present invention adds the CBAM attention mechanism after the fourth stage in the original ResNet34 network, combines channel attention and spatial attention to perform double refinement on the input features, and improves the representation ability and classification accuracy of the model while maintaining low additional computational costs through global pooling and simple convolution operations.
[0052] S4: Use the training set to train the improved lightweight residual network model, use the Adam algorithm as the optimizer, and the learning rate is 0.0001. The output is calculated through forward propagation, and then the loss is calculated according to the loss function of the Adam optimization algorithm. Then, back propagation is used to update the parameters of the model to achieve the optimal hyperparameters of the model. The parameter configuration after fine-tuning is shown in Table 1.
[0053] Table 1 Parameter configuration table
[0054]
[0055] S5: In the identification of power quality disturbances, the signal is input into the trained improved lightweight residual network model, and finally the identification result is obtained.
[0056] Figure 8 The results of the method proposed in this embodiment are compared in the original ResNet34 network, the ResNet34 network that has only undergone structural optimization, and the CNN, including three aspects: recognition accuracy, model parameter quantity, and total training and testing time. The red box is the method proposed in this embodiment. Compared with the original network, the method proposed in this embodiment has an improvement of 0.25% in classification accuracy, the number of model parameters is reduced by half, and the total training and testing time is reduced by half, which realizes the lightweight of the network and reduces the time cost.
[0057] The present invention and its embodiments are described schematically above, and the description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired by it and designs a structural method and an embodiment similar to the technical solution without creativity without departing from the purpose of the invention, they shall all fall within the protection scope of the present invention.
Claims
1. A power quality disturbance identification method based on Gram angular field and improved lightweight residual network, It is characterized in that The steps are: S1: Obtain experimental power quality disturbance data and normalize time series data; S2: Map the normalized data to the polar coordinate system, calculate the Gram matrix, and convert it into an image; S3: Build an improved lightweight residual network model and train the network model; S4: Acquire actual power quality disturbance data to process steps S1 and S2, and use the trained lightweight residual network to extract and classify image features to obtain recognition results.
2. According to claim 1, a method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network, Features: Step S1 establishes 24 power quality disturbance signal models according to the definition of power quality disturbance signals in the IEEE1159 standard, and generates 24 disturbance signal data through MATLAB, including 8 single disturbance signals, namely, sinusoidal wave signals, voltage sags, voltage swells, voltage interruptions, transient oscillations, transient pulses, flickers, and harmonics, and 16 composite disturbance signals composed of multiple single disturbance signals.
3. A method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network according to claim 2, Features: Step S1 adds white noise with signal-to-noise ratios of 20 dB, 30 dB, 40 dB, and 50 dB to the generated disturbance signal respectively.
4. A method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network according to claim 3, Features: Step S1 uses a maximum-minimum calibrator to normalize the disturbance signal data and scale the time series to the interval [-1,1].
5. A method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network according to any one of claims 1 to 4, Features: The lightweight residual network model constructed in the image input step S3 first passes through the Conv1 convolution block and the maximum pooling operation layer Maxpool, then passes through the four network layers consisting of stage1, stage2, stage3, and stage4, and then passes through the CBAM module. The feature map output by the CBAM module is subjected to global average pooling and Dropout operations and then input into the fully connected layer for classification.
6. A method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network according to claim 5, Features: The stage1, stage2, stage3, and stage4 network layers are composed of 3, 4, 6, and 3 basic residual blocks, respectively.
7. A method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network according to claim 6, Features: The basic residual block consists of a 3*3 convolutional layer, a batch normalization layer, and an ELu activation function layer connected in sequence, and L2 regularization is introduced in the convolutional layer.
8. A method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network according to claim 7, Features: The CBAM module includes a spatial attention module and a channel attention module. The feature maps output by the stage4 network layer are subjected to maximum pooling and average pooling to obtain two one-dimensional feature maps, and then the two one-dimensional feature maps are passed into the multi-layer perceptron MLP for corresponding element addition and activation, and then multiplied with the feature map output by stage4 to obtain a channel attention feature map, and then the channel attention feature map is subjected to maximum pooling and average pooling in the channel dimension to obtain two two-dimensional feature maps, and the two obtained two-dimensional feature maps are dimensionally spliced. The spliced feature map is passed through a convolutional layer to generate a spatial attention feature map, and then multiplied with the channel attention feature map to obtain the feature map finally output by the CBAM module.
9. A method for identifying power quality disturbances based on Gram angle field and improved lightweight residual network according to claim 8, Features: Step S3 uses the Adam algorithm as the optimizer with a learning rate of 0.0001. The output is calculated through forward propagation, and the loss is calculated according to the cross entropy loss function. Then, the parameters of the model are updated using back propagation to achieve the optimal hyperparameters of the model.
Citation Information
Cited By
Aluminum alloy mark identification method based on lightweight spectrum attention network
CN119513576A
Tumor single cell identification method based on residual network, microfluidic device and equipment
CN119807842A
Disturbance identification method based on Gramb angle difference field and transfer learning
CN120431340A
A disturbance identification method based on gram angle difference field and transfer learning
CN120431340B
Voltage sag state estimation method based on space-time three-dimensional tensor
CN120577640A
