Real-time Power System Topology Recognition through Convolutional Neural Networks

. This paper investigates the status of a transmission line (on/off) using a 140-bus Northeast Power Coordinating Council (NPCC) test system model [1]. The application of the software package ANDES [2] to obtain a database when solving this problem in the transient process of the power system is considered. The Deep Learning Neural Networks (DLNN) [3] were proposed to solve the problem, in particular, a convolutional neural network (CNN), the input variables of which are voltage and current phasors obtained from phasor measurement units (PMU). Calculations to determine the state of lines were performed using a program developed in the Julia language using the Flux package (a machine learning library that includes functions for creating CNN models). The results of the studies are presented.


Introduction
The task of detecting changes in a topology of an electric power system in transient states is one of most popular and complex tasks to be solved in the operational management of the power system.The electrical network topology is determined using information about the position of circuit breakers and disconnecting switches (open/closed), which is transmitted via telemechanics channels to the dispatch control centers.As a result of disturbances, this information can be distorted, leading to errors in determining connections of network components.Also sensors that transmit and receive information may be malfunctioning due to equipment failures or cyber attacks.
Modern PMUs also provide a line state information (on/off) due to the telesignalization function implemented in them, but not placed in all buses of the power system PMUs do not allow to get information about the states of all lines.In this paper, this problem is solved using convolutional neural networks based on data measured by the PMUs.Deep neural networks are becoming one of the most popular machine learning techniques for creating artificial intelligence systems in various fields due to their enhanced performance and scalability.With respect to solving energy problems, DLNN methods are widely used for the detection of false data injection attacks [4][5], load forecasting [6], load modeling [7], fault location [8], detecting defects in damaged equipment due to short circuits [9], etc.
There are various DLNN architectures (multilayer perceptron, neocognitron, autoencoders, convolutional neural networks, limited Boltzmann machine, deep trust networks, etc.).In this paper, a convolutional neural network based classifier, similar to the one developed earlier by the authors for the 14-bus electrical network [10], but focused on the 140-bus network, is used to detect changes in the topology of the 140-bus electrical network in real time.
The remaining parts are organized as follows: Sections 2, 3, and 4 briefly describe the architecture of the convolutional neural network, the ANDES software package used to obtain the database, and the 140-bus power system under study, respectively.Numerical results with the study of the influence of various factors on the accuracy of topology detection are given in Sections 5, 6.Then Section 7 concludes results and discusses future research.

Convolutional Neural Networks
To solve the problem of determining the change of line status in transient states, especially in the case of large volumes of input parameters, of all the above DLNN architectures the most suitable are CNNs.CNN receives input data, transforms them using a number of interrelated layers, and outputs a set of probabilities (estimates).The CNN architecture (Fig. 1) consists of three main groups of layers: 1) an input layer; 2) feature extraction layers; 3) classification layers.The input layer accepts 3D signals.Feature extraction layers have a repeating structure: convolution (filter) → activation (ReLU) → pooling.The convolution layer is a set of feature maps, which have a scanning kernel (filter).Fully connected layers are the layers of the usual multilayer perseptron, which determine the final classification decision.Gradient-based optimization method (error back-propagation algorithm) is used to trained CNN.A more detailed description of CNN is presented by the authors in [10].
The authors used the ANDES software package to obtain a database for the topology detection problem decision of a 140-bus test system.

ANDES Software Package
ANDES is a free open-source software package developed based on the Python programming language for modeling and numerical analysis of power system operation [2].The package has a hybrid symbolicnumeric structure for solving differential algebraic equations (DAEs) describing the energy system model [11].
The ANDES package allows you to develop abstract models in the symbolic layer independently of the test scheme.The computation time for processing equations depends on the number and complexity of model types, not on the number of devices in a particular test scheme.
Thus, ANDES is much easier to use than other DAEs modeling tools for dynamic power system simulation while maintaining high computational efficiency: ANDES can perform a 20-second transient simulation of a 2000-bus system in a few seconds on an ordinary desktop computer.
The ANDES calculations were performed by the authors in Google Colab, a free interactive cloud environment for working in Python.

Investigated NPCC 140-bus System
The 140-bus Northeast Power Coordinating Council (NPCC) system [1] is the equivalent of the Northeast Region of the Eastern Interconnection of the United States and Canada power system.
The scheme under study is shown in Fig. 2. The system includes 48 generators, 233 lines and 92 load buses.In Fig. 2 the generator buses are shown as squares and the load buses as circles.The base bus (78) is shown as a triangle.
As mentioned above, the implementation of the algorithm for detecting the topology of the electrical network uses the data transmitted by the PMU.In the NPCC scheme, the PMU is installed in 57 buses [12].
The database for solving the problem of determining the network topology are phasor measurements of voltage and current in the transient process, but the package ANDES in the calculation file of the necessary values provides only the values of the modulus and phase of the voltage in the buses.The following calculation formulas were used to determine the missing phasor current values in the branches: where н U  -the bus voltage phasor at the beginning of the line, к U  -the bus voltage phasor at the end of the line, r and x -respectively, the active and reactive resistances of the line, y  -complex conductivity of the line, bcapacitive conductivity of the line, н I  -the current phasor at the beginning of the line, к I  -the current phasor at the end of the line.

