Cyber Attack Detection Scheme for a Load Frequency Control System Based on Dual-Source Data of Compromised Variables

: Cyber attacks bring key challenges to the system reliability of load frequency control (LFC) systems. Attackers can compromise the measured data of critical variables of the LFC system, making the data received by the defender unreliable and resulting in system frequency ﬂuctuation or even collapse. In this paper, to detect potential attacks on measured data, we propose a novel attack detection scheme using the dual-source data (DSD) of compromised variables. First, we study the characteristics of the compromised LFC system considering potentially vulnerable variables and different types of attack templates. Second, by designing a variable observer, the relationship between the known security variables and the variables which are at risk of being compromised in the LFC system is established. The features of the data obtained by the observer can reﬂect those of the true data. Third, a Siamese network (SN) is designed to quantify the distance between the characteristics of measured data and that of observed data. Finally, an attack detection scheme is designed by analyzing the similarity of the DSD. Simulation results verify the feasibility of the detection scheme studied in this paper.


Introduction
Power systems with high integration of information technologies are being challenged by increasing cyberhacking activities [1]. In December 2015, the Ukraine Electric Grid Hack caused almost 225,000 customers to lose power for at least 6 h [2]. During the incident, varieties of critical data of power systems were compromised by cyber attacks. As an essential component of the power system, the LFC system needs to utilize varieties of measured data to maintain the stability of system frequency. Sophisticated attackers can compromise the measured data by launching cyber attacks to force the load frequency controller to issue incorrect instructions, which can lead to unpredictable frequency fluctuation. Therefore, it is necessary to detect the compromised data as a first step to mitigate cyber attacks.
The two main types of cyber attacks against power systems are false data injection (FDI) attacks and denial of service (DoS) attacks [3]. In [4], Liu first studied false data injection attacks targeting static state estimation (SE). It is proved that the compromised data meeting certain rules can bypass bad data detection. It is difficult for defenders to judge whether the measured data are reliable. To protect power systems from FDI attacks, the defense strategies are studied from many aspects including impact of cyber attacks, detection schemes, and mitigation strategies. In [5], attack and defense mechanisms are discussed using the method of bad data detection. Detection method and mitigation strategy of cyber attacks on substation automation systems are studied in [6]. The impacts of cyber attacks on supervisory control and data acquisition (SCADA) systems are studied by considering different attack scenarios [7]. In [8], a dynamic state dynamics is introduced to achieve risk mitigation against FDI attacks. In [9], the isolation of FDI attacks for smart grids using state observer is studied. In [2], known-secured phasor measurement unit (PMU) measurement is used to detect malicious attacks on power grids. As for DoS attacks, the existing literature shows that the opening of communication channels can be used to achieve attacked targets [10][11][12]. DoS attacks can disrupt the data exchange in multiarea power systems and lead to packet losses directly. Compared with FDI attacks, DoS attacks can achieve the attacked target without maintaining concealment, which makes it important to study the mitigation strategies for DoS attacks. The strategies to suppress DoS attacks have been extensively studied. Adopting appropriate communication protocol and event-triggered control scheme can effectively mitigate the impacts of DoS attacks [13,14]. Compared to DoS attacks, FDI attacks could easily manipulate the normal actions of a control center by compromising the data of vulnerable variables.
Analysis of cyber attacks on a LFC system is different from that on other systems in power systems [15]. A LFC system, which depends on the dynamic evolution rather than general SE, is designed to maintain the active power balance of power system. As is discussed in [15], unlike static state estimation, which estimate the state of power systems once every five minutes based on the ISO/RTO standard, the control center of LFC system should generate command data once every five seconds. As a result, it is difficult for a detection scheme of cyber attacks on a LFC system to benefit from current SE-based attack detection schemes. Ref. [15] proposes FDI attack templates matching the features of load frequency control system and evaluates the attack impact from aspects in frequency fluctuation and financial settlement. In [16], the model of optimal FDI attacks on the sensors of a LFC system is proposed to guide the defense of sensor data. In [17], authors introduce a priori knowledge of FDI attacks for studying more targeted detection methods, by analyzing four attack strategies targeting frequency collapse. Considering the concealment of the FDI attack and the accuracy of the attack detection, an optimal defense strategy is studied using game theory model [18]. Ref. [3] proposes an event-triggering control strategy to mitigate the impacts of cyber attacks on a LFC. Ref. [19] proposes the resilient load frequency control considering cyber attacks and communication delay.
Detection methods of cyber attacks against LFC systems should focus on dynamic features in vulnerable variables. In current literature, designing observers and using machine learning algorithms are two important methods to extract the dynamic features of variables [20][21][22]. In [23], the disturbance of active power is tracked using a second-order sliding mode in an LFC system. In [24], the fault signals in the LFC system are observed using the sliding mode observer.
The existing methods for detecting FDI attacks on LFC systems have the following defects: (1) The current data-driven methods are not sufficient to detect attacks in specific conditions. The features of historical operation data are exploited based on data in multiple operating conditions. Attackers can inject false data with the features of historical data in the LFC system. For example, in one operating condition, attackers can use historical data to generate attack signals that satisfy the features of the variables in other conditions.
(2) Due to the communication delay and noise, there exists a difference between the observed data and the true data. Defenders cannot set the reasonable threshold of the difference. Improper setting of threshold will lead to misjudgment.
Considering that the attacker is compromising the relationship between measured data and true data, we propose a detection scheme for FDI attacks on a load frequency control system based on dual-source data of compromised variables. Different from the methods of learning the features of historical data, we measure the relationship between observed data and measured data. The relationship between the two includes the difference caused by communication delay and noise.
The main contributions of the paper are three fold: (1) The attack detection scheme using dual-source data of compromised variables in an LFC system is proposed. Dual-source data can be used as a basis for defenders to detect false data injection attacks.
(2) Based on known-secure variables in an LFC system, an observer of tie-line power is designed considering uncertainties parameters in the LFC system. With this observer, defenders can obtain dual-source data (the observed data and the measured data) to assess whether the system is compromised.
(3) Considering the communication delay and noise of the dual-source data in the process of transmission to the defense center, the Siamese network is used to quantify the similarity of the dual-source data.
The remainder of this paper is organized as follows: in Section 2, the dynamic modeling of a compromised load frequency control system is studied. In Section 3, we design an observer for detecting tie-line power considering uncertainties in an LFC system. The FDI attack detection for the LFC system is designed in Section 4. In Section 5, simulation and analysis are carried out. Finally, Section 6 states conclusions.

