Power quality disturbance high-precision classification method of hybrid binary neural network
By combining full-precision convolution and binarized convolution with a hybrid binarized neural network, batch normalization and pseudo-gradient weight update are introduced to solve the problem of insufficient capture of time-related features of binarized neural networks in power quality disturbance classification, and achieve high-precision and efficient classification.
Patent Information
- Application Number
- CN202410339921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-25
- Publication Date
- 2025-09-26
AI Technical Summary
Binarized neural networks cannot effectively capture and utilize time-related dynamic features in power quality disturbance classification, resulting in a decrease in classification accuracy.
A hybrid binarized neural network is adopted, combining full-precision convolution and binarized convolution. By designing a reasonable convolution kernel and hierarchical structure, batch normalization and pseudo-gradient weight update strategy are introduced, and the Bop optimizer is used to optimize the parameters.
The accuracy and efficiency of power quality disturbance classification are improved, the gradient vanishing and weight update problems are solved, and the accurate and rapid classification of power quality disturbances is ensured.
Smart Images

Figure CN120705685A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power quality disturbance classification using a binary neural network, and in particular to a high-precision power quality disturbance classification method using a hybrid binary neural network. Background Art
[0002] With the widespread use of power electronics, power semiconductor devices exhibit characteristics such as nonlinearity, impact, and volatility, which can negatively impact the stability and reliability of power systems. These effects often cause deviations or disturbances in voltage, current, and frequency relative to standard ratings, a phenomenon known as power quality disturbances. Because different types of power quality disturbances have varying impacts on power systems, accurate classification of these disturbances is essential to ensure effective measures are taken to improve power quality. Therefore, accurately classifying power quality disturbances has become a pressing issue in increasingly power-electronic power systems.
[0003] The working principle of a binarized neural network is based on binarizing weights and activations to +1 and -1. By using binary weights and activation functions, the weight parameters are reduced from floating-point numbers to binary. This binarization process not only significantly reduces computational and storage requirements but also improves the network's generalization capabilities by limiting the range of weight values. This makes binary neural networks potentially advantageous in resource-constrained environments such as embedded devices and the Internet of Things. In the task of power quality disturbance classification, binary neural networks can provide efficient inference by learning the nonlinear characteristics of the disturbance, achieving efficient classification while reducing the demand for hardware resources.
[0004] The emergence of binary neural networks has brought many advantages to the field of real-time classification of power quality disturbances. However, they may face a serious problem in practical applications, namely the severe loss of time-related information. This is because in time series data, signal changes often contain rich time series information, but quantizing it into a discrete form with only two values makes it impossible for the model to effectively capture and utilize these time-related dynamic features. In power quality disturbance scenarios, signal fluctuations and changes are often time-related, and this time-related information is crucial for correctly classifying the type of power quality disturbance. Due to the discrete nature of binary neural networks, the model loses the ability to perceive the dynamic evolution of the signal and cannot accurately reflect the changes in features at different time points. As a result, in the classification task, the model has difficulty distinguishing easily overlooked but critical differences in power quality disturbance data, which significantly reduces the classification accuracy. Summary of the Invention
[0005] In order to solve the above problems, the present invention provides a high-precision classification method for power quality disturbances based on a hybrid binary neural network.
[0006] The technical solution of the present invention to solve the above problems is: a high-precision classification method for power quality disturbances using a hybrid binary neural network, comprising the following steps:
[0007] Step 1: Build a corresponding hybrid binarization neural network model: design a reasonable binarization strategy and select parameters such as convolution kernel size, number, and step size.
[0008] Step 2: Extract the correlation features in the time series by performing the first layer of full-precision convolution operation on the original time series data.
[0009] In step three, two layers of binary convolution layers are used to further extract the time-correlation features while ensuring the high efficiency and low parameters of the network.
[0010] Step 4: During the entire feature extraction process, the stacking structure order of the binary convolution layer (the first layer is the full-precision convolution layer), pooling layer, and batch normalization layer is maintained to ensure the effectiveness of the binarization operation.
[0011] Step 5: Classify the extracted features through the binarized fully connected layer while ensuring the high efficiency and low parameters of the network.
[0012] Step 6: Use the Softmax activation function to process the output of the fully connected layer to obtain the probability of each category, and select the category with the highest probability as the result output.
[0013] Step 7: Compare the classification results with the actual categories to determine whether the accuracy of the final classification meets the minimum requirements. If so, proceed to the next step; otherwise, update the parameters.
[0014] In step eight, the gradient is estimated by the direct estimator and the parameters are updated by the Bop optimizer. Finally, the model parameters that meet the conditions are obtained and the corresponding network model is exported.
[0015] In the above-mentioned high-precision classification method for power quality disturbances using a hybrid binary neural network, the expression for the full-precision convolution in step 2 is:
[0016]
[0017] in represents the output feature of the jth neuron in the lth layer, m represents the number of neurons connected between layers, represents the output feature of the i-th neuron in the l-1th layer, Represents the weight between the i-th and j-th neurons in the l-th layer.
[0018] In the aforementioned high-precision power quality disturbance classification method using a hybrid binary neural network, the stacking sequence in step 4 first uses batch normalization to process the output of the neural network layer, and then binarizes the activation values to ensure that the input of the next layer is +1 or -1 to reduce memory usage. This sequence maximizes data information preservation while reducing computational complexity, thereby improving the efficiency and performance of the binary neural network.
[0019] In the above-mentioned high-precision classification method for power quality disturbances using a hybrid binary neural network, the expression of the direct estimator in step eight is:
[0020] Htanh=Clip(x,-1,1)=max(-1,min(1,x)) (2)
[0021] Where Clip(·) is the clipping function and x is the original gradient.
[0022] In the above-mentioned high-precision classification method for power quality disturbances using a hybrid binary neural network, the calculation expression for updating the Bop optimizer weight in step eight is:
[0023] BPO(W R ,η)=W R -η·sign(W R ) (3)
[0024] Where BPO(·) is a binary proximal operator, η is the global learning rate, and W R is a real-valued weight.
[0025] In the above-mentioned high-precision classification method for power quality disturbances using a hybrid binary neural network, the calculation expression of the overall update rule of the Bop optimizer in step eight is:
[0026]
[0027] Where W old is the weight of the previous iteration, α is the pseudo gradient learning rate, is the gradient of the loss function with respect to the weights.
[0028] The beneficial effects of the present invention are as follows: the present invention provides a high-precision classification method for power quality disturbances of a hybrid binary neural network. According to the characteristics of power quality disturbances, the network parameters are reduced by using a binary neural network, the network operation efficiency is improved, the full-precision convolution is mixed with the binary convolution for feature extraction, the accuracy of the binary neural network in classifying power quality disturbances is improved, the pseudo-gradient weight update strategy and the Bop optimizer are introduced to solve the problems of gradient disappearance and weight inability to update of the binary neural network, thereby ensuring accurate and rapid classification of power quality disturbances. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The present invention will be further described below with reference to the accompanying drawings.
[0030] Figure 1 Schematic diagram of the training process for power quality disturbance classification
[0031] Figure 2 Schematic diagram of the hybrid binary neural network structure DETAILED DESCRIPTION
[0032] The present invention will be further described below with reference to the accompanying drawings and examples.
[0033] like Figure 1 As shown in the figure, the power quality disturbance signal is subjected to signal data feature extraction through a binary convolution kernel; key features are expanded through pooling to reduce the amount of computation; batch normalization makes the data distribution of each feature dimension more stable, which is beneficial to the network training and optimization process; the binary fully connected layer classifies the extracted features; and Softmax outputs the classification results.
[0034] A high-precision classification method for power quality disturbances based on a hybrid binary neural network is proposed. The specific process is as follows:
[0035] In step 1, a power quality disturbance signal is generated through MATLAB simulation. The sampling interval is set to 10 cycles (0.2 seconds), the sampling frequency is set to 3200 Hz, and the sampling points are set to 640. This sampled power quality disturbance signal constitutes a data set and is input into the first full-precision convolutional layer to extract raw time-correlated features.
[0036] Step 2: Use the binary convolution kernel to further extract the key features of the signal. The calculation formula of the binary convolution is:
[0037]
[0038] C=conv(X B ,K B )
[0039] Where X is the input of the binarization layer, X B Represents the binarized input, K B is the binarization kernel, and C is the binarization convolution result.
[0040] Step 3: The maximum pooling operator extracts the local maximum value from the input features, reducing the number of trainable parameters and improving the robustness of the features. The calculation formula for maximum pooling is:
[0041]
[0042] in is the output of the maximum pooling layer, Max(·) is the maximum pooling function, and the maximum value is selected from the binarization result; is the output of the upper network, and n is the number of neurons in the upper layer.
[0043] Step 4: Based on this, the data is standardized through the batch normalization layer to improve training speed and reduce overfitting. The batch normalization formula is:
[0044]
[0045] in is the input of the kth neuron in the lth layer, μ B is the mean, is the variance, ε is a small positive number to avoid the denominator becoming zero, is the output of the k-th neuron in the l-th layer after the batch normalization layer, is the scaling factor of the k-th neuron in the l-th layer. In this example, the scaling factor is set to 1. is the bias of the l-th batch normalization layer.
[0046] Step 5: The extracted features are then classified through a fully connected layer. In a fully connected layer, each neuron is connected to all neurons in the previous layer. The expression of the fully connected layer is:
[0047] D=X B ×W B
[0048] where X B is the binarized input, W B is the binarization weight, and D is the output of the fully connected layer.
[0049] Step 6: After that, the Softmax function is used to output the probability that the sample belongs to the corresponding category, and then the category with the largest probability value is output. The Softmax function is expressed as:
[0050]
[0051] For the input vector Z=[Z1,Z2,...,Z j ],Z i For the i-th element of the input vector Z, each input element Z i Convert it into a value between 0 and 1 to get the probability S of each category i , the sum of the probabilities of all categories is 1.
[0052] In step seven, the classification result is finally obtained and compared with the actual label to obtain the accuracy of the current model. If the requirements are not met, the weight parameters are updated through feedback from the pseudo-gradient weight update strategy until the accuracy meets the requirements. Then the model parameters are exported and the trained model is used to achieve high-precision classification of power quality disturbances.
[0053] Establish a hybrid binary neural network classification model, whose network structure is as follows Figure 2 . Among them, HBNN is the feature extraction module, Dense is the fully connected classification module, separated by the Flatten layer. The first layer is the Input input layer with an input size of 640; the second layer is the Conv1D convolution layer with 32 convolution kernels and a convolution kernel size of 5; the third layer is the MaxPooling1D maximum pooling layer with a pooling size of 3; the fourth layer is the BN batch normalization layer; the fifth layer is the BinConv1D binary convolution layer with 64 convolution kernels and a convolution kernel size of 5; the sixth layer is the MaxPooling1D maximum pooling layer with a pooling size of 3; the seventh layer is the BN batch normalization layer; the eighth layer is the BinConv1D binary convolution layer with 128 convolution kernels and a convolution kernel size of 5; the ninth layer is a GlobalMaxPooling1D global maximum pooling layer; the tenth layer is a Batch Normalization (BN) layer; the eleventh layer is a Flatten layer; the twelfth layer is a Dense fully connected layer with a pool size of 256; the thirteenth layer is a Batch Normalization (BN) layer; the fourteenth layer is a Dense fully connected layer with a pool size of 128; the fifteenth layer is a Batch Normalization (BN) layer; the sixteenth layer is a Dense fully connected layer with a pool size of 16; the seventeenth layer is a Batch Normalization (BN) layer; the eighteenth layer is the Output classification result layer, using the Softmax activation function and the Bop optimizer. The final output has 16 categories.
Claims
1. A high-precision classification method for power quality disturbances based on a hybrid binary neural network, characterized in that: The following steps are involved: Step 1: construct a hybrid binary neural network model including a feature extractor and a classifier; The feature extractor includes a full-precision convolution layer that preserves the original input information and a binarization convolution layer that reduces the model size and improves the classification speed. The classifier includes a fully connected layer for classifying the extracted features and a Softmax activation function for outputting the power quality disturbance category. In step 2, after the full-precision convolution layer generates feature maps, these feature maps are binarized and used as the input of the binarized convolution layer. The model reduces memory usage by binarizing parameters and obtains the efficiency of binarization calculation. In step 3, after the binarization convolution layer, a max pooling layer is used to retain the most significant features in each pooling window and weaken the secondary features. A batch normalization layer is used to improve the generalization ability of the model and reduce the risk of overfitting. In step 4, the input data is linearly transformed by passing it through the fully connected layer, and then the Softmax activation function is applied to obtain the normalized category probability distribution to obtain the final classification result. In step 5, the classification results are compared with the actual classifications, and the accuracy is calculated to determine whether the accuracy meets the requirements. If so, the weight parameters of this model are output for subsequent power quality disturbance classification. Otherwise, the binary weights are updated based on the loss value using a pseudo-gradient weight update strategy.
2. The method according to claim 1, characterized in that Weight update strategy, in step 5, the pseudo-gradient weight update strategy includes the following steps: Step 1: Pass the input data through the network forward propagation and calculate the network output. This process includes binarization weights and activation functions. The forward propagation calculation process is: Among them, x p is the input data, O p is the output result, w is the weight, and F is the activation function. Step 2: Calculate the loss using the difference between the predicted output and the actual label. The loss function uses the cross entropy function, and the calculation formula is: Where N is the number of samples, C is the number of categories, and y ij is the true label of sample i (one-hot encoding), p ij is the probability that sample i belongs to category j predicted by the model. Step 3: In the binarized neural network, it is impossible to calculate the gradient based on the derivative of the loss function with respect to the weights as in traditional back propagation. A direct estimator is used to estimate the gradient. In step 4, the actual valued latent weights are used in the update step, while the binarized version of the latent weights is used during the forward pass. In step 5, real-valued weights do not need to be used during the inference process. Binarized weights are the only weights that need to be used and stored. The binarization of weights converts continuous-valued weights into +1 and -1 through a sign function. The obtained binary weights are used for subsequent power quality disturbance classification.