Improved Deep Neural Network (IDNN) with SMO Algorithm for Enhancement of Third Zone Distance Relay under Power Swing Condition

: A zone 3 distance relay is utilized to provide remote backup protection in the event that the primary protection fails. However, under stressful situations such as severe loads, voltage, and transient instability, the danger of malfunction in distance relay is relatively high since it collapses the system’s stability and reliability. During maloperation, the relay does not function properly to operate the transmission line. To overcome this problem, an advanced power swing blocking scheme has been developed. An improved DNN-based power swing blocking system is proposed to avoid the maloperation of the distance relay and improve the system’s reliability. The current and voltage signal of the system is sensed, and the sensed data is fed into the Improved Discrete Wavelet Transform (IMDWT). The IMDWT generates the coefﬁcient value of the sensed data and further computes the standard deviation (SD) from the coefﬁcient, which is used to detect the condition of a system, such as normal or stressed. The SD value is given to the most valuable algorithm for the improved Deep Neural Network (IDNN). In the proposed work, the improved DNN operates in two modes, the ﬁrst mode is RDL-1 (normal condition), and the second mode is RDL-2 (power swing condition). The performance of the IDNN is enhanced by using the threshold-based blocking approach. Based on the threshold value, the proposed method detects an appropriate condition of the system. The proposed method is implemented in the Western System Coordinating Council (WSCC) IEEE 9 bus system, and the results are validated in MATLAB/Simulink software. The overall accuracy of the proposed method is 97%. The proposed method provides rapid operation and detects the power swing condition to trip the distance relay.


Introduction
The third zone distance relay is mostly used to secure UHV and EHV transmission lines because it provides a rapid power swing or fault clearance and system coordination [1].
In addition, it offers both backup and primary protection by setting the zonal region correctly to coordinate among the distance relays. A distance relay generally consists of zone 1, zone 2, and zone 3. A zone 1 distance relay covers the area of the transmission line, i.e., zone 1 covers 80% of the transmission line. Zone 2 covers 120% of the area of the transmission line, and zone 3 covers 180% and protects all transmission lines from power swings [2]. Even under the most unfavorable system conditions, a distance relay should not function for problems outside the remote bus. To put up the relay overreach triggered through power system suspicions, the nominal reach of a non-pilot relay is fixed smaller than the projected length of the line. Load encroachment, voltage instability, and power swings are the most prevalent conditions in the system that affect distance relay operation [3]. The load encroachment issue is considered a static event. Voltage instability and power swings are dynamic processes that create encroachment into the distance relays to cause maloperation.
The whole system's transmission line is in isolation due to circuit breaker tripping because of a breakdown in a respective transmission line or incorrect operation of circuit breakers attached to the transmission line due to zone 3 maloperation, causing power flow to be redirected through other transmission lines [4]. Load encroachment is one of the effects of this type of situation. Therefore, nearby transmission lines are, in turn, overloaded, causing cascaded circuit breaker tripping, resulting in power system blackouts and instabilities. An investigation of blackouts in North America and Canada on 14 August 2003, in the Malaysian grid in 2003 and 2005, and in India on 30 July 2012 found that the primary reason was the distance relay's maloperation owing to load encroachment due to transmission line overloading [5]. Distance relays have a power swing blocking (PSB) mechanism to prevent relays from maloperation [6].
There are various power swing blocking (PSB) and fault detection techniques using a zone 3 distance relay that recognize power swings in a system. Blinders and timers, which are traditionally used to determine the rate of change of positive sequence impedances, provide the foundation for applying PSB systems. The distance relay's PSB function utilizing several input signals can be developed using supervised learning methods such as support vector machine (SVM) [7] and adaptive neuro-fuzzy inference system (ANFIS) [8]. Due to the high processing time of SVM, this method needs much simulation time to train for a wider range of faults and power swing conditions. Flexible alternating current transmission (FACT) system devices [9] are being used more and more to increase transient and steady-state stability. The Thyristor Controlled Series Capacitor (TCSC) [10] is one of the devices used to enhance power system security.
The aforementioned protection concerns are a major reason to develop an intelligent power swing blocking scheme that can offer full adaptive security to prevent zone 3 distance relay maloperation as power swing for both uncompensated and compensated power transmission systems. In the proposed scheme, mitigation of maloperation in the zone 3 distance relay is improved by using an improved DNN-based blocking scheme. IDNN is the most widely utilized classifier because it solves more difficult problems rapidly. As soon as a machine learning system uses various layers of nodes to extract high-level functions from input data, it is denoted as a deep neural network. It involves converting facts into more creative and abstract components. The purpose of this proposed work is to develop appropriate indices to monitor and detect dangerous zone 3 distance relays because of power swing and voltage stability subjected to maloperation.