Basics of a Compromised LFC System
The diagram of a typical multi-area LFC system is depicted in Figure 1. The system consists of n areas. The attacker randomly selects one area (Area i ) to launch cyber attacks. Other normal areas are represented by area (j(j = 1, ..., i − 1, i + 1, ..., n)). The attack target is the remote terminal unit (RTU) of the compromised area. RTU is used to collect tie-line power data. Since RTU is compromised, tie-line data cannot be correctly transmitted to the control center, so that area control error (ACE) cannot be correctly calculated. Through the proportion integral differential (PID) controller, the wrong ACE signals produce the wrong control command. Based on the relationships between control command and active power (the relationships are represented by the transfer functions in Figure 1), incorrect control command could lead to power imbalance. Then, power imbalance leads to the fluctuation of system frequency, which endangers the stability of the power system.  The dynamic model of the compromised system is: where where ∆P g i and ∆P m i represent the deviation of the governor valve position and the generator output power, respectively; β i represents the frequency bias coefficient; ∆ f i represents the deviation of frequency. ∆P t i and ∆P d i represent the deviation of the tie-line power and the load fluctuation, respectively; D i , R i , and M i represent the generator unit damping coefficient, the speed drop, and the inertia of the synchronous machine, respectively; T ij is the synchronizing coefficient between area i and area j; T t i and T g i represent the time constants of the turbine and the governor, respectively; G i is a constant known matrix representing the distribution matrix of the bounded measurement noise ω i (t). Notice that the generating units are transformed into an equivalent unit in order to reduce the model complexity. A model fitting method can be used to transform the multi-unit into an equivalent unit. The details of the model fitting are given in [25] and omitted here due to space limitations. The time-varying uncertainties of A i and B i satisfy where Φ, Ψ a , and Ψ b are the distribution matrix of the variation vector σ(t). In this paper, we only focus on the situations in which (A i + ∆A i (t)) is asymptotically stable. Based on the area control error (ACE), the commands of the Area i of the LFC system are generated using the following equation: where K Pi and K Ii are the proportional and integral gains of the controller, respectively; ∆P tm i represents the measured data uploaded by the RTU of tie-line power; and ∆p f i represents the data of the equivalent active power deviation caused by f i . Attackers can mislead the controller by compromising the input data of the ACE. Considering the fact that the compromised ∆p f i can be rapidly detected by cross-checking the data with other normal ones, we only focus on FDI attacks on ∆P tm i in this paper.

