A Deep Neural Network Approach for Online Topology Identification in State Estimation 深度神经网络方法在状态估计中的在线拓扑识别
Davide Gotti , Student Member, IEEE, Hortensia Amaris , Senior Member, IEEE, and Pablo Ledesma Larrea 戴维德·戈托 ，学生会员，IEEE，霍滕西亚·阿马里斯 ，高级会员，IEEE，以及巴勃罗·莱德斯马·拉雷亚
Abstract 摘要
This paper introduces a network topology identification (TI) method based on deep neural networks (DNNs) for online applications. The proposed TI DNN utilizes the set of measurements used for state estimation to predict the actual network topology and offers low computational times along with high accuracy under a wide variety of testing scenarios. The training process of the TI DNN is duly discussed, and several deep learning heuristics that may be useful for similar implementations are provided. Simulations on the IEEE 14-bus and IEEE 39-bus test systems are reported to demonstrate the effectiveness and the small computational cost of the proposed methodology. 本文介绍了一种基于深度神经网络（DNNs）的网络拓扑识别（TI）方法，适用于在线应用。所提出的 TI DNN 利用用于状态估计的测量集来预测实际网络拓扑，并在多种测试场景下提供低计算时间与高准确性。文中详细讨论了 TI DNN 的训练过程，并提供了若干可能对类似实现有用的深度学习启发式方法。通过在 IEEE 14 母线和 IEEE 39 母线测试系统上的仿真，展示了该方法的有效性和较小的计算成本。
Index Terms-Topology identification, deep neural network, state estimation, bad data detection and identification. 关键词-拓扑识别，深度神经网络，状态估计，坏数据检测与识别。
I. InTRODUCTION I. 引言
OWER system dynamics are becoming increasingly complex due to the integration of nonsynchronous generation, energy storage devices and demand response technologies. As a result, new techniques of dynamic state estimation (DSE) are being developed to monitor the dynamics of electrical variables and improve the control and protection of power systems [1] and . 由于非同步发电、储能设备及需求响应技术的融合，OWER 系统动力学正变得日益复杂。因此，新兴的动态状态估计（DSE）技术被开发出来，以监测电气变量的动态变化，并提升电力系统的控制与保护性能[1]。
Deployment of phasor measurement units have enabled the development of fast DSE methods that require equally fast complementary tools such as topology identification (TI) algorithms. Significant efforts to properly identify topology changes in power systems have been made over the last several decades. Power system state estimation relies on the perfect a priori knowledge of the network topology provided by the network topology processor (NTP), which analyzes the status of the switching devices and provides the corresponding bus/branch model to the state estimator. However, in many cases, the NTP can be affected by the errors related to the status of the switching devices, which can result in the use of a wrong admittance matrix by the state estimator. Topology errors tend to have a stronger influence than network parameter errors and can cause the state estimation process to be strongly biased. 相量测量单元的部署促进了快速动态状态估计方法的发展，这些方法需要同样快速的辅助工具，如拓扑识别算法。过去几十年来，人们为准确识别电力系统中的拓扑变化做出了巨大努力。电力系统状态估计依赖于网络拓扑处理器提供的完美先验网络拓扑知识，该处理器分析开关设备的状态，并向状态估计器提供相应的母线/支路模型。然而，在许多情况下，网络拓扑处理器可能受到与开关设备状态相关的误差影响，这可能导致状态估计器使用错误的导纳矩阵。拓扑错误往往比网络参数错误影响更大，并可能导致状态估计过程出现严重偏差。
The residual analysis method reported in [3] assumes that the first state estimation iteration converges successfully so that the residual vector can be computed and used to identify the branch outage. This assumption is not always true because the state estimation convergence is not guaranteed due to the dramatic impact that the topology errors tend to have on the measurement residuals. [3]中所述的残差分析方法假设首次状态估计迭代能成功收敛，从而计算出残差向量并用于识别支路断开。然而，这一假设并不总是成立，因为拓扑错误往往对测量残差产生剧烈影响，导致状态估计的收敛无法保证。
The state vector augmentation method, which is also described in [3], includes the branch status in the state vector and requires several state estimation iterations to adjust the state vector, to add the model constraints and, eventually, to augment the state vector. The iterations required to detect the changes in the topology can be a limiting factor for DSE applications because the computational times of the algorithm increase. 状态向量增强方法，如文献[3]所述，将支路状态纳入状态向量中，并需要多次状态估计迭代以调整状态向量，添加模型约束，最终实现状态向量的增强。用于检测拓扑变化的迭代次数可能成为 DSE 应用的限制因素，因为算法的计算时间会增加。
In [4], a fuzzy c-means clustering method is proposed for TI and bad data processing. Using this method, the fuzzy pattern vector expands with the size of the network, and the number of possible topologies to be considered increases, causing a loss of resolution that affects the accuracy of the TI and the state estimation. 在[4]中，提出了一种用于拓扑识别和不良数据处理的模糊 c 均值聚类方法。采用此方法，模糊模式向量随网络规模扩大而扩展，需考虑的可能拓扑数量增加，导致分辨率下降，进而影响拓扑识别和状态估计的准确性。
An event-triggered topology identification is proposed in [5], where a recursive Bayesian approach is used when a network topology change is suspected. This approach is precise and reliable if the topology configurations to be estimated are limited, and it is sensitive to high measurement noise levels. However, the reported computational times are too long for DSE applications. 文献[5]提出了一种事件触发的拓扑识别方法，当怀疑网络拓扑发生变化时，采用递归贝叶斯方法进行处理。该方法在待估计的拓扑配置有限时精确且可靠，并对高测量噪声水平敏感。然而，所报告的计算时间对于动态状态估计应用而言过长。
A generalized state estimation algorithm for topology estimation that includes the switching devices status in the state vector is reported in [6]. This approach requires the incorporation of three additional state variables for each switching device, which will significantly increase the computational burden of the algorithm for large electric networks. 文献[6]中报道了一种广义状态估计算法，用于拓扑估计，其中包括开关设备状态在状态向量中。该方法要求为每个开关设备引入三个额外的状态变量，这将显著增加大型电力网络算法的计算负担。
The authors of [7] present a method for topology identification in the generalized state estimation framework. In the first stage, a bad data analysis is used to identify the region of the electric network affected by the error. Second, a network reduction is conducted to restrict the analysis to the suspected area. Finally, the Lagrange multiplier of the state estimation constraints are used to select the type of the anomaly. The reported results indicate that the methodology is accurate, but the CPU times are well above one second, making it unsuitable for DSE applications. [7]的作者提出了一种在广义状态估计框架下的拓扑识别方法。首先，利用坏数据分析来识别受误差影响的电网区域。其次，进行网络简化，将分析限制在可疑区域内。最后，利用状态估计约束的拉格朗日乘数来选择异常类型。报告结果显示该方法准确，但 CPU 时间远超一秒，使其不适用于动态状态估计应用。
In [8], a measurement-based approach to directly estimate the electric network bus admittance matrix is proposed. This methodology requires the monitoring of each bus voltage phasor through a phasor measurement unit (PMU) or a modern relay 在[8]中，提出了一种基于测量的方法，用于直接估计电力网络的节点导纳矩阵。该方法要求通过相量测量单元（PMU）或现代继电器对每个节点的电压相量进行监测。
capable of providing the voltage phasor measurement. This condition is currently not fulfilled in many power systems. 能够提供电压相量测量。这一条件目前在许多电力系统中尚未得到满足。
For the usage of neural networks in TI applications, pioneering work has been conducted in [9] and [10]. In [9] a counter propagation network (CPN) for topology processing is proposed. The results show a certain feasibility for online applications, as reported outcomes exhibit computational times lower than 100 ms . However, the CPN needs accurate information of the switching devices status along with power flow and injection measurements. In this paper, the proposed TI algorithm relies only on the measurement set used for the state estimation and does not need the information of the circuit breakers status, making the algorithm more reliable in case of wrong information from the NTP. 在用于输电系统应用的神经网络使用方面，[9]和[10]中已开展了开创性工作。[9]中提出了一种用于拓扑处理的反向传播网络（CPN）。结果显示，在线应用具有一定可行性，据报道计算时间低于 100 毫秒。然而，CPN 需要开关设备状态的准确信息以及潮流和注入测量数据。本文提出的输电算法仅依赖于用于状态估计的测量集，无需断路器状态信息，从而在网络时间协议（NTP）信息错误的情况下，算法更为可靠。
In [10], an artificial neural network (ANN) approach is used for TI. The algorithm can distinguish between topological and gross measurement errors by means of normalized innovations, which are obtained adding a previous state forecasting step to the state estimation algorithm. This methodology implies the implementation of four ANNs for each electrical network branch, which in the case of large-scale systems entails the implementation of a massive number of ANNs, leading to a cumbersome training process. With the approach proposed in this work, the topology determination relies only on one deep neural network (DNN) and does not need any pre-estimation step that implies an increase in the computational cost. 在[10]中，采用了一种人工神经网络（ANN）方法进行拓扑辨识。该算法通过归一化创新来区分拓扑和总体测量误差，这些归一化创新是通过在状态估计算法中加入前一状态预测步骤获得的。这种方法意味着为每个电网分支实现四个 ANN，对于大规模系统而言，这需要实现大量的 ANN，导致训练过程繁琐。而本文提出的方法仅依赖于一个深度神经网络（DNN）进行拓扑确定，无需任何预估步骤，从而避免了计算成本的增加。
As previously mentioned, the TI must be reliable and fast to enable the DSE to operate in a short time frame. In this regard, the abovementioned algorithms are not suitable for DSE applications due to their high CPU times. The methodology proposed in this work aims to bridge this gap. 如前所述，时间间隔(TI)必须可靠且快速，以便数据同步引擎(DSE)能在短时间内运行。就此而言，上述算法因 CPU 时间过长而不适用于 DSE 应用。本研究提出的方法旨在填补这一空白。
The contribution of this work is a TI algorithm that overcomes the limitations previously mentioned. Deployment of DNNs and modern deep learning techniques, that are duly discussed in the next sections, accurately extract the relations between the set of measurements and the topology information without the necessity to receive the switching device status from the NTP or to implement several ANNs for each branch of the electrical network. 本研究的主要贡献在于提出了一种克服上述限制的拓扑辨识算法。通过部署深度神经网络及现代深度学习技术，这些技术将在后续章节中详细讨论，能够准确提取测量数据集与拓扑信息之间的关系，无需从网络时间协议获取交换设备状态，也无需为电网的每个分支分别实现多个人工神经网络。
The methodology proposed in this work introduces a significant reduction of the computational time required to perform the topology identification. The proposed algorithm is suitable for DSE applications and provides a fast identification of the network topology using the measurements collected for state estimation. The proposed TI algorithm is based on a deep neural network and relies on a set of measurements free of gross errors. To demonstrate the TI algorithm, a bad data detection and identification algorithm, and a state estimator are coupled with the proposed method. For this purpose, a modified version of the algorithm introduced in [11] is used as a bad data detection and identification algorithm even though others methods can be used, e.g., [12] and [13]. Once the measurement set has been checked and possibly modified, the topology configuration is estimated, and subsequently, a network state estimation is performed using an unscented Kalman filter (UKF). However, it is important to note that other state estimation algorithms are compatible with the proposed TI DNN. 本文提出的方法显著减少了执行拓扑识别所需的计算时间。该算法适用于动态系统估计（DSE）应用，并利用为状态估计收集的测量数据快速识别网络拓扑。提出的拓扑识别（TI）算法基于深度神经网络，并依赖于一组无重大误差的测量数据。为展示 TI 算法，将其与坏数据检测与识别算法以及状态估计器相结合。为此，采用了[11]中算法的改进版本作为坏数据检测与识别算法，尽管也可以使用其他方法，例如[12]和[13]。一旦测量集经过检查并可能修正后，便估计拓扑配置，随后使用无迹卡尔曼滤波器（UKF）进行网络状态估计。但需注意，其他状态估计算法也与提出的 TI 深度神经网络兼容。
The main advantages of the proposed method are: 所提方法的主要优势在于：
It uses only the measurements required for the state estimation and it requires a single DNN. 它仅使用状态估计所需的数据，并仅需一个深度神经网络。
It is suitable for DSE applications as it significantly reduces the computational time required to perform the topology identification in comparison with current methods. 它适用于 DSE 应用，因其显著减少了与当前方法相比进行拓扑识别所需的计算时间。
The rest of the paper is organized as follows. Section II presents a brief explanation of both the DNNs and the UKF state estimator used in this work. In Section III the proposed methodology is described. Section IV provides the case study description, with a particular focus on the DNN training and testing process. Section V shows how the proposed TI DNN integrates with the state estimator and relative results on the IEEE 14-bus and the 39-bus test networks are reported. Finally, Section VI concludes the paper. 本文其余部分的组织结构如下。第二部分简要介绍了本工作中使用的 DNN 和 UKF 状态估计器。第三部分描述了所提出的方法论。第四部分提供了案例研究描述，特别关注 DNN 的训练和测试过程。第五部分展示了所提出的 TI DNN 如何与状态估计器集成，并报告了在 IEEE 14 母线和 39 母线测试网络上的相关结果。最后，第六部分总结了本文。
II. DESCRIPTION OF THE ALGORITHMS 二、算法描述
A. Deep Neural Network A. 深度神经网络
DNNs are defined as ANNs with multiple hidden layers between the input and output layers. The presence of multiple hidden layers allows the network to learn complex tasks by extracting significant features that enable input-output value mapping. 深度神经网络（DNNs）被定义为在输入层和输出层之间具有多个隐藏层的人工神经网络。多个隐藏层的存在使得网络能够通过提取关键特征来学习复杂任务，从而实现输入-输出值的映射。
During the training of a feed-forward neural network, the input signal is propagated forward, and then, the obtained output is compared with the desired output values, and an error signal is computed. This error is then backpropagated using the so-called backpropagation algorithm, which allows the network to adjust its parameters to minimize the cost function determined by the error signal. During the training phase, the process is repeated until a desired accuracy on the training set is achieved. As described in [14], the training can be executed in sequential mode (one training example at a time is introduced) or in batch mode (all the training examples are introduced simultaneously). 在训练前馈神经网络期间，输入信号被正向传播，随后，获得的输出与期望输出值进行比较，并计算误差信号。此误差随后通过所谓的反向传播算法进行反向传播，该算法使网络能够调整其参数以最小化由误差信号决定的成本函数。在训练阶段，此过程重复进行，直至在训练集上达到期望的精度。如[14]所述，训练可以执行顺序模式（一次引入一个训练样本）或批处理模式（同时引入所有训练样本）。
Feed-forward propagation: During the forward computation, the input patterns propagate forward through the network and appear at the output end as an output signal. The input signal propagates from one neuron to the next layer of neurons passing through the synaptic weights. The signal is processed as follows: 前馈传播：在正向计算过程中，输入模式通过网络向前传播，并在输出端表现为输出信号。输入信号从一个神经元传递到下一层神经元，途经突触权重。信号处理过程如下：
where is a vector representing the previous layer outputs, represents the synaptic weights matrix of dimensions (with and corresponding to the number of neurons in the and layer, respectively), represents the vector of the neuron bias values and represents the layer input vector. 其中， 是一个向量，表示前一层的输出， 代表具有 维度的突触权重矩阵（其中 和 分别对应于 层和 层中的神经元数量）， 表示神经元偏置值的向量，而 则代表 层的输入向量。
Subsequently, each neuron performs the computation of the activation function, usually expressed as a nonlinear function of the input signal: 随后，每个神经元执行激活函数的计算，该函数通常表示为输入信号的非线性函数：
where is the neuron activation function and is the layer output vector. 其中 表示神经元激活函数， 为 层的输出向量。
The choice of the activation function can radically modify how changes in the weights and bias during the training phase affect the variations in the output values. Once the input vector is propagated through the network, an error signal is computed: 激活函数的选择可以根本性地改变训练阶段权重和偏置的变化如何影响输出值的波动。一旦输入向量通过网络传播，就会计算出一个误差信号：
where represents the error vector of the output neuron, and is a generic function that relates the output error with the obtained output vector and the desired output vector known from the training set. 其中， 表示 输出神经元的误差向量，而 是一个通用函数，它将输出误差与获得的输出向量 以及从训练集中已知的期望输出向量 关联起来。
A variety of activation functions and error signals formulations and their characteristics are thoroughly described in [15]. [15]中详尽描述了多种激活函数、误差信号的构造及其特性。
Backpropagation: The backpropagation algorithm applies a correction to the synaptic weights and neuron bias that is proportional to the partial derivative of the error signal with respect to the synaptic weights and bias. These partial derivatives represent a sensitivity factor, which allows the determination of the change in the weights and bias hyperspace that minimize the cost function, i.e., the error signal. In the case of the output layer, the partial derivative can be directly computed because there exists a direct relationship between the error signal and the neurons belonging to this layer: 反向传播：反向传播算法根据误差信号对突触权重和神经元偏差的偏导数，按比例对其进行修正。这些偏导数代表了一个敏感因子，它有助于确定在权重和偏差超空间中，哪些变化能最小化成本函数，即误差信号。对于输出层而言，偏导数可以直接计算，因为误差信号与该层的神经元之间存在直接关系：
where represents the output layer index. In the case of the hidden layers neurons, the chain rule is adopted to express this gradient: 其中 表示输出层索引。对于隐藏层神经元，采用链式法则来表达这一梯度：
where represents the error signal propagated through the neural network up to the considered hidden layer. Once the partial derivative for a layer is computed, the weights are updated: 其中， 表示通过神经网络传播至所考虑的 隐藏层的误差信号。一旦计算出某层的偏导数，权重即被更新：
where is the learning rate that permits the adjustment of the trajectory rate of change in the weight and bias space. 其中 是学习率，允许调整权重和偏置空间中轨迹变化率。
The same procedure is executed for bias actualization. 同样的过程也适用于偏差实际化。
Dropout: When the training data are limited, DNNs may experience overfitting problems; i.e., a good performance is achieved during the training process, but poor results are obtained for the test set. This issue is caused by the fact that the derivative received by each unit gives an indication of how the synaptic weights and neurons bias should change to reduce the cost function considering how all other components are acting. Thus, units may vary to fix the errors generated by other units, leading to complex co-adaptation phenomena. Dropout：当训练数据有限时，深度神经网络（DNNs）可能会遭遇过拟合问题；即在训练过程中表现良好，但在测试集上结果不佳。这一问题源于每个单元接收到的导数指示了在考虑所有其他组件作用的情况下，如何调整突触权重和神经元偏置以降低成本函数。因此，单元可能会变化以修正其他单元产生的错误，导致复杂的协同适应现象。
The dropout technique introduced in [16] gives a solution to this problem. This approach consists of stochastically dropping neurons and their synaptic weights at each training iteration. Thus, co-adaptations are prevented since the compensating effect of other units is not certain. In fact, under these random changes, every unit must perform well under a wide variety of structural configurations. Fig. 1 shows the structure of a DNN after applying the dropout technique. [16]中引入的 dropout 技术为此问题提供了解决方案。该方法在每次训练迭代中随机丢弃神经元及其突触权重，从而防止了共适应现象，因为其他单元的补偿效应变得不确定。实际上，在这些随机变化下，每个单元必须在多种结构配置下表现良好。图 1 展示了应用 dropout 技术后的深度神经网络结构。
Fig. 1. A deep neural network with 3 hidden layers applying dropout (crossed units represent dropped neurons). 图 1. 一个具有 3 个隐藏层的深度神经网络，应用了 dropout（交叉单元表示被丢弃的神经元）。
B. Unscented Kalman Filter B. 无迹卡尔曼滤波器
The UKF is a nonlinear version of the well-established Kalman filter, described in [17]. It belongs to the wider class of sigma-point Kalman filters that make use of the statistical linearization technique known as unscented transformation [18]. UKF 是经典卡尔曼滤波器的非线性版本，详见[17]。它属于更广泛的 sigma 点卡尔曼滤波器类别，采用了一种称为无迹变换的统计线性化技术[18]。
The following nonlinear system is considered with a set of states to be estimated and an observation model with additional noises: 考虑以下非线性系统，其状态集待估计，观测模型附加噪声：
where represents the state vector, is the state estimation function, and is the observation function that relates the measurement set with the state vector at instant . Variables and are the process and measurement noises, respectively. Similar to the other classic Kalman filter versions, the UKF algorithm executes two main steps: the estimation step and the update step. 其中， 表示状态向量， 是状态估计函数，而 是观测函数，它将测量集 与时刻 的状态向量 关联起来。变量 和 分别为过程噪声和测量噪声。与其它经典卡尔曼滤波版本类似，UKF 算法执行两个主要步骤：估计步骤和更新步骤。
Estimation step: Once the sigma points and their weights are calculated as indicated in [18], they are propagated through the nonlinear estimation function, and the predicted states are computed as follows: 估计步骤：一旦按照[18]中的指示计算出 sigma 点和它们的权重，这些点将通过非线性估计函数进行传播，并如下计算预测状态：
where and represent the sigma point value and weight, respectively. Then, the estimate covariance matrix is calculated as: 其中， 和 分别表示 的 sigma 点值和权重。随后，估计协方差矩阵计算如下：
Propagating the sigma points through the observation function, the same procedure is applied to compute the observation mean and the covariance matrix . Then, following a similar approach, the cross-covariance matrix is determined. 通过观测函数传播 sigma 点，采用相同步骤计算观测均值 和协方差矩阵 。随后，依照类似方法，确定交叉协方差矩阵 。
Fig. 2. Flowchart of the proposed methodology. 图 2. 所提方法的流程图。
Update step: Once a new measurement set becomes available, the update step is applied: 更新步骤：一旦有新的测量数据集可用，便执行更新步骤：
A full description of UKF development can be found in [19]. This state estimator has been chosen for this work because, as reported in [20], it shows better performance in terms of accuracy than other state estimation algorithms such as the weighted least square or the extended Kalman filter. However, as pointed out previously, other state estimation algorithms are compatible with the proposed TI methodology. UKF 开发的完整描述可在[19]中找到。选择此状态估计器进行研究，是因为据[20]报道，在精度方面，它相较于加权最小二乘法或扩展卡尔曼滤波器等其他状态估计算法表现出更优的性能。然而，如前所述，其他状态估计算法也与所提出的 TI 方法论相兼容。
III. METHOD DESCRIPTION III. 方法描述
The main contribution of this work is to provide a fast and reliable TI algorithm. The methodology is based on DNNs and the TI is performed using the same set of measurements used by the state estimator. Fig. 2 illustrates how the proposed TI DNN method is integrated into a general state estimation problem. 本研究的主要贡献在于提供了一种快速且可靠的拓扑辨识算法。该方法基于深度神经网络，并利用状态估计器所使用的同一组测量数据进行拓扑辨识。图 2 展示了所提出的拓扑辨识深度神经网络方法如何融入一般状态估计问题中。
The proposed TI method uses a feed-forward DNN as described in Section II and is formulated to solve a classification problem. The DNN input is the measurement set, consisting of a number of active power, reactive power, voltage magnitude and voltage angle measurements. Before the inputs are fed to the DNN, they are normalized with the following procedure: 所提出的 TI 方法采用如第二节所述的前馈 DNN，并被设计用于解决分类问题。DNN 的输入为测量集，包含若干有功功率、无功功率、电压幅值及电压角度测量值。在将输入数据馈入 DNN 之前，它们会按照以下步骤进行归一化处理：
where is the measurement to be normalized, and and are the maximum and the minimum values, respectively, in the normalizing range. Thus, the normalized assumes a value between 0 and 1 . The normalization is applied separately for power flow/injection measurements, voltage magnitude measurements and voltage angle measurements. This procedure has proved to be very effective for avoiding the generalization problems and accelerating the training process [15]. The output neurons of the DNN have a binary formulation, in which each possible set of output values is associated with a topology configuration. The topology configurations considered for both test systems of Section IV represent the loss of every single branch, according to the outage criterion. They are reported in [21]. 其中 是需要归一化的 测量值，而 和 分别为归一化范围内的最大值和最小值。因此，归一化后的 取值介于 0 和 1 之间。归一化分别应用于功率潮流/注入测量、电压幅值测量和电压角度测量。该过程已被证明能有效避免泛化问题并加速训练进程[15]。DNN 的输出神经元采用二进制形式，其中每组可能的输出值对应一种拓扑配置。针对第四节所述两个测试系统的拓扑配置，考虑了根据 停运准则的每条单一支路失效情况，相关内容见文献[21]。
The TI DNN contains several layers, whose number and size depends on the specific power system. For both the test systems presented in Section IV, hidden and output layer neurons use the following sigmoid activation function: TI DNN 包含多个层，其数量和大小取决于特定的电力系统。对于第四节中介绍的两个测试系统，隐藏层和输出层神经元采用以下 S 型激活函数：
The error signal used during the training phase is expressed as follows: 训练阶段所使用的误差信号表示如下：
The proposed TI DNN allows an accurate mapping of the relations between the measurements and the topology configuration. Once properly trained, the TI DNN is able to accurately predict the network topology even under network operation scenarios for which the TI DNN has not been previously trained. 所提出的拓扑识别深度神经网络（TI DNN）能够精确映射测量数据与网络拓扑配置之间的关系。一旦经过适当训练，TI DNN 即使在未曾训练过的网络运行场景下，也能准确预测网络拓扑结构。
In order to demonstrate the proposed methodology, the TI DNN is combined with a bad data detection and identification algorithm that ensures that the set of measurements is free of gross errors. Once the TI has been carried out, the corresponding admittance matrix is loaded into the state estimator observation function and the power system states are calculated. 为了展示所提出的方法论，TI 深度神经网络（DNN）与一种不良数据检测与识别算法相结合，确保测量集无重大误差。一旦进行 TI 处理后，相应的导纳矩阵被加载到状态估计器的观测函数中，进而计算电力系统的状态。
IV. CASE StUDY 四、案例研究
The algorithms described in the previous sections are tested on the IEEE 14-bus and IEEE 39-bus test systems. In this section, the structure of the DNN used for the TI, the bad data detection and identification and the calibration of the UKF state estimator for both test networks are reported. Particular attention is directed at the election of the structure of the TI DNN and the creation of the training set, which are extremely important to properly estimate the electric network topology 前文所述算法在 IEEE 14 母线和 IEEE 39 母线测试系统上进行了测试。本节将报告用于拓扑辨识（TI）、不良数据检测与识别以及针对这两个测试网络的 UKF 状态估计器校准的 DNN 结构。特别关注于拓扑辨识 DNN 结构的选取及训练集的构建，这对准确估计电网拓扑至关重要。
The set of 50 and 127 measurements used for the IEEE 14-bus system and the IEEE 39-bus system are listed in [21] and are 用于 IEEE 14 母线系统和 IEEE 39 母线系统的 50 和 127 组测量数据列于[21]中
(b)
Fig. 3. Single-line diagram and measurement set of a) the IEEE 14-bus test system, and b) the IEEE 39-bus test system. 图 3. IEEE 14 节点测试系统的单线图及测量集，以及 IEEE 39 节点测试系统的单线图及测量集。
also shown in Figs. 3 a) and 3 b), respectively. In the case of the IEEE 14-bus system, to prove how the proposed TI DNN performs with different set of measurements, two distinct set of 40 measurements are also used to compare the testing accuracy and relevant considerations are made in this section. All the measurements used for TI, bad data detection and identification, and state estimation are generated using the software PowerFactory. The standard PowerFactory synchronous machine model 2.2 is employed, and voltage- and frequency-dependent loads are considered. A normally distributed random error with zero mean and a standard deviation, corresponding to the measurement accuracy, is added to the measurements. The accuracy values used in this work are described in [22]. 如图 3a)和 3b)所示，针对 IEEE 14 母线系统，为验证所提 TI DNN 在不同测量集上的表现，本节还采用了两组不同的 40 个测量数据进行测试精度比较，并进行了相关考量。所有用于 TI、坏数据检测与识别以及状态估计的测量数据均通过 PowerFactory 软件生成。采用 PowerFactory 标准同步电机模型 2.2，并考虑了电压和频率依赖性负载。向测量数据中添加了均值为零、标准差对应测量精度的正态分布随机误差。本文所用精度值详见[22]。
All the algorithms presented in this work have been coded in MATLAB. The computer used in this work is an Core(TM) i7-3770 CPU@3.40 GHz 3.40 GHz processor, with 6 GB RAM memory. 本文中所有算法均已在 MATLAB 中编码实现。本研究所使用的计算机配置为 Core(TM) i7-3770 CPU @3.40 GHz 3.40 GHz 处理器，配备 6 GB 运行内存。
A. DNN for Topology Identification A. 用于拓扑识别的深度神经网络
Different DNN structures for both test systems have been attempted, and the final DNN structure for the two test systems is reported below. 针对两个测试系统，已尝试了不同的深度神经网络（DNN）结构，以下报告了最终为这两个测试系统选定的 DNN 结构。
IEEE 14-bus System IEEE 14 节点系统
TABLE I 表一
ACCURACY OF DIFFERENT DNN STRUCTURES - IEEE 39-BUS SYSTEM 不同深度神经网络结构的准确性 - IEEE 39 母线系统
DNN
DNN
DNN
DNN
DNN
no 不
no 不
dropout 辍学
dropout 辍学
dropout 辍学
dropout 辍学
dropout 辍学
Training 训练
accuracy 准确性
Testing 测试
accuracy 准确性
The TI DNN in the case of the IEEE 14-bus system is structured with three hidden layers, with 40,20 and 10 neurons, separately. There are 50 input neurons corresponding to the number of measurements used for the state estimation, and there are 5 output neurons because the number of the considered topology configurations is 21 and thus can be expressed as a 5-digit binary number. 在 IEEE 14-bus 系统案例中，TI DNN 结构包含三个隐藏层，分别有 40、20 和 10 个神经元。输入层有 50 个神经元，对应于用于状态估计的测量数量；输出层有 5 个神经元，因为所考虑的拓扑配置数量为 21，可以表示为一个 5 位二进制数。
The learning rate used during the training phase is . No dropout procedure was necessary to correctly identify the topology changes during the testing phase. The training time of this DNN is approximately 12.5 hours, which is consistent with other computational times indicated in [23]. 训练阶段所采用的学习率为 。在测试阶段正确识别拓扑变化时，无需进行 dropout 操作。该深度神经网络（DNN）的训练时间约为 12.5 小时，这与文献[23]中提到的其他计算时间相符。
IEEE 39-bus system IEEE 39 节点系统
In the case of the IEEE 39-bus system, the DNN has also three hidden layers with 90,30 and 10 neurons, separately. There are 127 input neurons and 6 output neurons, as the number of possible topology configurations is 47 . The learning rate adopted in this case is . In the present case, an inverted dropout algorithm is applied since the DNN trained without dropout shows co-adaptation phenomena that compromise the test performance. The keeping probabilities used for the input layer, the first, the second and the third hidden layers are and 1 respectively. Lower keeping probabilities lead to no-convergence problems during the training phase, and the adoption of higher keeping probabilities is not effective against co-adaptation, as shown in Table I. Useful heuristics for effective dropout application can be found in [24]. The training phase of this DNN was carried out for approximately 94 hours. This value is consistent with other training times reported in [23]. 对于 IEEE 39 母线系统，DNN 同样包含三个隐藏层，分别有 90、30 和 10 个神经元。输入神经元数量为 127，输出神经元为 6，因为可能的拓扑配置数量为 47。此情况下采用的学习率为 。在本案例中，应用了反向 dropout 算法，因为未使用 dropout 训练的 DNN 显示出影响测试性能的协同适应现象。输入层、第一、第二及第三隐藏层的保留概率分别为 和 1。较低的保留概率会导致训练阶段不收敛问题，而采用较高的保留概率对防止协同适应效果不佳，如表 I 所示。关于有效应用 dropout 的有用启发式方法可参见[24]。该 DNN 的训练阶段耗时约 94 小时，与[23]中报告的其他训练时间相符。
In both test systems, the sigmoid activation function is used, as shown in (15), and the error signal has the same formulation of (16). Other activation functions such as the rectified linear unit and the hyperbolic tangent have also been tested, but the performance obtained during the testing phase with the sigmoid function was significantly superior, and the training time was shorter. 在两个测试系统中，均采用了如式(15)所示的 S 型激活函数，且误差信号的表达式与式(16)相同。其他激活函数，如修正线性单元和双曲正切函数，也进行了测试，但在测试阶段，使用 S 型函数获得的表现明显更优，且训练时间更短。
Some of the attempts realized to calibrate the TI DNN for the IEEE 39-bus test system are reported in Table I, where the first three numbers represent the number of neurons of the hidden layers and the last numbers represent the keeping probability used during the dropout procedure. Although with all the represented structures, a good estimation on the training set is achieved, the test accuracy is strongly influenced by the DNN structure and the use of the dropout procedure, as can be easily 表 I 中报告了针对 IEEE 39 母线测试系统校准 TI DNN 的一些实现尝试，其中前三个数字代表隐藏层的神经元数量，最后数字表示在 dropout 过程中使用的保持概率。尽管所有列出的结构都能在训练集上实现良好的估计，但测试精度受到 DNN 结构及 dropout 过程使用的显著影响，这一点显而易见。
TABLE II 表二
ACCURACY With DiFfERENT SET of MEASUREMENTS - IEEE 14-BUS SYSTEM 不同测量集下的精度 - IEEE 14 节点系统
50 次测量的集合
Set of 50
measurements
40 项测量集 - 类型 1
Set of 40
measurements -
type 1
40 次测量集 - 类型 2
Set of 40
measurements -
type 2
Training accuracy 训练准确率
Testing accuracy 测试精度
observed from Table I. In fact, it is found that the DNN with the chosen structure offers better accuracy during the testing. In particular, the proposed DNN was able to correctly detect all of the considered topology configurations reported in [21] in almost every topology estimation. DNNs with a lower number of hidden layers have been tested, but their structure proved to be insufficient for mapping the relations between the upcoming measurements and the actual network topology. 从表 I 中可以看出，事实上，发现具有所选结构的 DNN 在测试期间提供了更高的准确性。特别是，所提出的 DNN 能够几乎在每次拓扑估计中正确检测到[21]中报告的所有考虑的拓扑配置。已测试了具有较少隐藏层数的 DNN，但其结构被证明不足以映射即将到来的测量与实际网络拓扑之间的关系。
Extensive simulations on both test systems show that in order to correctly extract the relationship between the measurements values and the actual topology configuration, a wide variation of the input values during the DNN training process is essential. Hence, for the 14-bus system and the 39 -bus system, different generation and load profiles variations were simulated so that during the training process, the bus voltage magnitude fluctuates from approximately 0.75 p.u. to 1.25 p.u. and the current flows from 0 to of the line rated capacity. These variations have proved to be of pivotal importance to effectively extract the input-output mapping. In this manner, the DNN is trained so that its estimations remain reliable even outside the training set. This training process is generated by modeling the previously mentioned generation and loading events for each topology configuration, i.e., for each branch placed out of service. For every topology configuration, approximately 350 training examples are used on both test systems to train the DNN using batch mode [14]. Overall, the DNN for the 14-bus test system employs 7470 training samples, and the DNN for the 39-bus system is trained with 16590 samples. In both test systems, the DNN synaptic weights and bias are initialized using independent normalized Gaussian random variables with zero mean and unit variance. 在两个测试系统上进行的广泛模拟表明，为了正确提取测量值与实际拓扑配置之间的关系，DNN 训练过程中输入值的广泛变化至关重要。因此，针对 14 母线系统和 39 母线系统，模拟了不同的发电和负荷曲线变化，使得训练过程中母线电压幅值在约 0.75 p.u.至 1.25 p.u.之间波动，电流流量从 0 到线路额定容量的 。这些变化已被证明对有效提取输入-输出映射至关重要。通过这种方式，DNN 得以训练，使其估计即使在训练集之外也能保持可靠。此训练过程是通过对每种拓扑配置（即每条停运支路）模拟上述发电和负荷事件生成的。对于每种拓扑配置，在两个测试系统上均使用了约 350 个训练样本来以批处理模式训练 DNN[14]。 总体而言，针对 14 母线测试系统的 DNN 采用了 7470 个训练样本，而 39 母线系统的 DNN 则训练了 16590 个样本。在两个测试系统中，DNN 的突触权重和偏置均通过独立的标准化高斯随机变量进行初始化，这些变量具有零均值和单位方差。
To observe how the proposed method performs with lower global measurement redundancy and to analyse its dependence from the type of measurements, two TI DNNs are implemented for the IEEE 14-bus system, both with a measurement set composed of 40 elements. In both cases, 10 measurements are withdrawn from the set of 50 measurements reported in [21]. In the first set of measurements, namely type 1 in Table II, 10 active and reactive power injection measurements (relative to bus 5, 6 , 10,12 and 13) are removed from the set of 50 element. In the second set, namely type 2 in Table II, 10 active and reactive power flow measurements are withdrawn from the set of 50 measurements (relative to branch 1-2, branch 2-4, branch 6-11, branch 10-11 and branch 12-13). In this manner, it is possible to observe how the accuracy achieved during the testing phase depends on the measurement type. Results reported in Table II indicate that the accuracy obtained during the training phase with the two reduced sets of measurements is comparable with the training accuracy achieved with the set of 50 elements. 为了观察所提方法在较低全局测量冗余度下的表现，并分析其对测量类型的依赖性，针对 IEEE 14 母线系统实施了两个 TI DNN，均采用由 40 个元素组成的测量集。在这两种情况下，均从[21]中报告的 50 个测量集中撤除 10 个测量。在第一组测量中，即表 II 中的类型 1，从 50 元素集中移除了 10 个有功和无功功率注入测量（对应母线 5、6、10、12 和 13）。在第二组中，即表 II 中的类型 2，从 50 个测量集中撤除了 10 个有功和无功功率流测量（对应支路 1-2、支路 2-4、支路 6-11、支路 10-11 和支路 12-13）。通过这种方式，可以观察到测试阶段达到的精度如何依赖于测量类型。表 II 中的结果表明，使用这两个缩减测量集在训练阶段获得的精度与使用 50 元素集达到的训练精度相当。
Nevertheless, the testing accuracy varies significantly. As can be observed in Table II, in the case of the type 1 set of measurements the testing accuracy decreases only to , whereas in the case of the type 2 the accuracy strongly decreases to . This result indicates that power flow measurements tend to carry more relevant information than power injection measurements for the topology identification process. In fact, this is quite intuitive, as the former type of measurements are more related to the topology configuration of the network. Nevertheless, the TI DNN trained with 50 measurements is the one which shows better accuracy, because power injection measurements also provide information for the topology identification process. In conclusion, these results suggest that both the number of measurements and their type have an impact on the effectiveness of the proposed method. 然而，测试精度存在显著差异。如表 II 所示，在类型 1 测量集的情况下，测试精度仅降至 ，而在类型 2 的情况下，精度大幅下降至 。这一结果表明，对于拓扑识别过程，潮流测量比注入功率测量携带了更多相关信息。实际上，这是相当直观的，因为前一种测量类型与网络拓扑配置更为相关。尽管如此，使用 50 次测量训练的 TI DNN 显示出更高的精度，因为注入功率测量同样为拓扑识别过程提供了信息。总之，这些结果表明，测量数量及其类型均对所提方法的有效性产生影响。
For both the IEEE 14-bus and 39-bus systems, the testing phase is conducted considering the sudden outage of a branch, and the simulation is repeated for all the network branches. The simulation lasts 5 s , a short-circuit is simulated at and the affected branch is placed out of service after 100 ms . The simulation time step used is 33 ms , and thus, the TIDNN is called to estimate the network topology 150 times for each simulation. The procedure is repeated for all of the considered topology configurations 对于 IEEE 14 节点和 39 节点系统，测试阶段均考虑分支突然停运的情况，并对所有网络分支进行重复模拟。模拟持续 5 秒，在 处模拟短路，受影响分支在 100 毫秒后退出运行。所用的模拟时间步长为 33 毫秒，因此，TIDNN 需在每次模拟中估计网络拓扑结构 150 次。该过程针对所有考虑的拓扑配置重复进行。
B. Bad Data Detection, Identification and Replacement B. 不良数据检测、识别与替换
To correctly estimate the actual network topology and successively execute the state estimation, gross errors in the measurement set must be detected, identified and replaced. Thus, a bad data detection and identification algorithm is needed. In this work, the methodology proposed in [11] is modified and implemented, although other algorithms can be used. This algorithm is based on an ANN and has been implemented for the IEEE 39-bus system to prove its compatibility with the proposed TI identification algorithm. However, it must be noted that instead of using 1 hidden layer, as detailed in [11], the neural network used in this work is structured with 2 hidden layers because it shows better performance during testing. Since the measurement set for the IEEE 39-bus system has 127 elements, the neural network is provided with 127 input neurons and 127 output neurons, while both hidden layers are equipped with 80 neurons. With this structure, the neural network shows good performance during the test phase. Similar to the DNN for TI, the input set is normalized using (14) and the training set includes wide variations in the input measurements. The activation function used for the hidden layers and output layer neurons is: 为准确评估实际网络拓扑并连续执行状态估计，必须检测、识别并替换测量集中的粗差。因此，需要一种不良数据检测与识别算法。本研究中，基于[11]提出的方法进行了修改与实施，尽管也可采用其他算法。该算法基于人工神经网络，并在 IEEE 39 母线系统上实施，以验证其与所提暂态不稳定识别算法的兼容性。但需注意的是，不同于[11]中详述的使用单隐藏层，本工作中采用的神经网络结构为双隐藏层，因其在测试中展现出更佳性能。鉴于 IEEE 39 母线系统的测量集包含 127 个元素，神经网络配置了 127 个输入神经元和 127 个输出神经元，两隐藏层各配备 80 个神经元。此结构下，神经网络在测试阶段表现良好。与用于暂态不稳定的深度神经网络类似，输入集通过公式(14)进行归一化处理，训练集涵盖了输入测量的广泛变化。隐藏层和输出层神经元所使用的激活函数为：
Similar to the TI algorithm, the synaptic weights and neurons bias are initialized with Gaussian random values with zero mean and unit variance. No dropout procedure is implemented. The identification rule used in this work has the same formulation proposed in [11] and is expressed as follows: 与 TI 算法类似，突触权重和神经元偏置初始化为均值为零、单位方差的正态随机值。未实施 dropout 过程。本文采用的识别规则与[11]中提出的公式相同，表述如下：
where and are the measurement and its estimated value, respectively, and is the desired threshold that flags the bad measurement input. The identification threshold applied in this work is , where is the measurement standard deviation. 其中， 和 分别为 测量值及其估计值， 为标记不良测量输入的期望阈值。本工作中采用的识别阈值为 ，其中 为 测量标准差。
C. State Estimation Algorithm Based on UKF 基于 UKF 的状态估计算法
The diagonal initial estimate covariance matrix of the UKF is composed by the initial state variances of and , corresponding to the voltage magnitudes and voltage angles, respectively. The diagonal process noise covariance matrix is formed by the terms of and , corresponding to the voltage magnitude and angle process variances, respectively. In accordance with the measurements variances described above, the diagonal measurement uncertainty matrix is determined. The initial state vector is derived from a flat start hypothesis; i.e., the voltage magnitude and voltage angle states are initialized with ones and zeros, respectively. All of the previous assumptions are made for the state estimators implemented in both the IEEE 14-bus and 39-bus test systems. UKF 的对角初始估计协方差矩阵 由 和 的初始状态方差组成，分别对应电压幅值和电压角度。对角过程噪声协方差矩阵 由 和 项构成，分别对应电压幅值和角度过程方差。根据上述测量方差，确定对角测量不确定性矩阵 。初始状态向量 源自平滑启动假设，即电压幅值和电压角度状态分别初始化为 1 和 0。上述所有假设均适用于在 IEEE 14 母线和 39 母线测试系统中实施的状态估计器。
The index used to evaluate the accuracy of the state estimator is the root mean square (RMS) of the residuals , which is calculated separately for the voltage magnitudes and angles as shown in [20]. The observation function is determined using the same procedure described in [20]. 用于评估状态估计器准确性的指标是残差的均方根（RMS），如[20]所示，电压幅值和角度分别计算。观测函数 采用与[20]中描述的相同程序确定。
V. TEST ResULTS V. 测试结果
As described in the previous section, to test the effectiveness of the proposed TI algorithm, all of the topology configurations reported in [21] have been simulated and successfully detected during the testing phase. In this section, some study cases are reported to show how the integration of the proposed TI DNN can benefit the state estimation process and to show its DSE applicability due to its small computational cost. All of the cases reported in this section are implemented with the set of measurements described in [21]. The global measurement redundancy used for the IEEE 14-bus system and the IEEE 39-bus system is 1.79 and 1.63 , respectively. In all of the simulations cases, the time step is 20 ms and a random Gaussian noise as described in Section IV is applied to the measurement set. 如前一节所述，为检验所提 TI 算法的有效性，已对文献[21]中所有拓扑配置进行了仿真，并在测试阶段成功检测到。本节将报告一些研究案例，以展示所提出的 TI DNN 集成如何有利于状态估计过程，并因其低计算成本而展示其在动态状态估计(DSE)中的适用性。本节报告的所有案例均采用文献[21]所述的测量集实现。针对 IEEE 14 母线系统和 IEEE 39 母线系统，全局测量冗余分别为 1.79 和 1.63。在所有仿真案例中，时间步长为 20 毫秒，并按照第四节所述向测量集施加随机高斯噪声。
A. Case 1: Topology Change in the IEEE 14-Bus System 案例一：IEEE 14 节点系统中的拓扑变化
In this case, a topology change in the IEEE 14-bus test system is studied. Specifically, a three-phase short-circuit current with zero fault impedance is simulated at the middle of line 2-4 at 0.5 s , and the fault is cleared 100 ms later by opening the line. The simulation is carried out for 10 s . Once the faulted branch opens, a topology variation occurs. Consequently, some elements in the network admittance matrix that are used in the observation function equations vary. If the topology change is not detected and the admittance matrix values are not updated accordingly, a biased estimation occurs. Usually, the most affected states from this error are the voltage magnitudes and angles of the bus connected to the affected branch. For this reason, the voltage angles at the buses 2 and 4 are reported in Fig. 4 and Fig. 5. An 在此情况下，研究了 IEEE 14 母线测试系统中的拓扑结构变化。具体而言，在 0.5 秒时，在线路 2-4 的中点模拟了零故障阻抗的三相短路电流，并在 100 毫秒后通过断开线路清除故障。模拟持续了 10 秒。一旦故障支路断开，拓扑结构即发生变化。因此，用于观测函数方程的网络导纳矩阵中的一些元素随之改变。若未检测到拓扑变化且未相应更新导纳矩阵值，则会导致估计偏差。通常，受此误差影响最大的状态是与受影响支路相连母线的电压幅值和相角。为此，在图 4 和图 5 中报告了母线 2 和 4 的电压相角。
Fig. 4. Case 1- estimation with and without TI. 图 4. 案例 1 - 有与无 TI 情况下的 估计。
Fig. 5. Case 1- estimation with and without TI. 图 5. 案例 1 - 有无时间反转的 估计。
TABLE III 表三
CASE STUDY 1 案例研究 1
比较指标
Comparison
index
拓扑识别下的估计
Estimation with
topology identification
无拓扑识别的估计
Estimation without
topology identification
examination of the figures shows that the TI DNN can detect the correct topology after the disconnection of line 2-4 and avoid a biased estimation. It is observed that the algorithm improves not only the steady-state estimation but also the estimation of the transient behavior. 对图表的检查表明，TI DNN 能在 2-4 线路断开后正确检测网络拓扑，避免偏差估计。观察发现，该算法不仅提升了稳态估计的准确性，还改善了对暂态行为的估计。
Table III shows the RMS residuals of the state estimation. It is observed that the estimation of the voltage angles has improved significantly with the correct topology information, while the improvement in the voltage magnitude residuals is marginal. This result can be explained based on observation of the measurement set reported in [21]. In fact, the bus 2 voltage magnitude is measured and does not need to be estimated through a load-flow formulation in the observation function that relies on the topology information. While the bus 4 voltage magnitude is not measured, the adjacent bus 2,3 , and 5 voltage magnitudes are monitored, leading to a lower dependence from the topology configuration information. These results are consistent with the considerations made in [8], in which the advantages of using a measurement-based approach in state estimators are highlighted. 表 III 展示了状态估计的均方根残差。观察发现，随着正确拓扑信息的引入，电压角度的估计显著改善，而电压幅值残差的改进则较为有限。这一结果可根据[21]中报告的测量集观察来解释。实际上，母线 2 的电压幅值已被测量，无需依赖拓扑信息的潮流方程进行估计。而母线 4 的电压幅值虽未直接测量，但其相邻的母线 2、3 和 5 的电压幅值均被监测，从而降低了对拓扑配置信息的依赖。这些结果与[8]中的考虑相符，该文献强调了在状态估计中采用基于测量方法的优势。
In addition to excellent precision over a wide range of testing simulations, the algorithm proposed in this work showed a computational time of approximately for each topology 除了在广泛的测试模拟中展现出卓越的精度外，本文提出的算法对每个拓扑结构的计算时间约为