Main Contribution
Mitigation of maloperation in third zone distance relays enhances the system's protection and reliability. The main objectives of the proposed method are described below: • A Western System Coordinating Council (WSCC) IEEE 9 bus system with a third zone distance relay is structured and validated. • Zone 3 distance relay acts on maloperation at stressed conditions, such as power swing and voltage instability. The effect of maloperation is tripping of the transmission line.

•
In the proposed method, the voltage and current signals are analyzed to generate the coefficient value through an improved discrete wavelet transformer (IMDWT). Standard Deviation values are computed using these coefficients. • Based on the SD value, the improved deep neural network (IDNN) predicts the blocking or unblocking class to generate an appropriate command signal.

•
The DNN's prediction performance is enhanced by using a based-on threshold approach that chooses the correct class of IDNN to provide a superior operation.

•
The proposed method is analyzed under normal and power swing conditions, and the outcome is contrasted with the present approach.
The organization of the rest of the paper is as follows. Section 2 presents the literature survey related to the mitigation of maloperation in distance relay and system security. The proposed method architecture and working procedures are explained in Section 3. The outcome of the proposed approach is validated in Section 4. Section 5 concludes the paper.

Literature Survey
Over the last few years, researchers have used various techniques to overcome the drawbacks. Among these, the following strategies are discussed in Table 1.

Contribution
Authors Reference • They suggested a blocking method based on superimposed components of the magnitude of voltages to distinguish non-faulty situations from power swing occasions.

•
The method was capable of offering high sensitivity and security in detecting power swing events and preventing relays from an unexpected trip in that condition. The method was performed in a New England 39-bus test system. • This method gives more accurate value, yet, finding optimum settings requires comprehensive stability assessments for all potential power swing conditions on the system, which is a complex process.
Parniani et al. [11] • They presented a phase let method based on current samples and error computation among actual and estimated values. Both the 39-bus New England system and the two-area system were implemented and used in DIgSILENT power factory software. • However, this method has poor power swing detection speed and cannot identify multi-mode power swings.
Ghalesefidi et al. [12] • They suggested a method for identifying faults and power swings in the system. The power swing is detected based on the united use of Hilbert transform and empirical mode decomposition.

•
The method was tested on a standard IEEE 39-bus net-work for dissimilar fault and power swing conditions. How-ever, the method provides a slow power swing identification and blocks the relay.
Taheri et al. [13] • They presented a variational mode decomposition (VMD) method to decay the current signal into various modes of signals. The energy index and apparent impedance were used to detect asymmetrical and symmetrical fault/power swing in a zone 3 distance relay.

•
The method was validated in the IEEE 39-test bus system model. However, this technique's threshold setting is not de-pendent on the system structure.
Venkatanagaraju et al. [14] • They used a Fourier transform to detect power swings and various faults which occurred during the power swings circumstance. The performance of the method was based on a threshold value. The method provides a fast and easy way to compute threshold values for different power system networks.

•
This method was validated in the IEEE 39-test bus sys-tem model for various power swings and fault conditions. However, the method was very sensitive to noise and did not perform well when the current signal had noise.

Contribution Authors Reference
• They suggested an FZC method for power swing identi-fication. If the relative speed of the synchronous machine passed through a point of zero crossing, the power swing was stable; if the relative speed did not pass through the point of zero crossing, the power swing was unstable.

•
The performance and reliability were checked using the SMIB test system. However, the method offers a slow process for PS detection and blocks the relay.
Medhekar and Hasabe [16] • They presented a distance relay third zone protection in power system critical conditions and some essential power system operating conditions that make the operation of a third zone distance relay difficult.

•
The Indian Eastern Regional Grid (IERG) system was modeled using EMTDC/PSCAD software.
Venkatanagaraju et al. [17] In the above-mentioned literature, several issues in the detection of power swing and command signal of the zone 3 distance relay were presented. The most important problems are slow power swing detection and command of the distance relay, sensitivity to noise, and threshold value setting. To overcome these issues, as well as to attain power system stability and reliability, a new power swing blocking scheme must be designed. The working process involved in the proposed method is discussed in the upcoming section.