Attack Templates of FDI Attacks on LFC
In this subsection, we discuss different types of false data injection attack on an LFC system. The typical fixed FDI attacks can be categorized into two types: [17]: • Exogenous attack: where D p represents the value of the data injection added to the measurements of tie-line power. • Scaling attack: where K p is the scaling attack parameter.
Due to the fixed parameters of typical FDI attacks, the features of compromised data can be exploited. Based on the classifier, defenders can distinguish the compromised data from the normal ones. In fact, sophisticated attackers can adjust injection parameters flexibly to achieve attack targets. In this paper, we further study flexible FDI attacks on ∆P tm i , which can be written as: where k p (t) and d p (t) are time-varying variables. By launching the proposed FDI attacks, the attacker can tamper the data of ∆P tm i in the current operating condition into the false data with characteristics of real data in other operating situations. Thus, the controller can be misled to issue control commands that are not applicable to the current operating situation. It is necessary to relate the true data of tie-line power to accessible known-secured variables under the current operating situation.

Design of an Observer for Detecting Tie-Line Power Considering Uncertainties
In this section, an observer is designed to detect tie-line power based on accessible known-secured variables. Since system frequency is a global variable, the frequency of each position in the area is the same. When the attackers compromise the frequency measurement device in one place, the defender can cross verify the frequency measurement value in other places. Therefore, we utilize the system frequency as a known-secured variable and establish the following observer: where z represents the state vector of the dynamic system (10);x i represents the observation of x i ; and W i , T i , Y i and N i are the gain matrices with appropriate dimensions. Let e = x i −x i , and using the output equation in (10), we have Using (1), (10), and (11), we can derivė Considering that x i = e +x i = e + z i + N i y i , (12) can be expressed aṡ If the following relationships can be held: we can derive the following observation error: Based on the theory proposed in [26], the necessary and sufficient conditions for the existence of the observer are as follows: (1) rank (C i F i ) = rank(F i ). The special solution is

Theorem 1.
There exists a sub-optimal robust observer for the LFC system discussed in this paper when the following two conditions are satisfied: (1) There exists γ > 0 such that where (2) There exists a positive definite matrix P and Q, such that where Proof. Taking the following Lyapunov function: Using (1)-(4), (19) and (22), we can derivė where δ a and δ b are positive scalars. Letting β = [x i e α T ] T , we can derive: where If the aforementioned two requirements are satisfied, the system satisfies the Lyapunov stability criteria. The proof is completed.
Based on the proposed observer, we can derive the observation value ∆p to i of the tie-line power ∆P t i . Considering uncertain communication delay and noise in the process of transmission to the defense center, there is deviation between the measured data and the observed data received by the defender, which can be written as where di f f (t) represents the deviation between the measured data and the observed data; ∆P td i (t) is the observed data received by defender; τ is the communication delay; and N d (t) is the communication noise. This deviation also exists when the system is not compromised. Defenders cannot judge if this deviation is caused by the observer or the FDI attacks. Therefore, the similarity between the observed and real data should be further considered before applying the observed data for attack detection. In the next section, the similarity is studied.

Siamese-Network-Based Attack Detection for FDI Attacks on LFC
Considering the communication delay and noise, the proposed attack detection scheme is realized by comparing the signal similarity between the observed data and the measured data. In this section, a Siamese network is adopted to extract features for the similarity between measured data and observed data.

