A cyber physical energy system (CPES) involves a combination of processing, network, and physical processes. The smart grid plays a vital role in the CPES model where information technology (IT) can be related to the physical system. At the same time, the machine learning (ML) models find useful for the smart grids integrated into the CPES for effective decision making. Also, the smart grids using ML and deep learning (DL) models are anticipated to lessen the requirement of placing many power plants for electricity utilization. In this aspect, this study designs optimal multi-head attention based bidirectional long short term memory (OMHA-MBLSTM) technique for smart grid stability prediction in CPES. The proposed OMHA-MBLSTM technique involves three subprocesses such as pre-processing, prediction, and hyperparameter optimization. The OMHA-MBLSTM technique employs min-max normalization as a pre-processing step. Besides, the MBLSTM model is applied for the prediction of stability level of the smart grids in CPES. At the same time, the moth swarm algorithm (MHA) is utilized for optimally modifying the hyperparameters involved in the MBLSTM model. To ensure the enhanced outcomes of the OMHA-MBLSTM technique, a series of simulations were carried out and the results are inspected under several aspects. The experimental results pointed out the better outcomes of the OMHA-MBLSTM technique over the recent models.

In recent years, Digitalization and Automation have become significant topics in the energy sector, as modern energy system increasingly relies on information and communication technologies (ICT) to integrate smart controls with hardware framework [

There has been comprehensive study on the grid network for the distribution of power over different locations efficiently. One of these methods is the smart grid that employs ICT for aggregating data concerning the behavior of consumers to generate a context-aware scheme that could allocate the energy efficiently. Smart grids utilizing Artificial Intelligence (AI) technique are predicted for reducing the requirement to deploy additional power stations for electrical energy consumption. Also, the Smart grid uses renewable resources to be plugged securely into the grid system to appendage the source of electricity. The cyber-physical smart grids have experienced substantial damage on transformers, power lines, amongst others; also, cyber-attack and cyberespionage have been reported in real-life incidents. Such difficulties have driven the researches in defense and cyber-physical attack of the smart grids from control, information, power, and several more security-related researches, which leads to unified cyber-physical security perspectives. Smart grids, that could forecast energy consumption is essential need. This could be achieved with the applications of Machine Learning (ML) algorithm [

Wei et al. [

In [

Haija et al. [

This study designs optimal multi-head attention based bidirectional long short term memory (OMHA-MBLSTM) technique for smart grid stability prediction in CPES. The proposed OMHA-MBLSTM technique involves three subprocesses such as min-max normalization based pre-processing, prediction, and hyperparameter optimization. Moreover, the MBLSTM model is applied for the prediction of stability level of the smart grids in CPES. Furthermore, moth swarm algorithm (MHA) is utilized for optimally modifying the hyperparameters involved in the MBLSTM model. For ensuring the improved performance of the OMHA-MBLSTM technique, a series of simulations were carried out and the results are inspected under several aspects.

In this study, an effective OMHA-MBLSTM technique has been developed to predict the stability level of the smart grids in the CPES environment. The proposed OMHA-MBLSTM technique involves three subprocesses (as shown in

First, the electricity grid dataset from different power generating units is aggregated. The dataset is then normalized using min-max normalization. During this process, the minimum and maximum values of the data are obtained and replaced by using

Next to the pre-processing stage, the MBLSTM model is utilized to perform the stability prediction process [_{t} at time step _{t} at the time step _{t}, input gate _{t}, and output gate _{t} at time step

_{χ,f} and _{h,f} denotes the weights of LSTM in input-forget gate and in hidden layer to forget gate correspondingly. _{x,i} and _{h,i} refers to the association weights under the input-input gate and the hidden layer to the input gate correspondingly. _{x,0} and _{h,0} signifies the connect weights under the input-output gates and the hidden layer to the output gate correspondingly. _{f}, _{i}, and _{o} signifies the bias of forgetting, input, as well as output gates correspondingly. _{x,c} and _{h,c} defines the weight of LSTM under input to candidate memory and the hidden layer to candidate memory correspondingly, and _{c} refers to the bias. The memory cell at time step

The preceding RNN has forwarded. The output at time step

The output at time step

Attention is process to enhance the outcome of RNN based techniques, and the computation of attention has mostly separated into 3 stages. A 1st stage is for utilizing the attention function

To enhance the predictive outcomes of the MBLSTM model, the MHA is employed. The nighttime performance of moths is simulated to MHA has established in [

where _{i} indicates the candidate solution,

_{p} represents the amount of pathfinders, and

During the MHA crossover points were individuals with minimal dispersal values dependent upon:

After that only _{c} ∈ _{p} crossover point was employed for generating novel sub-trial pathfinder vectors _{pl} and _{p2} implies the independent variable calculated in the Lévy

Lastly, the MHA executes a chosen approach among the trial as well as original pathfinders determined as:

The probability of choosing the following pathfinder was determined as:

That utilizes the luminescence intensity computed as subsequent formula:

In the pathfinder, _{f} those were chosen as prospectors; this number is dynamically changed as under the subsequent formula:

With ^{⋅}

The onlooker is a moth with minimum luminescent intensity moving near the shiniest source of light; during the MHA, the onlooker's stage was employed for intensifying the exploitation of promissory spots of search spaces. The onlooker group is more separated based on 2 movement rules: Gaussian walks, and associative learning process with immediate memory. At the beginning, the onlooker in the actual iteration was attained as:_{2} and ɛ_{3} defines the uniformly distributed arbitrary numbers, _{g} refers the global optimum candidate solutions, _{o} = _{u}/2) represents the amount of onlookers which executes a Gaussian movement, _{u} stands for the amount of onlookers, and ɛ_{1} signifies the normal arbitrary number computed as:

The performance of moths regarding associative learning as well as short-term memory is upgraded based on:_{m} = _{u} − _{o} being the amount of onlookers which executes associative learning and short-term memory, 1 − _{p} signifies the optimum light source under the pathfinder group and

This section examines the predictive outcome of the OMHA-MBLSTM technique over the other techniques.

Methods | Training accuracy | Training loss | Testing accuracy | Testing loss |
---|---|---|---|---|

GRU Model | 0.9717 | 0.0600 | 0.9730 | 0.0600 |

RNN Model | 0.9666 | 0.0800 | 0.9660 | 0.0800 |

LSTM Model | 0.9730 | 0.0600 | 0.9713 | 0.0600 |

MLSTM Model | 0.9907 | 0.0200 | 0.9907 | 0.0200 |

MHA-MBLSTM | 0.9952 | 0.0150 | 0.9962 | 0.0110 |

OMHA-MBLSTM | 0.9967 | 0.0120 | 0.9971 | 0.0107 |

_{n}, _{l}, and _{score} of 0.9823, 1.0000, and 0.9963 respectively. Moreover, the OMHA-MBLSTM technique has identified the instances into Fault class with the _{n}, _{l}, and _{score} of 1.0000, 0.9967 and 0.9952 respectively.

Methods | Classes | Precision | Recall | F1-Score |
---|---|---|---|---|

GRU Model | Stable | 0.9318 | 1.0000 | 0.9638 |

Fault | 1.0000 | 0.9609 | 0.9811 | |

RNN Model | Stable | 0.9239 | 1.0000 | 0.9529 |

Fault | 1.0000 | 0.9518 | 0.9726 | |

LSTM Model | Stable | 0.9328 | 0.9906 | 0.9634 |

Fault | 0.9923 | 0.9640 | 0.9819 | |

MLSTM Model | Stable | 0.9706 | 1.0000 | 0.9922 |

Fault | 1.0000 | 0.9926 | 0.9910 | |

MHA-MBLSTM | Stable | 0.9784 | 1.0000 | 0.9951 |

Fault | 1.0000 | 0.9956 | 0.9935 | |

OMHA-MBLSTM | Stable | 0.9823 | 1.0000 | 0.9963 |

Fault | 1.0000 | 0.9967 | 0.9952 |

_{n} analysis of the OMHA-MBLSTM technique with existing techniques. The results showcased that the GRU, RNN, and LSTM models have reached to least _{n} if 96.59%, 96.20%, and 96.26% respectively. Though the MLSTM and MHA-MBLSTM techniques have resulted in competitive _{n} of 98.53% and 98.92%, the OMHA-MBLSTM technique has demonstrated better outcome with the _{n} of 99.12%.

Methods | Precision | Recall | Fl Score |
---|---|---|---|

GRU Model | 96.59 | 98.05 | 97.25 |

RNN Model | 96.20 | 97.59 | 96.28 |

LSTM Model | 96.26 | 97.73 | 97.27 |

MLSTM Model | 98.53 | 99.63 | 99.16 |

MHA-MBLSTM | 98.92 | 99.78 | 99.43 |

OMHA-MBLSTM | 99.12 | 99.84 | 99.58 |

_{l} analysis of the OMHA-MBLSTM technique with existing techniques. The figure revealed that the GRU, RNN, and LSTM models have obtained lower _{l} if 96.59%, 96.20%, and 96.26% respectively. Although the MLSTM and MHA-MBLSTM techniques have attained reasonable _{l} of 98.53% and 98.92%, the OMHA-MBLSTM technique has achieved improved outcome with the _{l} of 99.12%.

Finally, _{score} if 96.59%, 96.20%, and 96.26% respectively. Though the MLSTM and MHA-MBLSTM techniques have exhibited near optimal _{score} of 98.53% and 98.92%, the OMHA-MBLSTM technique has demonstrated better outcome with the _{score} of 99.12%. From the abovementioned results and discussion, it can be confirmed that the OMHA-MBLSTM technique has gained maximum stability prediction performance over the other techniques.

In this study, an effective OMHA-MBLSTM technique has been developed to predict the stability level of the smart grids in the CPES environment. The proposed OMHA-MBLSTM technique involves three subprocesses such as min-max normalization based pre-processing, MBLSTM based prediction, and MHA based hyperparameter optimization. The design of MHA helps to appropriately elect the hyperparameters and it leads to enhanced predictive outcomes. For ensuring the improved performance of the OMHA-MBLSTM technique, a series of simulations were carried out and the results are inspected under several aspects. The experimental results pointed out the better outcomes of the OMHA-MBLSTM technique over the recent models. Therefore, the OMHA-MBLSTM technique can be used as an efficient tool for stability prediction in smart grids. In future, the predictive outcome can be improved by the utilization of hybrid DL models.

The authors would like to acknowledge the support provided by AlMaarefa University while conducting this research work.