Robustness Analysis of AI Models in Critical Energy Systems
Abstract
This paper analyzes the robustness of state-of-the-art AI-based models for power grid operations under the security criterion. While these models perform well in regular grid settings, our results highlight a significant loss in accuracy following the disconnection of a line.Using graph theory-based analysis, we demonstrate the impact of node connectivity on this loss. Our findings emphasize the need for practical scenario considerations in develo** AI methodologies for critical infrastructure.
1 Introduction
The application of AI models has seen substantial growth across various industrial sectors, including manufacturing, transportation, and electricity. These models aim to replace costly traditional methods and improve computational efficiency. However, their deployment remains challenging due to unmet or unverified industrial criteria (Leyli Abadi et al., 2022). The deployment of unreliable AI models in critical infrastructure poses significant risks, potentially leading to severe or catastrophic failures with dire economic and societal consequences. In this paper, we study the robustness of state-of-the-art AI-based models in the context of power grids. Operating power grids requires a continuous assessment of their state, which can be costly especially the computation of power flow through grid lines. For Alternative Current (AC) grids, this problem is referred to as AC power flow and is traditionally addressed using the Newton-Raphson method, a classical numerical approach (Sereeter et al., 2019). This method yields results with negligible error but is rather slow and lacks flexibility with regard to grid evolution.
The AC power flow problem can be characterized by a system of nonlinear equations depending on the network configuration at each time point. The network configuration encompasses the loads, generations, and topology of the network, as well as, some intrinsic characteristics of the lines (i.e. reactance, resistance). Highly trained engineers (i.e. dispatchers) can simulate the state of the power grid using these methodologies to ensure operational security, maintaining current flow within specified thresholds.
Yet, as grid size increases, the computational complexity of this problem escalates. Adding to this, modern grids incorporate a growing amount of renewable energy sources, such as wind and solar, whose profiles are highly variable and dependent on factors like weather, leading to significant uncertainties and further complicating the problem (Aslam et al., 2021; Marot et al., 2020; Donnot et al., 2017).
![Refer to caption](x1.png)
Therefore, researchers have naturally started to investigate AI-based approaches to address the complexity of power flow prediction problems. This effort has been further motivated by the rise of Physics-Informed Machine Learning (Karniadakis et al., 2021), which enables a finer integration of physical laws involved in power flow within the models (Hu et al., 2020; Pagnier & Chertkov, 2021). Nevertheless, these studies lack focus on practical scenarios, resulting in inadequate frameworks for deploying these methods. Consequently, AI methods cannot yet be deemed industry-ready, as they have been minimally tested in industrial settings and are not suitable for real-time applications.
In the context of power grids, one critical assessment is the security criterion. This criterion is a fundamental reliability standard used in the operation of power grids. It ensures that the grid can withstand the failure of any single transmission line, without causing widespread outages or instability. Under this criterion, the power grid is expected to continue operating even after the loss of one of its lines (Figure 1). This necessitates sufficient redundancy and flexibility within the system to handle such contingencies. is crucial for maintaining the stability and reliability of power grids, as it helps prevent cascading failures and large-scale blackouts. Evaluating AI-based methods against it is thus essential to ensure their applicability and robustness in real-world scenarios.
In real-time operating grids, the number of possible topological configurations increases significantly, making it computationally intensive to evaluate every potential state of the grid. While the Newton-Raphson method achieves negligible error in the scenario (), it becomes computationally inefficient as grid size increases, due to significantly longer computation times. Conversely, machine learning models provide rapid and reliable predictions for grids without any topological modification, leveraging only inference time and achieving speeds approximately 145 times faster on large grids (Lin et al., 2023). However, in the area of grid digitization, these models must also demonstrate robustness to topological modifications within the grid to ensure its security and reliable operation.
In this paper, we first demonstrate the safety limitation of recent AI-based approaches for powerflow computation and then conduct an error analysis based on node connectivity.
2 Background
2.1 Problem Description
First, we can think of the grid as a graph. The nodes represent the grid’s buses, which are connected through edges, i.e. the transmission lines. The buses are categorized into three primary types: PV, PQ, and slack bus. The PV buses represent grid generators that produce and inject energy, including renewable energy (RE) generators that introduce significant uncertainties into power grid control. The PQ buses represent the grid’s loads, which are modules that consume energy. The slack bus serves as a reference point for the grid operation, where the voltage angle is known.
The objective of the power flow prediction problem is to determine the current flowing through each transmission line based on inputs from the buses and the grid’s topology. Specifically, for generator buses, the active power () and voltage magnitude () are provided, whereas, for load buses, the active () and reactive () powers are known.
Mathematically, the problem can be expressed through the Kirchhoff’s equations.
|
(1) |
In the above equations, the index denotes the buses of the grid and does not follow the aforementioned notation, where the index denotes the type of the bus. However the variables remain the same, so for example denotes the active power of the -th bus regardless of its type (i.e. generator, load, slack). Moreover and denote two physical line properties, the conductance and susceptance respectively. Based on this system of equations, the current that flows from bus to bus is then calculated through a basic physic’s equation (Ohm’s Law):
(2) |
while the current injected in bus , is calculated based on:
(3) |
In Eqs. 2 and 3, is the element in the position of the admittance matrix . This matrix consists of the admittance values (i.e. physical characteristics of the transmission lines) between different nodes in the power grid.
Newton-Raphson method
Traditionally, AC power flow problem solvers use the Newton-Raphson method, linearizing power flow equations around an initial guess, . The equations are represented as:
(4) |
where and are the specified active and reactive powers for each bus , and and are the calculated powers based on the state vector (voltage magnitudes and angles). The iterative update is given by:
(5) |
where is the Jacobian matrix of partial derivatives of with respect to . This process is repeated until reaching the convergence threshold defined by the user.
Unlike traditional numerical approaches, machine learning methods aim to predict current flows based on bus inputs and grid topology. These methods estimate the function that:
(6) |
where denotes the space of the inputs of the buses, denotes the space of the grid’s topology and denotes the the output space.
The dimension of varies across studies and depends on the framework employed. Some research predicts the vector , , , for each bus, while others predict directly the vector . Although using the Eqs. 2 and 3, one can infer the former vector from the latter and vice versa.
2.2 Related Work
In recent years, the demand for faster and more robust power grid simulators has increased due to the growing complexity of grid control problems and traditional simulation approaches (Sereeter et al., 2019; Kulworawanichpong, 2010; D’orto et al., 2021; Coffrin & Van Hentenryck, 2014; Capitanescu, 2016) have started to open the path for AI-based ones to meet rising computational requirements and the integration of renewable energy. One of the primary approaches was introduced by (Donon et al., 2020a) where the authors suggested a graph neural network architecture capable of calculating power flow and generalizing to small and medium-sized grids. The originality exists in the direct incorporation of Kirchhoff’s law into the optimization objective. Similarly, (Lin et al., 2023) introduced a graph-based architecture that also integrates Kirchhoff’s law into the loss function and employs a message-passing mechanism for feature propagation during training. Other relevant approaches include the work of (Bolz et al., 2019; Ghamizi et al., 2024), who suggested a graph-based convolutional neural network. (Donnot et al., 2018) also proposed a novel dropout mechanism (Srivastava et al., 2014) within a simple feed-forward neural network to train the model using instances. Building on this approach, (Donon et al., 2020b) proposed an architecture inspired by the aforementioned dropout technique. Their model incorporates an additional block designed to handle topological changes, and the training process includes both instances with the original topology ( case) and cases, enhancing the model’s adaptability and robustness.
3 Experimental Setup
Our aim is to evaluate the recently suggested AI-based approaches for power flow prediction on the security criterion, thus assessing their industrial readiness. In particular, we perform evaluations over two datasets of cases and explore whether: (a) the degree of connectivity of a node for which a line has been disconnected impacts the robustness of the approach to , (b) prior exposure of the model to certain instances enhances its robustness.
3.1 Datasets
To perform our experiments, we rely on two standard datasets across the Power Engineering community, namely IEEE 14 and IEEE 118. These datasets contain one instance of the grid, with the nominal values for each bus. They consist of 14 and 118 busses respectively.
To approach the problem from a machine learning perspective, it is required to augment these datasets to generate new iid data instances. For this purpose, we employed two distinct strategies: (a) Constrained Sampling and (b) Random Agent Cutting.
Regarding (a), we sampled new data instances for PQ buses based on a normal distribution around their nominal values while for the generators based on Dirichlet simplex sampling. Mathematically we express the process as:
, ,
and ,
where denotes the total amount of generation.
We use Dirichlet sampling for the generators, since the total amount of generation should be constant among all the data instances, and is predefined in the grid’s configuration. Then, we utilize Newton-Raphson method to calculate the outputs of the power flow problem (ground truth). The output is a vector for each bus of the generated power grid instance.
For the second strategy (b), a grid agent was initialized and tasked with randomly cutting one line of the grid, based on a probability . The new state of the grid was computed using the Newton-Raphson method (same as before), and the resulting data instance was recorded.
3.2 Models
We chose 3 state-of-the-art models namely: PowerFlowNet (Lin et al., 2023), LeapNet (Donon et al., 2020b) and ResNet (Donon et al., 2020b). The models relies on the same inputs which are the known values of each bus, but differ in their outputs differ. Hence, PowerFlowNet outputs the vector for each bus , while LeapNet and Resnet outputs the vector . Both vectors can be converted into the other using Eqs. 2 and 3.
3.3 Evaluation Protocol
Firstly, we utilized the pretrained PowerFlowNet models in the aforementioned datasets and we evaluated them in the cases. We note that these models were originally trained exclusively on cases, meaning they had no exposure to topological changes in the grid during training. We also trained a modified version of ResNet111This is not the classical version of ResNet as defined in (He et al., 2016). Instead, we adopt the implementation detailed in (Donon et al., 2020b), where the authors refer to their model as ResNet, inspired by the incorporation of residual connections., with the final linear layer replaced with one that projects the data into to match the dimensions of the output I. We then applied the criterion to assess the robustness of these models in real and critical scenarios. Moreover, training with instances of was performed in order to enhance the robustness of the models. For this, we also used LeapNet which integrates a module into its architecture that tracks the topological changes of the grid.
3.4 Metric
To evaluate the performance of the models, we used the traditional Mean Squared Error (MSE) metric. For the ResNet and LeapNet models, performance was assessed by averaging the MSE of the outputs and , representing the current at both the origin and end of the line. Regarding PowerFlowNet as the model outputs a different vector, we use the equations to convert the output into and to obtain comparable result.
3.5 Implementation Details
We explore 3 configurations of the PowerFlowNet, defined as (large), (medium), and (small). These reflect the number of hidden topology-adaptive convolutions utilized, as specified in the original paper.
In a similar manner, we implemented , , , and which vary in the number of hidden layers used, according to the values of (Donon et al., 2020b).
For the dataset generation we used Grid2op (Donnot, 2020) and Pandapower (Thurner et al., 2018), which are two popular Python frameworks for AI-based Power Engineering. The models were trained for 25 epochs using the Adam optimizer (Kingma & Ba, 2014). The learning rate was fixed at , with a linear scheduler of a step size equal to 5 and a batch size equal to 128. The training dataset comprised 10,000 different grid instances, while both the evaluation dataset for the case and the evaluation dataset for the case consisted of 2,000 instances each.
4 Results
In this section, we present the experimental results. Initially, we demonstrate that pretrained models lack robustness in the scenario and we conduct a short analysis of this issue using graph theory. Finally, as a partial solution to this problem, we report on the outcomes of an empirical study by mixing cases into the training set.
4.1 case
While the results on the cases are promising for each approach on the two datasets, and could even be deemed reliable enough given the speedup compared to Newton Raphson, their performance deteriorates in the modified topology scenario. We observe a significant increase in the error when evaluating the models under the scenario (Table 1). In particular, the best MSE reported for the case is , resp. , whereas for the case it is , resp. in the IEEE 14 dataset, resp. in the IEEE 118 dataset. The increase ranges between 10-100x in most cases and highlights the extent to which the models are impacted by simple grid’s topology modification, especially in the case of larger grids such as IEEE 118, which remains small in comparison to actual grids.
This indicates that the current models lack robustness when subjected to the critical assessments required for real-time operating grids.
Models | Datasets | N | N-1 |
IEEE 14 | 0.051 | 1.467 | |
IEEE 118 | |||
IEEE 14 | |||
IEEE 118 | 4.184 | ||
IEEE 14 | |||
IEEE 118 | |||
IEEE 14 | |||
IEEE 118 | |||
IEEE 14 | |||
IEEE 118 | 0.113 |
4.2 Graph Analysis
Dataset | MSE | MSE | ||
---|---|---|---|---|
IEEE 14 | 5 | 1.297 | 3 | 1.325 |
4 | 1.632 | 2 | 1.244 | |
IEEE 118 | 12 | 7.526 | 8 | 4.864 |
11 | 8.491 | 7 | 6.503 |
To further investigate the issue, we conducted an additional analysis to determine if the model’s performance in the scenario is influenced by the specific line removed from the grid topology.
We, therefore, focused on nodes with higher connectivity to assess their impact on model predictions (Figure LABEL:fig:3). Specifically, we identified the node with the highest degree in the original topology ( case). Since the grid agent removes lines randomly, the degree of varies across instances. We clustered test set instances based on the degree of the node and evaluated the model on these subsets. Additionally, we included the node with the median degree for a more comprehensive analysis.
For this experiment, we utilized , which demonstrated the lowest MSE error in both the and power flow scenarios for the IEEE 14 dataset.
In Table 2, for each dataset, the first row represents the original values of and , while the second row shows the degrees of these nodes when a connected line is removed. We observe that when a line connected to nodes with higher degrees is removed, it has a greater impact on the prediction process, as it produces a bigger error in the model. The intuition behind this finding is that nodes with higher degrees exhibit greater connectivity within the graph, thereby exerting a more significant impact on the grid’s physical behavior.
Models | p | MSE |
---|---|---|
0.141 | ||
0.067 | ||
4.3 Mix Training
The ResNet, LeapNet, and PowerFlowNet models were trained using instances of both and cases from the IEEE 14 dataset to evaluate their performance on unseen cases. The probability of generating an instance was set to either or for each dataset. As shown in Table 3, the robustness of each model notably improves, particularly when . This finding is particularly significant for larger grids, where the number of configurations increases exponentially. It demonstrates that grid robustness is enhanced even with a relatively small number of instances during the training process.
5 Conclusion
In this paper, we analyzed the robustness of AI-based models for power grid operations under the security criterion. Our study identified significant deficiencies in model robustness under real-time conditions and emphasized the need for improvements. A graph theory-based analysis highlighted the critical impact of node connectivity on model predictions. We deployed a mixed training technique with both and instances, which significantly enhanced model adaptability and reliability. Future research could focus on develo** a sampling method for instances to construct a training dataset, taking into account graph connectivity. This approach is motivated by the observation that the connectivity degree of each node significantly impacts the prediction accuracy of the models. In conclusion, our findings stress the importance of practical scenarios in develo** AI methodologies for critical infrastructure, advocating for future research on more complex topological changes and related topics, such as Voltage Control (Sun et al., 2019).
References
- Aslam et al. (2021) Aslam, S., Herodotou, H., Mohsin, S. M., Javaid, N., Ashraf, N., and Aslam, S. A survey on deep learning methods for power load and renewable energy forecasting in smart microgrids. Renewable and Sustainable Energy Reviews, 144:110992, 2021.
- Bolz et al. (2019) Bolz, V., Rueß, J., and Zell, A. Power flow approximation based on graph convolutional networks. In 2019 18th ieee international conference on machine learning and applications (icmla), pp. 1679–1686. IEEE, 2019.
- Capitanescu (2016) Capitanescu, F. Critical review of recent advances and further developments needed in ac optimal power flow. Electric Power Systems Research, 136:57–68, 2016.
- Coffrin & Van Hentenryck (2014) Coffrin, C. and Van Hentenryck, P. A linear-programming approximation of ac power flows. INFORMS Journal on Computing, 26(4):718–734, 2014.
- Donnot (2020) Donnot, B. Grid2op- A testbed platform to model sequential decision making in power systems. . https://GitHub.com/rte-france/grid2op, 2020.
- Donnot et al. (2017) Donnot, B., Guyon, I., Schoenauer, M., Panciatici, P., and Marot, A. Introducing machine learning for power system operation support. arXiv preprint arXiv:1709.09527, 2017.
- Donnot et al. (2018) Donnot, B., Guyon, I., Schoenauer, M., Marot, A., and Panciatici, P. Fast power system security analysis with guided dropout. arXiv preprint arXiv:1801.09870, 2018.
- Donon et al. (2020a) Donon, B., Clément, R., Donnot, B., Marot, A., Guyon, I., and Schoenauer, M. Neural networks for power flow: Graph neural solver. Electric Power Systems Research, 189:106547, 2020a.
- Donon et al. (2020b) Donon, B., Donnot, B., Guyon, I., Liu, Z., Marot, A., Panciatici, P., and Schoenauer, M. Leap nets for system identification and application to power systems. Neurocomputing, 416:316–327, 2020b.
- D’orto et al. (2021) D’orto, M., Sjöblom, S., Chien, L. S., Axner, L., and Gong, J. Comparing different approaches for solving large scale power-flow problems with the newton-raphson method. IEEE Access, 9:56604–56615, 2021.
- Ghamizi et al. (2024) Ghamizi, S., Cao, J., Ma, A., and Rodriguez, P. Powerflowmultinet: Multigraph neural networks for unbalanced three-phase distribution systems. arXiv preprint arXiv:2403.00892, 2024.
- He et al. (2016) He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
- Hu et al. (2020) Hu, X., Hu, H., Verma, S., and Zhang, Z.-L. Physics-guided deep neural networks for power flow analysis. IEEE Transactions on Power Systems, 36(3):2082–2092, 2020.
- Karniadakis et al. (2021) Karniadakis, G. E., Kevrekidis, I. G., Lu, L., Perdikaris, P., Wang, S., and Yang, L. Physics-informed machine learning. Nature Reviews Physics, 3(6):422–440, 2021.
- Kingma & Ba (2014) Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
- Kulworawanichpong (2010) Kulworawanichpong, T. Simplified newton–raphson power-flow solution method. International journal of electrical power & energy systems, 32(6):551–558, 2010.
- Leyli Abadi et al. (2022) Leyli Abadi, M., Marot, A., Picault, J., Danan, D., Yagoubi, M., Donnot, B., Attoui, S., Dimitrov, P., Farjallah, A., and Etienam, C. Lips-learning industrial physical simulation benchmark suite. Advances in Neural Information Processing Systems, 35:28095–28109, 2022.
- Lin et al. (2023) Lin, N., Orfanoudakis, S., Cardenas, N. O., Giraldo, J. S., and Vergara, P. P. Powerflownet: Leveraging message passing gnns for improved power flow approximation. arXiv preprint arXiv:2311.03415, 2023.
- Marot et al. (2020) Marot, A., Rozier, A., Dussartre, M., Crochepierre, L., and Donnot, B. Towards an ai assistant for power grid operators. arXiv preprint arXiv:2012.02026, 2020.
- Pagnier & Chertkov (2021) Pagnier, L. and Chertkov, M. Physics-informed graphical neural network for parameter & state estimations in power systems. arXiv preprint arXiv:2102.06349, 2021.
- Sereeter et al. (2019) Sereeter, B., Vuik, C., and Witteveen, C. On a comparison of newton–raphson solvers for power flow problems. Journal of Computational and Applied Mathematics, 360:157–169, 2019.
- Srivastava et al. (2014) Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
- Sun et al. (2019) Sun, H., Guo, Q., Qi, J., Ajjarapu, V., Bravo, R., Chow, J., Li, Z., Moghe, R., Nasr-Azadani, E., Tamrakar, U., et al. Review of challenges and research opportunities for voltage control in smart grids. IEEE Transactions on Power Systems, 34(4):2790–2801, 2019.
- Thurner et al. (2018) Thurner, L., Scheidler, A., Schäfer, F., Menke, J.-H., Dollichon, J., Meier, F., Meinecke, S., and Braun, M. pandapower—an open-source python tool for convenient modeling, analysis, and optimization of electric power systems. IEEE Transactions on Power Systems, 33(6):6510–6521, 2018.