Rapid identification method for power quality disturbance
Technical Field
The invention belongs to the field of control and identification systems of power systems, and particularly relates to a method for quickly identifying power quality disturbance.
Background
With the wide use of new energy power generation and various nonlinear loads, the number of power quality disturbance events in a power system is increasing. Power quality disturbances are typically manifested as sudden changes or deformations in the amplitude, phase and frequency of the voltage or current. These disturbances can cause a number of problems, such as damage to electrical equipment, increased energy consumption, increased electromagnetic interference, and even damage to the safe and stable operation of the power system. The recorder records a large amount of PQDs data, and it is not practical to judge the type of power quality disturbance by manual observation. Therefore, it is necessary to research a classification technique that can automatically determine the type of the power quality disturbance and is efficient and accurate. The automatic identification of power quality disturbances is generally divided into the following 3 steps: signal analysis and feature extraction, feature selection and disturbance classification.
Disclosure of Invention
The invention provides a method for quickly identifying power quality disturbance, which is a system for identifying the types of power quality problems at the highest speed and accuracy when the power quality is disturbed, expands the thought for identifying the power quality disturbance and further improves the accuracy.
The invention adopts the following technical scheme:
a method for rapidly identifying power quality disturbance comprises the following steps:
(1) sampling the disturbance signal as input;
(2) extracting characteristic data through a convolutional neural network CNN, convolving an input data sequence f with a kernel function sequence g, and obtaining an extracted characteristic sequence T;
performing convolution on the one-dimensional time sequence signal, wherein the operation formula is as follows:
in the formula: tn is the data sequence after convolution, namely the characteristic sequence; n is the length of the input data f (N); g (n) represents a convolved kernel function sequence, randomly generated, of length equal to the length L of the convolution kernel; the length of the convolved sequence is NL 1;
transmitting the power quality disturbance signal sample f to an input layer, performing convolution operation through a kernel function sequence g in a convolution layer to form a characteristic sequence T, normalizing the characteristic sequence through a normalization layer, activating the characteristic sequence through an excitation layer, deleting redundant parts of the characteristic sequence through a pooling layer, outputting the finally processed characteristic sequence T through a connecting layer, and training and classifying output characteristics; the calculation process of the classification layer is as follows:
wherein k is the number of categories, and the output result of Softmax represents the probability that the input data is classified into each label;
(3) the convolutional neural network CNN adopts a random gradient descent method SGD, the SGD method is specifically as follows, and the target function of a sample is as follows:
in the formula: theta is an initial parameter; m represents the number of records in the training set; i represents the ith sample; (x)(i),y(i)) Representing a training sample set; h isθ(x(i)) Representing a fitting function;
(4) calculating the importance of each feature through GBDT, wherein the importance measurement of the features by using GBDT is based on the number of times that each feature is used for deciding the node splitting of the tree and the structure gain of the model after each splitting, averaging all the trees after cumulative summation, and the importance of the feature j is measured by the average value of the importance of the feature in all the trees:
wherein M is the number of decision trees, and the calculation formula of the importance of the characteristic j in a single tree is
In the formula: the number of non-leaf nodes of the tree is L-1; is and node vt(ii) a relevant segmentation feature; t is tiIs the structural gain of the model after node t splitting;
(5) constructing a disturbance classifier by using a GBDT algorithm, wherein the feature vector of each sample forms an input space, and the corresponding disturbance class label forms a mark space; after a feature vector of a new sample is obtained, the learned classifier can predict the disturbance category of the sample, and then the identification of the power quality disturbance is realized.
In order to improve the classification accuracy of the power quality disturbance, a power quality disturbance identification method based on a convolution-gradient lifting tree is adopted for the characteristic of time sequence of disturbance signals. First, the disturbance signal is sampled as an input. Then, feature data are extracted through a Convolutional Neural Network (CNN), the extracted feature data are measured based on the importance of each feature of the gradient lifting tree, and important features are selected. And finally, training and constructing a gradient lifting tree according to the selected feature set to obtain a disturbance classifier, and then screening and updating feature data. And finally, learning and classifying the output characteristic data.
The invention has the advantages and effects that: after a large amount of disturbance data are recorded by the wave recorder, the problem of electric energy quality disturbance is identified more quickly and accurately through a composite algorithm of a convolutional neural network and a gradient lifting tree, the problem is solved more quickly, the loss caused by disturbance is reduced for a power grid, and the income is improved.
Drawings
FIG. 1 is a diagram of a convolutional neural network architecture;
FIG. 2 is a flow chart of the convolution-gradient lifting tree algorithm.
Detailed Description
The invention is explained in more detail below with reference to the drawings and exemplary embodiments.
A method for rapidly identifying power quality disturbance comprises the following steps:
(1) convolutional Neural Networks (CNN) can handle signals of different dimensions. The disturbing signal of the present invention belongs to a one-dimensional signal, so a one-dimensional CNN is used. Because the power quality disturbance signal of the invention has time sequence and the characteristic extracted by CNN lacks time dependency, the classification accuracy rate may be lower. The CNN classification network structure is shown in fig. 1. The structure of the device is respectively an input layer, a convolution layer, a normalization layer, an excitation layer, a pooling layer, an exit layer, a full-connection layer and a classification layer.
(2) The purpose of convolutional layers is to extract features, which are a key ring of the entire CNN. The invention carries out convolution on one-dimensional time sequence signals, and the operation formula is
In the formula: tn is the data sequence after convolution, namely the characteristic sequence; n is the length of the input data f (N); g (n) represents a convolved kernel function sequence, randomly generated, of length equal to the length L of the convolution kernel. The length of the convolved sequence is NL 1. The flow of the above convolution can be summarized as follows: and (4) convolving the input data sequence f with the kernel function sequence g, wherein the result is the extracted characteristic sequence T.
The calculation process of the classification layer is as follows:
in the formula, k is the number of categories. The output of Softmax represents the probability that the input data is classified to each tag.
The classification scheme is roughly as follows: firstly, a power quality disturbance signal sample f is transmitted to an input layer, then convolution operation is carried out through a kernel function sequence g in a convolution layer to form a characteristic sequence T, then the characteristic sequence is normalized through a normalization layer, activated through an excitation layer and deleted through a pooling layer, finally the processed characteristic sequence T is output through a connecting layer, and output characteristics are trained and classified.
(4) The CNN method of the invention adopts a random gradient descent method (SGD). The SGD method is specifically as follows. The objective function of the sample is:
in the formula: theta is an initial parameter; m represents the number of records in the training set; i represents the ith sample; (x)(i),y(i)) Representing a training sample set; h isθ(x(i)) The fitting function is represented. Its advantages are high updating speed and convergence speed of parameters in iterative process.
(5) Gradient boosting is a boosting algorithm using a Regression tree in cart (classification and Regression tree) as a basis learner, and an ensemble learner is obtained through weighted combination of the basis learners. GBDT uses an additive model and a forward stepwise algorithm to implement an iterative process of learning, and in each step, the next decision tree is determined by minimizing a loss function. Aiming at the difficult problem that the optimization problem of each step is difficult to solve, the gradient lifting method is to fit the next decision tree by using the value of the negative gradient of the loss function in the current model as the residual error approximate value of the lifting tree. GBDTs typically have three regularization modes to prevent overfitting to the training data. The first is a strategy to reduce the contribution of each regression tree to the prediction by setting the learning rate. The second is sub-sampling, where a subset of the sample set is obtained by non-back sub-sampling when fitting a new regression tree. And the third method is to carry out pruning treatment on a base learner, namely a CART regression tree. In addition, the complexity of the tree model can be used as a regular term to be added into an optimization target, and the generalization capability is further improved. Therefore, compared with other classification algorithms, the generalization capability of the GBDT is generally stronger, and higher classification accuracy can be obtained.
GBDT can calculate the importance of each feature and realize the ranking of feature importance. Therefore, after obtaining the original feature set F1-F53, GBDT can be used for feature selection to reduce the computational complexity and realize the classification of the disturbance more effectively. The importance measure of the features using GBDT is based on the number of times each feature is used to make a decision on the node split of the tree and the structure gain of the model after each split, and all trees are averaged after cumulative summing. The importance of feature j is measured by the average of the importance of the feature across all trees:
in the formula, M is the number of decision trees. The importance degree calculation formula of the characteristic j in a single tree is as follows
In the formula: the number of non-leaf nodes of the tree is L-1; is and node vt(ii) a relevant segmentation feature; t is tiIs the structural gain of the model after splitting of the node t
(5) The GBDT algorithm is used for constructing the disturbance classifier, and the process of learning the mapping from the input space to the mark space is provided. The feature vectors of the samples form an input space, and the corresponding disturbance category labels form a labeling space. FIG. 2 shows a construction process of a disturbance classifier based on a gradient lifting tree. After a feature vector of a new sample is obtained, the learned classifier can predict the disturbance category of the sample, and then the identification of the power quality disturbance is realized.
Example 1
By way of simulation data, in contrast to convolutional networks and long-short term memory networks, the table is as follows: