A power quality disturbance classification method based on feature fusion and dense network

By converting one-dimensional power quality disturbance signals into Markov transfer field and Gram angle field images, and combining feature fusion with a dense network model and attention mechanism, the problem of insufficient feature representation in complex disturbance scenarios is solved, and high-precision power quality disturbance classification is achieved.

CN122244569APending Publication Date: 2026-06-19HUNAN NORMAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN NORMAL UNIVERSITY
Filing Date
2026-05-22
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing power quality disturbance classification methods lack the ability to express features in complex disturbance scenarios, rely on manual feature design, and have low classification accuracy.

Method used

One-dimensional power quality disturbance signals are converted into Markov transfer field and Gram angle field images, feature fusion is performed, and feature extraction is performed through feature fusion and dense network model. Channel and spatial attention mechanisms are introduced for weighted processing.

Benefits of technology

It enhances the expressive power of complex perturbation features, alleviates the gradient vanishing problem, improves classification accuracy and robustness, and reduces the dependence on manual feature design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244569A_ABST
    Figure CN122244569A_ABST
Patent Text Reader

Abstract

This invention discloses a power quality disturbance classification method based on feature fusion and dense networks. The method first converts a one-dimensional signal into a Markov transfer field image and a Gram angle field image, and then fuses them. Subsequently, the fused two-dimensional image is input into a densely connected convolutional neural network model for feature extraction, where the dense connection structure enables the transfer and reuse of feature information. During feature extraction, channel attention and spatial attention mechanisms are further introduced to weight the features. Finally, the power quality disturbance classification result is output based on the weighted features. This invention employs an end-to-end modeling approach to achieve automatic feature extraction and classification of power quality disturbance signals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power quality analysis technology, specifically to a power quality disturbance classification method based on feature fusion and dense networks. Background Technology

[0002] With the continuous expansion of power system scale and the large-scale integration of new energy sources and power electronic equipment, the power grid operating environment is becoming increasingly complex, and power quality disturbances are becoming more prominent. Disturbances such as harmonics, voltage sags, voltage swells, and voltage interruptions not only affect the safe and stable operation of the power system but may also damage sensitive electrical equipment. Therefore, accurate identification and classification of power quality disturbances are of great significance for power grid operation monitoring and fault diagnosis.

[0003] Currently, methods for identifying power quality disturbances mainly include traditional signal processing-based methods and deep learning-based methods. Traditional methods typically extract signal features using techniques such as Fourier transform, wavelet transform, S-transform, or empirical mode decomposition, and then use support vector machines, decision trees, or neural networks for classification. However, these methods rely heavily on manual feature design, have limited feature representation capabilities in complex disturbance environments, and are difficult to adapt to various disturbance scenarios.

[0004] In recent years, deep learning methods have been increasingly applied to the classification of power quality disturbances. Convolutional neural networks can automatically extract features and reduce manual intervention, but models based on one-dimensional signals still lack the ability to express temporal features under complex disturbance conditions, and are prone to gradient vanishing problems in deep networks, thus affecting classification performance. To improve feature representation capabilities, some studies have converted one-dimensional disturbance signals into two-dimensional images, for example, by encoding them using the Gram corner field method and combining them with image classification models for recognition. Although this type of method improves feature representation capabilities to some extent, it still has the following shortcomings: on the one hand, a single encoding method is difficult to comprehensively represent the multi-dimensional feature information of disturbance signals; on the other hand, existing network structures still have room for improvement in feature reuse capabilities and key feature extraction.

[0005] Therefore, how to achieve efficient feature fusion under complex power quality disturbance scenarios and improve the feature expression capability and recognition accuracy of classification models has become an urgent technical problem to be solved. Summary of the Invention

[0006] The technical problem to be solved by this invention is to address the issues of existing power quality disturbance classification methods, such as heavy reliance on manual features, insufficient feature representation capabilities in complex disturbance scenarios, and low classification accuracy. This invention provides a power quality disturbance classification method based on feature fusion and dense networks to improve the accuracy and robustness of disturbance type identification in complex power grid environments.