Proposed Methodology
A third zone distance relay is a crucial component in enhancing the reliability and security of the power system through rapid mitigation of power swings in a transmission line. During a power swing, a certain value of the angle difference and the magnitude ratio are fulfilled, and the impedance flow in the distance relay under zone 3 causes relay maloperation [18]. Convolutional blocking methods are the measure of the amount of change of impedance that passes through the relay's zone. In the proposed method, the zone 3 distance relay performance is enhanced by using a supervision-based blocking scheme under normal and fault or power swing conditions. The voltage and current quantities of the transmission line are sensed to give as an input to improved discrete wavelet transform (IMDWT). IMDWT analyzes the sensed data to produce a coefficient value. The coefficient value is fed to the IDNN classifier, which analyses the coefficient value to create an appropriate command signal for the third zone distance relay to protect the transmission line. Figure 1 illustrates the architecture of the proposed method. change of impedance that passes through the relay's zone. In the proposed method, the zone 3 distance relay performance is enhanced by using a supervision-based blocking scheme under normal and fault or power swing conditions. The voltage and current quantities of the transmission line are sensed to give as an input to improved discrete wavelet transform (IMDWT). IMDWT analyzes the sensed data to produce a coefficient value. The coefficient value is fed to the IDNN classifier, which analyses the coefficient value to create an appropriate command signal for the third zone distance relay to protect the transmission line. Figure 1 illustrates the architecture of the proposed method.  The WSCC IEEE 9 bus system contains three generators and three loads. The transmission line's voltage and current are sensed to create a dataset. The sensed value is given as an input of IMDWT. IMDWT is a component that splits a signal or data into a different frequency. It values the input signal in Fourier transform to handle the sudden variation of signals competently. IMDWT has many useful power swing/faults transient features. Taking a wavelet wave, for example, to make the same original transients shape, IMDWT tries to balance them down and up, and moves left and right. It gives an appropriate coefficient of the input signal as well as the value that is most useful for analyzing transients in a fault condition. The coefficient values are given as an input of an improved deep neural network (IDNN) classifier. An IDNN is a kind of data-driven machine learning The WSCC IEEE 9 bus system contains three generators and three loads. The transmission line's voltage and current are sensed to create a dataset. The sensed value is given as an input of IMDWT. IMDWT is a component that splits a signal or data into a different frequency. It values the input signal in Fourier transform to handle the sudden variation of signals competently. IMDWT has many useful power swing/faults transient features.
Taking a wavelet wave, for example, to make the same original transients shape, IMDWT tries to balance them down and up, and moves left and right. It gives an appropriate coefficient of the input signal as well as the value that is most useful for analyzing transients in a fault condition. The coefficient values are given as an input of an improved deep neural network (IDNN) classifier. An IDNN is a kind of data-driven machine learning technique and is modeled to maintain the logic of the proposed method. By using an IDNN, the system's robustness and stability are improved. An IDNN acts in two modes of operation, namely blocking mode (RDL-1) and fault/power swing detection mode (RDL-2). During the blocking mode, the coefficient value is analyzed by RDL-1 to produce a command signal of the relay. During the fault detection mode, RDL-2 analyzes the coefficient value and generates a command signal to the third zone distance relay. The threshold-based method is used to reduce the error as well as improve the working performance of the IDNN. Numerical modeling of proposed components is provided below.

Modeling of Proposed Parameters
The supervision-based blocking system works on the basis of recognition of power swing/faults in the system. The operation of the third zone distance relay is on the base of the IMDWT coefficient value. A power swing is identified by measuring the current and voltage of the transmission line, its corresponding coefficient, and the classifier. An in-depth description of IMDWT and IDNN is presented below section.

Improved Discrete Wavelet Transform
DWT is a group of finite impulse response (FIR) filters that split the low-frequency signals and high-frequency signals from the input signal at different scaling factors [19]. Each scaling stage provides an estimated outcome of an input signal. The estimated outcome is very useful for classifying an appropriate class and detecting a power swing/fault. In the proposed work, improved DWT (IMDWT) is utilized as it is very fast and efficiently analyses the current and voltage signals from the WSCC 9 bus system. IMDWT offers input signal into frequency band and Fourier transforms for low and high-frequency components. The scaling factor of the IMDWT is based on the frequency of the system. The first scaling factor is based on the high-frequency end of the spectrum; during this period, the resolution time is very high. The lower frequency is based on the higher scaling factor; during this period, the resolution time is the worst. IMDWT produces a set of basis functions from a mother wavelet of DWT. An IMDWT arbitrary function is expressed as: where ϕ(t) is scaling wavelet functions and ψ(t) is mother wavelet functions.
where C j o are coefficients of wavelet expansion, ψ j,k (t) and ϕ j o, k (t) orthogonal bases functions of expansion, j signifies the scale factor. According to the scaling factor of IMDWT, Logarithmic frequency coverage is found, which is further matched to uniform frequency coverage. High-pass filters and low-pass filter impulses are computed by: where C j (k) indicates the highest scale. The filter bank of IMDWT is H[n] and G[n] are fulfilled by |H(ω) Detail of the high-frequency components are provided by High Pass Filter and separates the low-frequency components to gather extra information about the input signal.

