Empirical Wavelet Transform-Based Intelligent Protection Scheme for Microgrids

: Recently, the concept of the microgrid (MG) has been developed to assist the penetration of large numbers of distributed energy resources (DERs) into distribution networks. However, the integration of DERs in the form of MGs disturbs the operating codes of traditional distribution networks. Consequently, traditional protection strategies cannot be applied to MG against short-circuit faults. This paper presents a novel intelligent protection strategy (NIPS) for MGs based on empirical wavelet transform (EWT) and long short-term memory (LSTM) networks. In the proposed NIPS, ﬁrstly, the three-phase current signals measured by protective relays are decomposed into empirical modes (EMs). Then, various statistical features are extracted from the obtained EMs. Afterwards, the extracted features along with the three-phase current measurement are input to three different LSTM network to obtain exact fault type, phase, and location information. Finally, a trip signal based on the obtained fault information is generated to disconnect the faulty portion from the rest of the MG. The signiﬁcant feature of the proposed NIPS is that it does not need adaptive relaying and communication networks. Moreover, it is independent of the operating scenario and hence fault current magnitude. To evaluate the efﬁcacy of the proposed NIPS, exhaustive simulations are performed on an international electro-technical commission (IEC) MG. The simulation results conﬁrm the efﬁciency of the proposed NIPs in terms of accuracy, dependability, and security. Moreover, comparisons with existing intelligent protection schemes validate that the proposed NIPS is highly accurate, secure, and dependable.