[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0008] A power quality disturbance classification method based on feature fusion and dense networks includes the following steps:

[0009] S101, converts the one-dimensional power quality disturbance signal into Markov transfer field MTF image and Gram angle field GAF ​​image respectively;

[0010] S102, perform feature fusion on the MTF image and GAF ​​image to obtain a fused two-dimensional image;

[0011] S103, the fused two-dimensional image is input into a pre-constructed feature fusion and dense network model for feature extraction, wherein the feature fusion and dense network model includes a dense connection structure;

[0012] S104 introduces channel attention mechanism and spatial attention mechanism in the feature extraction process to perform weighted processing on features;

[0013] S105, output the power quality disturbance classification results based on the weighted features;

[0014] Optionally, in step S101, the step of converting the one-dimensional power quality disturbance signal into a Markov transfer field (MTF) image and a Gram angle field (GAF) image respectively includes:

[0015] S201, Constructing the transition matrix using MTF image encoding. ;

[0016] S202, by extending the Markov transition matrix Construct an n×n Markov transition field ;

[0017] S203, using GAF two-dimensional image encoding to encode a one-dimensional time series Adjust to the range [-1, 1];

[0018] S204, GAF maps time series values ​​to angles. The GASF matrix is ​​calculated by summing the inner products according to the defined angles. ;

[0019] Optionally, in step S201, an s×s Markov transition matrix is ​​constructed using MTF image encoding. Its function expression is

[0020] ,

[0021] In the above formula, and For each pair of adjacent time sampling points, their quantile intervals are respectively and ;

[0022] Optionally, in step S202, the Markov transition matrix is ​​extended. Construct an n×n Markov transition field Its function expression is

[0023] ,

[0024] In the above formula, For the first The sampled values ​​of each sampling point express The range to which it belongs;

[0025] Optionally, in step S203, the GAF two-dimensional image encoding method encodes the one-dimensional time series using the following formula. Adjust to the range [-1, 1]

[0026] ;

[0027] Optionally, in step S204, GAF maps the values ​​of the time series to angles. ,

[0028] ,

[0029] The GASF matrix is ​​calculated by summing the inner product according to the defined angle. Its function expression is

[0030] ;

[0031] Optionally, in step S102, the step of fusing the MTF image and the GAF image to obtain the fused two-dimensional image includes:

[0032] S301, the MTF image and GAF ​​image are respectively input into the Restormer module of the dual-branch encoder, and shallow global features are extracted by the shared feature encoder extraction unit. and ;

[0033] S302, the basic Transformer encoder uses a long-range Transformer module with spatial self-attention to extract long-range dependency features from shallow features. , Extracting low-frequency fundamental information from images and ;

[0034] The S303 detail CNN encoder employs a lossless, reversible neural network feature extraction module to extract high-frequency detail information from shallow features. and ;

[0035] S304, Basic features of MTF and GAF ​​images and detailed features Perform fusion processing;

[0036] S305 takes the fused features as input and concatenates them along the channel dimension to obtain a fused two-dimensional image. ;

[0037] Optionally, in step S103, the step of feature fusion and dense network model including dense connection structure includes:

[0038] S401, for the first The input of a layer is obtained by concatenating the outputs of all preceding layers along the channel dimension. ;

[0039] S402, to further reduce computational complexity, introduces a bottleneck structure in the dense block to calculate the corresponding number of parameters. ;

[0040] S403, a densely connected structure, has significant advantages in gradient propagation, especially for the first... Layer, calculate gradient as ;

[0041] Optionally, in step S401, for the first The input of a layer is obtained by concatenating the outputs of all preceding layers along the channel dimension. ,

[0042] ,

[0043] In the above formula, Indicates the first The output feature map of the layer; This represents the concatenation operation of feature maps along the channel dimension; This represents a nonlinear mapping function, consisting of batch normalization, ReLU activation function, and convolution operation;

