Classification of Power Quality Disturbances using Wavelets and Support Vector Machine

—In this paper we present a new method for detection and classification of power quality disturbances. Two discrete wavelet transforms with different wavelet filters are used in the feature extraction process. In this way we eliminate the problem of the selection of the most adequate wavelets in the current methods for classification of power quality disturbances. For the classification of the power disturbances we use a support vector machine. In order to reduce the computational cost of the proposed method, binary decision tree is created and a support vector machine classifier is trained for every node of the tree. The obtained experimental results show high accuracy of the proposed method.


I. INTRODUCTION
The quality of the power is with increasing importance due to the great damage caused by power quality (PQ) disturbances.The damage is clearly noticeable at great public or industrial facilities where the PQ disturbances cause malfunction in the equipment [1].In order to improve the power quality, the sources of PQ disturbances should be known before appropriate mitigating action can be taken.This can be achieved by detection of different power system disturbances.The detected disturbances are subsequently classified and information describing localization, duration and type of the disturbance is reported.Manual approach of analyzing and identifying PQ disturbances such as visual inspection of disturbance waveforms is laborious.The conventional techniques for analyzing these problems are too simple and rigid to capture all the relevant disturbance structure.A reliable automated system for disturbance detection and classification has many advantages over a manual one.These advantages include the speed of processing, amount of data that can be processed, ease of data collection and storage, reliability and cost.
Several methods for automated detection and classification of disturbances have been proposed recently.Some frequently used artificial intelligence (AI) based classifiers are rule-based expert systems, fuzzy classification Manuscript received February 12, 2012; accepted April 29, 2012.This work was supported by the EC project SEE ERA NET PLUS under grant ERA 078/01.systems, artificial neural networks (ANN), and support vector machines (SVM) [2].All these techniques use feature vectors derived from disturbance waveforms to classify power quality events.Different digital signal processing techniques can be used in the process of extraction features that characterize PQ disturbances [3].Among them, wavelet transform has been used extensively in the last years.Wavelet transform analysis approach is able to give information about frequency contents of the recorded signal and information about components time appearance.These features make the wavelet transform well suited for the analysis of the power system transients caused by various PQ disturbances [4].In [5], a comprehensive review on using wavelet transform approach for processing of the power quality disturbances is given.Here, we will consider three wavelet based methods that are used for comparison purposes later in the paper.In [6], Abdel-Galil et al. use a learning-based method in order to classify the power disturbances.A decision tree is created, using wavelet analysis in the feature extraction process.The signal, which is tested for power disturbances, is decomposed in 11 levels and the energy of every obtained signal is calculated.The reported overall accuracy is 90.4%.In [7], Haibo He et al. use the same feature vector as [6], however they use a different learning-based method.A type of neural network, called SOLAR (self-organizing learning array), is used for the classification of the power disturbances.The reported overall accuracy is 94.93%.They have also done a comparative study using SVM, obtaining accuracy, which is in some cases are very close to the accuracy obtained using SOLAR.In [8], wavelet norm entropy-based effective feature extraction method for power quality disturbance classification problem is presented.The disturbance classification schema is performed with the wavelet neural network (WNN).It performs a feature extraction and a classification algorithm composed of a wavelet feature extractor based on norm entropy and a classifier based on a multi-layer perceptron.The reported overall accuracy is 95.71%.
In this paper, we present a new wavelet based method for power quality disturbances detection and classification.Similarly to [6] and [7], wavelet feature extraction technique based on energy of detail and approximation coefficients is used for automatic PQ disturbances classification.In order to overcome the problem with the choice of the appropriate wavelet we use two discrete wavelet transforms (DWT), one with short filter and another with long filter in the proposed automatic disturbance recognition and classification procedure.The idea is to equally treat the analyzed data by the both filters and to use representation that emphasizes the uniqueness, selectivity and characterization of every distinctive class of disturbance.The feature vector can be constructed by concatenating the feature vectors obtained after applying wavelet transform with both filters as shown in Fig. 1.In most wavelet based methods rms values of different sub-bands are used as feature vectors.
In order to classify the power disturbances we use SVM as a classification method.Analyzing the properties of the power disturbances we designed binary decision tree and a SVM model is created for every node of the tree.

