Enhanced Memetic Algorithm-Based Extreme Learning Machine Model for Smart Grid Stability Prediction

Electrical and Electronics Engineering Department, Faculty of Engineering and Technology, Siksha O Anusandhan University, Bhubaneswar, India Department of Computer Science, Maharaja Sriram Chandra BhanjaDeo (MSCBD)University, Mayurbhanj, Odisha 757003, India Department of Computer Application, Veer Surendra Sai University of Technology, Burla, India Department of Electrical Engineering, Biju Patnaik University of Technology, Rourkela, India


Introduction
Use of the state-of-the-art technologies in the field of communication and computational ability has helped evolve most industries as smarter in terms of improved efficiency, productivity, quality of service, etc. However, the power system delivery grid (electric grid) has largely remained nonmodernized as compared to other sectors. e reasons can be attributed to the fact that grids have been built and developed over the years primarily as mechanical systems without attention to the possible future need for refurbishment or technological overhauling. With burgeoning demand for power, there has been a large-scale expansion of grid infrastructure, and manual monitoring of the grid has been increasingly difficult and challenging [1].
us, a certain level of computation-based automation in monitoring and controlling has been witnessed over the decade or so. However, it hardly suffices considering the new challenges in the form of changing grid dynamics and the need for enhanced grid performance in terms of efficiency, reliability, and resiliency. Although the conventional electrical power system (EPS) remains saddled with the aforementioned deficiencies, the changing scenarios ushered in due to fast depleting conventional energy sources and resulting technological developments in the field of renewable energy sources (RESs) have brought out newer challenges. Penetration of renewable energy resources at low voltage and distribution level of the EPS convert the grid topology from a centralized system to a distributed generation system. Although DGs help to supplement the energy requirements, they also pose many technological challenges, primarily as the power flow gets bidirectional leading to relay miscoordination. On the other hand, the availability of RESs also has given a fillip to the concept of microgrid technology, which not only helps cater to the local load demand but also adds much to the system stability. Needless to say, microgrids being one of the key smart grid components are going to be embedded prominently. However, the implementation of the same, as mentioned earlier, poses many challenges. e issues and challenges associated with implementing these cutting-edge technologies are enumerated in [2]. e complexities involved in the successful realization of a smart grid are very daunting, but the benefits accrued are also of immense importance. In a smart grid scenario, the monitoring and control of the EPS rest heavily on an expansive communication network to gather information generated by numerous sensors placed at various locations in the EPS. A huge amount of data thus collected needs to be processed and subjected to computational algorithms which can provide the appropriate and accurate decision in the shortest possible time. In short, we are veering towards an EPS which is heavily reliant on intelligent computational techniques with fast communication networks serving as the backbone. To be precise, the present-day EPS is smartening up as cyberphysical systems (CPSs). CPS is a strong linkage between cyber technologies and the physical system in order to deal with the operational and controlling complexities in a smart grid that are otherwise manually impossible to execute. NIST cyber-physical system website defines CPS as follows [3]: "Cyber-physical systems (CPSs) comprise interacting digital, analog, physical, and human components engineered for function through integrated physics and logic." A more generalized definition is given in [4] as follows: "CPS can be characterized as physical and engineered systems whose operations are monitored, controlled, coordinated, and integrated by a computing and communicating core." In the industrial smart grid perspective, the concept of CPS embodies physical systems such as the network of power infrastructure strongly interfaced with control, intelligence, processing, and information. e CPS enables the smart grid to deliver its expected functional features, which are as follows [5]: (i) Minimizing the need for deployment of additional power plants through effective power management (ii) Adaptive and self-healing protection mechanism in order to ensure high reliability and resiliency of the EPS (iii) Facilitate plug-in of DGs to the grid to meet the localized power demand (iv) Exhibit flexibility in the distribution process to supply the right amount of power to the various types of loads connected to the grid. (v) Predict the short-term and long-term power demand (vi) Help reduce pollution through environmentfriendly renewable energy sources (vii) Help minimize the price of electricity e above functionalities of an industrial smart grid that ultimately ensures the stability of the network are possible by using intelligent computing algorithms that comprise the backbone of the cyber technology in a CPS. Applications of these intelligent computational algorithms, such as advanced optimization techniques, expert systems, fuzzy logic, neural network, and deep neural network are used to design schemes meant for control, power management, power system protection, power trading, predisaster, and postdisaster management in order to have enhanced power system resiliency and all other such aspects of the smart grid concept that help to add to its stability.
In this work, an optimized extreme learning machine (ELM) is suggested to predict the stability of the industrial smart grid (SG). e performance of the proposed model is then compared with other contemporary machine learning (ML) and deep learning (DL) models. e steps involved in this work can be presented as follows: (1) Initially, the SG data have been retrieved from the UCI-ML repository [6] and processed through a preprocessing step such as normalization and label encoding. (2) A novel memetic algorithm-based optimized extreme learning machine (ELM) is proposed for the training and testing of the data. Here, the TLBO and SA techniques are used to design the memetic algorithm.
(3) is extracted SG dataset is then processed through the proposed optimized ELM model for training and testing purposes. (4) e performance of the proposed ML model is then compared with other contemporary ML and DL approaches using a few key indexes, such as accuracy, precision, recall, and F-score.
In short, our key contributions toward the prediction of the SG stability can be summarized as follows: e organization of the remaining parts of this article is presented as follows: Section 2 reviews the current literature associated with the application of intelligent computational techniques in various aspects of SG functionalities. Section 3 presents the proposed memetic algorithm-based ELM architecture in detail. e experimentation and result analysis has been carried out in Section 4. Section 5 highlights the concluding remark with the future direction.

