# Reducing Detrimental Communication Failure Impacts in Microgrids by Using Deep Learning Techniques
## 4 Deep Learning Techniques for Load/Generation Forecasting
### Simulation Results of Very Short-Term Residential Load Forecasting Using LSTM-RNN  
In order to demonstrate the forecasting capabilities of LSTM-RNN a series of tests were performed in this subsection where we attempt to conduct load forecasting, and also in Section 4.3 to repeat the procedure, but this time for PV-generation. The rationale behind  
Figure 5: LSTM-RNN cell architecture. these tests is to prove it is possible to predict multiple future time steps of a dataset in the form of a univariate time series by DL techniques and more specifically LSTM. As will be further explained in the rest of the article, the parameters of the DL model should be carefully selected in order to achieve an acceptable prediction while keeping the training time as low as possible. The utilized data for prediction consists of thirty hours of a typical household power consumption generated by utilizing a stochastic model with one minute resolution as illustrated in Figure 6[36]. The forecasting process is achieved by training the RNN network for 29 h and predict the remaining 60 min. The algorithm was coded in MATLAB programming environment using its standard RNN functions. Different number of hidden units (10, 50, 100, and 300) and epoch # (250, 500, and 2000) were used in order to examine their effects on the RMSE values. Furthermore, two distinct methods were used for forecasting, in the first case, the LSTM-RNN network state is updated with observed (measured) values at each prediction while forecasted data from previous steps were used for the network state update in the second method. The results are summarized in Table 3.  
As it can be observed adding the hidden units contributes to lower RMSE values, while extending the training time. However, in case of 300 hidden units the results are worse than the 100 units case; this is due to overfitting of the training set. Furthermore, increasing the epoch number significantly adds to the training elapsed time. This is more noticeable in the case of 300 units when the training time for the 500 epoch # case increases to 25 min and 32 s. Generally, it is safe to state that there is not a clear rule-of-thumb to select the LSTM network parameters and utilizing grid search algorithms can help to optimize the settings. Based on the test results a satisfactory configuration of 100 hidden units and 500 for epoch # was chose. The two distinct sets of forecasted results are illustrated in Figure 7. As expected, the prediction accuracy is much higher in Figure 7a (with updates) in comparison with Figure 7b. However, a decent approximation is still available from the second method. In our application, the observed values are not available since our goal is to provide load/generation predictions for several future time-steps so the EMS can calculate and transmit extra power references to the ESS. In other words Figure 7b represents the forecasting scenario that will be used for our proposed framework. Figure 6: Thirty-hour household consumption power data. Figure 7: LSTM-RNN very short-term load forecasting: 100 hidden units, 500 epoch #. (**a**) Updated with observed values. (**b**) Updated with predicted values. \begin{table}
\begin{tabular}{l l l l l l} \hline \hline
**Hidden Units** & **Epoch \#** & \
\begin{tabular}{l} **Training** \\ **RMSE** \\ \end{tabular} & **RMSE on Test Set (with Updates)** & **RMSE on Test Set** &
\begin{tabular}{l} **Training** \\ **Time** \\ \end{tabular} \\ \hline
10 & 250 & 0.36 & 27.9511 & 91.4892 & 0:30 \\
10 & 500 & 0.36 & 27.9075 & 83.9501 & 0:54 \\
10 & 2000 & 0.36 & 27.9057 & 83.3967 & 3:22 \\
50 & 250 & 0.23 & 26.7577 & 51.7804 & 0:49 \\
50 & 500 & 0.21 & 26.7284 & 58.8833 & 1:33 \\
50 & 2000 & 0.21 & 26.6763 & 58.2284 & 6:26 \\
100 & 250 & 0.20 & 24.771 & 31.3054 & 2:00 \\
100 & 500 & 0.18 & 24.8361 & 31.9779 & 3:37 \\
100 & 2000 & 0.18 & 24.8239 & 31.4652 & 14:12 \\
300 & 250 & 0.20 & 27.9456 & 58.9637 & 12:56 \\
300 & 500 & 0.14 & 27.6778 & 199.3257 & 25:32 \\ \hline \hline \end{tabular}
\end{table}