## 4 BILSTM-Transformer Based Bems Model
### Microgrid Optimization Method Based on Cognitive Control
#### 4.5.3 Quantification of Information Gap
This situation may be due to the sequential processing nature of the LSTM, and although the Transformer part can help alleviate this problem, the response of the model still lags slightly under complex load changes. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Network** & **MSE** & **RMSE** \\ \hline CNN-LSTM & 505.710 & 22.488 \\ RNN & 489.220 & 22.118 \\ LSTM–Transformer & 336.820 & 18.352 \\ BiLSTM–Transformer & 43.290 & 6.579 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Performance parameters of neural network models. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Network** & **MSE** & **RMSE** \\ \hline BT + data loss & 37,413.696 & 193.426 \\ \hline BT + data loss + cognitive control & 546.603 & 23.380 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance metrics of BiLSTM–Transformer with and without cognitive control under data loss. In Figure 6c, The RNN model: It can be seen that the RNN model is generally consistent with the actual load curve in terms of overall trend and can capture the basic trend in areas where the load changes are relatively stable. However, RNNs do not perform well in areas with significant load changes. The Figure shows that the predicted curve has deviations in some peak and valley areas, making it difficult to keep up with the fluctuations of actual load. This performance indicates that RNNs may lack the ability to handle long-term dependencies and rapid changes, especially in complex load scenarios where model lag and bias are more pronounced. In addition, the unidirectional structure of RNN limits its ability to capture bidirectional dependency information, resulting in limited performance of the model during severe load fluctuations. In Figure 6d, The CNN-LSTM model: It can be seen that the predicted curve of the model is generally consistent with the trend in the actual load curve and can closely follow the changes in the actual load in most areas, showing a good fitting effect. Especially in the range of stable load changes, the predicted values of the model are close to the actual values, indicating that the model has strong stability in capturing smooth load trends. However, in some areas, there are slight deviations between the predicted curve and the actual load curve, and there are also slight peaks or fluctuations in some positions. These biases reflect the limitations of the model in dealing with detailed changes in load signals, especially in areas where there are significant changes in load, where the model may experience brief overreaction or lag. This phenomenon indicates that the CNN-LSTM model has limited ability to capture rapid changes in load and is prone to generating certain errors in highly fluctuating intervals. Mean-squared error (MSE) is a metric that evaluates the accuracy of a prediction model, representing the mean square difference between the predicted value and the actual value. It is calculated by squaring the difference between the predicted and actual values and averaging the differences in squares. The smaller the value of the MSE, the smaller the error of the prediction of the model, and the more accurate the model. Because MSE is sensitive to predicted values with large deviations (because the square increases the weight of large deviations), it can reflect how the model will perform in extreme cases. The root mean-square error (RMSE) is the square root of the MSE and is used to reduce the error to the same units as the original data, making the error more intuitive. RMSE is a common metric to evaluate the standard error of a model's prediction, and a smaller value indicates

Figure 6: Prediction performance comparison of neural network models for load forecasting. (**a**) The BiLSTM–Transformer (BT) model; (**b**) The LSTM–Transformer model; (**c**) The RNN model; (**d**) The CNN-LSTM model. that the model has a smaller prediction error in the average sense. Similar to MSE, RMSE is also sensitive to large errors, but its units are consistent with actual data, so it is more intuitive in practical applications.