II. DISCRETE WAVELET TRANSFORM
The continuous wavelet transform of a signal f(t) is defined as where 1 ( ) , ; 0 The function ψ(t) is the base function or the mother wavelet and a and b, are the dilation and translation parameters, respectively.Since the transformation is achieved by dilating and translating the mother wavelet continuously, it generates substantial redundant information.Therefore, instead of continuous dilation and translation, the mother wavelet may be dilated and translated discretely by , where a 0 and b 0 are fixed constants with a 0 > 1 and b 0 > 0, , m n Z ∈ and Z is the set of integers [9].The resulting expression is given with The simpler choice is to make a 0 = 2 and b 0 = 1.With this, wavelet transform is called a dyadic-orthonormal wavelet transform, and can be easily and quickly implemented by filter bank techniques normally known as Multi-Resolution Analysis (MRA) [10].
The Fig. 2 shows a MRA diagram, which is built and performed by means of two filters: a high-pass filter with impulse response h[n] and its low-pass mirror version with impulse response g [n].These filters are related to the type of mother wavelet and can be chosen according to the application.At each stage, the input signal is decomposed into a coarse approximation signal (which can be considered as a low-pass version of the input) and an "added detail" signal (which can be considered as a high-pass version).The approximation signal is further decomposed to produce new coarser representation of the signal.After K levels of decomposition, reference signal a K [n] with resolution reduced by factor 2 K with respect to the original signal, as well as the detail signals contains precisely the information that, together with the reference signal a i [n], enables reconstruction of a i-1 [n], which is the reference signal at the next higher resolution.
where w x ⋅ denotes the dot product and w the normal vector to the hyperplane.The parameter / b w determines the offset of the hyperplane from the origin along the normal vector w.We want to choose the parameters w and b to maximize the margin, or distance between the parallel hyperplanes that are as far apart as possible while still separating the data.These hyperplanes can be described by the equations: The problem can be solved by minimizing This problem can be expressed as where α i are non-negative Lagrange multipliers.In this way, most of the α i are chosen to be zero.The α i which are not zero correspond to the feature vectors which are hardest to classify.These feature vectors are called support vectors [11].In [12] and [13] soft margin SVM was introduced.When the two classes are not linearly separable soft margin SVM can still chose hyperplane which best separates the data.This can be expressed as the following optimization problem: The slack variables, i ξ , were introduced, which measure the degree of misclassification of the feature vectors x i , c > 0 is the penalty parameter of the error term, and ( , ) ( ) ( ) is the kernel function.The kernel function maps the feature vector into a vector space where the feature vectors are linearly separable.In the proposed method the kernel is defined by ( , ) ( ) ( )

IV. PROPOSED METHOD
For the feature extraction process we use DWT, as used in [6] and [7].The DWT has been used intensely in the past years and in the most cases it is a better choice for the analysis of the PQ disturbances, compared to the discrete Fourier transform (DFT), since it provides not only frequency information, but also information about location of the components.The wavelet analysis is in fact a measure of similarity between the basis function (wavelets) and the signal itself.Therefore, the selection of the most adequate wavelet mother function to be used in the analysis is one of the key factors in successful application of wavelets, not only in power quality applications.As general rule, for detection of short and fast (transient) disturbances, shorter filters are proposed as better, while for slow transient disturbances long filters are presented as particularly good [9], [14].This means that selection of the best filter for detection and classification of PQ disturbances is not an easy task and in general depends from the application.
In order to reduce the influence of the choice of the wavelet we propose the use of two DWT with two different wavelets, one with high support and one with low support.Introducing the second wavelet transform in the feature extraction process provides additional information about the analyzed signal, which makes the classification more accurate.The increased accuracy comes with the price of increased computational complexity of the algorithm.However, the additional wavelet transform allows fewer levels of decomposition to be used, which reduces the computational complexity of the algorithm.Additionally, we design a classification algorithm which also reduces the number of operations in the test phase.
The signal, which is tested for PQ disturbances, is first decomposed in l-levels using discrete wavelet transform.The energy of the detail and approximation coefficients at each level of decomposition is used as feature vector, and is calculated according following equations: where d ij 1, , i l = … is the wavelet detail coefficient in the wavelet decomposition from level 1 to level l and a ij is the wavelet approximation coefficient in the wavelet decomposition at level l.N is the total number of wavelet coefficients at each level of decomposition, ED i is the energy of detail coefficients at the decomposition level i and EA l is the energy of the approximate wavelet coefficients at decomposition level l.In this way, the size of the analyzed data is significantly reduced and the original waveform is represented with only l+1 coefficient.The same feature vector is also used in [6] and [7].
The overall feature vector is obtained after applying another wavelet transform and calculation of the energy of detailed and approximation coefficients in the same manner.The overall feature vector has length 2l+2.Increasing the length of the feature vector will increase the computational cost.With aim to make length of the feature vector and computational cost comparable with other wavelet based methods for detection and classification of PQ disturbances we reduce the number of decomposition levels in the process of feature vector extraction.Although there are many classification methods we have chosen SVM as a main of-the-shelf machine learning method.We have constructed binary decision tree shown on Fig. 4, where for every node a liner-SVM model is created.The tree is designed analyzing the properties of the seven signals.At the root node we have grouped the seven types of signals into two groups in such way that they would be easiest to separate.In the first group are the signals without harmonic disturbances and in the other with harmonic disturbances.The feature vectors extracted from the signal from the second group will have higher values for the coefficients corresponding to the energy in the higher frequencies, thus making the two groups easy to classify.The rest of tree is constructed in a similar way i.e. grouping the signals into two groups in a way that will make the classification easiest.At the leaf nodes the algorithm separates the signals which are hardest to separate.The designed decision tree is illustrated at Fig. 5.
The results with the use of the decision tree are similar with the results using the typical one-against-all or oneagainst-one approach.However, in the testing phase only three decisions are made instead of seven, thus making this approach faster.We have used the libSVM implementation for MATLAB [15].