[0044] Optionally, in step S402, to further reduce computational complexity, a bottleneck structure is introduced into the dense block, corresponding to a certain number of parameters. for

[0045] ,

[0046] In the above formula, Indicates the first The number of parameters in the layer; Input the number of channels; Represents the growth rate;

[0047] Optionally, in step S403, the densely connected structure has significant advantages in the gradient propagation process, for the first... Layer, its gradient for

[0048] ,

[0049] In the above formula, Indicates the total number of network layers; For the loss function on the th The gradient of the layer output;

[0050] Optionally, in step S104, the steps of introducing channel attention mechanism and spatial attention mechanism during feature extraction, and weighting the features, include:

[0051] S501, Input feature map Perform global average pooling and global max pooling respectively to obtain the feature descriptions of the corresponding channels. and ;

[0052] S502, the channel feature description is input into a multilayer perceptron (MLP) for feature transformation, and the output results are summed and then processed by a sigmoid function to generate channel attention weights. ;

[0053] S503, the channel attention weights are weighted channel-by-channel with the input feature map to obtain the channel-enhanced feature map. ;

[0054] S504, Feature map after channel enhancement Average pooling and max pooling are performed along the channel dimension to obtain two spatial feature maps. and ;

[0055] S505 concatenates the channel-enhanced feature maps along the channel dimension, extracts spatial correlations through a convolutional layer, and generates spatial attention weights using a sigmoid function. ;

[0056] S506, perform element-wise multiplication of the spatial attention weights with the channel enhancement feature map to obtain the weighted output feature map. ;

[0057] Optionally, in step S502, the channel feature description is input into a multilayer perceptron (MLP) for feature transformation, and the output results are summed and then channel attention weights are generated using a sigmoid function. ,

[0058] ,

[0059] In the above formula, Indicates channel attention weights; This represents a nonlinear mapping containing a two-layer fully connected structure. Use the Sigmoid activation function;

[0060] Optionally, in step S505, the channel-enhanced feature maps are concatenated along the channel dimension, and spatial correlations are extracted through a convolutional layer and spatial attention weights are generated using a sigmoid function. ,

[0061] ,

[0062] In the above formula, [ ; ] indicates spatial attention weights; [ ; ] indicates channel splicing operations; This indicates a convolution operation with a kernel size of 3×3;

[0063] Optionally, in step S506, the spatial attention weights are multiplied element-wise with the channel enhancement feature map to obtain the weighted output feature map. ,

[0064] ,

[0065] In the above formula, The output feature map is weighted by the attention mechanism; This represents the weighted function composed of both channel attention and spatial attention; This represents an element-wise multiplication operation;

[0066] Optionally, before inputting multiple types of power quality disturbance signals into a pre-trained feature fusion and dense network model to obtain the classification results of the power quality disturbance signals, the method further includes the step of training the feature fusion and dense network model:

[0067] S601, construct a dataset containing multiple categories of power quality disturbance signals, and divide it into training and test sets;

[0068] S602 converts the one-dimensional power quality disturbance signal in the training set into a fused two-dimensional image;

[0069] S603, the fused two-dimensional image is input into the feature fusion and dense network model for training, and the model parameters are updated through backpropagation;

[0070] S604, when the preset training termination condition is met, the trained feature fusion and dense network model is obtained;

[0071] S605 uses a test set to verify the classification performance of the trained model.

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

[0073] 1. By converting one-dimensional perturbation signals into two-dimensional images and performing feature fusion, the expressive power of complex perturbation features is effectively improved;

[0074] 2. By introducing a dense connection structure, the feature reuse rate is improved, the gradient vanishing problem is alleviated, and the model stability is enhanced;

[0075] 3. By introducing channel and spatial attention mechanisms, the model's ability to focus on key feature regions is improved, thereby enhancing classification accuracy;

[0076] 4. This method does not rely on manual feature design and has a high degree of automation and engineering application value. Attached Figure Description

[0077] Figure 1 This is the overall process of the power quality disturbance classification method based on feature fusion and dense network described in this invention.