Literature Survey
A smart grid vastly relies on the accumulation of a huge amount of data procured from numerous sensors placed at different strategic locations of the EPS, fast and robust internet-based communication channels, and of course a fast-acting intelligent computation algorithm. It is imperative that handling and managing such huge data, protecting the communication channel from cyber infringements, and engaging a fast-acting computational technique for accurate prediction of the set objective are vital for realizing a smart grid. Smart grid deployment thus involves huge complexity. Advanced intelligent systems, with techniques such as ML, DL, reinforcement learning (RL), deep reinforcement learning (DRL), and SG realization are becoming feasible [7].
In the above context, the authors in [8] enumerate how the use of big data analysis in conjunction with intelligent models helps to resolve the issue of processing these huge data in an SG. Various applications of big data in the SG perspective are listed in [9]. reat to the communication network in the form of covert data integrity assault (CDIA) can be detrimental to the reliability and safety of smart grid functionalities.
ese smartly designed CDIAs can easily outwit the conventional bad-data detector employed in SG control hubs. e authors in [10] have proposed an unsupervised ML-based model to identify CDIAs in SG communication grids using an unlabeled dataset. e ML algorithm employed is called isolation forest. e security system against CDIAs generally is a three-tier structure. 'Protection,' 'intrusion detection system (IDS)', and 'alleviation,' are the first, second, and third tier, respectively. rough shielded communications and data safeguarding measures, the first tier ensures protection of the communication channel against the majority of CDIAs. In the event of the protection tier getting violated, the IDS as the second tier of defense detects the intrusion and generates precautionary signals for the operators to take up preventive measures against the CDIA. e recent literature enumerates many ML-based IDSs [11][12][13][14][15][16][17]. e authors in [11,12] have depicted the application of ML algorithms in identifying unscrupulous user activities in smart grid communication channels. e authors in [13] have demonstrated the utility of several ML algorithms in the detection of CDIAs at the physical layer of a smart grid. e authors in [14] have employed a support vector machine (SVM) classifier in the above context. e authors in [15] have proposed another ML-based model to detect time synchronization assault (TSA). e authors in [16] proposed the Euclidean-distance-based ML model to predict the CDIAs. e authors in [17] have suggested a genetic algorithm (GA) combined with SVM, for future selection and classification purposes, respectively, in order to detect CDIAs. Most of the CDIA recognition techniques using machine learning as stated in the collected works have considered supervised learning on labeled data only. e third defense tier, known as alleviation, serves as a kind of restoration system, which helps restore the reliable system operations once the CPSassault recognition message is established at the SG control hub. Many optimizations and intelligent techniques too are engaged in this tier for the intended purpose.
From a smart grid stability perspective, it is very essential that zone-specific accurate load forecasting must be carried out in order to meet the dynamic energy demands. Various ML techniques can be used for such purposes. Based on historical data on weather, load variation pattern, and energy generation, these ML algorithms make an accurate prediction of load demand in specific regions [18,19]. In [19],a deep neural network (DNN) model is employed for generation and load demand forecasting, where DNN has proven better than the contemporary regression model. In [20], the authors have offered a big data framework for distributed processing to predict energy load demand. Here, the MLib-ML library is used for assessing the performance of different regression models. e stability of SGs, which enables smart cities, is challenged by the dynamic energy consumption due to the household appliances in these smart cities. IoT technologies along with ICTs present many energy management techniques to address the issue. e authors in [21] suggested a consumption prediction technique based on a probabilistic data-driven prognostic technique developed on a Bayesian network (BN) framework. Elsisi and Tran proposed a unified Internet of thing (IoT) architecture to manage the issue of cyberattacks using a DNN model having a rectified linear unit [22]. is stated system can supervise the automated guided vehicles reliably and securely. Elsisi et al. suggested an effective online fault diagnosis system against cyberattacks and data uncertainties using an IoT enabled DL model [23]. e cost of power also plays an important role in ensuring the stability of the distributed power systems. e authors in [24] have proposed a decentralized SG control model to ensure demand-side management in the grid by analyzing the electricity price versus grid frequency deviation. e authors have also implemented an optimized data matching ML technique and the transparent open box learning model to realize dynamic SG stability.
Against the backdrop of the above discussion on various factors of smart grid instability and the possible intelligent methods to mitigate them, it is also essential that there should be an efficient scheme for the estimation and prediction of SG stability in place. e authors in [25] have proposed an ML-based smart grid stability forecasting scheme. e proposed method employs three different genetic algorithms in the future selection stage and four different ML classifiers including the GBM algorithm. e authors in [5] proposed a few DL-based models such as recurrent neural network (RNN), long short-term memory (LSTM), and gated recurrent unit (GRU) for prediction of SG stability.
It can be inferred very well from the above survey that there is no single comprehensive solution to tackle the challenges of stability in an SG. Also, there is a need for further research in the area of stability prediction as evident from the scarcity of the literature in this regard. In the present study, it is envisaged to design the novel memetic algorithm-based ELM model for smart grid stability prediction. e proposed approach shows better results than the