Introduction
Nowadays, increasing load demand, increasing concerns about global warming, and the latest advancements in renewable energy technology have led to a new trend in electricity generation [1,2]. These new power generation systems are usually integrated into the power system at distribution networks and represent distributed energy resources (DERs) [3,4]. To fully utilize the evolving potential of DERs, recently the concept of microgrid has been presented to integrate them into electrical distribution networks (EDNs).
A microgrid (MG) is generally regarded as a small part of a power network which incorporates a significant number of distributed generations, besides local loads and energy storage devices [5]. It is controlled and managed by intelligence and can operate in conjunction with the utility grid (grid-tied mode) in addition to being independent from the host grid (islanded mode). A MG is expected to guarantee a cost-effective service to the The above-mentioned protection strategies cannot protect the MGs in all operating scenarios. The schemes that can protect MGs in all operating scenarios need a communication medium and synchronized measurement. Therefore, recently, many intelligent and signal processing-based MG protection strategies have been developed against various types of faults. In ref. [19], a statistical classifier-based differential protection strategy has been presented for islanded MGs. Several features from current and voltage signals were extracted at both terminals of a line in MGs. A data mining method was employed to pick the most suitable features. Finally, a differential operator was utilized to the selected features to identify and locate the faulty events in MGs. A time-frequency-based differential protection strategy has been presented in [20] for medium voltage MG with loop and radial network and CIDERs. In the suggested strategy, initially, the currents at both ends of the line were retrieved. Then, the spectral energy content of S-transform-based contours was computed. After that, the differential energy was obtained by calculating the difference of spectral energy computed at both ends of a line. The scheme was upgraded in [21] by suggesting the Hilbert-Huang transform for the calculation of the spectral energy instead of the s-transform due to the benefits of the Hilbert-Huang transform. In ref. [22], the initial travelling wave of current was extracted by mathematical morphology to identify the faults and their location. The scheme was used for islanded MG only. The authors in [23] used the wavelet transform to obtain the high-frequency components of current and voltage signals for radial MG protection. F. Costa et al. [24] developed a boundary wavelet transform-based protection for MGs. The time delay and instantaneous elements of the relay were calculated in the wavelet domain. A modified over-current relay was then employed to detect the faults in the grid-tied MG. In ref. [25], features were extracted by discrete wavelet transform. The extracted features were input into a data mining algorithm to detect and classify the faults in MGs. In ref. [6], the authors extracted various hidden features by using a matching pursuit algorithm. The extracted features were then provided to four different classifiers for fault detection and classification. Naive Bayes classifiers, along with the decision tree, were utilized to distinguish the faults in an islanded MG [26]. The authors in [9] used an interval type-2 fuzzy inference system to develop a new protection scheme for MG. Various fuzzy rules were defined for fault detection and fault direction identification. In ref. [1], a convolutional neural network-based The above-mentioned protection strategies cannot protect the MGs in all operating scenarios. The schemes that can protect MGs in all operating scenarios need a communication medium and synchronized measurement. Therefore, recently, many intelligent and signal processing-based MG protection strategies have been developed against various types of faults. In ref. [19], a statistical classifier-based differential protection strategy has been presented for islanded MGs. Several features from current and voltage signals were extracted at both terminals of a line in MGs. A data mining method was employed to pick the most suitable features. Finally, a differential operator was utilized to the selected features to identify and locate the faulty events in MGs. A time-frequency-based differential protection strategy has been presented in [20] for medium voltage MG with loop and radial network and CIDERs. In the suggested strategy, initially, the currents at both ends of the line were retrieved. Then, the spectral energy content of S-transform-based contours was computed. After that, the differential energy was obtained by calculating the difference of spectral energy computed at both ends of a line. The scheme was upgraded in [21] by suggesting the Hilbert-Huang transform for the calculation of the spectral energy instead of the s-transform due to the benefits of the Hilbert-Huang transform. In ref. [22], the initial travelling wave of current was extracted by mathematical morphology to identify the faults and their location. The scheme was used for islanded MG only. The authors in [23] used the wavelet transform to obtain the high-frequency components of current and voltage signals for radial MG protection. F. Costa et al. [24] developed a boundary wavelet transform-based protection for MGs. The time delay and instantaneous elements of the relay were calculated in the wavelet domain. A modified over-current relay was then employed to detect the faults in the grid-tied MG. In ref. [25], features were extracted by discrete wavelet transform. The extracted features were input into a data mining algorithm to detect and classify the faults in MGs. In ref. [6], the authors extracted various hidden features by using a matching pursuit algorithm. The extracted features were then provided to four different classifiers for fault detection and classification. Naive Bayes classifiers, along with the decision tree, were utilized to distinguish the faults in an islanded MG [26]. The authors in [9] used an interval type-2 fuzzy inference system to develop a new protection scheme for MG. Various fuzzy rules were defined for fault detection and fault direction identification. In ref. [1], a convolutional neural network-based protection scheme was presented for MGs. The scheme did not necessitate any external feature extractor for the intelligent classifier. Three different convolutional neural network structures were developed for fault detection, location, and classification. In ref. [27], discrete wavelet transform was employed to extract several fault features from the current signal; the deep neural network was then used to detect and classify the faults in MGs.
The above-presented protection schemes provided protection against various types of faults in MGs. However, each scheme has some limitations; some of the schemes only provided protection in one operating scenario. The scheme which provided protection in all scenarios required a communication medium, and hence was prone to communication failure. Additionally, some methods are only applicable to inverter-based DERs. Therefore, it is vital to design a new protection scheme for MGs that upholds its performance for all types of faults and operating conditions and DERs.
This paper presents a novel fast and intelligent strategy (NIPS) for the protection of MGs with multiple DERs against fault. The proposed NIPS uses EWT and LSTM to develop fault type, phase, and location information. First, the three-phase current signals are measured and sampled at the relay point. Next, the EWT, which is an adaptive timefrequency transform, is employed to decompose the current signals into EMs. Afterwards, several statistical features are extracted from the EMs. Later, the extracted features, along with the three-phase current measurements, are input into three different LSTMs for developing fault type, phase, and location information. Finally, based on the developed fault information, a trip signal is sent to the appropriate circuit breaker to isolate the faulty section from the rest of the MG. The main contributions of the paper are as follows: • Intelligent Protection Strategy: A NIPS based on empirical wavelet EWT and LSTM is proposed that can protect MGs in all operating scenarios against short-circuit and high impedance faults. • Adaptive Feature Extraction: Unlike existing protection schemes, the proposed scheme extracts the features from the fault signals using signal-adaptive filter banks. The wavelet filter banks in the EWT are built based on the information contained in the input signals.

•
Communication-independent Strategy: The scheme does not require any communication networks for fault detection, classification or location, and it can be applied to any MG without significant modifications.
The rest of the paper is organized as follows: Sections 2 and 3 provide the details of EWT and LSTM. The proposed NIPS is presented in Section 4. Section 5 provides the test system and fault data generation. Simulation results are presented in Section 6. Finally, the paper is synopsized in Section 7.