[0078] Figure 2 This is a schematic diagram of the CDDFuse module structure used in this invention to achieve multi-source feature fusion.

[0079] Figure 3 This is a schematic diagram of the T-DenseNet dense network module structure of the present invention.

[0080] Figure 4 This is a schematic diagram of the core dense block structure of the T-DenseNet dense network of the present invention.

[0081] Figure 5 This is a schematic diagram of the attention module structure that combines channel attention and spatial attention according to the present invention. (a) represents the channel attention module; (b) represents the spatial attention module; and (c) represents the product of the spatial attention weights and the channel attention weights.

[0082] Figure 6 This is a comparison chart showing the accuracy of the present invention and different comparative models in the power quality disturbance classification task. Detailed Implementation

[0083] To more clearly illustrate the technical solutions and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the described embodiments are only for explaining the present invention and are not intended to limit the scope of protection of the present invention.

[0084] This embodiment provides a power quality disturbance classification method based on feature fusion and dense networks. This method constructs a deep learning model that fuses multi-source features to achieve automatic identification and classification of power quality disturbance signals. For example... Figure 1 As shown, this feature fusion and dense network-based model includes:

[0085] S101, converts the one-dimensional power quality disturbance signal into Markov transfer field MTF image and Gram angle field GAF ​​image respectively;

[0086] S102, the MTF image and GAF ​​image are input to the feature fusion module CDDFuse for feature fusion to obtain a fused two-dimensional image;

[0087] S103, the fused two-dimensional image is input into a pre-constructed feature fusion and dense network model for feature extraction, wherein the feature fusion and dense network model includes a dense connection structure T-DenseNet;

[0088] S104 introduces channel attention mechanism and spatial attention mechanism CBAM during feature extraction to perform weighted processing on features;

[0089] S105, output the power quality disturbance classification results based on the weighted features;

[0090] According to the power quality disturbance classification method based on feature fusion and dense network model, the CDDFuse module converts one-dimensional signals into two-dimensional signals and fuses them, compensating for the loss of static information in MTF and the poor handling of nonlinear or non-uniform sequences by GAF. The network adopts a T-DenseNet structure, first passing through a convolutional layer with a 7×7 convolution kernel and a stride of 2; then passing through a pooling layer with a 3×3 max pooling and a stride of 2; next, entering dense block layer 1, which consists of [1×1 convolution, 3×3 convolution] repeated 3 times; then a transition layer successively containing 1×1 convolution and 2×2 average pooling with a stride of 2; then dense block layer 2, which consists of [1×1 convolution, 3×3 convolution] repeated 6 times; then passing through another transition layer successively containing 1×1 convolution and 2×2 average pooling with a stride of 2; finally, dense block layer 3, which consists of [1×1 convolution, 3×3 convolution] repeated 9 times. After passing through a transition layer, which successively contains 1×1 convolutions and 2×2 average pooling with a stride of 2; finally, there is a dense block layer 4, which consists of [1×1 convolutions and 3×3 convolutions] repeated 6 times; the CBAM module introduces an attention mechanism in the channel and spatial dimensions to improve network performance.

[0091] In this embodiment, step S101, which involves converting the one-dimensional power quality disturbance signal into a Markov transfer field (MTF) image and a Gram angle field (GAF) image, includes:

[0092] S201, Constructing the transition matrix using MTF image encoding. ;

[0093] S202, by extending the Markov transition matrix Construct an n×n Markov transition field ;

[0094] S203, using GAF two-dimensional image encoding to encode a one-dimensional time series Adjust to the range [-1, 1];

[0095] S204, GAF maps time series values ​​to angles. The GASF matrix is ​​calculated by summing the inner products according to the defined angles. ;

[0096] Optionally, in step S201, an s×s Markov transition matrix is ​​constructed using MTF image encoding. Its function expression is

[0097] ,

[0098] In the above formula, and For each pair of adjacent time sampling points, their quantile intervals are respectively and ;