Modeling of Improved Deep Neural Network
An Improved Deep Neural Network (IDNN) contains three layers, namely, the input layer, hidden layer, and output layer as shown in Figure 2. Each layer involves several nodes that are united step by step into whole nodes in an ensuing layer [20]. Typically input and output layers are single layers, but the hidden layers are expanded to more than two. In the proposed work, six input layers and seven hidden layers are provided to analyze the input data. This IDNN consists of 64 input neurons and 64 output neurons per cycle of rapid current. A lot of neurons are overfitting, so only a small number of neurons are underfitting. Due to the above reason, the hidden layer neuron size and numbers are chosen carefully. Each layer of neurons is computed practically. Because the hidden layer size is set as hyperparameters, it is executed by the Tensor flow. The problem solving and the fault learning ability of the IDNN is based on activation function. The coefficient value is fed into the input layer of the IDNN, and the predicted classes are provided in the output layer. The weight of each node is computed, and appropriate values are predicted by using an activation function. In the proposed work, rectified linear unit (ReLU) is used as an activation function that finds an appropriate weight between the nodes to reduce the error that happened in the system. This weight shift is done in reverse by pack propulsion, from the output layer to the input layer, until the cost function is reduced. Neurons outputs are specified by: where σ(z) denotes activation function, indicates the output of q neuron in the n + 1 layer, represent the weight among n layer's i neuron and n + 1 layer q neuron signifies the bias of linear relationships. In the repulsion process, errors among the computed coefficient and the actual values are measured by the loss function. The variables of b and ω are resolved by a small value of the loss function. The loss function of improved DNN is stated as: where actual values of qth sample nth element, is the projected value of qth sample nth element, θ signifies the parameter of ω and b, N denotes the number of samples. By the use of a dropout mechanism, the outfitting of neurons is minimized, thus disrupting the neuron network structure by somehow removing the neurons. Additionally, the proposed method improves the standard learning rate depending on the traditional gradient descent system. The optimal variable of θ is expressed as: Neurons outputs are specified by: where σ(z) denotes activation function, y n+1 q indicates the output of q neuron in the n + 1 layer, ω n iq represent the weight among n layer's i neuron and n + 1 layer q neuron b n+1 q signifies the bias of linear relationships. In the repulsion process, errors among the computed coefficient and the actual values are measured by the loss function. The variables of b and ω are resolved by a small value of the loss function. The loss function of improved DNN is stated as: where t nq actual values of qth sample nth element, y nq is the projected value of qth sample nth element, θ signifies the parameter of ω and b, N denotes the number of samples. By the use of a dropout mechanism, the outfitting of neurons is minimized, thus disrupting the neuron network structure by somehow removing the neurons. Additionally, the proposed method improves the standard learning rate depending on the traditional gradient descent system. The optimal variable of θ is expressed as: where V t signifies the average movement of the square of gradient, g t denotes the parameter gradient, m t is the average movement of the gradient, α 0 represent the learning rate initial value,V t andm t are corrected quantities, β 1 , β 2 , and β 3 are exponential decay rates that are in use 0.9, 0.999, and 0.95, ep batch-size denotes the batch processing parameter, and ochnum signifies the current training times. The suggested improved DNN method works as two-mode of command generation depending on the coefficient, such as normal condition mode (RDL-1) and power swing detection mode (RDL-2).