Empirical Wavelet Transform for Fault Signal Decomposition
The fault signals in the power system are non-stationary. Therefore, it is worthwhile to use time-frequency analyzing techniques to obtain the most appropriate features. In this study, the EWT transform is used to extract useful features from the three-phase current signals. The EWT is an adaptive non-stationary time-frequency analysis tool which decomposes a signal into EMs/frequency sub-bands [28,29]. Unlike a conventional wavelet transform, the EWT uses the information of the analyzed signal to design signal adaptive wavelet filters.
The three-phase current signals sampled by the protective relay are used as input to the EWT. The EWT is applied to each phase current independently. In EWT, firstly, the Fourier spectrum of the input signal is obtained. Then, the obtained Fourier spectrum is divided into N adjacent segments using the EWT boundary detection method. Afterwards, the empirical wavelets are defined as a band-pass filter on each segment by using the concept of Littlewoods-Paley and Meyer's wavelet. Next, the empirical wavelets and scaling functions are obtained by using the following equations [28]: where ω is the frequency; β and ξ are the parameters which ensure that the empirical wavelet and scaling functions form a compact frame. These parameters are obtained by using the equations given in ref. [28]. Afterwards, the approximation and detail coefficients are determined from the inner product of the phase current with its corresponding wavelet and scaling functions.
Finally, these coefficients are utilized to obtain the EMs from the phase current.
In this study, the first three EMs were used since most of the signal information is available in these modes. The result of the EWT decomposition of the three-phase current signal during a three-phase fault is shown in Figure 2a. It can be observed from the figure that the variation in the EMs is significant during the fault. The EWT sub-bands of the three-phase current signal for unbalanced faults (AG) are shown in Figure 2b. The figure shows a significant variation in the EMs of the faulty phase (A-phase) as compared to the healthy phases (B and C phase). Figure 2c shows the EMs of three-phase current when a capacitor bank is switched at 0.25 s. It can be observed from the results show that there are some variations in the EMs. However, these variations are minimal compared to the fault cases.
where ω is the frequency;  and ξ are the parameters which ensure that the empirical wavelet and scaling functions form a compact frame. These parameters are obtained by using the equations given in ref. [28]. Afterwards, the approximation and detail coefficients are determined from the inner product of the phase current with its corresponding wavelet and scaling functions.
Finally, these coefficients are utilized to obtain the EMs from the phase current.
In this study, the first three EMs were used since most of the signal information is available in these modes. The result of the EWT decomposition of the three-phase current signal during a three-phase fault is shown in Figure 2a. It can be observed from the figure that the variation in the EMs is significant during the fault. The EWT sub-bands of the three-phase current signal for unbalanced faults (AG) are shown in Figure 2b. The figure shows a significant variation in the EMs of the faulty phase (A-phase) as compared to the healthy phases (B and C phase). Figure 2c shows the EMs of three-phase current when a capacitor bank is switched at 0.25 s. It can be observed from the results show that there are some variations in the EMs. However, these variations are minimal compared to the fault cases.  From the above results, it can be concluded that the EWT decomposition can be applied to the fault signals for effective feature extraction. The adaptive nature of EWT can be useful to process the power system signals not only for transient analysis but also for estimation purposes.

Feature Extraction
Once the EMs of each phase are obtained, the next task is to extract discriminative features from the EMs for better performance of the proposed NIPS. In the proposed NIPS, several statistical features from the first three modes are extracted to develop the input feature vector for the LSTM networks. The reason for selecting three modes is that most of the signal information is available in the first three modes. Precisely, the following features are calculated from the first three EMs of each phase.

1.
The minimum value.

2.
The maximum value.
The energy of the EM. 5.
The entropy of the EMs.
These features are extracted from the first three Ems. Therefore, for each cycle of the current 3 (EMs) × 8 (features) × 3 (phases) = 72 features are calculated. The generated features are later input into the LSTM network to develop the fault information.

Long Short-Term Memory Networks
An LSTM is a useful deep learning network, which is applied for sequential data processing. LSTM has the ability to extract long-term temporal features since it does not have a gradient vanishing problem. LSTM networks are widely utilized in the classification of time-series data due to their effectiveness [30,31].
The building block of LSTM networks is the memory units. The memory units are composed of memory cells which have self-joints. This helps the LSTMs to extract widerange temporal features. The configuration of a simple LSTM memory unit is given in Figure 3. The basic memory unit has one cell for memory and three gates: (1) a forget gate, (2) an input gate, and (3) an output gate. The gates process the input data, update the memory cell and control the output information. An LSTM network relates the input and output sequences by computing the activation function for all nodes. In this study, the formulations of all nodes are taken from [30].
From the above results, it can be concluded that the EWT decomposition can be applied to the fault signals for effective feature extraction. The adaptive nature of EWT can be useful to process the power system signals not only for transient analysis but also for estimation purposes.

Feature Extraction
Once the EMs of each phase are obtained, the next task is to extract discriminative features from the EMs for better performance of the proposed NIPS. In the proposed NIPS, several statistical features from the first three modes are extracted to develop the input feature vector for the LSTM networks. The reason for selecting three modes is that most of the signal information is available in the first three modes. Precisely, the following features are calculated from the first three EMs of each phase.