[0099] Optionally, in step S202, the Markov transition matrix is ​​extended. Construct an n×n Markov transition field Its function expression is

[0100] ,

[0101] In the above formula, For the first The sampled values ​​of each sampling point express The range to which it belongs;

[0102] Optionally, in step S203, the GAF two-dimensional image encoding method encodes the one-dimensional time series using the following formula. Adjust to the range [-1, 1]

[0103] ,

[0104] Optionally, in step S204, GAF maps the values ​​of the time series to angles. ,

[0105] ,

[0106] The GASF matrix is ​​calculated by summing the inner product according to the defined angle. Its function expression is

[0107] ;

[0108] In this embodiment, step S102, which involves fusing the MTF image and the GAF image to obtain a fused two-dimensional image, includes:

[0109] S301, the MTF image and GAF ​​image are respectively input into the Restormer module of the dual-branch encoder, and shallow global features are extracted by the shared feature encoder extraction unit. and ;

[0110] S302, the basic Transformer encoder uses a long-range Transformer module with spatial self-attention to extract long-range dependency features from shallow features. , Extracting low-frequency fundamental information from images and ;

[0111] The S303 detail CNN encoder employs a lossless, reversible neural network feature extraction module to extract high-frequency detail information from shallow features. and ;

[0112] S304, Basic features of MTF and GAF ​​images and detailed features Perform fusion processing;

[0113] S305 takes the fused features as input and concatenates them along the channel dimension to obtain a fused two-dimensional image. ;

[0114] In this embodiment, step S103, which involves feature fusion and a dense network model including a dense connection structure, includes:

[0115] S401, for the first The input of a layer is obtained by concatenating the outputs of all preceding layers along the channel dimension. ;

[0116] S402, to further reduce computational complexity, introduces a bottleneck structure in the dense block to calculate the corresponding number of parameters. ;

[0117] S403, a densely connected structure, has significant advantages in gradient propagation, especially for the first... Layer, calculate gradient as ;

[0118] Optionally, in step S401, for the first The input of a layer is obtained by concatenating the outputs of all preceding layers along the channel dimension. Its function expression is

[0119] ,

[0120] In the above formula, Indicates the first The output feature map of the layer; This represents the concatenation operation of feature maps along the channel dimension; This represents a nonlinear mapping function, consisting of batch normalization, ReLU activation function, and convolution operation;

[0121] Optionally, in step S402, to further reduce computational complexity, a bottleneck structure is introduced into the dense block, corresponding to a certain number of parameters. for

[0122] ,

[0123] In the above formula, Indicates the first The number of parameters in the layer; The input channel number is k; k represents the growth rate.

[0124] Optionally, in step S403, the densely connected structure has significant advantages in the gradient propagation process, for the first... Layer, its gradient for

[0125] ,

[0126] In the above formula, Indicates the total number of network layers; For the loss function on the th The gradient of the layer output;

[0127] In this embodiment, step S104, which involves introducing channel attention and spatial attention mechanisms during feature extraction and performing weighted processing on the features, includes:

[0128] S501, Input feature map Perform global average pooling and global max pooling respectively to obtain the feature descriptions of the corresponding channels. and ;

[0129] S502, the channel feature description is input into a multilayer perceptron (MLP) for feature transformation, and the output results are summed and then processed by a sigmoid function to generate channel attention weights. ;

[0130] S503, the channel attention weights are weighted channel-by-channel with the input feature map to obtain the channel-enhanced feature map. ;

[0131] S504, Feature map after channel enhancement Average pooling and max pooling are performed along the channel dimension to obtain two spatial feature maps. and ;

[0132] S505 concatenates the channel-enhanced feature maps along the channel dimension, extracts spatial correlations through a convolutional layer, and generates spatial attention weights using a sigmoid function. ;

[0133] S506, perform element-wise multiplication of the spatial attention weights with the channel enhancement feature map to obtain the weighted output feature map. ;

[0134] Optionally, in step S502, the channel feature description is input into a multilayer perceptron (MLP) for feature transformation, and the output results are summed and then channel attention weights are generated using a sigmoid function. Its function expression is