Modes of RDL-1 and RDL-2
Both voltage and current flow constantly during normal functioning conditions. The reactive power and active power also flow constantly. However, during power swing conditions, both voltage and current magnitudes increase, and the reactive and active powers of the transmission line oscillate. The oscillated power enters the zone three distance relay and affects the operation of the relay components; this is termed maloperation. Both kinetic and potential energies of transmission line are stated as: where w i is the generator speed and M i is the moment of inertia, m represents the number of generators, n represents the number of transmission lines, P l represent the line power flow, P ls represent the P l values under steady-state conditions, δ l is the phase angle difference among lines. The line's potential power is stated as: Fault and power swing are separated by a change in voltage angle (∆δ) and real power flow (∆P). Reactive power loss, transient potential power, positive sequence voltage magnitude, and phase angles are all inputs of RDL-1. The defect is detected in RDL-2 under power swing conditions with positive sequence current magnitudes and power exchange as inputs.
For RDL-1: ∆I A1 = {∆V, ∆δ, ∆Q loss , PP T } and For RDL-2: ∆I A2 = {∆V, ∆δ, ∆I, ∆P, ∆Q loss } Differentiate attributes ∆I A can be stated as: Mathematics 2022, 10, 1944 8 of 19 where k denotes sample count, ∆X p denotes the p bus successive data points ∆I A represent p and q bus line connection, X p (k) represent kth sample of p bus. Mathematical expression of ∆X p (k) is given as: In the threshold-based method, the proposed classifier class value is selected. The relay blocking or fault detection and unblocking of the relay depend on DNN, and the thresholdbased approach is used to make the correct selection of class in DNN. The threshold-based method is stated as: ∆v ∆t ≤ Threshold ⇒ Non power swing condition Otherwise ⇒ Power swing condition (11) where ∆t is the fixed value, is the same as the value per frequency cycle.
(k < TH) ⇒ No power swing Under power swing circumstances, does the value of k go beyond the threshold value. Figure 3 presents the flow chart of the proposed technique and following Algorithm 1 elaborates the code of proposed work.
Training Phase of IDNN: In the training phase, the Spider Monkey Optimization (SMO) algorithm is used. SMO is used to optimize the weight of DNN.

Step 1: Initialization
In step 1, the weight of DNN has initialized the input of SMO.
where n represents several populations.

Step 2: Evaluation of Fitness Function
Each fitness value can be estimated according to Equation (13). The following error function is used to choose the fitness function of SMO: where θ signifies the parameter of ω and b, t nq actual values of qth sample nth element, N denotes the number of samples, y nq is the projected value of qth sample nth element.

Step 3: Update the Position
Update the value to detect the best solution, the activity is analyzed based on the updated value.
where jth dimension of ith the solution is denoted as SM ij , jth dimension of kth local leader location can be represented as LL kj . U[0, 1] is in the range of (0, 1) as a uniformly distributed random number. The rth the solution which is selected randomly from kth the group as denoted as SM rj such as r = i.
where, GL j correspond to the jth dimension of the global leadership position, where j = 1, 2, . . . D is randomly selected within the dimension.

Step 4. Termination
The final step is termination; when the best solution is obtained, the process is terminated. Testing phase: The data is tested in this testing phase with the help of the training phase. The final output from this neural network is to generate the blocking and unblocking command of the relay. Then, the experimental analysis of the proposed work is performed to study its performance in detail.

Result and Discussion
The proposed IDNN-based blocking scheme is integrated, and performance is validated in the WSCC IEEE 9 bus system. The proposed method contains a system to identify the power swing and block the third zone distance relay. Power swing in a system is caused due to unexpected changes in loads and voltage deviation. Recognition of power swing is a complex task in a power system because the variation of voltage and loads are caused in seconds. The proposed IDNN-based blocking scheme provides a rapid operation to identify the power swing/fault in a system to turn OFF the distance relay. The proposed method is designed, and the performance is validated by using MATLAB 2021a Simulink software; the system configuration is described as an Intel (R) Core (TM) i5-10300H Processor, CPU @2.50 GHz, 32 GB Memory (RAM), and System type of 64-bit operating system. Based on the current and voltage of the line, the IMDWT generates a coefficient, and the IDNN analyses the coefficient to generate a suitable command signal for a distance relay. The prediction performance of the IDNN is enhanced by using a threshold-based blocking method. A threshold value of proposed methods is taken as 2.8915. Figure 4 shows the WSCC 9 bus test system. The structure of the WSCC 9 bus system contains three generators, three loads, and nine buses. The WSCC 9 bus system was designed using MATLAB/SIMULINK. Afterload flow was converged, faults were applied at different locations in the network, and the voltage and current variations were verified. A classifier that helps to decide whether the disturbance is due to fault or power swing was designed. The distance relay is attached to disconnect the line with a fault/power swing. The proposed method was validated under two situations, namely, normal condition and power swing condition.