Network Structure
The structure of the proposed Siamese network for attack detection is depicted in Figure 2. The Siamese network consists of two symmetrical branches that share equal weights (EW). Sharing equal weights can effectively reduce the training parameters in the training process. The structure of each branch consists of four full connect (FC) layers and rectified linear units (ReLUs). The function of FC layers is to map the original data to the hidden layer feature space. The output produced by the FC layer is the hidden feature of the sample data. We use many neurons to fit the features of the input data. Generally, single-layer FC does not have the ability of nonlinear expression. Therefore, we increase the number of layers of FC to enhance its nonlinear expression ability. In each FC layer, the number of elements is equal to the dimension of sample data. The ReLUs, which can alleviate the over fitting problem of the Siamese network, are defined as After that, the input data (measured data and observed data) are transformed into two sets of feature vectors. Then, the two sets of vectors are transmitted to the loss layer to quantify the distance.
We input the observed data and the true data into the Siamese network as the input pair. When it is a positive sample, the calculated distance of the input pair should be smaller than that of the negative input pair. Due to the equal weights and ReLUs, the features caused by communication delay and noise can be mitigated during the training process.

Cluster-Based Loss Function
The loss function in the loss layer is designed to calculate the distance between the features of the observed data and that of the measured data. The distance can be further output as positive label or negative label through binary constraints. The distance with a positive label represents the similarity of the positive pairs (observed data and normal data). The distance with negative label represents the similarity of the negative pairs (observed data and compromised data). The distance between observed data and normal data should be less than that between observed data and compromised data, which can be written as: where a o is the observed data; a n is the normal data; and a c is the compromised data. Therefore, differences lie in the positive pairs and the negative pairs should be fully exploited in the loss function. Therefore, differences lie in the positive pairs (observed data and normal data) and the negative pairs (observed data and compromised data) should be fully exploited in the loss function. Notice that the observed data and normal data are usually highly correlated when the load disturbance occurs, which makes it possible to cluster the positive pairs. In this paper, we focus on the cluster of positive pairs when designing the loss function. The proposed cluster-based loss function aims to encourage the features in positive pairs to be close and push the ones in negative pairs far away. The cluster center of the positive data can be defined as: f (a n m ) (29) where M is the number of the normal samples; f (a n m ) is the vector output from the FC layers. Considering that the parameters of the injection data are flexible, it is difficult for the input samples to cover the characteristics of all types of injection data. In the proposed cluster-based loss function, a concentric-circles model is used to improve the ability to detect the unknown type of injection data. Two margins between positive pairs and negative pairs are used: ξ min is used to increase the distance between different types of pairs, and ξ max is used to make positive pairs more compact. The loss function can be defined as: where where f (a n F ) represents the farthest normal data of tie-line power. It can be learned that L 1 is used to measure the distance of negative pairs and positive pairs. If L 1 ≤ 0, the distance of negative pairs is far enough to positive pairs. L 2 is used to measure the distance of positive pairs and the cluster center. If L 2 ≤ 0, the distance of positive pairs is close enough to the cluster center. When L 1 ≤ 0, L 2 ≤ 0, negative pairs can be effectively separated from positive pairs. Intuitively, L 1 > 0 or L 2 > 0 means that the function (28) is not satisfied and a positive loss value is generated. Then, the following gradient equations are used to guide the training direction in the process of training. That is to say, these equations are used to guide L 1 , L 2 from (L 1 > 0 or L 2 > 0) to (L 1 ≤ 0, L 2 ≤ 0). The gradient of the positive pairs G n can be expressed as The gradient of the positive pairs G c can be expressed as The gradient of the positive pairs G F can be expressed as

Attack Detection Scheme for FDI Attacks on LFC
The procedures of the attack detection scheme are as follows: • Step 1: Generate the training data set. Load the historical tie-line power data under different operating conditions as the normal data. Based on (7)-(9), the data set of compromised tie-line power data can be generated using the method proposed in Section 3. • Step 2: Transfer the training data in the form of data pairs to the Siamese network for training. • Step 3: Using the high dimensional features obtained by FC layers to calculate the similarity between observed data and measured data. Loss function is used to make positive pairs compact and negative pairs far away from the positive pairs. • Step 4: Sample the incoming data pair, which could be compromised potentially or normal load disturbance. By checking the high dimensional features of the data pairs, the status of the RTU for tie-line power can be identified.

Simulations and Analysis
In this section, simulations are implemented to illustrate the feasibility of the proposed detection scheme on the LFC system. As is shown in Figure 3, an IEEE 39-bus 10-unit power system is used as the tested system. The data of the system can be found in [27,28]. The red block represents the compromised area (Area i). Based on the Formulas (2)-(4), it is assumed that the uncertainties of the system studied in this simulation environment are as follows:

Performance of the Observer for the Compromised LFC System
Based on the method studied in Section 3 and the parameters of the system, the observer gains for the tie-line power of the compromised area i can be calculated as follows: It can be learned that the dynamic features of real data can be reflected by that of observed data when the system is compromised by the aforementioned types of FDI attacks. The defender can detect attacks based on the dynamic feature similarity between the observed data and the true data. Although the characteristics of the observation error are different when the system is under different attacks, the observation error tends to be small in the long-term range, which means that the observed data are closer to the true data in the case of a long sample time.

Performance of the Proposed Attack Detection Scheme
In this subsection, we evaluate the performance of the Siamese network used to detect FDI attacks. The batch size of the Siamese network is chosen as 20. Let ξ max = 2 and ξ min = 1. Training samples contain 900 historical normal sample data and 300 compromised data. As for the compromised data, we set the value templates of the exogeneous attacks from 0.01 p.u. to 5 p.u. and set the value templates of the scaling attacks from 0.01 to 5. Each sample contains 60 s of tie-line power data. In addition, 3000 observed sample data including 1500 samples of the aforementioned three types of FDI attack templates are generated as test samples.
To illustrate the advantages of the FDI attack detection scheme studied in this paper, we choose the following five methods for comparison: (1) The proposed attack detection scheme using a cluster-based loss function (Method-A); (2) the proposed attack detection scheme using triplet loss function (Method-B) [29]; (3) the detection method using multilayer perception (Method-C) [17]; (4) the detection method using clustering-particle swarm optimization (clustering-PSO) (Method-D) [30]; and (5) the ACE forecasting method (Method-E) [15].
True positive rate (TPR) and true negative rate (TNR) are utilized to evaluate the performance of these five methods: where TP, FP, TN, and FN are the correctly detected positive samples, incorrectly detected positive samples, correctly detected negative samples, and incorrectly detected negative samples, respectively.  From Figures 7 and 8, it can be learned that the proposed attack detection scheme achieves higher TP rate and TN rate than the detection method using multilayer perception and that using clustering-PSO. In particular, when the system is compromised by flexible attacks, the proposed detection scheme has more prominent advantages than these two methods. This is because the proposed scheme is trained based on the relationship between observed data and true data. The detection method using multilayer perception and that using clustering-PSO are trained based on features of true data, which can be easily imitated by flexible attack. The lower TP rate of the ACE-forecasting method stems from the prediction errors.

Reliability of the Proposed Attack Detection Scheme
In this subsection, we evaluate the reliability of the proposed attack detection scheme by considering four safe factors: safe SNR, safe delay, safe number of training samples, and safe margin difference. To quantify reasonable safe levels which could guarantee certain detection performance, we establish the relationship between the minimum of the safe factors and threshold for detection performance. S r is used to represent the threshold for detection performance, which can be expressed as: Safe SNR considering different S r and different attack templates are In Table 1. It can be learned that the safe SNR increases with the increase of S r . The impact of attack type on safe SNR is less than that of S r . When S r is at a high level, the safe SNR is basically the same. When S r is at a low level, the safe SNR under different attacks begin to differ.  Table 2. Different attack types perform almost the same under different S r . This is because, when the time span of the data sample is long, the short time delay is difficult to change the main characteristics of the data.  Table 3. It can be seen that the proposed detection scheme does not require a high number of data samples considering the scale of historical data of power systems. Among them, the proposed flexible attack requires a little higher data size. This is because it is more diverse, and a small number of samples can not effectively cover all cases. A safe margin difference considering different S r and different attack templates is in Table 4. As the margin difference increases, S r increases. The marginal benefit of the method of increasing S r by increasing the margin difference is reduced. This is because the test data outside the margin are limited. Different attack types perform almost the same under different S r . This is because the probability of testing data outside the margin is almost the same for different attack types.

Conclusions
A novel detection scheme of cyber attacks on a load frequency control system is studied in this paper. We design an observer of the tie-line power based on known-secured variables to track the dynamic features of the tie-line power. The designed observer can achieve the observation tie-line power when the system is under different types of FDI attacks. The observed data and the measured data of tie-line power are combined into the input pairs of the Siamese network to achieve attack detection. The simulation results illustrate that the proposed attack detection scheme is feasible under mid or little SNRs. Data Availability Statement: Publicly available datasets were analyzed in this study. This data can be found here: [27,28].