[0135] ,

[0136] In the above formula, Indicates channel attention weights; This represents a nonlinear mapping containing a two-layer fully connected structure. Use the Sigmoid activation function;

[0137] Optionally, in step S505, the channel-enhanced feature maps are concatenated along the channel dimension, spatial correlation is extracted through a convolutional layer, and spatial attention weights are generated using a sigmoid function. ,

[0138] ,

[0139] In the above formula, [ ; ] indicates spatial attention weights; [ ; ] indicates channel splicing operations; This indicates a convolution operation with a kernel size of 3×3;

[0140] Optionally, in step S506, the spatial attention weights are multiplied element-wise with the channel enhancement feature map to obtain a weighted output feature map. ,

[0141] ,

[0142] In the above formula, The output feature map is weighted by the attention mechanism; This represents the weighted function composed of both channel attention and spatial attention; This represents an element-wise multiplication operation;

[0143] In this embodiment, before inputting various types of power quality disturbance signals into a pre-trained feature fusion and dense network model to obtain the classification results of the power quality disturbance signals, the method further includes the step of training the feature fusion and dense network model:

[0144] S601, construct a dataset containing multiple categories of power quality disturbance signals, and divide it into training and test sets;

[0145] S602 converts the one-dimensional power quality disturbance signal in the training set into a fused two-dimensional image;

[0146] S603, the fused two-dimensional image is input into the feature fusion and dense network model for training, and the model parameters are updated through backpropagation;

[0147] S604, when the preset training termination condition is met, the trained feature fusion and dense network model is obtained;

[0148] S605 uses a test set to verify the classification performance of the trained model.

[0149] To verify the effectiveness of the feature fusion and dense network-based model proposed in this embodiment for the identification and classification of complex power quality disturbance signals, training, validation, and test sets were constructed for experimental verification. Specifically, a power quality disturbance dataset was first constructed, which includes 8 single disturbance signals, 11 double disturbance signals, 8 triple disturbances, and normal grid signals, totaling 28 disturbance types, with 1000 samples in each type. The signal-to-noise ratio (SNR) of each sample was randomly set to 20-50 dB. Based on this, the dataset was divided into training and validation sets in a 4:1 ratio for model training and parameter tuning, with a total of 28,000 samples. Furthermore, an independent test set was constructed for model performance evaluation. This test set also includes 28 types of power quality disturbance signals, with 200 samples in each type, to ensure the objectivity and reliability of the test results. During the model training process in this embodiment, the number of iterations was 50, and the Adam optimizer was used to update the model parameters, with the initial learning rate set to 0.001. To evaluate the model's classification performance in noisy environments, test samples with a signal-to-noise ratio of 30 dB were selected for experimental verification during the testing phase. The classification results obtained based on the above experimental settings are shown in Table 1.

[0150]

[0151] As shown in Table 1, the feature fusion and dense network model proposed in this embodiment outperforms the MTF and GAF ​​models based on a single encoding method in the power quality disturbance classification task. Especially in multi-disturbance scenarios, the model exhibits high recognition accuracy, with classification accuracy exceeding 94% for most categories in triple disturbance types, indicating that the method has good adaptability in complex disturbance recognition. Further analysis shows that in the disturbance type of "fluctuation + voltage swell + harmonics," which has strong feature coupling, the feature fusion and dense network model achieved a classification accuracy of 94.13%. Since this type of disturbance has significant overlap in time and frequency domain features, its recognition is difficult. The method in this embodiment improves the recognition accuracy by approximately 7 percentage points compared to the "MTF and T-DenseNet" models, demonstrating that multi-feature fusion and dense network structures can effectively improve the distinguishability of complex disturbance features.

[0152] Furthermore, to further verify the generalization performance of the method of this invention, four independent test sets were constructed. Each test set contained 28 classes of power quality disturbance signals, with 200 samples in each class. Under the same experimental conditions, different models were compared and tested, and the classification performance comparison results are as follows: Figure 6 As shown in Table 2, the results of the computational complexity comparison are as follows.