Long Short-Term Memory Networks
An LSTM is a useful deep learning network, which is applied for sequential data processing. LSTM has the ability to extract long-term temporal features since it does not have a gradient vanishing problem. LSTM networks are widely utilized in the classification of time-series data due to their effectiveness [30,31].
The building block of LSTM networks is the memory units. The memory units are composed of memory cells which have self-joints. This helps the LSTMs to extract widerange temporal features. The configuration of a simple LSTM memory unit is given in Figure 3. The basic memory unit has one cell for memory and three gates: (1) a forget gate, (2) an input gate, and (3) an output gate. The gates process the input data, update the memory cell and control the output information. An LSTM network relates the input and output sequences by computing the activation function for all nodes. In this study, the formulations of all nodes are taken from [30].  LSTM learn the relation between input and output datasets by supervised training. Generally fully connected (FC) layers are used at the end of LSTM layers to develop highlevel decision logic for the extracted features. The FC layer contains a large number of neurons that maps the input to the output by using activation functions [30].

Proposed Protection Strategy
This paper proposes a NIPS for MGs using three-phase current data. The NIPS employs EWT and LSTM networks to develop fault information. The proposed NIPS has the ability to protect the looped and radial MGs against all types of short-circuit and high impedance faults in all operating scenarios. Firstly, the proposed NIPS takes threephase currents at a relay as input. Then, the input signal at the relay point is processed through a second-order low-pass Butterworth filter with a cut-off frequency of 1500 Hz for antialiasing. The reason of selecting the value of 1500 Hz is that the 25th harmonic is the highest component of interest in the power system. Afterwards, the signal is sampled at a sampling rate of 3840 Hz. Next, the sampled signal is decomposed into EMs by EWT for feature extraction. Later, the extracted features, along with the three-phase current measurements, are input into three different units for developing fault type, phase, and location information. Finally, based on the developed fault information, a trip signal is sent to the appropriate circuit breaker to isolate the faulty section from the rest of the MG.
The flow chart of the proposed NIPS is given in Figure 4. The proposed FIPS has four key stages: signal measurement; fault type detection (FTD); fault classification; and fault location estimation. The subsequent subsections explain each stage of the proposed NIPS in detail. level decision logic for the extracted features. The FC layer contains a large number of neurons that maps the input to the output by using activation functions [30].

Proposed Protection Strategy
This paper proposes a NIPS for MGs using three-phase current data. The NIPS employs EWT and LSTM networks to develop fault information. The proposed NIPS has the ability to protect the looped and radial MGs against all types of short-circuit and high impedance faults in all operating scenarios. Firstly, the proposed NIPS takes three-phase currents at a relay as input. Then, the input signal at the relay point is processed through a second-order low-pass Butterworth filter with a cut-off frequency of 1500 Hz for antialiasing. The reason of selecting the value of 1500 Hz is that the 25th harmonic is the highest component of interest in the power system. Afterwards, the signal is sampled at a sampling rate of 3840 Hz. Next, the sampled signal is decomposed into EMs by EWT for feature extraction. Later, the extracted features, along with the three-phase current measurements, are input into three different units for developing fault type, phase, and location information. Finally, based on the developed fault information, a trip signal is sent to the appropriate circuit breaker to isolate the faulty section from the rest of the MG.
The flow chart of the proposed NIPS is given in Figure 4.

Fault Type Detection Unit
The FTD unit is responsible for detecting the fault type in the MGs. The schematic diagram of the FTD unit is shown in Figure 5. This input of this unit is the three-phase

Fault Type Detection Unit
The FTD unit is responsible for detecting the fault type in the MGs. The schematic diagram of the FTD unit is shown in Figure 5. This input of this unit is the three-phase current which is classified among no-fault, three-phase fault, and unbalanced fault at the where FDT m denotes the output status of the mth fault type. The FTD unit employs three LSTM layers for temporal feature extraction and EWT for statistical feature extraction from the three-phase current signal. Among the three LSTM layers, the first layer maps the time-domain current signal into higher dimension space, whereas the next two layers are used to extract the long and short-term temporal dependencies. These LSTM layers are constructed using LSTM memory units. The dimensions of the layers are selected based on the number of input samples and the number of hidden neurons. After extracting features, a depth concatenation layer is used to combine LSTM-based features with EWT-based features. Afterwards, the features are abstracted by three FC layers. The number of hidden neurons in the first two FC layers is selected by performing extensive simulations, whereas the three hidden neurons are used in the last FC layer (which corresponds to three outputs).
To avoid the risk of over-fitting, a dropout layer is employed after the first two FC layers, which exclude some features (30% in this study). The excluded features do not contribute to the output estimation. Lastly, a Softmax layer is used, which provides the most probable fault type at the output. where FDTm denotes the output status of the mth fault type. The FTD unit employs three LSTM layers for temporal feature extraction and EWT for statistical feature extraction from the three-phase current signal. Among the three LSTM layers, the first layer maps the time-domain current signal into higher dimension space, whereas the next two layers are used to extract the long and short-term temporal dependencies. These LSTM layers are constructed using LSTM memory units. The dimensions of the layers are selected based on the number of input samples and the number of hidden neurons. After extracting features, a depth concatenation layer is used to combine LSTM-based features with EWT-based features. Afterwards, the features are abstracted by three FC layers. The number of hidden neurons in the first two FC layers is selected by performing extensive simulations, whereas the three hidden neurons are used in the last FC layer (which corresponds to three outputs). To avoid the risk of over-fitting, a dropout layer is employed after the first two FC layers, which exclude some features (30% in this study). The excluded features do not contribute to the output estimation. Lastly, a Softmax layer is used, which provides the most probable fault type at the output.

