# MADDPG-Based Security Situational Awareness for Smart Grid with Intelligent Edge
## 6 Performance Evaluation
### Performance Evaluation
However, as the error rate decreases, the rewards gradually grow. The lower the error rate is, the more rapidly the reward value increases. By the time the error rate approaches 0, the optimal rewards of the model are achieved. This is because the error rate reduction enables the edge agent to make correct actions based on the situational elements, resulting in higher total long-term rewards for situational awareness. It is also shown that awareness for port information has less impact on the rewards than related logs, vulnerable nodes, and known attacks. The detection error rate of known attacks has the most significant impact on the rewards. Figure 4: The total episode rewards obtained by the 3-agent MADDPG algorithm and the single-agent DDPG algorithm over 50,000 episodes. Figure 5: Comparison of MADDPG-based and DDPG-based algorithm’s mean rewards for an edge agent. Next, we trained three different models independently. The models consist of the MADDPG-based model proposed in this paper and the DDPG-based model trained at the edge agent side, and the DDPG-based model trained at the cloud side, respectively. Then the trained three models have experimented simultaneously in the same situational environment. Setting the interval of each time slot to 1 s, we recorded the time for the models to make an awareness action in each time slot as the processing time. Figure 7 shows the processing time for each trained model working on the given environment to take awareness actions within 20-time slots. Among the algorithms performed at the edge, MADDPG-based has a shorter and more stable processing time than the DDPG-based algorithm. Yet, the DDPG-based algorithm performed at the cloud has the shortest processing time. Considering that situation awareness architecture based on the cloud paradigm needs to consider the network latency (around 200 ms) from edge to cloud, which is approaching 500 ms. Therefore, the processing time for threats is decreased with the effect of edge intelligence. Further, comparing the three models, the MADDPG-based situational awareness model proposed in this paper has the lowest latency for threat processing. Simulations were performed to consider the impact of a large number of heterogeneous terminals in the smart grids on the process of situational awareness. The total number of power terminals distributed under the edge agent was set to 1000 and 2000. These total terminals contain different categories. Next, we positioned the trained proposed MADDPG  
Figure 6: Impact of detection error rate on the rewards of the proposed MADDPG-based algorithm. Figure 7: The processing time of different models working on the situational environment within 20-time slots. based situational awareness module to the edge and cloud, respectively. The average processing time for making each situational awareness action was calculated separately for the awareness environments of different terminals. Figure 8 shows the average processing time of the proposed model under various categories of heterogeneous terminals, including edge processing and cloud processing. To be seen, the average processing time increases with the number of terminal categories as well as the total number of terminals. The average processing time performed in the cloud is much greater than that in the edge under the same conditions. When the number of heterogeneous terminal categories approaches 100, the average processing time in the cloud is about twice that of the edge. The results show that the proposed MADDPG-based model under edge computing in this paper is effective in the problem of situational awareness with a large number of heterogeneous terminals. To verify the detection performance of specific categories of attacks, we implement the proposed model to detect a new type of cyber-attack on power data integrity, the false data injection (FDI) attacks [33]. FDI attacks may tamper with the measurement information acquired by power data collection terminals.