Situation 1: Normal Condition
Under normal conditions, the flow of voltage and current is not varied because the load is not much varied. Therefore, the system does not face a power swing/fault condition. Figure 5 shows the waveform of voltage and current under normal conditions at Bus 2. It shows that the voltage of the system flows from −40 kV to +40 kV. Similarly, the current varies from −26 kA to +26 kA.  The structure of the WSCC 9 bus system contains three generators, three loads, and nine buses. The WSCC 9 bus system was designed using MATLAB/SIMULINK. Afterload flow was converged, faults were applied at different locations in the network, and the voltage and current variations were verified. A classifier that helps to decide whether the disturbance is due to fault or power swing was designed. The distance relay is attached to disconnect the line with a fault/power swing. The proposed method was validated under two situations, namely, normal condition and power swing condition.

Situation 1: Normal Condition
Under normal conditions, the flow of voltage and current is not varied because the load is not much varied. Therefore, the system does not face a power swing/fault condition. Figure 5 shows the waveform of voltage and current under normal conditions at Bus 2. It shows that the voltage of the system flows from −40 kV to +40 kV. Similarly, the current varies from −26 kA to +26 kA.  The structure of the WSCC 9 bus system contains three generators, three loads, and nine buses. The WSCC 9 bus system was designed using MATLAB/SIMULINK. Afterload flow was converged, faults were applied at different locations in the network, and the voltage and current variations were verified. A classifier that helps to decide whether the disturbance is due to fault or power swing was designed. The distance relay is attached to disconnect the line with a fault/power swing. The proposed method was validated under two situations, namely, normal condition and power swing condition.

Situation 1: Normal Condition
Under normal conditions, the flow of voltage and current is not varied because the load is not much varied. Therefore, the system does not face a power swing/fault condition. Figure 5 shows the waveform of voltage and current under normal conditions at Bus 2. It shows that the voltage of the system flows from −40 kV to +40 kV. Similarly, the current varies from −26 kA to +26 kA.

Situation 2: Power Swing Condition
The flow of voltage and current are varied because a power swing occurred due to a variation in voltage and current due to a sudden variation in load. In this proposed work, the power swing happened in the second generator. Figures 6-9 show the voltage and current waveforms during the power swing at Bus 2, Bus 5, Bus 6, and Bus 8, respectively, which occurred at the period of 0.3 s to 0.5 s.