Fault Classification Unit
The fault type detection unit classifies the input signal among no-fault, three-phase fault, and unbalanced fault conditions. If the fault is detected as an unbalanced fault, then the fault classification unit is triggered. The fault classification unit employs LSTM and FC layers for fault classification. The structure of the fault classification unit is similar to that shown in Figure 5, except for the last FC layer. The block diagram of the modified structure is shown in Figure 6a. The last FC layer of the fault classification unit has six neurons, which corresponds to six unbalance faults. Each output has 0-1 indicators, which represent the status of each unbalance fault.

Fault Classification Unit
The fault type detection unit classifies the input signal among no-fault, three-phase fault, and unbalanced fault conditions. If the fault is detected as an unbalanced fault, then the fault classification unit is triggered. The fault classification unit employs LSTM and FC layers for fault classification. The structure of the fault classification unit is similar to that shown in Figure 5, except for the last FC layer. The block diagram of the modified structure is shown in Figure 6a. The last FC layer of the fault classification unit has six neurons, which corresponds to six unbalance faults. Each output has 0-1 indicators, which represent the status of each unbalance fault. The fault classification unit works only for asymmetrical faults and classifies the input three-phase current into one of the six unbalanced faults.

Fault Location Estimation Unit
To reduce the blackout time and to increase the system repair, the precise location of the fault is important. The fault location estimation unit is developed to obtain the exact fault location in the proposed NIPS. This unit is triggered only if the fault type detection unit detects a three-phase or unbalanced fault in a MG. The fault location estimation unit also has a similar structure to that of the fault type detection unit except for the last FC layer and Softmax layer. The modified structure is shown in Figure 6b. The last FC layer in this unit has only one neuron as the regression layer relates the input data sample to continuous value. The objective function to be optimized during the training process of a network with a regression layer is the mean square error (MSE). The MSE can be calculated by using the following equation: Here, MSE denotes the mean square error, n is the number of training samples, actual L is the actual fault location and . est L is the estimated location. The fault location estimation unit uses a three-phase current at its input and maps it to one output. The output specifies the estimated percentage location of a fault in the MGs from the relay point.

Microgrid Test System and Fault Data Generation
To authenticate the efficacy of the proposed NIPS, several fault and non-fault conditions are investigated on IEC MG. The single-line diagram of the IEC MG is shown in Figure 7. The network and load-related data have been taken [32]. The nominal voltage of the system is 25 kV. The system integrates two CIDERs at buses B-4 and B-6 and two SBDERs at buses B-2 and B-3 by using step-up transformers. Three circuit breakers are used to create different working scenarios in the MG. The fault classification unit works only for asymmetrical faults and classifies the input three-phase current into one of the six unbalanced faults.

Fault Location Estimation Unit
To reduce the blackout time and to increase the system repair, the precise location of the fault is important. The fault location estimation unit is developed to obtain the exact fault location in the proposed NIPS. This unit is triggered only if the fault type detection unit detects a three-phase or unbalanced fault in a MG. The fault location estimation unit also has a similar structure to that of the fault type detection unit except for the last FC layer and Softmax layer. The modified structure is shown in Figure 6b. The last FC layer in this unit has only one neuron as the regression layer relates the input data sample to continuous value. The objective function to be optimized during the training process of a network with a regression layer is the mean square error (MSE). The MSE can be calculated by using the following equation: Here, MSE denotes the mean square error, n is the number of training samples, L actual is the actual fault location and L est. is the estimated location.
The fault location estimation unit uses a three-phase current at its input and maps it to one output. The output specifies the estimated percentage location of a fault in the MGs from the relay point.