Proposed TLBO-SA-ELM Approach
e performance of the ML model is generally enhanced by integrating the optimization algorithm [26][27][28][29]. In this work, a memetic algorithm based on TLBO and SA is proposed to increase the performance of the ELM classifier. Afterward, the proposed optimized ELM is trained and tested using the SG dataset.
A single metaheuristic algorithm cannot solve all optimization problems and is usually less effective for highdimensional SG datasets. erefore, there always remains a possibility to design an improved search approach and develop novel optimization techniques which can be used to solve gene selection problems in the SG dataset. is is our major inspiration behind the scheming of this proposed memetic algorithm. e proposed SG stability predictive algorithm is designed using three basic soft computing models such as TLBO, SA, and ELM.
In this work, an ELM-based model [30] with optimized parameters is developed for efficient prediction of smart grid status from smart grid operational features. e proposed problem can be visualized as an optimization problem where the objective is to select the best p i � f i , α i , nh i in P � p 1 , p 2 , . . . , p n (population with 'n' a number of hyperparameter sets). Here, p i is the i th randomly generated hyperparameter value set which is drawn from an allowed range of values as follows: f i ∈ list [1,2,3,4,5,6,7,8], nh i ∈ range [1,200], and α i ∈ range[0.1, 1.0]. Here, f i , nh i , and α i are i th activation function, a selected number of the hidden layer, and learning rate. e activation function f i is chosen as '1,' '2,' '3,' '4,' '5,' '6,' '7,' and '8' for sine, tanh, tribas, sigmoid, hand/lim, soft/lim, Gaussian, and multiquadric, respectively. e performance of ELM on the prediction of smart grid status is dependent on these parameters f, nh, and α. Here, the studied problem can be visualized as an optimization problem to get optimal P * i � f i , nh i , α i in P, which is the optimal parameter set of ELM for solving the identification of the various states of the smart grid. On the given operational SG properties, , and modelELM(D Train , P i ), where the objective is to find optimal P * i which optimizes the following objective function: (1) is the collection of smart grid operational properties op i with thirteen features and one class label st i representing the status of the grid condition, i.e., either 'stable' or 'unstable.' e proposed ELM model has been trained with these instances. In ELM, the prediction of the class label is made using Equation (2), where Houtput (Equation (3)) is the output matrix, β (Equation (4)) is the weight matrix representing the weights between hidden layer neurons and out neurons, and Equation (5) is the prediction matrix.
In this work, the hyperparameters of ELM are optimized with the memetic version of teaching-learning based optimization (TLBO) [31]. Here, the TLBO is integrated with simulated annealing [32] in order to avoid a locally optimal solution.
In this work, the domains of the considered hyperparameters are as follows: activation function (f), alpha (α), and several hidden neurons (nh). Here, f is the mathematical equation that is responsible to determine whether the neuron input is significant for prediction. α is the controlling parameter for the adjustment of weights and H is the number of hidden neurons that highly impact the performance and network stability.
is work is focused on the process of finding optimal parameters (P i ) ELM by using TLBO with SA. e objective function is used to evaluate the parameter combinations (P i ) and output a fitness (accuracy) fit P i � ELM(D Train , P i ) which indicates how well the set of hyperparameters performs for the considered problem. For the present problem, we have considered 'accuracy' as the evaluation matrix, and it is the objective to maximize the objective function presented in Equation (2). e architecture of the proposed algorithm is presented graphically in Figure 1. e proposed scheme for hyperparameter optimization starts with random generation of the population of the hyperparameter set P � P i n i�1 , where P i � f i , nh i , α i representing i th instance of the ELM parameter set. e fitness of each P i in P is evaluated (in Algorithm 1, i.e., fit P i � ELM(D Train , P i ) by setting the P i in ELM and testing on the data D Train . en, the fittest P i in P is P Teacher . e teaching factor tf � rand(1 + rand(1)) and the population meanP Mean are computed in order to use them for the generation of a new population. For each P i , the P new i is generated as P new i � P i + r × (P Teacher − tf × P Mean ), where r is a random number. e updating of P is performed by comparing each of P i in P with the corresponding P new i in P new . en, the resultant population is improvised by choosing two solutions P i and P j randomly from P and altering them as mentioned in the following equation:

International Transactions on Electrical Energy Systems
After improvisation of P, the best solution P best in P is selected based on the highest fitness. en, the simulated annealing (Algorithm 2) has been applied on P best to generate a new solution from P best in order to avoid local optimal solutions. e proposed approach of applying simulated annealing with TLBO not only accepts the best solution but also considers the nearer solution to the best solution with some probability. e major steps of applying simulated annealing on P best are as follows: (i) random generation of a solution P best ′ from P best and N(P best ), where it is the neighborhood operation; (ii) computation of the fitness fit best and fit best ′ of P best and P best ′ , respectively, by calling the procedure ELM(D Train , P best ) and ELM(D Train , P best ′ ), respectively; (iii) replacement of P best with P best ′ if fit best ′ > fit best , or if r and(1) < p, where p � e θ/T ; (iv) decrement of the temperature: T � 0.93 × T and checking the maximum trial. If maximum trial is reached, then extract the P best .
After getting the update P best from Algorithm 2 (simulated annealing process), the population P has been updated by replacing old P best with new P best (returned from the procedure SA). If a maximum generation is reached or no further improvement on the performance, then we stop and assign P * � P best . Finally, Algorithm 3 returns the best hyperparameter set P * from the entire final population P.
en, this is set on ELM as fit P * � ELM(D Train , P * ) and fit P * � ELM(D Train , P * ) to get the generalized performance on training data D Train and test data D Test , respectively. e complete process of getting an optimal hyperparameterP * can be realized in Algorithm 3.

Results and Discussion
In this section, the proposed SG stability prediction method is evaluated through proper experimental analysis.

Return P best
Return best solution P* update P find the best P i for each randomly choosen P i and P j update P by comparing each P i in P Inprove them by equation (6) i.e. P best P best = P best Generate a random solution P best from P best and N(P best ) ' Compute the fitness of P best and P bset as fit best and fit bset ' '

Compute P mean
Select P i with highest fitness (Accuracy) as P teacher Compute tf = round(1+rand (1) International Transactions on Electrical Energy Systems

Experimental Platform.
e experimental setup for the proposed work comprises an online graphical processing unit (GPU) enabled by Google called "Google Colab," a supercomputer having a Windows 10 Operating system with a core I7 processor and a Python 3.9 programming tool.

Dataset Description.
e SG data used in this experiment have been extracted from the UCI-ML repository [6].
is dataset comprised 10000 samples with fourteen features. e attributes are divided into 12 primary predictive features and 2 dependent variables. e predictive features provide information about the reaction time (tau[x]) of smart grid participants {range: 0.5-10s}, nominal power (p[x]) consumed (negative)/produced (positive), and coefficient related to elasticity price (g[x]). e dependent attributes can be described as follows: the first attribute indicates: the maximal real part of the characteristic equation root (if positive -the system is linearly unstable) and the second dependent attribute states the stability label (class level) of the system (categorical: stable/unstable).

Performance Evaluation Matrices.
In this work, the classification result corresponding to the proposed TLBO-SA-ELM is interpreted through the following performance evaluation matrices.
Confusion matrix (CM): it represents the actual value with respect to the predicted values corresponding to the class level.
CM is a table that visualizes and compares the result obtained from a classifier by presenting the actual values and predicted values (number of samples) with respect to the class levels in terms of correct and incorrect prediction. A sample of the confusion matrix is presented in Figure 2.
From the above confusion matrix, the following six matrices are calculated as presented from the following equations.
Accuracy (A): it signifies the correctness of the classifier. It is mathematically represented as follows: Precision(P): Fβ Score: F1_Score (F1): in the calculation of F1_Score, equal weight is given for both precision and recall. erefore, in equation (10), a beta (β) value of 1 can be considered for the calculation of F1_measure. So it can be represented as follows : F2_Score (F1): in the calculation of F1_Score, less weight is given for precision compared to the recall value. erefore, in equation (10), a beta (β) value of 2 can be considered for the calculation of F1_measure. So, it can be represented as follows:

Performance Evaluation of the Proposed TLBO-SA-ELM
Model. e collected SG data are divided into 8 : 2 ratios for training and testing, respectively. e testing result in terms of the confusion matrix is presented in Figure 3. Figure 3 shows the confusion matrix for ELM and the proposed model for the classification of the SG stability dataset.
e proposed TLBO-SA-ELM model detects 703 data as truly stable and 1292 as truly unstable, whereas traditional ELM detects 669 data as truly stable and 1223 as truly unstable. Only 5 data are misclassified through the proposed model. From these confusion matrixes, different measuring indices such as precision, recall, accuracy, and Fβ-Score are calculated and tabulated in Table I. It can be seen from the table that the proposed model can classify the stability of the SG data with 99.75% accuracy.
e other indices such as precision, recall, F1, F2 scores, and area under the curve (AUC) are noted to be 1.0, 0.996144, 0.998068, 0.6197, and 0.998072, respectively. It can be seen from the table that the proposed model outperforms traditional ELM with respect to all the measuring indices. e proposed approach is a hybrid model where the parameter of the ELM is optimized through a memetic algorithm comprised TLBO and SA. In order to check the effectiveness of the proposed memetic algorithm, a few other optimization algorithms such as genetic algorithm (GA), particle swarm optimization (PSO), and TLBO are hybridized with the ELM algorithm, and the corresponding result is interpreted in Figure 4. Figure 4 shows the plot of fitness (accuracy) versus the number of generations. It is seen from the figure that the proposed memetic algorithm-  (2) Calculate the hidden layer output function Houtput by using the selected activation function f(·).
(3) Compute the output weight matrix β � Houtput μ × st, which maximizes the objective function ‖Houtput × β − st‖ � min β ‖Houtput × β − st‖. Here, Houtput μ is the Moore-Penrose generalized inverse of the Houtput. Houtput μ � (Houtput × Houtput) −1 × Houtput T . Perform the prediction by using β on the data st � α × ( Houtput × β), α is the learning rate. st (1) Randomly generate a solution P best ′ from P best and N(P best ) (neighbor structure of P best ) (2) Compute the fitness fit best and fit best ′ of P best and P best ′ , respectively, by calling the procedure ELM(D Train , P best ) and ELM(D Train , P best ′ ), respectively (3) If fit best ′ > fit best , then assign P best � P best ′ Else calculate p � e θ/T . If r and(1) < p, then assign P best � P best ′ (4) Decrease the temperature, T � 0.93 × T (5) If the maximum trial is reached, then return P best (6) Else go to step 1. ALGORITHM 2: P best � SA(P best , N(P best ), D Train ). (1) Randomly generate the population P � P i n i�1 , where P i � f i , nh i , α i representing i th is an instance of the ELM parameter set.
(2) Evaluate the fitness of each P i in P. fit P i � ELM(D Train , P i ).
where r is a random number. (6) Perform the updating P by comparison of each P i in P with the corresponding P new i in P new . (7) For each pair of randomly chosen P i and P j in P, improvise them by using the following equation: (8) Find the best solution P best in P based on the highest fitness. (9) Generate a new solution from P best by using a simulated annealing process P best � SA(P best , N(P best ), D Train ). (10) Update the population by replacing old P best with new P best (returned from the procedure SA). (11) If a maximum generation is reached, then assign P * � P best .
Else, go to step 2.   Model Accuracy Recurrent neural network (RNN) [5] 96.60 Gated recurrent unit (GRU) [5] 97.30 Long short term memory (LSTM) [5] 97.13 Multidimensional long short term memory (M-LSTM) [5] 99.07  International Transactions on Electrical Energy Systems (accuracy > 6.4%). Finally, it can be concluded that the proposed approach performs better than all other ML models with respect to each performance indices. In addition to this, the performance of the proposed approach is compared with the result of different deep learning models (such as RNN, GRU, LSTM, and MLSTM) applied to a similar dataset [5]. is comparative result analysis is presented in Table 2. It can be analyzed from the table that MLSTM performs better than RNN, GRU, and LSTM; however, the proposed algorithm (TLBO-SA-ELM) outperforms in all aspect. Figure 5 shows the overall comparative results graphically.

Conclusion
Smart grids are identified with the cyber-physical system used for intelligent management of power generation and dissipation ensuring quality power supply at the most economical price. However, the threat to CPS and several issues including a threat to CPSs severely affects the stability of a smart grid. Machine learning techniques play a vital role in predicting the stability of the smart grid. In this work, a novel memetic algorithm-based ELM model is introduced to predict the stability of the SG. e proposed optimized ELM algorithm is tested on the SG dataset extracted from the UCI-ML repository. e proposed model achieved 99.75% accuracy and 100% precision in classifying the stability status of the smart grid. To justify the effectiveness of the proposed model, a detailed comparative analysis is carried out with other contemporary machine learning models (such as decision tree, linear regression, random forest, naïve bias, XGBoost, and ELM) and previously published work based on deep learning (such as LSTM, GRU, RNN, and MLSTM). 99.8072% of ROC is achieved through the proposed algorithm which outperformed the other comparative models. e effectiveness of the proposed memetic algorithm based on TLBO and SA is additionally compared with several other optimization techniques (such as particle swam optimization, genetic algorithm, and TLBO) hybridized with ELM. e future scope of the work may deal with the analysis of dynamic power requirements, reliability, and resiliency of SG.