{'fraction_non_alphanumeric': 0.034043704233243814, 'fraction_numerical': 0.008907007747744267, 'mean_word_length': 4.555817947617003, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Mahalanobis distance-based robust approaches against false data injection attacks on dynamic power state estimation

Many researchers have studied false data injection (FDI) attacks in power state estimation, but existing state estimation approaches are still highly vulnerable to FDI attacks. In this paper, we investigate the problem of the above three FDI attacks against dynamic power state estimation (DSE). Although the three attacks were discovered in SSE several years ago, none of them has been well addressed in static power state systems. In this research, we propose two robust defense approaches against the above three efficient FDI attacks on DSE. Compared to existing approaches, our proposed approaches have three major differences and significant strengths: (1) they defend against the three FDI attacks on dynamic power state estimation rather than static power state estimation, (2) they give a robust estimator that can accurately extract a subset of attack-free sensors for power state estimation, and (3) they adopt the little-known Mahalanobis distance in the consistency check of power sensor measurements, which is different from the Euclidean distance used in all the existing studies on power state estimation. We mathematically prove that the Mahalanobis distance is not only useful but also much better than the Euclidean distance in the consistency check of power sensor measurements. Our time complexity analysis shows that the two proposed robust defense approaches are efficient. Moreover, in order to demonstrate the effectiveness of the proposed approaches, we compare them with the three well-known approaches: the least square approach, the Imhotep-SMT approach, and the MEE-UKF approach. Our extensive experiments show that the proposed approaches further reduce the estimation error by two orders of magnitude and four orders of magnitude compared to the Imhotep-SMT approach and the least square approach, respectively. Moreover, our approach is more stable than the MEE-UKF approach.


Introduction
The power grid is a complex electricity delivery system of interconnected networks that deliver electricity from electric power generators to large geographical areas through transmission and distribution lines. Our daily routines rely heavily on the use of electricity. However, a few recent incidents have indicated that the power system is under constant attacks [11]. In December 2015, hackers struck three power distribution centers in Western Ukraine and caused nearly a quarter-million residents to lose their power for several hours [13]. A year later, the Ukrainian power grid was attacked again and people of the city of Kiev lost power for about an hour [31,14]. Such incidents are not limited to Ukraine. Recently, the Department of Homeland Security and the Federal Bureau of Investigation (FBI) alerted the public that the foreign government has attempted to target critical US infrastructure sectors since at least March 2016 [3]. Stuxnet malware is the first well-known cyberwarfare weapon that targeted Iran's nuclear power program [18], [34]. Two consecutive Ukrainian power grid attacks could be a test run for another cyberwarfare weapon. It is critical to protect our infrastructure from cybercriminals.
The real-time system monitoring of a power system is essential to ensure the reliable and secured electricity service operation of power grids. The control center of the power system uses the collected sensor measurements to conduct state estimation (SE). SE is then used by the power system operators to perform the contingency analysis for power system security.
There are two types of SE: traditional static state estimation (SSE) and dynamic state estimation (DSE) [39,7]. SSE does not consider the relationship among the states at a different time (i.e., states are not varied with time), whereas DSE does. SSE usually uses some sort of the least square approaches such as the weighted least square approach to obtain the best estimate of the static state variables. On the other hand, Kalman filter techniques are widely used for real-time DSE to obtain the optimal estimate of the power grid state [1,15,5]. Both types of SE use power flow models and meter measurements. A power flow model consists of a set of power flow equations that describe the flow of electric power in an interconnected system. The SE based on these nonlinear equations can be computationally expensive. Instead, the linearized power flow model is often used to approximate the power flow model, although it is less accurate.
Cybercriminals have many ways to attack a power system. One of the most severe ways to attack the power system is through FDI. For instance, an attacker can compromise a few sensors and inject malicious data to mislead SE and intervene in normal power system operations, such as the attacks occurred in Ukraine [13]. In this paper, we investigate FDI attacks against dynamic power state estimation.
To address this threat, researchers have come up with various defense methods, but they have only focused on static power state estimation. The Imhotep-SMT approach [32] and the least square approach [24] are two popular ways to solve the SE problem. The Imhotep-SMT approach uses the Satisfiability Modulo Theories to solve the state estimation problem, whereas the least square approach estimates the state of a system by minimizing the mean square error. Furthermore, in [20], a consistency check among sensor readings is introduced for SSE under the FDI attacks. The formal definition of such a consistency check is presented in section II. However, it is shown in [21] that there are several attack approaches that can inject false data and bypass the consistency check. In [12], the Kalman filter approach uses the information from a system model, previous estimation of system states, and sensor measurements to give the optimal SE. Nevertheless, if the sensor measurement is modified by an attacker, the Kalman filter approach provides misleading state estimation since this approach gives the same weight to these malicious sensors as to the normal sensors when performing the state estimation.
To find a robust method for SE against FDI attacks, we combine the consistency check with the Kalman filter approach to defending against it. First, we present the probabilistic rank-based expanding approach to finding a large set of consistent sensors for a dynamic power system and then apply the Kalman filter approach to this subset of the consistent sensors for SE. It is called the combined consistency and Kalman filter approach (CCKF). To this end, we review the specific attacks that target the consistency check. Then, we introduce our attack-resilient approach and evaluate it by conducting extensive experiments on an IEEE 14-bus system. Furthermore, we perform the runtime analysis to show the scalability of our approach.
The key contributions of this paper are in the following: • All existing studies on SE use the Euclidean distance that does not consider the relationship among sensor measurements. Instead, we adopt the Mahalanobis transformation and the Mahalanobis distance to address the correlation between the measurement noise and standardize the variance of each sensor's mea-surements. Specifically, we mathematically prove that the Mahalanobis distance is a better measure of the error than the Euclidean distance does, so it is used for consistency check.
• To improve the robustness of SE, we propose two new approaches for selecting a consistent set of sensor measurements for dynamic power state estimation. Our new proposed approaches do not rely on solving Cx = y to find the MMSE estimate for x and so Liu et al.'s method [21] for generating false data attack vectors based on the column space of C does not work. That is, our proposed approaches are resilient to the false data attacks discovered in [21]. They are also robust statistics since they provide a good performance no matter what distributions sensor measurement data follow when the number of the sensors is large based on the central limit theorem.
• We propose the prediction-based consistency approach (PCNA) and the combined consistency check with the Kalman filter (CCKF) approach for dynamic power state estimation against FDI attacks. The two proposed approaches, which incorporate a consistency check into the Kalman filter for the state estimation, have similar performance in terms of accuracy, though PCNA is more time-efficient. Furthermore, the experimental results show that the two proposed approaches outperform the two wellknown approaches: the Imhotep-SMT approach [32] and the least square approach. Specifically, the two proposed approaches reduce the estimation error by two orders of magnitude and four orders of magnitude compared to the Imhotep-SMT approach and the least square approach, respectively.
The remainder of this paper is organized as follows. In section 2, we give the background information of this research, such as the system model. In addition, section 2 introduces the concept of τ -consistency and discusses attack models. Section 3 first studies the Mahalanobis transformation for obtaining uncorrelated and standardize variables, as well as the Mahalanobis distance for measuring distance when the variables are correlated and have the fluctuations of different magnitudes. Then, section 3 presents PCNA and CCKF approaches for SE. In section 3, we further conduct the time complexity analysis of these approaches. Section 4 illustrates the performance of these approaches against FDI attacks. Section 5 discusses related work. Finally, we conclude this paper and point out some future research directions in section 6.

System Model and Problem Formulations
In this section, we start with necessary mathematical notation, present the system model, define measurement consistency with existing approaches against false data injection, and give three attack models.

Notation
In this paper, we denote a vector by a boldfaced lowercase letter, and a matrix by an boldfaced uppercase letter. The symbol R denotes a set of real numbers, as well as k, n, and p are positive integers. The symbol 1 n denotes a n by 1 vector whose elements are all 1's, 0 n denotes a n by 1 vector whose elements are all 0's, and I n denotes the n by n identity matrix. C(j 1 , ..., j k ) is a matrix consisting of the j 1 -th, j 2 -th,..., and j k -th rows of matrix C. The symbol where |x i | is the absolute value of x i .

System Model
Assume that there are p power state variables to be estimated in a power system, each variable representing either the voltage magnitude V i or phase angle δ i of a bus i, and let us denote the p power state variables at time k by a p × 1 column vector, x(k). Since we cannot directly measure the values of the power states, we have to rely on power flow meters to measure the readings of sensors installed in the power system. We further assume that there are n power flow meters to provide sensor measurements at time k denoted by an n×1 column vector, y(k), each vector element corresponding to one sensor measurement. Thus, the dynamic state estimation problem is to estimate the state vector x(k) at time k based on a sensor measurement vector y(k), where x(k) ∈ R p is a vector containing p state variables and y(k) ∈ R n is a vector consisting of all meter measurements (i.e., active power injections, reactive power injections, active power flows, and reactive power flows). The state estimation problem is considered dynamic since its power state variables and sensor measurements are varied with time k. Furthermore, We assume that the system has the linear time invariant dynamics. That is, the state vector x(k + 1) at time k + 1 is related to the state vector x(k) at time k as follows.
x(k + 1) = Ax(k) + w(k), where A = (a ij ) is a p × p system matrix relating state vector at time k to the state vector at time k + 1, and w(k) ∼ N(0, σ 2 w I p ) is a process noise vector at the time k.
The relationship between the state variables (voltage magnitude V i or angle δ i ) and sensor measurements (real power injections P i and reactive power injections Q i at bus i) can be described by the following power flow equations: where i = 1, 2, ..., b and b is the total number of buses. Furthermore, G ij and B ij are the real and imaginary parts of the (i, j)-th element in the bus admittance matrix.
Moreover, we assume that the state vector is associated with the sensor measurement vector through the following relationship: where C is an n × p matrix relating state vector to the measurement vector and is independent of time, and v(k) ∼ N(0, σ 2 v I n ) is the measurement noise vector at time k. The matrix C is determined by the topology of the power system. Furthermore, we assume that the attacker knows the matrix C, and the observed measurement vector at time k is where φ(k) ∈ R n is the attack vector at time k. Assume that there are m malicious sensor measurements and let I = {i 1 , i 2 , ..., i m } be the index set of the m malicious sensor measurements. Then, the ith element of the attack vector φ(k) is zero for all i / ∈ I.

Measurement Consistency
In this section, we review the notion of a consistency check among sensor measurements used in [40]. The normal sensor measurements usually provide a good estimate of the true state variables, whereas the malicious sensor measurements are intended to provide a biased estimation of state variables, where such an estimation is quite different from the true value. Therefore, the consistency among the sensor measurements can be defined as follows. Note we assume d > p in the definition since the state estimation is not unique otherwise. where || * || is a L 2 -norm and C(j 1 , ..., j d ) is a matrix consisting of the j 1 -th, j 2 -th,..., and j d -th rows of matrix C. τ is the critical chi-square test statistics that satisfies where L = ||C(j 1 , ..., j d )x − (y j1 , ..., y j d ) T || follows a chisquare distribution with d − p degree of freedom and α is significance level of the test.
Several algorithms based on this consistency check have been introduced to detect malicious measurements [40]. A naive algorithm is to simply use the brute force approach to conduct the consistency check as follows.

Brute force approach
The brute force approach examines all combinations of measurements in order to find the largest subset that is τ -consistent. Starting with the set of all measurements y = (y 1 , y 2 , ..., y n ), we estimate x using the least square approach and check the τ -consistency based on Definition 1. If it is τ -consistent, we are done. Otherwise, we would test all subsets of y with one fewer measurement. We would continue to do so until a τ -consistent subset is obtained. (Note: the largest subset found by this brute force approach need not be unique since there could be multiple subsets of the same size that are τ -consistent.) However, this approach is time-consuming in general. Therefore, Xiong and Ning [40] introduced a more computationally efficient probabilistic rank-based expanding approach.

Probabilistic Rank-Based Expanding Approach
The brute force approach is inefficient when the number of sensors m is large. A probabilistic rank-based expanding approach was initially proposed by Xiong and Ning in [40]. Its main key is to use a probabilistic rankbased approach to find a collection of benign sensor measurements as a seed and then expand the seed to contain the rest of benign sensor measurements as many as possible for estimating a power state. The probabilistic rank-based expanding approach is less time-consuming, although there is no guarantee the obtained subset is the largest among all consistent subsets. It consists of the seeding phase and the expanding phase.
The seeding phase is to find a collection of benign sensor measurements as a seed. Since the majority of the sensors are benign, there is no need to examine all the subsets of size p to find a good seed. Suppose there are at least benign sensors. In this case, the probability that a randomly chosen subset of p sensors is benign is Let P h be the probability that at least one subsets out of h (h > 0) randomly chosen subsets of n measurements is benign. Then, However, since not all the subsets can be used to obtain an estimated state vector, P h is an approximation of the probability of finding a seed from h randomly chosen subsets of p measurements.
To find a seed, we first calculate the number h of subsets of size p to ensure that P h is large enough, saying 0.995. This can be done by solving the equation Then, randomly choose h subsets of size p from n measurements. For each chosen subset, solve for x = (x 1 , x 2 , ..., x p ) using the least square method. For each obtained solution x j , compute the absolute residuals: for all measurements y i for i = 1, 2, ..., n. Since residual r i,xj reflects the consistency betweenx j and y i , the sorting score for each subset can be defined as the sum over the smallest δ squared residuals; i.e., Intuitively, smaller S j indicates smaller overall residual and better estimate. Thus, we keep n best , where 0 < n best < h, subsets that corresponds to the n best smallest sorting score used for the expanding phase.
In the expanding phase, the objective is to expand the seed obtained in the seeding phase in order to find the largest consistent subset. For each seed obtained from the seeding phase, we sort all the measurements that are not in the seed S according to their absolute residual. Start with the measurement with the smallest residual, check if it is τ -consistent with the seed S. If yes, it is added to S. If not, it is discarded. Repeat this process until all measurements are checked. In section 3, we extend the probabilistic rank-based approach to solve the SE problem when dynamic power systems are under FDI attacks.
The consistency check is used to detect malicious sensor measurements in [20,32,40]. However, Liu et al. [21] proposed several FDI attacks that can bypass this τ -consistency check. These FDI attacks are based on the idea of generating an attack vector φ(k) such that φ(k) is a linear combination of the column vectors of C. That is, φ(k) = Ce(k), for some nonzero vector e(k).
If y(k) at time k can bypass the τ -consistency check, then, as shown below, the malicious sensor measurement is the estimated state vector obtained from y o (k) at time k andx(k) is the estimated state vector obtained from y(k). Then, Therefore, if the attack vector φ(k) is a linear combination of the column vectors of C, then the injected false data can bypass the detection. In the next subsection, we will consider this type of FDI attack, as well as a random attack.

The Attack Models
Three attack models are considered in this paper. They are (1) the random attack considered by most researchers in the existing literature, (2) the specific sensor attack for a limited number of malicious sensors, and (3) the targeted attack that focuses on changing the state estimation for a particular set of state variables, i.e., specific voltage magnitude and/or angle.

Attack Model 1
The simplest one is a random attack model. This attack model assumes that an attacker can randomly select a subset of sensors and inject false data into them. To generate a random attack, an attacker randomly selects m sensors and adds random errors to these sensor measurements. Formally, we let I m be a set of indices of m sensors randomly selected from n sensor readings. Then, ith component of the attack vector φ(k) at time k is where r ∈ N (0, 1) and M ∈ R, and the malicious sensor measurements y o (k) at time k is equal to where y(k) is an actual sensor measurement at time k. This attack model is the simplest in the sense that no much calculation is needed to determine the attack vector. The drawbacks are: (1) it is not targeted to specific state variables, and (2) it is assumed that the attacker can freely change measurements of the chosen sensors to any value at any time.

Attack Models 2 and 3
The other two attack models are more intricate. They are called consistency attack models, which are based on the idea introduced in subsection 2.3. They are more complex than the random attack model and focus on injecting the false data that bypasses the consistency check. These attack models are developed based on Liu et al.'s work [21]. a) Attack Model 2: The specific sensor attack model assumes that the limited number of sensors are malicious and the attacker can change them at will. Suppose the attacker has access to m sensors and let I m be an index set of these m sensors. Let φ be the reduced attack vector that is corresponding to m malicious sensors. It is shown in [21] where the matrix B consists of the column vectors of C(C T C) − C T − I n that correspond to m malicious sensors and is not full rank, d is an arbitrary nonzero vector of length m, and φ i = φ i if i ∈ I m and φ i = 0 for i / ∈ I m , then FDI attack can bypass the detection. See [21] for the implementation of specific sensor attack. b) Attack Model 3: In the targeted attack model, the attacker aims to change SE by the particular amount c(k) for chosen state variables wherex a,i (k) is estimated ith state variable obtained by applying the weighted least square approach to malicious sensor measurements y o at time k, denoted by y o (k); c i (k) is the specific error inject to ith state variable by an attacker at time k, andx i (k) is estimated ith state variable before polluted by the attacker. See [21] for the implementation of targeted attack.

The Proposed Methodology for Dynamic Power State Estimation
In this section, we study the Mahalanobis transformation and its distance, propose robust approaches to detecting false data injection attacks in dynamic power state estimation, and give the time complexity analysis of the proposed approaches. Most importantly, we mathematically prove that the Mahalanobis distance is better than the Euclidean distance in terms of measuring an error in this study.

Mahalanobis Transformation and Mahalanobis Dis-
tance All the existing studies on power state estimation use the Euclidean distance, which is actually based on the assumption that the measurement noise follows multivariate normal distributions with the variance-covariance matrix as an identity matrix given in subsection 2.3. However, in reality, the sensor measurements are correlated and the magnitude of the fluctuation among the sensor measurements are different. Therefore, the Euclidean distance cannot be directly applied to these correlated sensor measurements of different magnitudes. Hence, we use the Mahalanobis transformation to eliminate the correlation between the sensor measurements and to standardize the variance of each sensor measurement in order to satisfy the assumption that the measurement errors follow mutually independent standard normal distributions.
Before defining the Mahalanobis transformation, we review some linear algebra concepts [8,30]. First, the eigenvalues and eigenvectors of a symmetric matrix are defined as follows.
The vector γ is called the eigenvector corresponding to λ.
The real symmetric matrix has real-valued eigenvalues. If all eigenvalues of a matrix A are non-negative, then A is called positive semidefinite. If all eigenvalues of A are strictly positive, then it is called positive definite. Any symmetric matrix can be factored using the spectral decomposition (or Jordan decomposition) as shown in Theorem 1 [16].
Using the spectral decomposition, we can define the power of a matrix as follows [16].

Mahalanobis Transformation
In this subsection, we introduce the Mahalanobis transformation and show that this transformation standardizes a set of correlated variates y. The Mahalanobis transformation is defined as follows.
Definition 4. Given an n-variate random vector y with mean E(y) = µ and variance V ar(y) = Σ. Suppose that Σ is positive definite. Then, the linear transformation is called the Mahalanobis transformation.
In the following theorem, we show that the Mahalanobis transformation transforms y to a standardized uncorrelated variate z.
Theorem 2. Given n-variate random vector y with mean E(y) = µ and variance V ar(y) = Σ. Suppose that Σ is positive definite. Let Then, E(z) = 0 and V ar(z) = I p . Proof.
Based on the central limit theorem, the noise follows a normal distribution under normal operations. Furthermore, after applying the Mahalanobis transformation, the noise has a zero mean and an identity covariance matrix based on Theorem 2. However, we do not know the true mean µ and variance Σ. Therefore, we use the sample meanx to estimate µ and the sample variance matrix to estimate Σ.

Mahalanobis Distance
After applying the Mahalanobis transformation, the variables are uncorrelated and standardized (theorem 3), and the familiar Euclidean distance can be used to define τ -consistency. Alternatively, if we do not use the Mahalanobis transformation to decorrelate and standardize the variates, we can modify the definition of τ -consistency use the idea of Mahalanobis distance. Usually, the Euclidean distance is used for measurements with the assumption that each element of y contributes equally to the calculation of the Euclidean distance. However, in reality, the magnitude of random fluctuations is different for each element of y and there are correlations between y s. Hence, it is desirable to weigh each variable subject to the variancecovariance matrix. The Mahalanobis distance is defined as follows.
Definition 5. Given a p-variate random vector x with mean E(x) = µ and variance V ar(x) = Σ. Suppose that Σ is positive definite. Then the Mahalanobis distance of an observation y = (y 1 , y 2 , ..., y n ) from µ is The next theorem shows that the Euclidean distance is a special case of the Mahalanobis distance when the variance-covariance matrix is an identity matrix. That is, only when there is neither correlation between the variables nor the variation in fluctuations among the variables, the Mahalanobis distance is equivalent to the Euclidean distance; they are not equal to each other otherwise. In other words, the Mahalanobis distance provides a better measure of error since it does not assume that the variables are not correlated.
Theorem 3. If Σ = I, then Mahalanobis distance is equivalent to the Euclidean distance.
A direct substitution of Σ = I to the definition of Mahalanobis distance can prove the previous theorem. Using the idea of the Mahalanobis distance, we can redefine τ -consistency as follows.
where H = C(j 1 , ..., j k ) is a matrix consisting of the j 1 -th, j 2 -th,..., and j k -th rows of matrix C.
For the rest of the paper, we assume that either the Mahalanobis transformation has been applied to y or the Mahalanobis distance is used for τ -consistency checks.

Robust Approaches for Dynamic State Estimation
In this subsection, we present the proposed robust algorithms against FDI attacks for DSE. In subsection 2.3, the measurement consistency is defined based on the L 2norm ||C(j 1 , ..., j d )x(k)−(y j1 , ..., y j d ) T || where C(j 1 , ..., j d ) is a matrix consisting of the j 1 -th, j 2 -th,..., and j d -th rows of matrix C. Liu et al. [21] showed the vulnerability of this type of consistency check and presented a new class of attacks that can bypass this consistency check. In this paper, we develop two alternative versions of this τ consistency check. These alternative versions do not rely on solving Cx = y to find the MMSE estimate for x, so Liu et al.'s method [21] for generating attack vector based on the column space of C does not work in our proposed two versions of this τ consistency check.

Prediction based Consistency Approach (PCNA)
We estimatex k by CAx k−1 and define the consistency check using the L 2 -norm: Formally, it is defined as follows. where || * || is a L 2 -norm and (CA)(j 1 , ..., j d ) is a matrix consisting of the j 1 -th, j 2 -th,..., and j d -th rows of the product of matrix C and matrix A. τ is the threshold that can be determined through a hypothesis test follows a chi-square distribution with d − p degree of freedom and α is significance level of the test.
This way of defining τ -consistency is better than Definition 1 in two aspects. First, attack models proposed by Liu et al. [28] do not work in this case. Secondly, it is computationally efficient by using Ax(k − 1) to estimate x(k) instead of finding the estimate of x(k) using the minimum mean square error method (MMSE).
Starting with all measurements: we check if it is τ consistent. If it is not τ consistent, we remove such a sensor, denoted as sensor l, that is corresponding to the largest residual Next, update the value of τ and check the τ -consistency for the remain set of sensor measurements. Process repeat until a τ consistent set I c is obtained. See Algorithm 1 for the implementation details.

Algorithm 1 Prediction based Consistency Approach (PCNA) Algorithm
Input: measurements I, previous state estimate Output: a consistent subset of measurements Compute the L 2 -norm using measurement set I

Combined Consistency and Kalman filter (CCKF)
Approach PCNA is time-efficient; however, it does not incorporate the current sensor measurements in SE. To added current sensor measurements information to SE, we need to define our τ consistency check differently. Before defining it, we introduce the Kalman filter estimation. The Kalman filter estimation is an optimal SE that combines the information from the system model, previous SE, and the sensors measurements. It is light on memory since the only previous state is needed to calculate the current state. These are the main reasons that the Kalman filter is selected for real-time DSE. The Kalman filter technique consists of two steps: prediction and update.
With the knowledge of the power system model, we calculate the predicted state estimatê and its covariance matrix Use the current measurements, we can update the state estimatê x(k|k) =x(k|k − 1) + K(k)(y(k) − Cx(k|k − 1)) (6) and its updated estimate covariance where the Kalman gain The Kalman filter is an optimal SE that uses the information from both the system model and sensors measurements. However, if a subset of the sensor measurements is corrupt, it affects the SE. Hence, the consistency check is first applied to find a large subset of consistent sensor measurements, and then the Kalman filter is utilized to that subset for optimizing SE.
To make the Kalman filter work under the FDI attack, we modify the Kalman filter approach by changing the Kalman gain K to K ∼ Uniform(K − r, K + r). where r > 0 is some small number related to K and K − r > 0. This introduces some random variation to the Kalman gain to further reduce the attacker's ability to generating an effective FDI attack. Now we define the τ -consistency based on this modified Kalman filter estimation as follows.
where || * || is a L 2 -norm,x F is the modified Kalman filter estimate, and C(j 1 , ..., j d ) is a matrix consisting of the j 1th, j 2 -th,..., and j d -th rows of matrix C. τ is the threshold that can be determined through a hypothesis test where L = ||C(j 1 , ..., j d )x F − (y j1 , ..., y j d ) T || follows a chisquare distribution with d − p degree of freedom and α is significance level of the test.

Algorithm 2 Probabilistic Rank-Based Expanding
Input: measurements, previous state vector, desired probability, and the number n best of best set want to obtain Output: a consistent set of measurements Randomly select a subset I j of measurements 6: Compute the state estimation based on I j

7:
Compute and sort the residuals 8: Sum up the first δ smallest residual squares 9: end for 10: Select n best subsets with smallest residual squares 11: Expanding Phase 12: for each subset S obtained from seeding phase do 13: for each sensor measurement y not in S do 14: Check whether adding y to S improves fitness 15: if the fitness improves then Before presenting our proposed robust approach for DSE in dynamic power systems, we first extend the probabilistic rank-based expanding approach to defend against FDI in dynamic power systems. Algorithm 2 gives the pseudocode of this approach. Then, using Algorithm 2, Definition 8, and the Kalman filter described previously, we obtained the Combined Consistency with the Kalman filter (CCKF) Algorithm as follows.

Complexity Analysis
Three consistency checks are introduced to find the consistent set of sensor measurements, assuming that the number of malicious sensors is less than half of the total number of sensors. In this section, we analyze the computational time complexity of them.
There are several methods for implementing these consistency checks. The brute force approach introduced in section 2. In contrast, the probabilistic rank-based expanding approach can find a large subset of measurements for SE while being efficient. The seeding phase primarily consists of finding MMSE and calculating the residuals. As stated in section IV, we only need to examine subsets of p measurements to find a seed for expanding phase. Hence, the time complexity for solving the linear equation is O(hp 2.376 ) < O( n k p 2.376 ) whereas the time complexity for calculate the measurement residual in the seeding phase is O(nph) < O( n k np). Therefore, the time complexity of seeding phase is O( n k (np + p 2.376 )). For the expanding phase, we only need to perform n − p Kalman filter estimation operations. Thus, the most timeconsuming step is from the seeding phase with time complexity O( n k (np + p 2.376 )), as the time complexity of the Kalman filter estimation is the same as the time complexity for solving a linear system of equations.
However, there is no need to do the rank-based expanding approach if Definition 7 is used. In this case, the dominant operations consist of matrix multiplications and the calculation of the measurement residual. The best known algorithm for multiplying an n × p and a p × p matrix runs as O(np 2 ), whereas the time complexity for calculating the measurement residual is O(np). Therefore, the time complexity is O(np 2 ), and the consistency check based on Definition 7 is the most time-efficient.

Discussion
In this subsection, we would like to discuss the two potential extension directions of our proposed approaches as follows.
As shown above, we have developed robust approaches against false data injection attacks, where it is assumed that power sensor data are collected and sent to a control center for dynamic power state estimation. In a large-scale power grid system, however, it is not only very expensive but also infeasible to send all the sensor data collected in different locations to a single central location such as the control center. This is because real-time monitoring a power system must result in large sensor data and such a big data transfer over networks is very challenging in terms of performance and security. Thus, it is better to achieve power state estimation in a distributed computing fashion. That is, power sensor data will be processed in a local control center that is close to where those data are collected. Such a distributed computing framework can dramatically reduce the sizes of data that need to be transferred and the difficulty of the transfer of those data, resulting in the performance improvement of data transfer. Of course, such a framework may arise other research challenges that are usually seen in a distributed computing. However, a lot of studies have been conducted to addressed such challenges. For example, we can propose to implement a blockchainbased orchestrator to automate the management, coordination, and organization of the proposed approaches in the local control centers. The orchestration supports the efficient delivery of distributed computing resources for the local state estimation under false data injection attacks, whereas blockchain-based implementation eliminates trust issues when local control centers may belong to different entities. More precisely, we may follow the framework proposed in [29] to implement a blockchain-based orchestrator. In this case, each local state estimation update is uploaded to its associated miner. This local state estimation is verified and shared among all other miners, and then the global state estimation is achieved through the collaborative computation among these miners.
Furthermore, distributed computing encounters a variety of security attacks. For example, a new type of data poisoning attacks has been recently developed to attack federated learning systems, a new type of distributed computing systems [42]. The main idea of this attack is to use a generative adversarial network (GAN) to artificially generate data similar to real data and then to update the weights of each local neural network model based on these artificial data instead of real data. This attack is stealthy because the generated data are apparently indistinguishable from real data. Moreover, in order to increase the influence of the updates of local model weights on the global neural network model, the attacker scales up their local model weight updates by some large values, i.e., 20-100 as proposed in [42]. Though this scale-up increases the attack success rate, the updated weights provided by an attacker is very different from the weight updates of local neural networks obtained through normal operations without any attacks. In our further study, we may apply our proposed consistency check to local model weights for defending against such data poisoning attacks. More precisely, we may follow the consistency check framework proposed in [19].

Evaluation
We empirically evaluate the proposed approaches through experiments using an IEEE 14 bus system in this section. More specifically, we give our evaluation setup, present our parameter selection of three attack models, and conduct the performance comparison of the proposed algorithms with existing ones in terms of accuracy, runtime, and the effect of injection error on estimation.

Evaluation Setup
The IEEE 14 bus power system is used to compare three definitions of consistency and to evaluate all four approaches: the least square approach, the Imhotep-SMT approach, the CCKF approach, and the MEE-UKF approach [5]. Since the Imhotep-SMT approach is evaluated using the 14 bus system in [32], we compare the Imhotep-SMT approach with the CCKF approach using the same bus system. This 14 bus power network consists of five synchronous generators and 14 buses [27]. To ensure that SE is feasible, sensor number 35 is assumed to be safe as well. That is, the attacker does not have access to sensor number 35. The matrices A, B, and C modeling the power network are derived in [27]. The sensor readings at time k is generated by calculating the sensor measurements using Cx(k) + v(k) + φ(k), where v(k) follows the normal distribution with mean 0 and variance 10 −1 I n , and φ(k) is the attack vector given as before.

Parameter Selection of Three Attack Models
We have three attack models. The simplest attack model is a random attack model (model 1). For this attack model, the attacker randomly selects m = 14 sensors and introduces random errors to these sensor measurements. The next two attack models (consistency attack models) are more intricate. The consistency attack models are based on the idea introduced in subsection 2.3. They are more complex than model 1 and focus on introducing the attack that bypasses the consistency check. Attack models 2 and 3 are developed based on Liu et al.'s work [21]. For attack model 2, we assume the attacker has access to 14 meters; i.e., meters numbering 1-5, 13, 15-20, 28, and 33 are malicious. The attack vector for Attack Model 2 is φ(k) = (I 35 − B − B )d, where the matrix B is the column vectors of C(C T C) − C T that are corresponding to meters 1-5, 13, 15-20, 28, and 33 and d = 50 * 1 14 (In general, d is an arbitrary nonzero vector). Attack Model 3 is called the targeted attack Model. The targeted attack model introduces specific errors to chosen target state variables using Algorithm 2.
Before the simulation, we also specified some parameters for these approaches. For the Imhotep-SMT approach, we specified the upper bound for the maximum number of the attacked sensors to be 14. For the CCKF approach, we set α = 0.5% and P h = 0.995 since we want to have a high confidence, i.e., the 99.5% confidence, to ensure that we are able to find a large consistent set whose type 1 error is α = 0.5% within first h random subsets tested. We set the process covariance matrix as 10 −7 I p and the noise covariance matrix as 10 −1 I n to see the performance of our approach under a relatively large measurement uncertainty comparing to process uncertainty [6]. The simulation is repeated 100 times, and the rootmean-squared error (RMSE) of attack-resilient SE is reported based on the result of these 100 simulations. Figures 1, 2, and 3 show the root mean squared error introduced by attack models 1, 2, and 3, respectively. As shown, the least square method performs poorly under all three attack scenarios. The Imhotep-SMT approach performed better with RMSE about 0.1, and the CCKF approach is best with the smallest RMSE. After approxi- Furthermore, we compare our approach with the MEE-UKF approach [5]. The comparison setup is the same as [5], except we use the root mean square error (RMSE) instead of the mean absolute error (MAE) as a measure of performance. Both approaches utilize the Kalman filter, although our approach also uses the Kalman filter's prediction step for consistency check. As shown in Figure 4, our approach has a somewhat lower root mean square error and provides a more stable result since it first filters out the inconsistent sensors before the state estimation.

Performance Comparison
Since the Kalman filter uses both information from the sensor measurements and the system model, the Kalman filter gives a more precise state estimation than the least square approach. Combining the consistency check with the Kalman filter gives a new approach for SE against FDI attacks. By the observation matrix definition, the measurement matrix C is a submatrix of O. Since the Imhotep-SMT approach also considers the consistency check but in terms of the observation matrix, the Imhotep-SMT approach gives a more precise estimation. However, the Imhotep-SMT approach assumes that the bound on the maximum number of malicious sensors and the bound on the sensor noise are known in addition to knowing that the number of malicious sensors is sparse. For the CCKF approach, we assume that the noise is Gaussian and the number of malicious sensors is less than half of the total number of sensors. With the Gaussian noise assumption, if the consistency check can remove all malicious sensors, the Kalman filter estimation is optimal. In this subsection, the performance of two proposed consistency checks based on Definitions 7 and 8 are evaluated and compared with the existing consistency check defined in Definition 1. Figures 5 and 6 show the RMSE in SE of the power system under the random attack and the consistency attack, respectively. In the first experiment ( Figure 5), we generate a random attack based on Algorithm 1. For this attack model, the attacker randomly selects m = 14 sensors and introduces random errors to these sensor measurements. As shown in Figure 5, the performances of the three consistency checks are about the same. In the second experiment ( Figure 6), we generate a specific meter attack assuming that the attacker has access to meters 1-5, 13, 15-20, 28, and 33. As shown in Figure 6, the τ -consistency check based on Definition 7 performs best among the three.  Table 1 shows the execution times for the SE of the power system under the random attack. Without loss of generality, we increase the number of state variables and the number of sensors simultaneously. We set n = 3p as in [32] for comparison purposes. As p increases, the average runtime also increases. When p = 10, the average runtime for the CCKF approach based on Definition 8 is the smallest. However, the average runtime for it increases faster than that of PCNA. When p = 50, the average runtime for the PCNA becomes the smallest. When p = 150, the average runtime for the MMSE is triple the average runtime for PCNA, whereas the average runtime for CCKF is more than ten times the average runtime for the CCKF. This shows that PCNA based on Definition 7 is the most time effective and confirms the runtime analysis of section 3.

Effect of injection error on estimation
To see the effect of the injection error on SE, we double the injection errors and rerun the experiment in subsection C. As shown in Figures 7 and 8, the performance of CCKF (based on Definition 8) and PCNA (based on Definition 7) are similar, whereas their performances are significantly better than the performance of MMSE (based on Definition 1) under both consistency attack and random attack.

Related Work
In this section, we review some related work to our study. Many researchers have considered the problem of detecting and identifying FDI attacks [4], [9], [37]- [38], but they mainly focus on static power state estimation instead of a dynamic one studied in this research. For instance, Pires et al. [28] and Vedik and Chandel [2] proposed robust iteratively reweighted least squares (IRLS) approach and least winsorized square (LWS) approach for SE, respectively. The least winsorized square is robust in that it eliminates an outlier before making the SE. Our proposed methodology also performs the SE by first removing the outlier or potential malicious sensors. Teixeira et al. [35] proposed the false data attack under both linear and nonlinear estimators, assuming that the attacker only possesses a perturbed model. Xiong and Ning [40] also studied the FDI attacks against power system SSE and counter measurement. Nevertheless, Yao Liu et al. [21] showed the vulnerability of this SSE; i.e., an FDI attack can be designed that introduces arbitrary errors that bypass detection even when the attacker has limited resources.
Different from the SSE, the DSE is more robust in the sense that it includes the information from the previous state and system model [10]. A number of techniques for DSE in power systems have been developed [5], [23], [25], [26], [36]- [39], [41], [43], [44]. For instance, an extended particle filter (PF) is used to estimating the dynamic states of a synchronous machine [45], and Zhang et al. [43] developed an adaptive mixed Kalman/H ∞ filtering for the distribution network. Mandal et al. [23] proposed two algorithms that incorporated the measurement function nonlinearities in the extended Kalman filter (EKF) scheme for DSE. Pang et al. [26] proposed a Kalman filter based output tracking control system against FDI attacks. Kundu et al. presented an anomaly detector based on an auto-encoder [17].
Yang et al. [41] developed the following five novel attack approaches: maximum magnitude-based attack, wave-based attack, positive deviation attack, negative deviation attack, and mixed attack that can bypass the anomaly detection. These approaches are based on the idea of injecting a small error that is within the specified tolerance. In addition, they developed temporal-based detection algorithms to defend against those attacks. They assumed that the measurement errors before the attack follow a distribution, whereas the measurement errors after the attack follow a different distribution. However, in reality, an attacker could inject the targeted specified error that constantly moves the system through multiple transient phases. Shoukry and Tabuada [33] designed two computationally efficient algorithms for SE using eventtriggered techniques. However, the work does not consider the sensor and process noise and only considered the random attack model. On contrary, this paper considers both sensor and process noise. In addition, our proposed algorithm is evaluated using both the random attack model and consistency attack models described in the previous section. Wu et al. [39] proposed a novel sliding-mode observer for SE and an event-triggered scheme for saving limited computational resources. Lyu et al. [22] considered a different aspect of the SE, the transmission reliability for SE. In [32], Tabuada introduced the Imhotep-SMT approach for secure SE. The technique consists of two main steps: detection and estimation. The idea behind the detection of the malicious sensors is similar to the consistency check introduced in the previous section. However, instead of using the norm ||y(k)−Cx(k)||, it uses ||Y(k)−Ox(k)|| where is the measurement matrix, and η ≤ p is an integer selected that guarantees the system observability matrix where φ is the nonzero attack vector injected by an attacker.
Proof. Since O has full rank, then O has a left inverse Therefore, exists. Letx(k) be the estimated state vector obtained from the y(k), andx a (k) be the estimated state vector obtained from the y a (k). Then, Y(k) and Y a (k) are a corresponding matrix generated from y(k) and y a (k), respectively. And we have that This theorem shows that the constructed attack vector φ can easily bypass the detection. On the contrary, our proposed consistency checks overcome this limitation.

Conclusion and Future Work
A power grid is a typical energy-based Cyber Physical System (CPS) that is vital to our daily life, but it, at the same time, is susceptible to various cyber attacks. A successful attack on power systems not only results in a significant economic loss, but it may also cause loss of human life. State estimation is needed for controlling and monitoring the state of power systems based on readings of sensors placed at important power grid components. Existing studies focused on static power state estimation.
In this paper, instead, we investigated power state estimation, where PCNA and CCKF approaches were proposed and implemented to estimate the dynamic states of a power system. The two approaches are robust. The experimental studies illustrated that the performances of PCNA and CCKF are similar, even though PCNA is more timeefficient. The performance of the CCKF approach was also compared with the two well-known approaches, the Imhotep-SMT approach, and the least square approach, under three different attack models: a random attack model and two consistency attack models, which gave typical FDI attacks in a power system. Our experimental results demonstrated that the proposed approach outperforms both the Imhotep-SMT approach by two orders of magnitude and the least square approach by four orders of magnitude. Furthermore, we compared our approach with the MEE-UKF approach to show that our approach provides a more stable result, though both approaches have similar performance. Moreover, all the existing studies used the Euclidean distance in power state estimation. In this research, the little-known but useful Mahalanobis distance was presented and used for τ -consistency calculation. Finally, we investigated the properties of the Mahalanobis transformation and the Mahalanobis distance through theoretical analysis to show that the Mahalanobis distance is a better measure of the error than the Euclidean distance does.
In the future work, we will investigate the performance of the proposed approaches on real-world power grid data. We will also consider extending the proposed approaches by using a blockchain-based orchestrator and studying data poisoning attacks.