Microgrid Test System and Fault Data Generation
To authenticate the efficacy of the proposed NIPS, several fault and non-fault conditions are investigated on IEC MG. The single-line diagram of the IEC MG is shown in Figure 7. The network and load-related data have been taken [32]. The nominal voltage of the system is 25 kV. The system integrates two CIDERs at buses B-4 and B-6 and two SBDERs at buses B-2 and B-3 by using step-up transformers. Three circuit breakers are used to create different working scenarios in the MG. To train the LSTM layers network with supervised learning, suitable prior data that represents fault/no-fault instances is important. In this study, the IEC MG was simulated in MATLAB/SIMULINK to produce the fault data for the training process of the LSTM networks. Simulations were executed for all ten types of faults under diverse fault locations, operating scenarios, network configuration, fault resistances, and loads. The details of the simulated fault conditions and no-fault conditions have been given in Tables 1 and  2.  A total of 288 non-fault and 16,000 fault cases were generated in simulations. In each case, the three-phase currents signals were obtained at the relay point and then given to the proposed NIPS to obtain fault information. The obtained simulated data were randomly separated into training and testing datasets in the ratio of 3:1. The training dataset was used to train the learnable biases and weights of LSTM and FC layers. To train the LSTM layers network with supervised learning, suitable prior data that represents fault/no-fault instances is important. In this study, the IEC MG was simulated in MATLAB/SIMULINK to produce the fault data for the training process of the LSTM networks. Simulations were executed for all ten types of faults under diverse fault locations, operating scenarios, network configuration, fault resistances, and loads. The details of the simulated fault conditions and no-fault conditions have been given in Tables 1 and 2.
2 Capacitor switching at PCC and load buses.

DER integration percentage 2 Total no-fault cases 288
A total of 288 non-fault and 16,000 fault cases were generated in simulations. In each case, the three-phase currents signals were obtained at the relay point and then given to the proposed NIPS to obtain fault information. The obtained simulated data were randomly separated into training and testing datasets in the ratio of 3:1. The training dataset was used to train the learnable biases and weights of LSTM and FC layers.

Performance of Fault Type Detection
The two datasets obtained by simulation various fault and non-fault conditions were employed to train and test the LSTM network of the FTD unit. In the training phase, 10,080 samples of unbalanced faults, 1120 samples of three-phase faults, and 230 samples of no-fault (NF) were used. To remove the bias in the input samples, the non-fault samples and three-phase fault samples were replicated. The bias and weights of the structure were trained using the Adam optimization approach with a mini-batch size of 64. The percentage loss and accuracy during the training process of the fault type detection unit are shown in Figure 8. The figure shows that the training process converged fast within 23 epochs.

Performance of Fault Type Detection
The two datasets obtained by simulation various fault and non-fault conditions were employed to train and test the LSTM network of the FTD unit. In the training phase, 10,080 samples of unbalanced faults, 1120 samples of three-phase faults, and 230 samples of nofault (NF) were used. To remove the bias in the input samples, the non-fault samples and three-phase fault samples were replicated. The bias and weights of the structure were trained using the Adam optimization approach with a mini-batch size of 64. The percentage loss and accuracy during the training process of the fault type detection unit are shown in Figure 8. The figure shows that the training process converged fast within 23 epochs. A confusion matrix is an effective method to demonstrate the performance of a multiclass intelligent classifier. The confusion matrices of the FTD unit during the grid-tied and islanding modes of operation are shown in Figure 9. The confusion matrix of gridtied mode shows that all samples of the no faults and three-phase cases were correctly classified. In the case of unbalanced faults, 4 data samples, which constitute 0.2% of total data, were misclassified as a three-phase fault. Similarly, only one data sample of unbalanced faults was misclassified to no fault. Similarly, the confusion matrix of islanded mode depicts that 4 of the unbalanced fault data samples were incorrectly classified as a three-phase fault, whereas two three-phase fault data samples were miss-detected as unbalanced faults. In the case of the no-fault, the prediction accuracy is 100% (i.e., no other case was miss detected as NF and vice versa). The overall prediction accuracy of the FTD unit in grid-tied and islanded mode was 99.8% and 99.76%, respectively.  A confusion matrix is an effective method to demonstrate the performance of a multiclass intelligent classifier. The confusion matrices of the FTD unit during the grid-tied and islanding modes of operation are shown in Figure 9. The confusion matrix of grid-tied mode shows that all samples of the no faults and three-phase cases were correctly classified. In the case of unbalanced faults, 4 data samples, which constitute 0.2% of total data, were misclassified as a three-phase fault. Similarly, only one data sample of unbalanced faults was misclassified to no fault. Similarly, the confusion matrix of islanded mode depicts that 4 of the unbalanced fault data samples were incorrectly classified as a three-phase fault, whereas two three-phase fault data samples were miss-detected as unbalanced faults. In the case of the no-fault, the prediction accuracy is 100% (i.e., no other case was miss detected as NF and vice versa). The overall prediction accuracy of the FTD unit in grid-tied and islanded mode was 99.8% and 99.76%, respectively. 022, 15, x FOR PEER REVIEW 11 of 17

