TY - JOUR AU - Wahab, Noor Izzri Abdul AB - 1. Introduction Microgrid (MG) generally provides reliable, economic, and secured energy supply to the critical loads and remote areas of communities, with following additional features: promotes demand side management; low carbon emission of energy supply; accommodates multiple generating options from different types of Distributed Generation (DG) sources, and so on [1]. It is a major challenge to maintain the quality of energy supply in the MG network while penetration of nonlinear and unbalanced loads, renewable energy (RE) sources, and switching of heavy loads, capacitor banks, and network faults, etc. The PQEs (voltage sag, swell, harmonics, transients, interruptions, unbalanced voltage and current, etc.) can influence the overall performance of MG operation and shorten the life time of power devices integrated into the MG system [2, 3]. Therefore, to achieve improved PQ with safe and reliable operation of the MG power system, the source of PQEs must be detected and classified by means of applying advanced classification techniques [3, 4]. In view of this, many researchers have applied different signal processing techniques (SPT) in the pre-processing stage along with several classifiers during the classification phase of PQ analysis. The extracted features from the PQE signals during pre-processing analysis can be used to learn and verify the advanced classifiers to get class values of predictions at the final decision phase [3–5]. In the pre-processing stage, several signal analysing methods were used by the researchers for extraction of features from PQEs. Authors [6] applied the spectral analysis of the Fast Fourier Transform (FFT) and Discrete Fourier Transform (DFT) analysis techniques for discriminating of numerous PQEs in power systems. The Short Time Fourier Transform (STFT) in [5] applied for analysis of nonlinear nature of PQEs in power system. These methods are incapable of analysing the nonlinear nature of PQEs [7]. To nullify the issues of these transforms, Wavelet Transform (WT) analysis was widely used by the researchers in PQ study. Because, WT is more flexible in analysing PQEs in both time and frequency domains concurrently [8]. On the other hand, computational burden and being less immune to the noise effect are the biggest issues in the WT approach. In the view of PQEs and fault study applications, the Discrete Wavelet Transform (DWT) of WT series is extensively used [9]. Nevertheless, the choice of mother wavelet for a particular application can be considered as a main challenge in DWT analysis [4]. The researchers extensively used a well-known mother wavelet, namely Daubechies-4 (db4), to analyse PQEs in the majority of the research works [10]. In comparison to the existing SPT, the discrete method of wavelet analysis is broadly utilized since it takes minimum processing time and offers higher accuracy while extracting features in fast manner from the PQE signals [11]. Therefore, in this research work, the application of the DWT technique has been considered for the extraction of features from various PQEs. Numerous machine learning algorithms were used by the research experts in the classification phase of the PQ studies. The most common techniques include decision trees (DT) [12], Fuzzy logic (FL) based classifiers [13], artificial neural networks (ANN) [14], neural networks with probabilistic function (PNN) [15], Naive Bayes method (NB) [16], K-nearest neighbour (KNN) [14], and SVM [17, 18] have been utilized to classify the PQEs. Among all these classifiers, SVM is one of the most powerful and effective for classifying linear and non-linear data [19]. Additionally, it has superior generalisation performance and is capable of handling an expansive, dimensional input vector proficiently in comparison with other conventional classifiers [5]. Typically, the SVM is useful to avoid over-fitting problem (as encountered in neural networks) and offers the highest accuracy of classification results, especially in high dimensional data sets [20]. Thus, considering the advantages of the SVM classifier, many researchers have applied SVM technique to classify complex PQEs in large power networks as well in MG power systems. Authors [21] used a learning framework which was developed with WT and SVM methods to classify complex PQEs. For the identification of different PQEs in the PV integrated power network, authors [22] applied the SVM learning method with multi-class features. Ray et al. [23] proposed SVM with Independent Component Analysis (ICA) to distinguish between different PQEs in the MG power network. Wang Y et al. [24] applied SVM with Multi Resolution Analysis of DWT to categorise different PQEs. Cortes Robles et al. [25] proposed multi-scale recurrence quantification decomposition (MSRQD) method along with SVM classifier for classification of complex PQEs in grid connected MG system. Furthermore, SVM with different kinds of kernel functions can be used to enhance the classifier performance while solving the non-linear nature of classification problems in PQ study [26]. The kernel function can transform the inseparable data from a small dimensional area to a large dimensional area where the information can be separated more accurately. The different types of kernel functions of SVM include linear kernel, polynomial kernel, and Gaussian kernel (Radial Basis Function), etc. [27]. Biswal et al. [28] proposed a multiclass SVM using linear kernel function with a combination of disturbances versus normal (DVN) approach of feature extraction for classifying complex PQEs in power systems. Radial Basis Function (RBF) and polynomial kernel-based SVM were introduced by the authors of [29] in a hybrid DG environment of a power system network. Similarly, the authors in [30] utilised SVM with RBF based kernel to detect the disturbance patterns in the three-phase simulated signals. Most of the intelligent classifiers, like ANN, PNN, NB, KNN, SVM, and different kernels of SVM, are stated in literature to have their own strengths and weaknesses. For enhancing the precision and generalisation ability of individual weak learners, several ensemble classifiers are used by the researchers. Ensemble classifiers are mainly used to improve the overall performance and stability of weak classifiers through computing their output predictions in different ways [31]. From several research studies, it can be proven that the ensemble approach to classification offers promising results of accuracy compared to individual weak classifiers. Several ensemble classifiers have been used by researchers to discriminate between different PQEs in conventional and RE integrated power system networks. The Bagging ensemble classifier with the flexible analytic wavelet transform (FAWT) method in [32] is applied to discriminate multiple PQEs in RE connected power networks with promising results compared to individual weak classifiers. The S-Transform extraction method with Adaboost ensemble approach [33] and Hilbert Huang Transform feature extraction with adaptive NFS [34] have been used for PQ analysis with achievement of higher accuracy and better performance than single classifiers. Furthermore, DWT analysis with voting approach in [35] and stacking ensemble approach in [36] have shown better effectiveness in predicting various PQEs in the PV integrated power network. Similarly, to improve the classification accuracy and robustness of individual weak classifiers, the authors in [37] used Random Forest classifier for discrimination of multiple PQ signals in RE connected power network. Thus, it is clear from the literature of the ensemble approach that ensemble models can significantly improve the overall accuracy and generalisation ability of weak classifiers. Hence, in this study, SVM based Random Subspace (RS) ensemble classifier is proposed to discriminate against different PQEs in the MG network. The structure of classifiers used in the RS ensemble method is constructed with different subsets of features which are sampled randomly from the main data set [38]. Because of using randomly selected subset features, the RS method can provide low bias risk with enhancement of prediction performance for the weak classifiers. The RS method also offers superior performance when the training data set has redundant features [39–41]. In most of the research works [2, 4, 23, 24, 42, 43], the PQ analysis in the MG network was carried out either in the on-grid or off-grid (islanded) mode of MG operation. However, to ensure reliable operation and improved PQ of MG network, it is necessary to discriminate between the PQEs in both the on-grid and off-grid modes of MG operation. Also, limited research work was observed with the analysis of PQEs in MG network using an ensemble approach of classification in MG network under the weather intermittence condition of RE sources. Hence, in this study, discrimination of different PQEs is considered in both modes (on-grid and off-grid) of the PV connected MG network under variation of solar PV irradiance with real time condition. From the final results of classification analysis, it is inferred that the proposed SVM based RS ensemble classification model outperforms different types of kernel based SVM classifiers (Linear, Quadratic, and Cubic) in terms of classification accuracy and performance level. The important objectives of this research study are listed below: For analysing the causes of different PQEs and evaluating the effectiveness of kernel based SVM learners and the proposed SVM based RS ensemble classifier, a simulation network of the PV connected MG model is formulated with introduction of different PQEs. The classification framework is proposed with a combination of DWT technique along with different types of kernel based SVM and RS ensemble classifiers to identify and categorize the various types of PQEs in both the mode of MG network under STC and real time varying solar irradiance of PV conditions. The effectiveness of the proposed RS ensemble model has been verified through a comprehensive evaluation of Performance Factors (Kappa Statistics (KS), Recall, Precision, ROC, and F-Measure) results with the kernel based SVM classifiers. This article is structured as follows: Section 2 explains the definition of MG simulation model with addition of various PQEs, Section 3 describes the concept of the classification framework model, Section 4 presents the detail of data acquisition and signal processing method, Section 5 describes the SVM classifier concept with various kinds of kernel functions (Linear, Quadratic, and Cubic) and the proposed RS ensemble classification model, Section 6 discusses the results analysis based on the classification and performance analysis of the proposed RS ensemble classification model and kernel-based SVM classifiers, Section 7 describes the comparative analysis, and the outcomes with future scope of this study are concluded in section 8. 2. Overview of MG model The Matlab-Simulink software tool is used to develop a PV integrated MG simulation model. The MG model is simulated with the introduction of different PQE’s (normal, voltage sag & swell, harmonic distortions, and transients (due to switching of capacitor bank, PV inverter, and LG fault) for analysis. The configurations on-grid and off-grid MG models are portrayed in Fig 1A and 1B, respectively. The MG model includes different types of Distribution Generation (DG) sources (Solar Photovoltaic (PV) and diesel powered genset)) and loads (linear and non-linear). Also, the MG model includes with 25 kV feeder lines with a length of 2 km (each). Details of the power ratings of all elements used in the MG network are shown in Table 1. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 1. MG Network Model (a) On-grid mode (b) Off grid mode. https://doi.org/10.1371/journal.pone.0262570.g001 Download: PPT PowerPoint slide PNG larger image TIFF original image Table 1. Detail of MG components. https://doi.org/10.1371/journal.pone.0262570.t001 2.1 Description of different PQEs During PQ analysis, it is considered to follow the threshold limits (as per IEEE 1159 standard [44] of different PQEs in the MG network. Normal and the three most common voltage-related PQEs (sag, swell, and harmonic distortions) are generated by switching heavy (sag/swell) and non-linear (harmonics) loads in the MG network’s off-grid mode. Furthermore, three PQ transients have been generated by switching of capacitor bank (transients-1), PV inverter (transients-2), and ground fault-LG (transients-3) for both modes (on-grid and off-grid) of the MG network. The PQEs with corresponding switching actions are listed in Table 2. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 2. Switching conditions of different PQEs. https://doi.org/10.1371/journal.pone.0262570.t002 2.1 Description of different PQEs During PQ analysis, it is considered to follow the threshold limits (as per IEEE 1159 standard [44] of different PQEs in the MG network. Normal and the three most common voltage-related PQEs (sag, swell, and harmonic distortions) are generated by switching heavy (sag/swell) and non-linear (harmonics) loads in the MG network’s off-grid mode. Furthermore, three PQ transients have been generated by switching of capacitor bank (transients-1), PV inverter (transients-2), and ground fault-LG (transients-3) for both modes (on-grid and off-grid) of the MG network. The PQEs with corresponding switching actions are listed in Table 2. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 2. Switching conditions of different PQEs. https://doi.org/10.1371/journal.pone.0262570.t002 3. Methodology of classification Fig 2 demonstrates the basic methodology for identification and discrimination of various PQEs within the MG network. The main steps in the process of classification are explained below: Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 2. Fundamental concept of proposed classification strategy. https://doi.org/10.1371/journal.pone.0262570.g002 Data Collection (Step-1): During the simulation of the PV integrated MG model, signal data from different PQEs are collected. Feature Extraction (Step-2): During this step, with the help of the DWT technique, features are extracted from disturbance signal of different PQEs. Prediction (Step-3): To train the kernel based SVM learners and RS ensemble classifier that extracted features are used to get final predictions for further evaluation. Final decision (Step-4): Based on the final predictions, each classifier gives output class labels (K1 to K10) in the final stage. 4. DWT method of feature extraction The Wavelet transform analysis method is one of the most effective methods for decomposing a fast varying signal into numerous sub-components in time and frequency domains [45]. The WT variants are often available in the form of continuous and discrete variants. Continuous wavelet transform (CWT) can be used to address the resolution constraint in STFT, but in the case of real-time applications, it is less beneficial and has low rpetition. The discrete method of wavelet transform (DWT) can be used to nullify the drawbacks of CWT and mathematically can be defined as [46, 47], (1) where is the scaling factor, is the translation factor, m and n are the representation of integers, X(n) is the time signal, and f is the function of the mother wavelet. Multi Resolution Analysis (MRA) is typically used for the DWT process to get wavelet transform coefficients (detail and approximate) through decomposing of the input signal. MRA is more appropriate for decomposing the PQE signals, because it has the characteristics of using less memory and simple implementation. In this process, a series of filter banks are used at each point of decomposition to decompose the signals at different resolutions. Fig 3 indicates the decomposition of the test signal up to the second stage. The input signal V(n) is passed through a collection of high-pass (g1) and low-pass (h1) filters to obtain the detailed (D1, D2) and approximate coefficients (A1, A2). In addition, the signal is downscaled by a factor of two at each step and the approximation of coefficient is used for further decomposition. This decomposition process is carried on till the specified decomposition level is reached [46, 47]. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 3. Signal decomposition (stage two). https://doi.org/10.1371/journal.pone.0262570.g003 From the below given Eqs (2) and (3), that detail (Di) and approximation (Ai) coefficients can be evaluated: (2) (3) where Di and Ai are the coefficients of detail and approximation, respectively at the ith level. where Di and Ai denote the detail and approximation coefficients, respectively, at the level of ith. High-pass and low-pass filters are associated with the wavelet ω (t) and scaling β (t) functions and can be expressed as, (4) (5) The mother wavelet of Daubechies-4 (db4) is commonly used in PQ analysis to detect fast transient signals in the power system, according to the literature [48, 49]. Therefore, in this research work, mother wavelet of db4 is considered for analysis of PQE signals. 4.1 Evaluation of energy value The feature extraction is useful in such a way as to provide reduced dimension of the input vector matrix with useful information for the classifiers. Using the Eq (6) [49], the energy value (EV) can be estimated from the detail coefficients of DWT analysis. (6) let mean , j = 1,2,3….l (decomposition level), K is the number of samples for each decomposed signal. 4.1 Evaluation of energy value The feature extraction is useful in such a way as to provide reduced dimension of the input vector matrix with useful information for the classifiers. Using the Eq (6) [49], the energy value (EV) can be estimated from the detail coefficients of DWT analysis. (6) let mean , j = 1,2,3….l (decomposition level), K is the number of samples for each decomposed signal. 5. Materials and classification methods In this research, the software tool WEKA is utilised to discriminate between different PQEs in the MG network using extracted features. The WEKA is an effective tool with inclusion of several classification algorithms and the option of providing base and ensemble classification, clustering, and visualization facilities [10]. In this study, different types of kernel based SVM classifiers such as SVM linear kernel, SVM polynomial (quadratic and cubic), and SVM based RS ensemble classification approach have been considered to classify various PQEs like normal, sag, swell, and distortion of harmonics with consideration of class labels such as K1, K2, K3, and K4, respectively, in off-grid mode of the MG network. In addition, other PQEs like three numbers of PQ transients (due to switching of capacitor bank and PV inverter, and LG fault) have been classified in both modes (off-grid and on grid) of the MG network with consideration of the following class labels: K5, (transient 1) K6 (transient 2), K7 (transient 3) in off-grid and K8 (transient 1), K9 (transient 2), K10 (transient 3) in on grid, respectively. The estimated energy values from the extracted features of various PQE signals have been utilised to learn the kernel based SVM learners during the first phase of classification. While learning the classifiers, a k-fold cross validation method is applied with the input data set to nullify the issue of over-fitting. The prediction capability of classifiers can be assessed with the help of the cross validation method [50]. The training data (X) is separated into equal sized chunks with a bunch of k disjoint subsets (X1, X2, …., Xk). From available k-subsets, one subset is utilised for testing, and the remaining subsets (k-1/k) are utilised for classifier training [50]. In this work, cross validation with 10 folds is considered while learning the classifiers. This section describes the kernel based SVM classifiers (linear, polynomial (quadratic and cubic)), and the proposed RS ensemble classifier in more detail. 5.1 SVM classifier SVM is a more flexible machine learning algorithm for the applications of pattern recognition and classification [4]. The SVM rule algorithm was developed by Vapnik [51] and operates on the basis of supervised learning theory. SVM seeks to separate the heperplane in an optimum way by maximising the margin data set and hyperplanes [52]. It offers good generalisation accuracy on unknown data and supports the intensive optimization methods that enable SVM to learn from a large scale of data [53]. An example of the SVM concept is shown in Fig 4. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 4. Concept of SVM classifier. https://doi.org/10.1371/journal.pone.0262570.g004 For a given training data set, , where xi ∈ Rn is the vectors of input data, yi ∈ {+1, -1} denotes different classes, and K is the number of samples. The given training data set can be separated linearly by the hyperplane f(x), as represented by Eq (7) [52–54] (7) where w and b represent the terms for weights and bias used to optimise the position of the hyperplane separation. The constraints as given in Eq (8) should be satisfied to separate the hyperplane. (8) It is possible to estimate the distance between margin and vectors xi that lies on the incorrect side of the margin is generally outlined by the positive slack variable £i. For separating given data, optimal hyperplane is determined by solving the optimization problem which is expressed in Eq (9): (9) Prone to yi(w.xi + b) ≥ 1 - £i, and £i ≥ 0, let C denote the penalty for error, and by using Lagrangian multipliers αi, the problem of optimization (Eq (9)) will be transformed into a problem of dual quadratic optimization, as expressed in Eq (10) [54]: (10) Subject to , The problem of dual optimization is possible to solve by using linear decision function, expressed in the Eq (11): (11) The kernel functions of SVM are useful for solving nonlinear classification problems. By using a nonlinear function (φ), the kernel functions of SVM can be used to transform inseparable data from low-dimensional space to a higher-dimensional space where the data is separated linearly [52]. The function of non-linear decision with kernel (K) inclusive can be defined as follows: (12) where k(xi, xj) is the kernel function that can be written as ɸ(xi) and ɸ(xj), respectively. In this study, SVM classifiers with different kernel functions like linear, olynomial (quadratic and cubic), and RBF (Gaussian fine) have been used to categorise various PQEs in the MG model of power network. Furthermore, for classification of multi class PQEs in MG network that kernel based SVM classifiers have been used with adoption of the One Against One (OAO) multiclass method [55]. The classification of various PQEs in the MG network using kernel based SVM classifiers is shown in Fig 5. A 10 folds cross validation method is applied with a given input data set (400 instances (40 instances per PQE) and three features) while learning kernel based SVM classifiers (linear kernel, and polynomial kernel (Quadratic & Cubic)). In the final decision phase, predictions of class values are obtained from each classifier. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 5. Classification framework of kernel based SVM classifiers. https://doi.org/10.1371/journal.pone.0262570.g005 5.1.1 SVM linear kernel. The linear kernel is a simple and easy to interpret kernel function. It is a fast data mining algorithm for solving multiclass classification problems. It can be used for a number of features in a large data set. The linear kernel function can be expressed as [56], (13) where k(xi, xj) is the kernel function, xi and xj are feature space vectors. and ‘C’ is the box constraint or regularization parameter. The value of regularization parameter (C) is greatly influences over the trade off between the maximisation of classification margin and minimisation of error [57]. In this study, for the linear kernel of SVM, the value of ‘C’ is considered as 9 on the basis of achieved higher accuracy and minimum error level. The steps of classification process with linear kernel of SVM classifier are illustrated in Table 3. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 3. Process steps of classification: SVM linear kernel. https://doi.org/10.1371/journal.pone.0262570.t003 5.1.2 SVM polynomial kernel. It is a global kernel with good generalization ability. Ii is useful for learning high dimensional data with nonlinear boundaries, and its kernel parameters have a substantial effect on the decision boundary. This kernel is capable of solving multi class problems with allowable margin [58]. The definition of a polynomial kernel can be expressed as [56], (14) where ‘C’ is the regularisation or box constraint parameter; k(xi, xj) is the kernel function; xi and xj denotes feature space vectors; and ‘d’ states the degree of polynomial function. The Quadratic and Cubic kernels are the sub types of polynomial kernel functions of SVM. The quadratic kernel is a 2nd order polynomial kernel function that can be stated as [59], (15) The cubic kernel is a third order polynomial kernel function and it can be defined as [59, 60], (16) For polynomial kernel based SVM classifiers (quadratic and cubic), two parameters like regularisation parameters ‘C’ and ‘d’ degree of polynomial function are greatly influenced by their performance level [57]. In this work, according to the observation of higher accuracy and minimum level of mean absolute error of classification, the value of ‘C’ is considered as 12 for both quadratic and cubic kernel based SVM classifiers, and the value of ‘d’ is considered as 2 for quadratic and 3 for cubic kernel based SVM classifiers, respectively. The steps of classification process with the polynomial kernel of SVM classifier are illustrated in Table 4. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 4. Process steps of classification: SVM polynomial kernel. https://doi.org/10.1371/journal.pone.0262570.t004 5.2 Random subspace (RS) ensemble classifier The RS ensemble classifier can achieve the benefits by applying a random subset of features over the combined set of base classifiers. Fig 6 depicts the basic configuration of RS ensemble model. Randomly selected subset features (between D1 and DM) from the complete space data set (D) are utilised to learn the set of N number of base classifiers in the model of the RS ensemble approach [53]. A majority voting rule is implemented over the output predictions of weak classifiers to obtain target class labels at final stage of classification [38]. The performance and accuracy precision of weak classifiers are improved by the ensemble approach of RS technique to effectively exploit their outcome predictions. Furthermore, because the classifiers are easily trained using smaller subspaces with the RS technique, the features to instance ratio can be significantly improved [38]. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 6. Basic configuration of RS ensemble model. https://doi.org/10.1371/journal.pone.0262570.g006 For this RS ensemble model, the p* dimension feature subset (p*