[0153]

[0154] Depend on Figure 6 As shown in Table 2, the feature fusion and dense network model proposed in this embodiment has significant advantages in terms of computational complexity and resource consumption. Specifically, its floating-point operation count (FLOPs) is 1.45 × 10⁻⁶. 9 It is lower than ResNet-18 and various DenseNet models; the number of parameters is 4.02×10 6 It is the smallest among all the comparison models; the model storage size is 15.5MB, which is significantly lower than the comparison models; the model training time is 40.12 min, which is also the shortest.

[0155] The above results show that the present invention effectively reduces computational complexity and storage overhead while ensuring model classification performance, and has good lightweight characteristics.

[0156] Furthermore, comparative model analysis shows that while ResNet-18 converges quickly in the early stages of training, its parameter size and storage overhead are relatively large. While the DenseNet series models improve classification performance with increasing network depth, the computational cost and training time increase significantly, with DenseNet-201 reaching the maximum in both model size and runtime. In contrast, the method of this invention does not improve performance by simply increasing network depth, but rather achieves superior classification results with lower complexity through feature fusion and structural optimization. From the training process, the accuracy improvement rate of the feature fusion and dense network model is slightly slower than that of ResNet-18 in the early stages of training, but as training iterations progress, its classification accuracy continuously improves and tends to stabilize, eventually reaching a level comparable to or better than mainstream deep learning models, demonstrating good training stability.

[0157] In summary, compared with existing technologies, the power quality disturbance classification method based on feature fusion and dense networks proposed in this embodiment has the following technical effects: On the one hand, by using multi-source feature encoding and fusion mechanisms, the feature representation capability of disturbance signals is improved, enabling the model to effectively characterize the multidimensional information in complex power quality disturbances; on the other hand, by introducing dense connection structures and attention mechanisms, the feature reuse capability and key feature extraction capability are enhanced, thereby improving the model's recognition accuracy in complex disturbance scenarios; furthermore, this invention adopts an end-to-end modeling approach, which can directly and automatically extract features from the original signal and complete the classification task without relying on manual feature design, reducing the complexity of model construction and improving the efficiency of the method's engineering application; in addition, the method of this invention has strong generalization ability, can effectively identify power quality disturbance types outside the training samples, and still has good adaptability and stability in complex power grid environments.

[0158] Furthermore, this embodiment also provides a power quality disturbance classification system based on feature fusion and dense network model. The system includes a processor and a memory connected to each other. The memory stores a computer program. When the computer program is run on the processor, the processor executes the above-mentioned power quality disturbance classification method.

[0159] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, various equivalent substitutions or modifications made without departing from the technical solution and concept of the present invention should fall within the scope of protection of the present invention.

Claims

1. A power quality disturbance classification method based on feature fusion and dense networks, characterized in that, Includes the following steps: S101, converts the one-dimensional power quality disturbance signal into Markov transfer field MTF image and Gram angle field GAF ​​image respectively; S102, perform feature fusion on the MTF image and GAF ​​image to obtain a fused two-dimensional image; S103, the fused two-dimensional image is input into a pre-constructed feature fusion and dense network model for feature extraction, wherein the feature fusion and dense network model includes a dense connection structure; S104 introduces channel attention mechanism and spatial attention mechanism in the feature extraction process to perform weighted processing on features; S105 outputs the power quality disturbance classification results based on the weighted features.