Situation 2: Power Swing Condition
The flow of voltage and current are varied because a power swing occurred due to a variation in voltage and current due to a sudden variation in load. In this proposed work, the power swing happened in the second generator. Figures 6-9 show the voltage and current waveforms during the power swing at Bus 2, Bus 5, Bus 6, and Bus 8, respectively, which occurred at the period of 0.3 s to 0.5 s.  The ROC and AUC of the proposed method are illustrated in Figure 10. The ROC curve is a performance measure for classifying tasks at different levels of the threshold. The ROC is a probability curve, while AUC stands for separable size or quantity. This shows how different the model is amongst classes. The AUC forecasts that class 0 will be 0 and class 1 will be 1. The AUC indicates the appropriate class prediction of the proposed method. If the AUC is high, the proposed model predicts 0 classes such as 0 and 1 classes as 1. The proposed technique obtained the best fault detection validated by performance matrices based on the ROC characteristics. The proposed SBS is used to examine the blocking scheme utilizing the impedance approach based on the fault detection phase.
The proposed method 2 × 2 confusion matrix is provided in Table 2. The matrix is formed as the predicted value and actual value of the system. The parameter of a confusion matrix is True, False, Negative, and Positive, which are further computed as True Negative, which is the number of negative events correctly classified as ordinary. The total number of positive cases is correctly classified as an attack which describes as a True Positive. False Positive is termed as the number of non-attacking instances that were misclassified as attacks, and False Negative is stated as the number of assaults that are incorrectly classified as normal.   The ROC and AUC of the proposed method are illustrated in Figure 10. The ROC curve is a performance measure for classifying tasks at different levels of the threshold. The ROC is a probability curve, while AUC stands for separable size or quantity. This shows how different the model is amongst classes. The AUC forecasts that class 0 will be 0 and class 1 will be 1. The AUC indicates the appropriate class prediction of the proposed method. If the AUC is high, the proposed model predicts 0 classes such as 0 and 1 classes as 1. The proposed technique obtained the best fault detection validated by performance matrices based on the ROC characteristics. The proposed SBS is used to examine the blocking scheme utilizing the impedance approach based on the fault  The proposed method 2 × 2 confusion matrix is provided in Table 2. The matrix is formed as the predicted value and actual value of the system. The parameter of a confusion matrix is True, False, Negative, and Positive, which are further computed as True Negative, which is the number of negative events correctly classified as ordinary. The total number of positive cases is correctly classified as an attack which describes as a True Positive. False Positive is termed as the number of non-attacking instances that were misclassified as attacks, and False Negative is stated as the number of assaults that are incorrectly classified as normal. The proposed method is analyzed with performance metrics as well as the outcome compared with existing methods like SVM, ANN, and KNN. Table 3 shows the performance of proposed and existing methods. The accuracy of the proposed technique is 97%, and the existing SVM, ANN, and KNN techniques are 95%, 91%, and 88%. This analysis proves the proposed method's accuracy in obtaining the best result compared to the other methods. The sensitivity of the proposed method is 95%, and the existing SVM, ANN, and KNN techniques' sensitivity is 93%, 89.5%, and 87%. The specificity of the proposed method is 90%. The existing SVM, ANN, and KNN techniques attain 88%, 84%, and 81%. After that error is analyzed, the proposed method gives only a 3% error, yet the existing methods of SVM, ANN, and KNN are 5%, 9%, and 12%. The precision value of the proposed method is 94%, and the current SVM, ANN, and KNN techniques have the precision of 92%, 87%, and 84%.
Then the proposed and existing methods' F_1 score values are analyzed, the proposed method attains 78%, and the existing method SVM, ANN, and KNN are 75%, 69%, and 66%. The Kappa value of the proposed method is 85%, the existing SVM is 78%, ANN is 74%, and KNN is 67%. Finally, recall is analyzed; the proposed recall value is 86%, existing SVM attains 82%, ANN attains 73%, and KNN attains 70%.   The proposed method is analyzed with performance metrics as well as the outcome compared with existing methods like SVM, ANN, and KNN. Table 3 shows the performance of proposed and existing methods. The accuracy of the proposed technique is 97%, and the existing SVM, ANN, and KNN techniques are 95%, 91%, and 88%. This analysis proves the proposed method's accuracy in obtaining the best result compared to the other methods. The sensitivity of the proposed method is 95%, and the existing SVM, ANN, and KNN techniques' sensitivity is 93%, 89.5%, and 87%. The specificity of the proposed method is 90%. The existing SVM, ANN, and KNN techniques attain 88%, 84%, and 81%. After that error is analyzed, the proposed method gives only a 3% error, yet the existing methods of SVM, ANN, and KNN are 5%, 9%, and 12%. The precision value of the proposed method is 94%, and the current SVM, ANN, and KNN techniques have the precision of 92%, 87%, and 84%. Then the proposed and existing methods' F_1 score values are analyzed, the proposed method attains 78%, and the existing method SVM, ANN, and KNN are 75%, 69%, and 66%. The Kappa value of the proposed method is 85%, the existing SVM is 78%, ANN is 74%, and KNN is 67%. Finally, recall is analyzed; the proposed recall value is 86%, existing SVM attains 82%, ANN attains 73%, and KNN attains 70%.

Characteristics of Distance Relay
Zone 3 distance relay is used for measuring mho units in conjunction to detect the power swing. In the proposed work, a powerful swing is formed at the second generator owing to the variation of loads. Figure 11 shows the distance relay characteristics under power swing conditions. The figure shows power swing passes to the third zone, which is analyzed, and the distance relay is blocked to secure the system.

Characteristics of Distance Relay
Zone 3 distance relay is used for measuring mho units in conjunction to detect the power swing. In the proposed work, a powerful swing is formed at the second generator owing to the variation of loads. Figure 11 shows the distance relay characteristics under power swing conditions. The figure shows power swing passes to the third zone, which is analyzed, and the distance relay is blocked to secure the system. Moreover, this proposed method is analyzed month-wise, for example, in June, July, and August, which is clearly described in the upcoming section.