Performance of Fault Type Detection
The two datasets obtained by simulation various fault and non-fault conditions were employed to train and test the LSTM network of the FTD unit. In the training phase, 10,080 samples of unbalanced faults, 1120 samples of three-phase faults, and 230 samples of nofault (NF) were used. To remove the bias in the input samples, the non-fault samples and three-phase fault samples were replicated. The bias and weights of the structure were trained using the Adam optimization approach with a mini-batch size of 64. The percentage loss and accuracy during the training process of the fault type detection unit are shown in Figure 8. The figure shows that the training process converged fast within 23 epochs. A confusion matrix is an effective method to demonstrate the performance of a multiclass intelligent classifier. The confusion matrices of the FTD unit during the grid-tied and islanding modes of operation are shown in Figure 9. The confusion matrix of gridtied mode shows that all samples of the no faults and three-phase cases were correctly classified. In the case of unbalanced faults, 4 data samples, which constitute 0.2% of total data, were misclassified as a three-phase fault. Similarly, only one data sample of unbalanced faults was misclassified to no fault. Similarly, the confusion matrix of islanded mode depicts that 4 of the unbalanced fault data samples were incorrectly classified as a three-phase fault, whereas two three-phase fault data samples were miss-detected as unbalanced faults. In the case of the no-fault, the prediction accuracy is 100% (i.e., no other case was miss detected as NF and vice versa). The overall prediction accuracy of the FTD unit in grid-tied and islanded mode was 99.8% and 99.76%, respectively.  The results of the FTD unit of the proposed NIPS on each line of the IEC MG have been shown in Table 3. In the islanded mode, the FTD unit of NIPS attained 100% fault/no-fault accuracy. Furthermore, the results show that the proposed NIPS has the ability to give correct fault type information in most of the fault events.

Performance of Fault Classification Unit
The fault classification unit is activated when the FTD unit identifies an asymmetrical fault in the MG. The LSTM network of this unit was trained by using 2240 samples of each unbalanced fault. The loss and accuracy of the fault classification network during the training process are shown in Figure 10. The figure demonstrates that the training converged within 35 epochs. The results of the FTD unit of the proposed NIPS on each line of the IEC MG have been shown in Table 3. In the islanded mode, the FTD unit of NIPS attained 100% fault/nofault accuracy. Furthermore, the results show that the proposed NIPS has the ability to give correct fault type information in most of the fault events.

Performance of Fault Classification Unit
The fault classification unit is activated when the FTD unit identifies an asymmetrical fault in the MG. The LSTM network of this unit was trained by using 2240 samples of each unbalanced fault. The loss and accuracy of the fault classification network during the training process are shown in Figure 10. The figure demonstrates that the training converged within 35 epochs. The performance of the fault classification unit during islanded and grid-tied modes is presented in Figure 11. In most of the unbalanced fault events, the fault classification unit of the proposed NIPS predicted an accurate class for the input data samples. Overall classification accuracy of 99.3% in grid-tied mode was observed, and only 15 out of 2160 fault events had incorrect classification information. In the islanded mode, the fault classification accuracy was more than 99.2%, and only 18 test samples had wrong fault classification. The performance of the fault classification unit during islanded and grid-tied modes is presented in Figure 11. In most of the unbalanced fault events, the fault classification unit of the proposed NIPS predicted an accurate class for the input data samples. Overall classification accuracy of 99.3% in grid-tied mode was observed, and only 15 out of 2160 fault events had incorrect classification information. In the islanded mode, the fault classification accuracy was more than 99.2%, and only 18 test samples had wrong fault classification. The results of the fault classification unit for each distribution line of the IEC MG are provided in Table 4. The results depict that the proposed NIPS accurately classified the asymmetrical faults in both islanded and grid-tied modes.

Performance of Fault Location Estimation Unit
This unit is triggered when the FTD unit identifies a fault in the MG. In the fault location estimation unit, the LSTM structure was trained to minimize the root-MSE between actual and estimated locations. To confirm the effectiveness of the proposed fault locator of NIPS, exhaustive simulations were executed at different locations in each distribution line and the results are shown in Table 5. The results demonstrate that the proposed NIPS provided a significantly accurate location of faults with a small error of 3.29% in islanded mode and 3.01% in grid-tied mode. This small error is acceptable as the length of the distribution lines in MGs is generally less than 20 km.  The results of the fault classification unit for each distribution line of the IEC MG are provided in Table 4. The results depict that the proposed NIPS accurately classified the asymmetrical faults in both islanded and grid-tied modes.