2. The power quality disturbance classification method based on feature fusion and dense networks according to claim 1, characterized in that, In step S101, converting the one-dimensional power quality disturbance signal into an MTF image and a GAF image respectively includes: S201, construct an s×s Markov transition matrix using MTF image encoding. Its function expression is , In the above formula, and For each pair of adjacent time sampling points, their quantile intervals are respectively and ; S202, calculate the transition probability of the quantile interval between each pair of sampling points, and then extend the Markov transition matrix. Construct an n×n Markov transition field Its function expression is , In the above formula, For the first The sampled values ​​of each sampling point for The range to which it belongs; S203, GAF two-dimensional image encoding method uses the following formula to encode a one-dimensional time series. Adjust to the range [-1, 1] ; S204, GAF maps time series values ​​to angles. , , The GASF matrix is ​​calculated by summing the inner product according to the defined angle. Its function expression is 。 3. The power quality disturbance classification method based on feature fusion and dense networks according to claim 1, characterized in that, In step S102, feature fusion of the MTF image and GAF ​​image includes: S301, the MTF image and GAF ​​image are respectively input into the Restormer module of the dual-branch encoder, and shallow global features are extracted by the shared feature encoder extraction unit. and ; S302, the basic Transformer encoder uses a long-range Transformer module with spatial self-attention to extract long-range dependency features from shallow features. , Extracting low-frequency fundamental information from images and ; The S303 detail CNN encoder employs a lossless, reversible neural network feature extraction module to extract high-frequency detail information from shallow features. and ; S304, Basic features of MTF and GAF ​​images and detailed features Perform fusion processing; S305 takes the fused features as input and concatenates them along the channel dimension to obtain a fused two-dimensional image. .

4. The power quality disturbance classification method based on feature fusion and dense networks according to claim 1, characterized in that, The feature fusion and dense network in step S103 include: S401, p. The input of a layer is obtained by concatenating the outputs of all its preceding layers along the channel dimension. , In the above formula, x l For the first The output feature map of the layer; This refers to the concatenation operation of feature maps along the channel dimension. It is a nonlinear mapping function, consisting of batch normalization, ReLU activation function and convolution operation; S402, In the densely connected structure, a bottleneck structure is set to compress the number of feature channels, thereby reducing computational complexity and the corresponding number of parameters. for , In the above formula, For the first The number of parameters in the layer; Input the number of channels; The growth rate; S403, for the first The gradient of the densely connected structure of the layer is , In the above formula, This represents the total number of network layers. For the loss function on the th The gradient output by the layer.

5. The power quality disturbance classification method based on feature fusion and dense networks according to claim 1, characterized in that, The channel attention mechanism and spatial attention mechanism in step S104 include: S501, Input feature map Perform global average pooling and global max pooling respectively to obtain the feature descriptions of the corresponding channels. and ; S502, the channel feature description is input into a multilayer perceptron (MLP) for feature transformation, and the output results are summed and then processed by a sigmoid function to generate channel attention weights. , In the above formula, Channel attention weights; It is a nonlinear mapping containing two fully connected layers; Use the Sigmoid activation function; S503, the channel attention weights are weighted channel-by-channel with the input feature map to obtain the channel-enhanced feature map. ; S504, Feature map after channel enhancement Average pooling and max pooling are performed along the channel dimension to obtain the channel-enhanced feature maps. and ; S505 concatenates the channel-enhanced feature maps along the channel dimension, extracts spatial correlations through convolutional layers, and generates spatial attention weights using the sigmoid function. , In the above formula, Spatial attention weights; For channel splicing operations; This is a convolution operation with a kernel size of 3×3; S506, The spatial attention weights are element-wise multiplied with the channel enhancement feature map to obtain the weighted output feature map. , In the above formula, The output feature map is weighted by the attention mechanism; It is a weighted function composed of channel attention and spatial attention; This is an element-wise multiplication operation.

6. The power quality disturbance classification method based on feature fusion and dense networks according to any one of claims 1 to 5, characterized in that, Before obtaining the power quality disturbance signal classification results, the process also includes the step of training the feature fusion and dense network model, including: S601, construct a dataset containing multiple categories of power quality disturbance signals, and divide it into training and test sets; S602 converts the one-dimensional power quality disturbance signal in the training set into a fused two-dimensional image; S603, the fused two-dimensional image is input into the feature fusion and dense network model for training, and the model parameters are updated through backpropagation; S604, when the preset training termination condition is met, the trained model is obtained; S605 uses a test set to verify the classification performance of the trained model.