Distance Relay Characteristics Analysis for Monthly Wise
Based on the load power and generated power, the power swing occurs. Therefore, the performance of the relay is analyzed monthly, namely in June, July, and August. Power swing problems may vary due to the power variation on the generation side every month. Therefore, the distance relay measures the voltage and current to decide whether the operation is needed to block or not. Figure 12 shows the accuracy and losses of the distance relay under the training process. The proposed method is analyzed and validated month-wise, as shown in Table  4. In June, accuracy, specificity, F1_Score, and precision are 0.97, 0.90, 0.93, and 0.86%, respectively. Due to the variation in power, the values in July are varied. This month's accuracy, specificity, F1_Score, and precision are 0.94, 0.84, 0.85, and 0.75%, respectively. Similarly, August's accuracy, specificity, F1_Score, and precision are 0.90, 0.80, 0.90, and 0.82%, respectively. Figure 13 shows the response time of the relay in the proposed and existing methods. Taylor method-based fault detection [21] takes 45 ms to generate a command signal of the relay. An adaptive method-based fault detection [22] takes 50 ms to generate a command signal of the relay. The adaptive setting-based fault identification [23] method takes 52 ms for command generation. The UPFC based relay approach [24] takes 46 ms to generate a command signal. The data mining technique [25] takes 35.5 ms Moreover, this proposed method is analyzed month-wise, for example, in June, July, and August, which is clearly described in the upcoming section.

Distance Relay Characteristics Analysis for Monthly Wise
Based on the load power and generated power, the power swing occurs. Therefore, the performance of the relay is analyzed monthly, namely in June, July, and August. Power swing problems may vary due to the power variation on the generation side every month. Therefore, the distance relay measures the voltage and current to decide whether the operation is needed to block or not. Figure 12 shows the accuracy and losses of the distance relay under the training process. The proposed method is analyzed and validated month-wise, as shown in Table 4. In June, accuracy, specificity, F1_Score, and precision are 0.97, 0.90, 0.93, and 0.86%, respectively. Due to the variation in power, the values in July are varied. This month's accuracy, specificity, F1_Score, and precision are 0.94, 0.84, 0.85, and 0.75%, respectively. Similarly, August's accuracy, specificity, F1_Score, and precision are 0.90, 0.80, 0.90, and 0.82%, respectively. Figure 13 shows the response time of the relay in the proposed and existing methods. Taylor method-based fault detection [21] takes 45 ms to generate a command signal of the relay. An adaptive method-based fault detection [22] takes 50 ms to generate a command signal of the relay. The adaptive setting-based fault identification [23] method takes 52 ms for command generation. The UPFC based relay approach [24] takes 46 ms to generate a command signal. The data mining technique [25] takes 35.5 ms to generate a command signal of a distance relay to block/unblock the relay. The proposed improved DNN takes only 30 ms to analyze the voltage and current and generate a command signal of the relay to block/unblock the relay. The comparison figure shows that the proposed method more effectively identifies the power swing/fault as well as block/unblocks the relay within a rapid period. signal of a distance relay to block/unblock the relay. The proposed improved DNN ta only 30 ms to analyze the voltage and current and generate a command signal of the re to block/unblock the relay. The comparison figure shows that the proposed method m effectively identifies the power swing/fault as well as block/unblocks the relay withi rapid period.
Mathematics 2022, 10, x FOR PEER REVIEW 20 of Figure 12. The training process of (a) June, (b) July, (c) August.    Figure 12. The training process of (a) June, (b) July, (c) August.

Conclusions
The IDNN based power swing blocking method was discovered to avoid maloperation of the zone 3 distance relay. The transmission line's current and voltage signals are separately sensed, and then the sensed data is given to IMDWT. IMDWT produces a coefficient from the sensed data and then computes the SD value of the coefficient. Based on the SD value, the IDNN function is either RDL-1 (normal condition) or RDL-2 (power swing condition). When the system power is increased or differs from the specified value, the IDNN acts in RDL-2 mode, which detects the power swing and sends a tripping signal

Conclusions
The IDNN based power swing blocking method was discovered to avoid maloperation of the zone 3 distance relay. The transmission line's current and voltage signals are separately sensed, and then the sensed data is given to IMDWT. IMDWT produces a coefficient from the sensed data and then computes the SD value of the coefficient. Based on the SD value, the IDNN function is either RDL-1 (normal condition) or RDL-2 (power swing condition). When the system power is increased or differs from the specified value, the IDNN acts in RDL-2 mode, which detects the power swing and sends a tripping signal to the zone 3 distance relay to protect the transmission line. The magnitude of voltage and current differs following a power swing. The effect of the power swing reduces the system's reliability and causes undesirable tripping due to zone 3 distance relay maloperation. The proposed method gives an appropriate condition for the system and generates a suitable command signal for the distance relay. The proposed method's performance and relay characteristics validated that the IDNN-based power swing blocking method performs successfully under normal and power swing conditions, as well as eliminates distance relay maloperation. The proposed method is evaluated on the WSCC IEEE 9 bus system and compared to existing methods such as SVM, ANN, and KNN. In future work, novel techniques or novel intelligent systems may be used to enhance the system's security and reliability further.