Compound power quality disturbance classification method based on GAF and improved efficient net
By using GAF signal visualization and an improved EfficientNet-DO network, the problem of efficient and accurate classification of complex power quality disturbances is solved, achieving high-precision classification in high-dimensional, multi-category, and noisy environments, which is suitable for power quality monitoring devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED
- Filing Date
- 2026-01-16
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to efficiently and accurately classify complex power quality disturbances, especially in high-dimensional, multi-category, and noisy environments. Traditional methods suffer from incomplete feature extraction, loss of phase information, and low classification accuracy.
One-dimensional composite PQDs signals are converted into two-dimensional images using GAF signal visualization. An improved EfficientNet-DO network is then constructed by optimizing feature extraction through the DOConv module, thereby achieving automatic feature extraction and classification.
It improves the accuracy and noise resistance of complex disturbance classification, can work stably under different signal-to-noise ratios, simplifies the preprocessing process, and is suitable for power quality monitoring devices.
Smart Images

Figure CN121542860B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power quality monitoring technology, and in particular to a composite power quality disturbance classification method based on GAF (Gramian Angular Field) and an improved EfficientNet (Efficient Neural Network). Background Technology
[0002] The grid-connected capacity of renewable energy sources such as photovoltaics and wind power continues to rise, and nonlinear loads such as electric vehicles and power electronic devices are being connected to the grid on a large scale. This has led to frequent power quality disturbances (PQDs), often involving complex disturbances such as voltage spikes and harmonics, and voltage drops, voltage oscillations, and voltage shearing. Complex PQDs can cause failures in sensitive loads (such as precision instruments and data center equipment), shorten the lifespan of grid equipment, and even cause system stability problems. Therefore, there is an urgent need for efficient and accurate complex PQD classification technology.
[0003] Current technologies for classifying PQDs signals typically involve two stages: feature extraction and classifier recognition. The first stage uses methods such as Short Time Fourier Transform (STFT), Wavelet Transform (WT), and S-Transform (ST) to extract features from the PQDs signals. The second stage uses classifiers such as Support Vector Machines, Backpropagation Neural Networks, and Decision Trees to recognize the extracted features. However, these classification methods suffer from the following problems:
[0004] 1. Traditional feature extraction methods such as Short Time Fourier Transform (STFT), Wavelet Transform (WT), and S-Transform (ST) rely on manually designed feature extraction rules, which cannot fully capture the complex features of composite disturbances and are prone to losing key information such as phase and amplitude abrupt changes in time series signals, thus resulting in low classification accuracy of composite disturbances.
[0005] 2. Traditional classifiers such as Support Vector Machines, Backpropagation Neural Networks, and Decision Trees exhibit low accuracy in classifying high-dimensional, multi-class composite perturbations, especially in noisy environments (e.g., a signal-to-noise ratio of 30dB), where accuracy often falls below 95%. Traditional deep learning methods also have limitations. For example, CNN-LSTM methods use one-dimensional feature extraction, which is less efficient (lower than two-dimensional models). CNNs based on spectral maps lose phase information during signal visualization, and classification methods based on Markov transform fields have complex preprocessing procedures, making them difficult to apply in engineering. Therefore, existing classifiers and deep learning models struggle to accurately classify high-dimensional, multi-class composite perturbations. Summary of the Invention
[0006] The technical problem to be solved by this invention is: In view of the above-mentioned problems existing in the prior art, this invention provides a composite power quality disturbance classification method based on GAF and improved EfficientNet, which is simple to implement, low in cost, high in classification accuracy and efficiency, and strong in noise resistance. It can combine the GAF method and the improved EfficientNet-DO network to achieve accurate classification of high-dimensional, multi-class composite disturbances, while improving noise resistance and robustness in noisy environments.
[0007] To solve the above-mentioned technical problems, the technical solution proposed by this invention is as follows:
[0008] A composite power quality perturbation classification method based on GAF and an improved EfficientNet includes the following steps:
[0009] Step S01. Obtain PQDs signals with different perturbation types and different signal-to-noise ratios to construct a composite PQDs signal dataset, wherein the perturbation types of the PQDs signals include multiple single perturbation types and multiple composite perturbation types;
[0010] Step S02. Convert each PQDs signal in the composite PQDs signal dataset into a two-dimensional image based on GAF to construct a training set;
[0011] Step S03. Construct an improved EfficientNet-DO network. The improved EfficientNet-DO (EfficientNet with Dropout) network is based on EfficientNet-B0 and uses the DOConv module for feature extraction to optimize the MBConv layer. The DOConv module uses depthwise separable convolution and ordinary convolution for convolution operations. The input layer of the network takes PQDs signals as input and the output layer outputs the classification results of PQDs signal perturbation types. The improved EfficientNet-DO network is trained using the training set to obtain a perturbation classification model.
[0012] Step S04. After converting the PQDs signal to be classified into a two-dimensional image based on GAF, input it into the trained perturbation classification model for classification, and output the perturbation type of the PQDs signal to be classified.
[0013] Further, in step S02, the step of converting each PQDs signal in the composite PQDs signal dataset into a two-dimensional image based on GAF includes:
[0014] Step S201. Data scaling: Scale the PQDs signal to be converted to [-1, 1];
[0015] Step S202. Polar coordinate transformation: Perform polar coordinate transformation on the scaled data to obtain the radius of each sampling point. r With angle θ ;
[0016] Step S203. Image generation: Calculate the GASF and GADF pixel values based on the calculated angle θ, and adjust the image size according to the RGB format to obtain the converted two-dimensional image.
[0017] Further, in step S202, the radius is obtained by performing a polar coordinate transformation on the scaled data. r With angle θ They are respectively:
[0018]
[0019] in, t The timestamps are evenly distributed in the interval [0,1] and divided into... N Divide into equal parts, N The number of signal sampling points. This is the scaled signal.
[0020] Further, in step S203, the calculation expressions for the GASF and GADF pixel values based on the calculated angle θ are as follows:
[0021]
[0022] in, θ i , θ j The first i , j The polar angle of each sampling point , These are the Gram summation angle field and the Gram difference angle field, respectively, which are the image pixel values.
[0023] Furthermore, the DOConv module performs convolution operations using a feature combination method or a kernel combination method. The feature combination method involves processing the input feature map... P Using depthwise convolution kernels D Perform depthwise convolution, and then use a convolution kernel W on the output of the depthwise convolution to obtain the output features. The kernel combination method is to use depthwise convolution kernels... P A combined convolutional kernel is formed with the convolutional kernel W, and the combined convolutional kernel is combined with the input feature map. P The output features are obtained by performing a convolution operation.
[0024] Furthermore, the improved EfficientNet-DO network includes multiple stages, each stage including multiple DOConv modules. The single disturbance type includes any combination of normal signals, voltage surges, voltage drops, interruptions, harmonics, voltage oscillation transients, voltage flicker, voltage notches, and voltage spikes. The composite disturbance type is a disturbance type formed by combining multiple single disturbance types.
[0025] Furthermore, in step S03, during the process of training the improved EfficientNet-DO network using the training set, the method further includes optimizing any one or more of the network depth, width, and input resolution using the NAS method, and adopting an adaptive gradient pruning strategy during training, setting different pruning thresholds according to different layers of the network, and adjusting the pruning thresholds according to the historical gradient statistics during training.
[0026] Furthermore, the calculation expressions for optimizing network depth, width, and input resolution using the NAS method are as follows:
[0027]
[0028] in, As a mixing factor, , , These are the network's depth, width, and input resolution, respectively. , , These are the baseline parameters for the network's depth, width, and input resolution, respectively, α, β , γ This is the scaling factor.
[0029] An electronic device includes a processor and a memory, the memory being used to store a computer program, and the processor being used to execute the computer program to perform the method described above.
[0030] A computer-readable storage medium storing a computer program that, when executed, implements the method described above.
[0031] Compared with the prior art, the advantages of the present invention are as follows:
[0032] 1. This invention converts one-dimensional composite PQDs signals into two-dimensional images by utilizing GAF signal visualization. It can fully preserve the temporal correlation characteristics and phase information of the signal during the conversion process, comprehensively capture the characteristics of composite disturbances, and avoid losing key information such as phase information and amplitude abrupt changes.
[0033] 2. This invention combines GAF signal visualization with an improved EfficientNet-DO network formed by optimizing the EfficientNet-B0 network based on the DOConv module. It can automatically extract and classify image features without relying on manually designed features, thus avoiding the limitations of manually designed features. It can also make full use of the DOConv module to enhance the fusion capability of local and global features through the fusion of depthwise convolution and ordinary convolution, effectively improving the classification accuracy of various single or composite perturbation types. At the same time, it enhances noise resistance and robustness. Using the DOConv module to replace the traditional MBConv layer can also increase the number of trainable parameters while reducing the amount of computation, effectively improving the feature extraction efficiency. Attached Figure Description
[0034] Figure 1 This is a schematic diagram illustrating the implementation process of the composite power quality disturbance classification based on GAF and the improved EfficientNet in this embodiment.
[0035] Figure 2 This is a schematic diagram illustrating the process of converting a one-dimensional voltage disturbance signal into a two-dimensional GAF image in this embodiment.
[0036] Figure 3 This is a schematic diagram illustrating the structural principle of the EfficientNet-DO network constructed in this embodiment.
[0037] Figure 4 This is a schematic diagram illustrating the principles of the two implementation methods of the DOConv convolution operation in this embodiment, where (a) corresponds to the principle of feature combination and (b) corresponds to the principle of kernel combination. Detailed Implementation
[0038] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.
[0039] For the classification of complex perturbations, existing classification methods have the following problems:
[0040] 1. The hybridity and low signal-to-noise ratio of composite perturbation characteristics
[0041] Composite perturbation features are characterized by hybridity and low signal-to-noise ratio. The perturbation features are superimposed and masked in both the time and frequency domains. Traditional one-dimensional analysis methods or simple time-frequency transforms (such as STFT and wavelet transform) are difficult to clearly separate and extract the key features of all perturbation components when the signal-to-noise ratio is low. In particular, weak and transient features such as oscillation transients are easily submerged by principal components (such as sudden rises / falls) and harmonics.
[0042] 2. Loss of phase information leads to ambiguous classification.
[0043] Many existing transformation methods (such as certain scalar wavelet transforms) lose the absolute phase information of the signal. However, in PQD classification, phase is crucial for distinguishing perturbations such as the direction of oscillation onset and the location of voltage indentations. Therefore, how to fully preserve and highlight the temporal dependence and phase information of the one-dimensional signal in the transformed two-dimensional image without increasing computational complexity is a key challenge that needs to be addressed in current composite perturbation classification.
[0044] 3. The model lacks the ability to collaboratively perceive the relationship between subtle local features and global context.
[0045] Complex perturbations often contain both local abrupt changes (such as oscillations and spikes) and global changes (such as sustained voltage surges), which traditional CNN models may struggle to capture simultaneously: shallow networks capture local details, while deep networks, although able to increase the receptive field, may dilute these subtle local features during the process of increasing the receptive field. How to enable models to both sensitively capture the minute textures representing transient oscillations in images and understand the overall patterns representing long-term voltage changes is a pressing problem to be solved in current complex perturbation classification.
[0046] 4. The contradiction between model complexity and industrial deployment feasibility
[0047] Current classification models often require large and complex models to achieve high accuracy, but these are difficult to deploy on power quality monitoring devices with limited computing resources. Therefore, it is necessary to design a lightweight network with optimized parameters and computational complexity while ensuring high accuracy.
[0048] Traditional image modal transformation methods, such as Markov transform fields (GRFs), are essentially statistical summaries. During the transformation process, they lose a significant amount of detailed signal information, particularly precise temporal dependencies and phase information. For transient, phase-sensitive perturbations such as "oscillations" and "peaks" in composite PQDs, these methods are insufficient in their representational ability, resulting in relatively coarse image textures that may not fully preserve subtle transient features. Similarly, Regression Proof (RP) is a binary image (using only 0s and 1s), which loses the original amplitude information of the signal. Its generation result is highly dependent on the threshold selection; an inappropriate threshold setting can lead to feature overloading or noise amplification. Furthermore, while the textures in RP images (such as diagonals and patches) can reflect the dynamic characteristics of the system, their intuitive correspondence with the original PQD signal is weak, resulting in poor interpretability. In contrast, Gaussian Image Functions (GAFs) directly encode the absolute temporal position and interrelationships of the signal into the image through the superposition of trigonometric functions, thus completely preserving the signal's numerical information, temporal dependencies, and crucial phase information.
[0049] The key to this invention is considering the unique characteristics of the composite PQD classification problem. It combines GAF signal visualization with EfficientNet-DO intelligent classification to achieve composite power quality disturbance classification. First, one-dimensional composite PQD signals are converted into two-dimensional images using the GAF method. This process fully preserves the temporal correlation features and phase information of the signals, comprehensively capturing the characteristics of composite disturbances such as voltage surges, harmonics, and voltage oscillation transients. This generates a complete, feature-rich two-dimensional image that is highly compatible with CNN architecture, avoiding the loss of key information such as phase information and amplitude abrupt changes. Simultaneously, an improved EfficientNet-DO network, optimized based on the DOConv module, is used. This network eliminates the need for manually designed features, enabling automatic image feature extraction and classification. It avoids the limitations of manually designed features and fully utilizes the DOConv module to enhance the fusion of local and global features through the fusion of deep convolution and ordinary convolution, effectively improving the classification accuracy of various single or composite disturbance types. It also enhances noise resistance and robustness. Replacing the traditional MBConv layer with the DOConv module increases trainable parameters while reducing computational load, effectively improving feature extraction efficiency.
[0050] like Figure 1 As shown, the steps of the composite power quality disturbance classification method based on GAF and improved EfficientNet in this embodiment include:
[0051] Step S01. Obtain PQDs signals with different perturbation types and different signal-to-noise ratios to construct a composite PQDs signal dataset, wherein the perturbation types of the PQDs signals include multiple single perturbation types and multiple composite perturbation types.
[0052] Specifically, single disturbance types include normal signals, voltage surges, voltage drops, interruptions, harmonics, voltage oscillation transients, voltage flicker, voltage notches, and voltage spikes, etc. The specific formulas are shown in Table 1. Composite disturbance types are disturbance types formed by combining multiple single disturbance types, such as voltage drop + harmonic + voltage oscillation transient, interruption + harmonic + voltage oscillation transient, voltage surge + harmonic + voltage flicker, etc. The specific type configurations are shown in Table 2.
[0053] Table 1: Mathematical Models for Single Perturbation
[0054]
[0055] Table 2: Labels for Various PQDs
[0056]
[0057] In specific application examples, PQDs signals with different signal-to-noise ratios (such as 0dB, 30dB, 40dB, 50dB, etc.) can be generated using software such as MATLAB. Parameters can be set, for example, setting the base frequency to 50Hz, the sampling frequency to 6.4kHz, and the sampling period to 10 cycles. This will generate 2000 samples for each type of signal. The generated sample data is then divided into training set, validation set, and test set according to a specified ratio. The sample format can be a CSV file, which stores voltage time series data.
[0058] In this embodiment, before inputting the GAF dataset into the classifier, the GAF dataset is preprocessed, such as randomly flipping the images horizontally / vertically (simulating phase changes), randomly rotating them (within a small angle range), and applying data augmentation strategies. Among these data augmentation strategies, to simulate noise interference in a real power grid environment, this embodiment adds colored noise (Gaussian noise with a signal-to-noise ratio (SNR) of 30dB to 40dB) that matches the characteristics of the real power grid noise spectrum to the GAF-converted image. This forces the model to learn more robust features, further improving the model's robustness.
[0059] Step S02. Convert each PQDs signal in the composite PQDs signal dataset into a two-dimensional image based on GAF to construct a training set.
[0060] In this embodiment, the GAF method is used to map a one-dimensional time-series signal into a two-dimensional image through data scaling, polar coordinate transformation, and angle calculation. Specifically, it includes Gram summation angle field (GASF) and Gram difference angle field (GADF). The PQDs signal data generated in step S01 is read, scaled, and then the scaled data is transformed in polar coordinates to calculate the radius of each sampling point. r With angle θ Based on angle θ Calculate the pixel values of GASF and GADF, and adjust the image size to RGB format to obtain the converted GAF two-dimensional image.
[0061] Specifically, such as Figure 2 As shown, the steps for converting each PQDs signal in the composite PQDs signal dataset into a two-dimensional image based on GAF include:
[0062] Step S201. Data scaling: Scale the PQDs signal to be converted to [-1, 1].
[0063] For example, the Min-Max scaler can be used to scale the original PQDs signal x to the [-1, 1] interval, as shown in the formula:
[0064] (1)
[0065] in, , These are the minimum and maximum values of the original signal, respectively. This is the scaled signal.
[0066] Step S202. Polar coordinate transformation: Perform polar coordinate transformation on the scaled data to obtain the radius of each sampling point. r With angle θ .
[0067] Specifically, the radius can be obtained by performing a polar coordinate transformation on the scaled data according to the following formula. r With angle θ :
[0068] (2)
[0069] in, t The timestamps are evenly distributed in the interval [0,1] and divided into... N Divide into equal parts, N The number of signal sampling points. This is the scaled signal.
[0070] This embodiment uses the GAF signal visualization method to convert one-dimensional PQDs signals into two-dimensional images. Combined with the EfficientNet-DO network, it can achieve automatic feature extraction capabilities, avoid the limitations of manually designed features, effectively improve the comprehensiveness of feature capture, simplify the signal preprocessing process, shorten the single-sample classification time, and meet the real-time monitoring needs of power systems.
[0071] Step S203. Image generation: Based on the calculated angle θ Calculate the GASF and GADF pixel values, and adjust the image size according to the RGB format to obtain the converted two-dimensional image.
[0072] Specifically, the pixel values of GASF and GADF can be calculated using the following formula based on the calculated angle θ:
[0073] (3)
[0074] in, θ i , θ j The first i , j The polar angle of each sampling point , These are the Gram summation angle field and the Gram difference angle field, respectively, which are the image pixel values.
[0075] Step S03. Construct an improved EfficientNet-DO network. This improved EfficientNet-DO network is based on EfficientNet-B0 and uses the DOConv module for feature extraction to optimize the MBConv layer. The input layer of this improved EfficientNet-DO network takes PQDs signals as input and the output layer outputs the classification results of PQDs signal perturbation types. The improved EfficientNet-DO network is trained using the training set to obtain a perturbation classification model.
[0076] This embodiment uses EfficientNet-B0 as a baseline and replaces the MBConv convolutional layers with DOConv modules to construct an improved EfficientNet-DO network, such as... Figure 3 As shown, the network consists of an input layer, a convolutional layer (Conv3×3), a batch normalization layer (BatchNorm), a Swish activation function layer, a DOConv module layer, a convolutional layer (Conv1×1), an average pooling layer (AvgPool), a fully connected layer (FC), and an output layer. By introducing the DOConv module to optimize the MBConv convolutional layer in the EfficientNet-DO network, the ability to fuse local and global features can be enhanced, ensuring the classification accuracy and noise resistance of various PQDs signals. This allows for the accurate extraction of composite perturbation signal features even in noisy environments, thereby improving the noise resistance and robustness of the classification.
[0077] Specifically, the improved EfficientNet-DO network comprises multiple stages, each containing multiple DOConv modules. The network consists of 5 stages (each containing 2-8 DOConv blocks), with an output layer of 26 neurons, each corresponding to a different type of PQD to output PQD signal classification results. Preferably, by using DOConv modules in the shallow to mid-level layers (responsible for extracting local features such as edges and textures), the ability to capture subtle patterns such as "voltage oscillation transients" and "voltage notches" can be significantly improved. Meanwhile, by using all DOConv modules or partially using DOConv modules and partially using the original MBConv (i.e., retaining some of the original MBConv) in the deep layers (responsible for feature fusion and abstraction), the enhanced global context modeling capabilities of DOConv modules can be utilized to better understand complex PQD patterns such as "voltage surge + harmonics".
[0078] In this embodiment, the DOConv module structure consists of depthwise convolution and pointwise convolution. The DOConv module can perform convolution operations using either feature combination or kernel combination methods. The feature combination method involves processing the input feature map... P Using depthwise convolution kernels D Perform depthwise convolution, and then apply a convolution kernel W to the output of the depthwise convolution to obtain the output features. The kernel combination method is to use depthwise convolution kernels... P A combined convolutional kernel is formed with the convolutional kernel W, and the combined convolutional kernel is combined with the input feature map. P The output features are obtained by performing a convolution operation.
[0079] Specifically, the DOConv module structure consists of depthwise convolution and pointwise convolution. DOConv convolution has two equivalent implementations, such as... Figure 4 In the diagram, (a) and (b) correspond to feature combination and kernel combination, respectively, as detailed below:
[0080] (1) Feature combination
[0081] The input feature map is Where M×N is the spatial dimension and Cin is the number of input channels. Feature combination first applies depthwise convolution, then traditional convolution:
[0082] (4)
[0083] in, This indicates that a depthwise convolution kernel P is applied to the input feature map P; This indicates that a traditional convolution kernel W is applied to the output of a depthwise convolution.
[0084] (2) Nuclear assembly
[0085] Kernel combining directly generates equivalent traditional convolutional kernels by combining depthwise convolutional kernels and traditional convolutional kernels, and then applies them to the input feature map:
[0086] (5)
[0087] in, It is a trainable kernel for depthwise convolution. yes transpose, For depth coefficient; It is a trainable kernel for ordinary convolution; This represents a depthwise convolution operation. This represents a normal convolution operation. It is a convolution kernel obtained after a depthwise convolution operation; It is the output feature.
[0088] In this embodiment, during the training process, parameters are first configured, such as using the SGD optimizer, initial learning rate of 0.01, batch size of 32, epoch of 100, dropout coefficient of 0.5, and cross-entropy loss function. Then, model training is started, training set images are input into the network, and the classification accuracy is fed back in real time using the validation set. When the validation set accuracy does not improve for several consecutive epochs, the learning rate is reduced until training ends, and finally, the optimal model weights are saved.
[0089] In this embodiment, label smoothing and complex adaptive gradient pruning strategies are also introduced during the training process. These strategies, combined with the rich parameter space provided by DOConv, work together to effectively prevent overfitting and significantly improve the classification accuracy and stability of the model under low signal-to-noise ratio conditions. Through the synergistic design of this training strategy and network structure improvement, the noise resistance of the model can be effectively improved.
[0090] In a specific application embodiment, the steps to achieve label smoothing may include:
[0091] First, in the early stages of training, the smoothing parameter label_smoothing of torch.nn.CrossEntropyLoss is used, such as the loss function: loss_function = torch.nn.CrossEntropyLoss(label_smoothing=0.1);
[0092] Then, a smoothing strategy is defined, and the smoothing parameter ε is dynamically adjusted according to the training stage. For example, in the early training stage (first 10 epochs): ε=0.1; in the middle training stage (10-80 epochs): ε decreases linearly from 0.1 to 0.02; and in the later training stage (80-100 epochs): ε=0.01.
[0093] The calculation logic is as follows: the true labels are converted from one-shot form to a smooth distribution, the correct class probability is set to (1-ε), the incorrect class probability is uniformly distributed ε / (K-1), K is the number of classes, and the KL divergence loss between the model output and the smooth labels is calculated.
[0094] Label smoothing employs a one-shot encoding method, which effectively prevents overfitting, reduces model confidence, and ensures a smoother probability distribution in the model output. It avoids pursuing the extreme probability peak on the training set, especially under low signal-to-noise ratio conditions. The PQD input signal itself is blurry and has interference, and the corresponding "correct" label may also have uncertainty. Label smoothing is a better match for this uncertainty, and can train a more robust and fault-tolerant classification boundary, thereby improving classification accuracy and stability.
[0095] Traditional gradient pruning typically employs a simple pruning method: setting a threshold, and if the length (norm) of the gradient vector for all parameters of the entire model exceeds this threshold, it is proportionally reduced to prevent gradient explosion. Considering that different layers may have different parameter scales and update dynamics, this embodiment uses an adaptive hierarchical gradient pruning method. Different pruning thresholds are set for different parts of the network (e.g., different layers, DOConv layers, and ordinary layers). Specifically, the maximum gradient norm of convolutional layers, fully connected layers, and batch normalization (BN) layers decreases sequentially. Simultaneously, the pruning threshold is dynamically adjusted based on historical gradient statistics (e.g., mean, variance) during training. Since the DOConv module used in this embodiment introduces a richer parameter space, it may also make the optimization terrain more complex, and gradients more prone to outliers or instability. By combining this with the adaptive hierarchical gradient pruning method, the training process can be ensured to run more smoothly and controllably, allowing the advantages of DOConv to be fully and stably trained, preventing failure due to training instability.
[0096] Specifically, the implementation steps of the gradient clipping function include:
[0097] First, iterate through all trainable models and determine the parameter type based on the parameter name. For example, names containing 'conv' are convolutional layer parameters (including DOConv); names containing 'bn' or 'norm' are batch normalization layer parameters; names containing 'fc' or 'classifier' are fully connected layer parameters; others are default parameters.
[0098] Secondly, different strategies are set for different parameter types. For example, for convolutional layers, the maximum gradient norm is set to 1.0 (relatively lenient); for BN layers, the maximum gradient norm is set to 0.5 (strict); and for fully connected layers, the maximum gradient norm is set to 0.8 (moderate).
[0099] Finally, during the training phase, the pruning thresholds for each layer are dynamically adjusted based on the number of epochs. For example, in the initial training phase (first 5 epochs): all thresholds are multiplied by 1.5; in the mid-term training phase (5-50 epochs): standard thresholds are used; and in the later training phase (after 50 epochs): all thresholds are multiplied by 0.8 and adjusted according to gradient history. The gradient norm record of the most recent 10 batches is maintained for each parameter. If the current gradient norm deviates significantly from the historical average (> average + 2 × standard deviation), the pruning threshold of that layer is temporarily reduced.
[0100] Furthermore, the process of training the improved EfficientNet-DO network using the training set also includes optimizing the network depth, width, and input resolution using NAS methods.
[0101] Specifically, the NAS method can optimize network depth, width, and input resolution according to the following formula:
[0102] (6)
[0103] in, As a mixing factor, , , These are the network's depth, width, and input resolution, respectively. , , These are the baseline parameters for the network's depth, width, and input resolution, respectively, α, β , γ This is the scaling factor.
[0104] This embodiment leverages DOConv's advantage of having more parameters but lower FLOPs by automatically optimizing the network depth, width, and resolution (GAF image size) using the NAS method. This allows for finding an optimal input size for a typical composite PQD GAF image, further reducing the model's overall computational cost while ensuring no feature loss. This results in a model that balances accuracy and efficiency, and its inference speed has the potential for practical application in embedded devices. It also avoids the blindness of manual parameter tuning and effectively improves the model's generalization ability.
[0105] After model training is complete, the test set GAF images are input into the trained perturbation classification model (EfficientNet-DO model), which outputs the classification result for each class of samples. The model's performance under different signal-to-noise ratios is then evaluated based on the classification accuracy. Specifically, the formula for calculating the classification accuracy is as follows:
[0106] (7)
[0107] Wherein, TP represents the number of true positive samples, TN represents the number of true negative samples, FP represents the number of false positive samples, and FN represents the number of false negative samples.
[0108] Step S04. After converting the PQDs signal to be classified into a two-dimensional image based on GAF, input it into the trained perturbation classification model for classification, and output the perturbation type of the PQDs signal to be classified.
[0109] Using the perturbation classification model trained in step S03, after acquiring the PQDs signal to be classified in real time, the perturbation classification model can quickly and accurately obtain the classification result, and can accurately identify various composite perturbation signal types.
[0110] In this embodiment, a simulation platform (MATLAB generating PQDs signals) and an experimental platform (GPU server based on RTX3080Ti) are further built to compare the key indicators of the traditional method and the method of the present invention, so as to verify the performance of the method of the present invention. As shown in Tables 3, 4 and 5, the experimental results are as follows:
[0111] (1) Classification accuracy
[0112] In a noise-free environment, the method of this invention achieves an average classification accuracy of 99.30% for the 26 categories of PQDs shown in Table 1, with 100% accuracy for categories such as normal signals (C1), harmonics (C5), and voltage oscillation transients (C6). The accuracy of the traditional EfficientNet method is 98.54%, and the accuracy of ResNet34 is 97.50%.
[0113] In a 30dB signal-to-noise ratio environment, the accuracy of the method of this invention still reaches 98.65%, only 0.65 percentage points lower than that in a noise-free environment. The accuracy of RegNet, DenseNet, and MobileNet are 98.42%, 98.20%, and 78.20%, respectively. This method has a more significant advantage in classifying complex disturbances (such as C19 "voltage sag + harmonics + voltage oscillation transients" and C25 "voltage sag + voltage oscillation transients + voltage indentation"), with accuracy of 99.90% and 98.25%, respectively, which is 0.3 to 0.5 percentage points higher than that of the traditional EfficientNet.
[0114] (2) Noise resistance
[0115] Within the signal-to-noise ratio range of 0dB to 50dB, the classification accuracy of the method of the present invention remains above 98%.
[0116] At 0dB (strong noise), the classification accuracy of the method of this invention is 98.57%, while the accuracy of the traditional EfficientNet is 97.82%.
[0117] At 40 dB (moderate noise), the classification accuracy of the method of the present invention is 98.44%, which is only 0.86 percentage points lower than that in a noise-free environment;
[0118] At 50dB (weak noise), the classification accuracy of the method of this invention is 98.31%, and its stability is better than all the comparison models.
[0119] Table 3: Classification results of the GAF-EfficientNet model of this invention
[0120]
[0121] Table 4: PQDs Classification and Recognition Accuracy
[0122]
[0123] Table 5: Performance Comparison of Different Methods
[0124]
[0125] In summary, this invention achieves accurate mapping from one-dimensional signals to two-dimensional images by introducing GAF to visualize composite PQDs signals. It preserves temporal features and perturbation correlations, solving the problems of lost phase information and complex Markov transformation processes in traditional spectrograms. Furthermore, it optimizes the EfficientNet-DO network structure by replacing the MBConv layer of EfficientNet-B0 with the DOConv module, enhancing the convolutional layers' ability to capture complex features, improving classification accuracy and noise resistance. Through the noise robustness of GAF images and the regularization effect of DOConv, the method can ensure stable operation under different signal-to-noise ratios and perturbation types. Moreover, it eliminates the need for manual feature design, simplifying the preprocessing process and improving the ease of engineering applications.
[0126] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the method as described above.
[0127] It is understood that the method described in this embodiment can be executed by a single device, such as a computer or server, or it can be applied to a distributed scenario where multiple devices cooperate to complete the task. In a distributed scenario, one of the multiple devices may execute only one or more steps of the method described in this embodiment, and the multiple devices interact to complete the method. The processor can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit, or one or more integrated circuits, and is used to execute relevant programs to implement the method described in this embodiment. The memory can be implemented using read-only memory (ROM), random access memory (RAM), static storage devices, and dynamic storage devices. The memory can store the operating system and other applications. When the method described in this embodiment is implemented through software or firmware, the relevant program code is stored in the memory and called and executed by the processor.
[0128] This embodiment further provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described above.
[0129] Those skilled in the art will understand that the above embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0130] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Therefore, any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention should fall within the protection scope of the present invention.
Claims
1. A composite power quality disturbance classification method based on GAF and improved EfficientNet, characterized by the steps of include: Step S01. Obtain PQDs signals with different perturbation types and different signal-to-noise ratios to construct a composite PQDs signal dataset, wherein the perturbation types of the PQDs signals include multiple single perturbation types and multiple composite perturbation types; Step S02. Convert each PQDs signal in the composite PQDs signal dataset into a two-dimensional image based on GAF to construct a training set; Step S03. Construct an improved EfficientNet-DO network. The improved EfficientNet-DO network is based on EfficientNet-B0 and uses the DOConv module for feature extraction to optimize the MBConv layer. The DOConv module uses depthwise separable convolution and ordinary convolution for convolution operations. The input layer of the improved EfficientNet-DO network takes PQDs signals as input and the output layer outputs the classification results of PQDs signal perturbation types. The improved EfficientNet-DO network is trained using the training set to obtain a perturbation classification model. Step S04. After converting the PQDs signal to be classified into a two-dimensional image based on GAF, input it into the trained perturbation classification model for classification, and output the perturbation type of the PQDs signal to be classified. The DOConv module performs convolution operations using either a feature combination method or a kernel combination method. The feature combination method involves processing the input feature map... P Using depthwise convolution kernels D Perform depthwise convolution, and then use a convolution kernel W on the output of the depthwise convolution to obtain the output features. The kernel combination method is to use depthwise convolution kernels... D A combined convolution kernel is formed with the convolution kernel W, and the output features are obtained by convolving the combined convolution kernel with the input feature map; The improved EfficientNet-DO network includes multiple stages, each stage including multiple DOConv modules. DOConv modules are used in the shallow and mid-level layers responsible for extracting local features, while DOConv modules are used entirely or partially in the deep layers responsible for feature fusion and abstraction.
2. The composite power quality disturbance classification method based on GAF and improved EfficientNet according to claim 1, characterized in that, Step S02, the step of converting each PQDs signal in the composite PQDs signal dataset into a two-dimensional image based on GAF, includes: Step S201. Data scaling: Scale the PQDs signal to be converted to [-1, 1]; Step S202. Polar coordinate transformation: polar coordinate transformation is performed on the scaled data to obtain the radius of each sampling point r with the angle θ ; Step S203. Image generation: Calculate the GASF and GADF pixel values based on the calculated angle θ, and adjust the image size according to the RGB format to obtain the converted two-dimensional image.
3. The composite power quality disturbance classification method based on GAF and improved EfficientNet according to claim 2, characterized in that, In step S202, the radius obtained by performing polar coordinate transformation on the scaled data r and the angle θ are respectively: in, t The timestamps are evenly distributed in the interval [0,1] and divided into... N Divide into equal parts, N The number of signal sampling points. This is the scaled signal.
4. The GAF and improved EfficientNet-based composite power quality disturbance classification method according to claim 2, characterized in that, In step S203, the calculation expressions for the pixel values of GASF and GADF based on the calculated angle θ are as follows: in, θ i , θ j The first i , j The polar angle of each sampling point , These are the Gram summation angle field and the Gram difference angle field, respectively, which are the image pixel values.
5. The composite power quality disturbance classification method based on GAF and improved EfficientNet according to any one of claims 1 to 4, characterized in that, In step S01, the single disturbance type includes any combination of normal signal, voltage surge, voltage drop, interruption, harmonic, voltage oscillation transient, voltage flicker, voltage notch and voltage spike, and the composite disturbance type is a disturbance type formed by combining multiple single disturbance types.
6. The composite power quality disturbance classification method based on GAF and improved EfficientNet according to any one of claims 1-4, characterized in that, In step S03, during the process of training the improved EfficientNet-DO network using the training set, the method further includes optimizing any one or more of the network depth, width, and input resolution using the NAS method, and adopting an adaptive gradient pruning strategy during training, setting different pruning thresholds according to different layers of the network, and adjusting the pruning thresholds according to the historical gradient statistics during training.
7. The GAF and improved EfficientNet-based composite power quality disturbance classification method according to claim 6, characterized in that, The calculation expressions for optimizing network depth, width, and input resolution using the NAS method are as follows: in, As a mixing factor, , , These are the network's depth, width, and input resolution, respectively. , , These are the baseline parameters for the network's depth, width, and input resolution, respectively, α, β , γ This is the scaling factor.
8. An electronic device comprising a processor and a memory for storing a computer program, characterized in that The processor is used to execute the computer program to perform the composite power quality disturbance classification method based on GAF and improved EfficientNet as described in any one of claims 1 to 7.
9. A computer readable storage medium storing a computer program, characterized in that, When the computer program is executed, it implements the composite power quality disturbance classification method based on GAF and improved EfficientNet as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Electric energy quality disturbance signal classification method and system
CN113780160A
Electric energy quality disturbance identification method based on Gramb angle field and improved lightweight residual network
CN118863631A