Numerical Experiments
The data base, calculated with the ANDES package, includes 600 modes obtained by means of the load changes in all load buses in the range 75-125 percent of the base level and adding a random value equal to 0-20 percent of the base load of the bus to the obtained values.For each bus, transient calculations associated with turning off one of the lines and turning it back on after three seconds with an auto-reclosing device have been performed.In the experiment, 100 lines turned off/in is considered (these lines are highlighted by a dotted line in Fig. 2).Half of the 600 calculated modes was used to train the CNN, and the other half was used for testing.Voltage and current measurement values were used with the addition of a random noise: the phase change of voltage by ±0.5 o and the modulus change of current by ±0.5%.The superposition of noise is due to the PMU errors and voltage and current instrument transformers.
Calculations to determine the topology were performed using the program written in the Julia language using the Flux package.

Influence of Various Factors on the Accuracy of Topology Change Detection
Variants of the CNN input parameters.10 variants of input parameters are considered.
The first option consists of changes in measurement values of one (first) time slice after the beginning of the transient mode.In this case, the number of CNN input parameters is 256 (voltage phases in the PMU placement buses and current modules in the branches incident to the PMU placement buses).
Changes in measurement values for one time slice are calculated as the difference between the measurements of the current and the preceding time slice.The time interval between time slices is 0.02 s, which corresponds to the PMU sampling rate.
Since to solve the problem, an CNN is used, the input layer of which, as mentioned above, accepts threedimensional signals, the first version of the input parameters is a three-dimensional 1x256x1 matrix.For each variant of input parameters a different CNN architecture is used.
The results of the calculations according to the variants proposed above are shown in Table 1.The accuracy of the calculations shows how correctly the CNN has determined the state of the lines in all the tested samples.The lowest accuracy corresponds to the first variant of the input data (91.48%).Starting from the sixth variant accuracy in detecting changes in the network topology in question in the event of switchingoff / in one of the lines is over 95%.Thus, the accumulation of the PMU data from the time of the emergency improves the topology detection accuracy of the electric network.
Rough error in PMU measurements.The effect of coarse measurement error associated with a change in the sign of the current modulus was investigated for 6 -10 variants of the input data.The essence of the study was that in one of the time slices (after 0.02 s and 0.14 s after the start of the transient) the sign of the current modulus for one of the two lines (25th or 28th) changed, and the indicated change remained constant until the end of the time interval in question.
The interval of current modulus values in all 600 modes for Line 25 is [0.0295;4.8855](mean value 1.072 p.u.); for Line 28 is [0.7323;5.8693](mean value 2.7079 p.u.).Training was performed with data without coarse error.The test results are shown in Table 2.
Based on the results obtained, a conclusion was made about a sharp decrease in the accuracy of detecting topology changes in the case of switching-off one of the lines (in Table 2, these values are highlighted in bold).For line 25 with a smaller value of the current modulus, the accuracy in this case is higher than for line 28.When the line was turned on, the classifiers correctly identified the topology state in most cases.
Due to the low accuracy of topology detection, a classifier using the 10th variant of input parameters was tested.The training sample included 20% of the data with a coarse error.The results of the calculations are shown in Table 3, which shows that the accuracy for the data without coarse error decreased slightly, but the accuracy for the data with coarse error increased.

Conclusion
In this work, studies were performed to detect the power transmission line state (switching-off/in) using the test model of the 140-bus NPCC system (USA, Canada).The application of the ANDES software package to obtain a database when solving this problem in the transient mode of the power system is considered.
The developed classifier based on convolutional neural network processes a large volume of input data in real time.Phasor measurements of phases and effective values of voltages and currents (modules) come from 57 PMU installed in the power system.The accuracy of the line status detection is more than 95% when the phases of voltages and the effective values of currents of 6-10 time slices are used as input parameters.Studies on the effect of coarse error (reversal of the sign of the current modulus) on the accuracy of topology detection have shown that to increase the accuracy it is necessary to include data with a coarse error in the training sample.In the future, we will test this work on real-data (as opposed to synthetically generated data).

Table 1 .
Average accuracy of topology change detection for different data options when disconnecting/connecting one line.

Table 2 .
Calculation results for data with gross errors.

Table 3 .
Accuracy of calculations for 10 variants of input parameters when including data with gross error in the training sample.