Performance of Fault Location Estimation Unit
This unit is triggered when the FTD unit identifies a fault in the MG. In the fault location estimation unit, the LSTM structure was trained to minimize the root-MSE between actual and estimated locations. To confirm the effectiveness of the proposed fault locator of NIPS, exhaustive simulations were executed at different locations in each distribution line and the results are shown in Table 5. The results demonstrate that the proposed NIPS provided a significantly accurate location of faults with a small error of 3.29% in islanded mode and 3.01% in grid-tied mode. This small error is acceptable as the length of the distribution lines in MGs is generally less than 20 km.

Comparison with Existing Intelligent Schemes
Unlike the existing intelligent protection methods, the proposed NIPS uses signal adaptive filter banks to extract statistical features from the three-phase current signals. To confirm the effectiveness of the proposed NIPS, the obtained results are compared with the existing intelligent schemes using the same IEC MG. For this purpose, Convolutional neural network (CNN) [1], decision tree (DT) and support vector machine (SVM)-based schemes were selected [32]. Besides accuracy, two additional parameters, dependability and security, were used in the performance comparison. The parameters were obtained by the formula given in ref [1,32]. Table 6 provides the comparison of the proposed NIPS with CNN, SVM, and DTbased protection schemes. It is evident from the comparison results that the SVM has 99.03% detection accuracy (with 100% dependability and 98.06% security) in islanded mode whereas it has 98.33% accuracy (with 99.6% dependability and 97.06% security) in the grid-tied mode. For the same cases, CNN-based schemes provide 99.58% fault accuracy (with 98.89% dependability and 98.23% security) in islanded mode and 99.65% accuracy (with 100% dependability and 100% security) in grid-tied mode. Similarly, the DT was 99.02% accurate (with 99.8% dependability and 98.24% security) in the grid-tied mode and 99.47% accurate (with 99.60% dependability and 99.35% security) in islanded mode. The SVM and DT-based protection schemes did not offer fault location information. Moreover, they are prone to communication failure. On the other hand, the proposed NIPS offered an accuracy of 99.97% and security of 100% in both modes of operation. To validate the effectiveness in terms of operating time, the speed of operation of the proposed NIPS was also compared with already existing schemes. For this purpose, superimposed reactive energy (SRE) [11], interval type-2 fuzzy logic system (IT2FLS) [9] and CNN [1]-based MG protection schemes were selected. The comparison is given in Table 7. It can be observed from the table that the proposed NIPS provided better performance in terms of operating time as compared to SRE and IT2FLS-based schemes. Although the operating time of the proposed NIPS is the same as compared to CNN based protection scheme, the accuracy, dependability, and security are higher. In summary, the proposed NIPS has the ability to present fast and accurate fault type, phase and location information for MGs in different operating scenarios without any communication.

Conclusions
This paper presents a NIPS for MGs based on EWT and LSTM networks. The threephase currents measurement were the input into the proposed NIPS, which processed them to provide complete information about the fault type, class, and location for the MGs. Precisely, the three-phase current signal was preprocessed using EWT, and various kinds of statistical features were obtained. Then, the phase currents, along with the extracted features, were used as input to the developed LSTM networks to detect, classify, and locate the faults within the MGs. To evaluate the effectiveness of the proposed scheme, exhaustive simulations were carried out on a standard IEC MG test system. The results demonstrated that the proposed NIPS successfully developed correct fault information for all of the lines in the MG. The fault type detection unit of the proposed NIPS achieved an overall accuracy of 99.76% in the grid-tied mode and 99.70% in the islanded mode. The fault classification accuracy of the proposed scheme was 99.30% in both modes of operation. The proposed scheme estimated quite precise fault location for all distribution lines of the MG, resulting in 3.01% and 3.29% mean square error for grid-tied and islanded modes, respectively. The scheme provided exact fault type, phase, and location information as compared to the advanced fault detection schemes in the literature for a similar test system. In summary, the proposed NIPS can be used to detect, classify, and locate different types of faults within radial and looped MGs in both modes of operation, which will ensure the safe operation of MGs.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations were used in this paper. Parameters which ensure the compact frame for empirical wavelet and scaling function y 0 (t) Approximation coefficient at time t y k (t) Kth detailed coefficient at time t FDT m Output status of the mth fault type L actual Actual fault location L est.
Estimated fault location n Number of training samples