V. EXPERIMENTAL RESULTS
For comparison purposes the power disturbances are modeled in the same way as in [6]- [8].All these works include the same disturbance types and the same pattern numbers generated by parametric equations of data (Table .I) for training and testing of the classification stage.Seven different classes are considered, including the case with no power disturbances: normal, swell, sag, harmonic, outage, sag with harmonic and swell with harmonic, denoted with C1, C2, C3, C4, C5, C6, C7, respectively.Ten cycles are included in every signal with a sampling frequency of 256 samples/cycle i.e. every signal has 2560 samples.The normal frequency is assumed to be 50Hz.
The The choice of the number of decomposition level l has significant influence on the process of classification.Choosing higher l will, generally, bring more information in the system and in that way higher accuracy.On the other hand, higher number of decompositions means more calculations i.e. more computational cost.In most of proposed wavelet based methods for detection and classification of power quality disturbances the level of decomposition is set between 10 and 12. Since two DWTs are used for extraction of feature vectors in the proposed method we reduce the level of decomposition to l =7.
Table II shows obtained results when only one wavelet transform is used in the process of feature vector extraction.The influence of the used wavelet on the classification results is evident.When two wavelet transforms with different wavelets are applied, as explained in Section 1, significant improvements in the classification processes are obtained.Some of obtained results are given in Table III.These results have very high classification accuracy rate.The results also show that the filter v24, which is mainly used for harmonic analysis [3], is not appropriate choice for classification of PQ disturbances.

∑
Additionally, we compared the obtained results with the results presented in [6], [7] and [8].In [7] and [8], feature vectors are extracted after applying wavelet transform with db4 wavelet in 10 and 12 levels, respectively and have length of 11 and 13 elements.The results are comparatively presented in Table IV.As seen from Table IV, the performance of the proposed wavelet classification methods exceeds the performance of the classification methods proposed in [6]- [8].
In order to analyze the computational complexity of the proposed method we analyze the number of support vectors obtained in the training process.The classification function of the linear SVM is where i x are the support vectors and m is the number of the support vectors.It can be seen that the number of operations depends of the number of the support vectors.In Table V the number of support vectors is given for every SVM model of the designed tree.It can be seen that due to the correct grouping of the signals in most cases the classification is very easy and the SVM requires very few support vectors.The number of support vectors is largest for the SVM that distinguishes the sags from the outages.This is result of the fact that the two disturbances are modelled similarly and in some cases, even for a human, can be difficult to distinguish.Compared to default multi-class in the libSVM (1 vs 1) the total number of support vectors is slightly reduced.However, the proposed classification method does not use all of the support vectors for a given test sample and in the case when the signal is not sag or outage the number of calculations is significantly reduced.

VI. CONCLUSIONS
In this paper we have presented a new method for classification of power quality disturbances based on discrete wavelet transform and support vector machine.High classification accuracy rate of the proposed method is result of the use of two wavelets, one with long support and one with short support.Additionally, analysing the properties of the power disturbances signals, we have designed a SVM decision tree that reduces the number of operations made in the testing phase.The presented results show superior accuracy compared to similar works.
to the constraint that the hyperplane should separate the samples of the two classes correctly : i

Fig. 4 .
Fig. 4. Classification of the power disturbances using SVM decision tree.
learning for single binary classifier was done using training data set with size of 1400 examples.In the training data set each training class has size of 200 data examples.The data sets with same size were used in the testing process.

Fig. 5 .
Fig. 5. Example of separating seven classes of data.

TABLE I .
PQ DISTURBANCE MODELS.

TABLE II .
CLASSIFICATION PRECISION FOR DIFFERENT WAVELET FILTERS.

TABLE III .
CLASSIFICATION PRECISION FOR DIFFERENT PAIRS OF WAVELETS.

TABLE IV .
PERFORMANCE COMPARISON OF CORRECT CLASSIFICATION RESULTS.

TABLE V .
NUMBER OF SUPPORT VECTORS PER SVM MODEL, TOTAL NUMBER OF SUPPORT VECTORS FOR THE SVM-DECISION TREE AND THE DEFAULT LIBSVM IMPLEMENTATION.