Learning-based power grid FDIA identification method and device and medium
Through the learning-based FDIA identification method, Deep SVDD and the improved ResNet18 model are used to solve the identification and positioning of FDIA attacks in the power grid, especially under highly unbalanced data conditions, and efficient and accurate identification and positioning effects are achieved.
Patent Information
- Application Number
- CN202411503200.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art has problems with insufficient information utilization and difficulty in locate specific attack locations when identifying FDIA attacks in the power grid, especially under highly unbalanced data conditions.
A learning-based FDIA recognition method is proposed, using benign historical data training detectors and damaged data training locators, and using Deep SVDD and improved ResNet18 model for global detection and fine-grained positioning.
Effective FDIA identification and positioning under highly unbalanced data conditions is achieved, and the limitations of traditional methods in data-driven and positioning accuracy are overcome, and the accuracy and robustness of recognition are improved.
Smart Images

Figure CN119397523A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power generation prediction in a wind power plant of an electric power system, and in particular to a method, a device and a medium for identifying FDIA of a power grid under highly unbalanced data conditions. Background Art
[0002] With the continuous development of smart grids, modern power systems are gradually transforming into cyber-physical systems (CPS). CPS is associated with complex adaptive systems such as deeply coupled power grids and networks. Smart computing and frequent communications have potential negative effects, as cyber attacks against the network may be introduced into the power system, increasing security risks. Since the power system is a critical infrastructure, the threat of cyber attacks requires special attention.
[0003] Cyberattacks that manipulate measurement data to change its behavior pose a significant threat to the integrity of the system, which may cause system failures or blackouts. One of the most powerful attacks is FDIA due to its strong deception and masking capabilities. FDIA may pollute the results of the power system state estimation (SE) process by introducing bad data in meter measurements, resulting in serious erroneous operations. Therefore, FDIA attacks must be detected and located in a timely manner to mitigate their impact on grid operations.
[0004] The traditional FDIA identification method is to determine a hypothesis test threshold for the SE residual, which is usually equipped with a measurement device and used as a bad data detector (BDD). However, FDIA can evade the detection of BDD by corrupting the measurement results while allowing the residual to remain below the threshold. Recent research has developed advanced methods to address this problem, which can be divided into two categories: model-based and learning-based. Model-based methods apply classical models to describe the operating state of smart grids. Some inventions use weighted least squares methods for steady-state models that are insensitive to fluctuations. However, this is not enough in practice when dealing with dynamically fluctuating power systems. In order to address random effects, dynamic modeling methods such as Kalman filters (KFs) are used, which are online parameter estimation tools. Some inventions have also developed distributed KFs to accelerate complex calculations. However, model-based methods often ignore the previous state of the grid, which affects the system state that depends on current and previous system measurements.
[0005] Therefore, existing methods may have the problem of insufficient information utilization and there is still room for improvement. Machine learning-based methods are gaining more and more attention as potential solutions to the above problems. These methods are completely data-driven and use machine learning or deep learning techniques to classify data into two categories: damaged (FDI attack) and benign (unattacked). Support vector machine (SVM) is a commonly used FDIA binary classification method and is favored due to its simplicity. However, SVM faces challenges related to the correct kernel function selection and limited computing resources, and also encounters difficulties in processing high-dimensional data with complex patterns. Deep learning has become a popular method due to its ability to extract meaningful information from complex data. Convolutional neural networks (CNNs) are considered for FDIA detection because they can process data in parallel and allow real-time calculations. Many studies use autoencoders (AEs), which minimize the reconstruction error between decoded samples and input samples, to achieve unsupervised FDIA detection, that is, detecting the presence of FDIA (with binary output). There are inventions that combine stealth attack strategies with deep autoencoder Gaussian mixture models to detect FDIA. There are inventions that apply denoising AE to detect FDIA in industrial IoT. Some inventions use stacked AE networks and trainable clustering algorithms to achieve self-supervised FDIA detection. However, these methods generally detect the presence of FDIA but cannot point out the specific attack location. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention proposes a learning-based FDIA identification method, which is applied to highly unbalanced power grid data conditions, including
[0007] Obtain the benign historical data and damaged data of the power system operation, train the detector with the benign historical data to obtain the hypersphere H, and train the locator with the damaged data;
[0008] The detector receives real-time data of the power grid and maps it to a high-dimensional space, and the data mapped outside the radius H of the hypersphere is determined to be FDIA;
[0009] The locator locates the attack position of the data determined to be FDIA, and generates a binary vector output to identify the specific position of the FDIA.
[0010] A further technical solution of this embodiment is that the detector is configured as a Depp SVDD method, and in the stage of performing FDIA detection by the trained detector, the following steps are further included:
[0011] Performing data preprocessing on the benign historical data;
[0012] Representation learning for FDIA;
[0013] Model learning for detectors;
[0014] Calculate the anomaly score of the measured samples.
[0015] A further technical solution of this embodiment is that the data preprocessing of the benign historical data includes the following steps:
[0016] Exclude outliers: Use the 3-sigma statistical method to exclude obviously abnormal values in the benign historical data. For each meter, if its corresponding measurement value exceeds the range of (u-3o, u+3o), the value will be regarded as an abnormal measurement point and eliminated; where u and o are the mean and standard deviation of the benign historical data, respectively;
[0017] Handling missing values: Sampling the measurement data of the estimated state at preset intervals, and filling the missing points with the average of several temporally adjacent sampling points;
[0018] Data normalization: Use the maximum and minimum normalization method to normalize the data so that the minimum value is mapped to 0, the maximum value is mapped to 1, and all other values are scaled proportionally between the two points, as shown in the following formula:
[0019]
[0020] Where z represents the measurement data of the power grid monitoring instrument.
[0021] A further technical solution of this embodiment is that the representation learning of FDIA includes the following steps:
[0022] Improved ResNet18 model by replacing 2D convolutional layer with 1D convolutional layer for FDIA recognition;
[0023] Given a measurement vector z∈Rn of any time slot, where n is the number of meters, the improved ResNet18 model processes it in the following way:
[0024]
[0025] Where W represents the learnable parameters and h is the learned representation. Specifically, every two layers form a residual module R', which is calculated as follows:
[0026]
[0027] Where W and h represent the representation of parameters and module output respectively, ho is z, and L is the number of residual modules;
[0028] The representation of the last module is successively fed into an average pooling layer and a linear layer to obtain the desired dimension h of the final representation.
[0029] A further technical solution of this embodiment is that the model learning of the detector includes the following steps:
[0030] Using Deep SVDD, let z = (z1, ..., zn) ∈ Rn be the input measurement data and F ∈ RP be the output space. The parameters W of the improved ResNet18 model are learned by minimizing the radius R>0 of the data enclosing the hypersphere centered on c ∈ F. The goal is to minimize the following soft boundary loss function:
[0031]
[0032] Among them, the first term is to minimize the hypersphere, the second term is to avoid the penalty of overfitting with the hyperparameter X, and the third term jointly requires the imposition of a penalty on data points that exceed the boundary of the given sphere space, and β is a balance parameter.
[0033] A further technical solution of this embodiment is that the calculation of the abnormality score of the measurement sample includes the following steps:
[0034] Through the trained Deep SVDD model, the data sample to be detected is converted into a representation h embedded in the feature space F, and the anomaly score is defined as follows:
[0035]
[0036] Here, c and R are the center and radius of the learned normal shell, respectively, and a percentile threshold based on historically calculated scores is used to distinguish between benign data and FDIA. Samples with scores below the threshold are considered benign, and high anomaly scores above the threshold indicate the presence of FDIA.
[0037] A further technical solution of this embodiment is that the locator is configured as an improved ResNet18 model.
[0038] A further technical solution of this embodiment is to further include adjusting the positioner, including the following steps:
[0039] Copy and share the improved ResNet18 model parameters in the detector to the locator, and then freeze the parameters of the bottom residual module of the ResNet locator so that only the top-level parameters are updated when training the locator;
[0040] The output representation of the locator is fed into multiple linear layers with ReLU as the activation function to obtain the result of an n-dimensional binary vector for judging whether it is a FDIA, where n represents the potential FDIA target. The ResNet locator is trained using the damaged data with grid-truth annotations, and the training goal is to minimize the binary cross entropy loss function:
[0041]
[0042] The predicted probability pj of the jth instrument as a FDIA target is compared with the ground truth attack target, represented by a binary variable ji∈0,1, where yi=1 if it is an attack target and yi=0 otherwise.
[0043] This embodiment also proposes a learning-based FDIA recognition device, including:
[0044] A training module, which is used to obtain benign historical data and damaged data of the power system operation, train the detector through the benign historical data to obtain the hypersphere H, and train the locator through the damaged data;
[0045] A detection module, which is used for the detector to receive real-time data of the power grid and map it to a high-dimensional space, and the data mapped outside the radius H of the hypersphere is determined to be FDIA;
[0046] The positioning module is used for the locator to locate the attack position of the data determined to be FDIA, and generate a binary vector output to identify the specific position of the FDIA.
[0047] The present invention also provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned learning-based FDIA identification method is implemented.
[0048] The beneficial effects of this technical solution are:
[0049] This paper proposes a two-stage FDIA decentralized framework that formulates the problem as global detection and fine-grained localization. Following this paradigm, a new method is designed to use Deep SVDD to partition attacked and benign measurements in the power grid in an unsupervised manner, and use an improved one-dimensional ResNet to locate the attack target when FDIA is detected. The present invention can overcome the limitations of data-driven methods under infrequent FDIA, thereby achieving effective and robust FDIA identification. Case studies on IEEE standard 14-node system and 118-node system demonstrate the effectiveness and superiority of the present invention and bridge the gap between simulation and reality. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0051] Figure 1 A schematic diagram of the steps of a learning-based power grid FDIA identification method of the present invention;
[0052] Figure 2 A detailed step diagram of a learning-based power grid FDIA identification method in an embodiment of the present invention;
[0053] Figure 3 It is a structural diagram of a learning-based power grid FDIA identification device in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the well-known modules, units and their connections, links, communications or operations are not shown or described in detail. In addition, the described features, architectures or functions can be combined in any way in one or more embodiments. It should be understood by those skilled in the art that the various embodiments described below are only for illustration and not for limiting the scope of protection of the present invention. It can also be easily understood that the modules or units or processing methods in the various embodiments described herein and shown in the drawings can be combined and designed according to various different configurations. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0055] Existing learning-based methods model FDIA recognition as supervised multi-label binary classification, which suffers from important limitations under the highly imbalanced data in the real world:
[0056] (1) Shortcut Learning: Real-world data imbalance and rare FDIA mislead binary classification-based methods to focus on the majority class. By always predicting the majority class, the model can easily achieve high accuracy, so the model will learn shortcuts instead of meaningful information.
[0057] (2) Simulation-Reality Gap: Some studies force the model to learn the attacked data patterns by simulating frequent attacks during training. However, this leads to a distribution gap between simulated training data and real-world data, resulting in poor generalization ability and practicality in real-world scenarios.
[0058] (3) Over-annotation: Traditional methods recognize every node / branch at every time slot, requiring a large number of high-quality labels to be annotated by experienced practitioners. This label dependence has been a bottleneck in putting supervised FDIA recognizers into practice. However, due to the rarity of the attack, this labor-intensive annotation is futile.
[0059] Since many problems in existing research are caused by highly unbalanced data, this embodiment uses this feature instead of imposing assumptions about data balance. For this purpose, a two-stage paradigm for FDIA identification is proposed, which expresses this problem as follows:
[0060] (1) Unsupervised FDIA detection: Detecting whether FDIA exists in a global view by modeling data normality from a large amount of benign data;
[0061] (2) Fine-grained FDIA localization: Determine the target branch / node of the FDIA when the FDIA exists by learning meaningful information from historically damaged data; in this way, the first stage avoids shortcut learning by encouraging learning normal patterns, not to mention generating simulated data that does not conform to the actual distribution. Since only the second stage requires a small number of labels, this embodiment reduces the annotation work. Based on this paradigm, a new FDIA identification method is designed, using ResNet to learn data representation and utilizing Deep SVDD for unsupervised single-class classification in the first stage. The second method also uses a similar ResNet with shared learning weights to locate the attack target based on the detected FDIA. Specifically, this application proposes a two-stage method for power grid FDIA identification under highly unbalanced data conditions. The method includes two stages: detection and localization. The detector is trained with benign data, while the locator is trained with labeled damaged data. During the inference process, the input measurement value is first processed by the detector. After the FDIA is detected, the locator is activated to identify the attack target by generating a binary vector output; that is,
[0062] S1 obtains the benign historical data and damaged data of the power system operation, trains the detector with the benign historical data to obtain the hypersphere H, and trains the locator with the damaged data;
[0063] S2: the detector receives the real-time data of the power grid and maps it to a high-dimensional space, and the data mapped outside the radius H of the hypersphere is determined to be FDIA;
[0064] S3: The locator locates the attack position of the data determined to be FDIA, and generates a binary vector output to identify the specific position of FDIA.
[0065] The following is a detailed description:
[0066] The detection stage is mainly used to perform global FDIA detection on the power grid, aiming to detect the existence of FDIA by distinguishing damaged data from benign data on a global scale. This embodiment formulates the problem as a one-class classification, which can utilize the rarity of FDIA and avoid prioritizing fitting data of the main category. This stage includes four steps: data preprocessing of the benign historical data; representation learning of FDIA; model learning of the detector; and calculation of the anomaly score of the measurement sample.
[0067] As a preferred solution but not a limitation, the step of performing data preprocessing on the benign historical data includes: in the context of detecting FDIA in the smart grid, the data preprocessing involves several steps. The first step is to exclude obviously abnormal values in the benign data. The basic 3-sigma statistical method is used. For each meter, if its corresponding measurement value exceeds the range of (u-3o, u+3o), the value will be regarded as an abnormal measurement point and eliminated. Here, u and o are the mean and standard deviation of the historical benign data, respectively. Therefore, this embodiment can delete abnormal values that may distort further analysis. The second step is to handle missing values. The measurement data of the estimated state is sampled at a constant interval, so the average value of five temporally adjacent sampling points is used to fill the missing points. Finally, the data is normalized using the maximum and minimum normalization method, which involves scaling the data so that the minimum value is mapped to 0 and the maximum value is mapped to 1, and all other values are scaled proportionally between these two points, as shown in Equation 2:
[0068]
[0069] Where z represents the measurement data of a certain instrument.
[0070] As a preferred solution rather than a limitation, the steps of representation learning for FDIA in the present method are as follows. The data-driven method attempts to learn representations from inputs for further analysis. Therefore, this embodiment requires a powerful and effective representation learner to handle FDIA attacks under complex and changing conditions in smart grids. ResNet18 is a variant of the residual network architecture family based on convolutional neural networks. It consists of 18 layers, including convolutional layers, pooling layers, and fully connected layers. The key innovation of ResNet is the residual connection, which allows information to bypass some layers in the network, which helps to alleviate the problem of gradient vanishing in very deep networks because gradients can be propagated through shortcut connections. ResNet18 is effective in large-scale graphs. The state-of-the-art performance in classification has been achieved. This embodiment borrows the idea of ResNet18 from the computer version and performs FDIA recognition by replacing the 2D convolution layer with a 1D convolution layer. This method applies convolution operations along one-dimensional spatial dimensions. The deep architecture of ResNet, with its skip connections and nonlinear activation functions, can capture complex interactions and learn meaningful representations by adapting to and learning complex high-dimensional data. This enables ResNet to extract distinguishing features, which are crucial for identifying FDIA attacks under the ever-changing conditions of smart grids. Given a measurement vector z∈Rn for a certain time slot, where n is the number of meters, 1DResNet processes it in the following way:
[0071]
[0072] Where W represents the learnable parameters and h is the learned representation. Specifically, every two layers form a residual module R', which is calculated as follows:
[0073]
[0074] Where W and h represent the representation of parameters and module output respectively, ho is z, and L is the number of residual modules, usually a dozen or dozens. After that, the representation of the last module is fed into an average pooling layer and then a linear layer to obtain the desired dimension h of the final representation. It can be understood by those skilled in the art that other representation learners besides ResNet can also work, but the ResNet model performs better by alleviating the problem of complex data collected by grid meters.
[0075] Specifically, the model learning steps of the detector in this method are as follows: Since FDIA detection should be unsupervised, the challenge lies in how to set goals for model training. This method models FDIA detection under highly imbalanced data as a single classification problem. SVDD is a single-value classification algorithm for anomaly detection that can be used as a solution
[22] . Its working principle is to map non-target data from the original space to the feature space through a nonlinear transformation function, and then find the smallest hypersphere in the feature space that contains all non-target data. It aims to minimize the volume of the hypersphere while enclosing all non-target data. After constructing the hypersphere, any data outside the hypersphere is marked as anomaly. It is assumed that outliers are located in low-density areas, so there is no need to strictly restrict the purity of training data, that is, a small amount of damaged data is allowed to be mixed with benign training data. Although SVDD is a powerful tool, its kernel-based transformation function may not be sufficient to handle complex data in large-scale smart grids. Deep SVDD overcomes this limitation by using deep learning models for transformation, which has achieved great success in cancer detection and other related anomaly detection subfields.
[0076] Furthermore, let z = (z1, ..., zn) ∈ Rn be the input measurement data and F ∈ RP be the output space. Using DeepSVDD, we can learn the parameters W of the improved ResNet by minimizing the radius R>0 of the data enclosing the hypersphere centered on c ∈ F. The goal is to minimize the following soft boundary loss function:
[0077]
[0078] The first term is to minimize the hypersphere, the second term is to avoid overfitting with the hyperparameter X, and the last term jointly requires a penalty for data points that exceed the boundary of the given sphere space. The hyperparameter represented by β adjusts the balance between the volume of the sphere and the degree of exceeding the boundary. This ResNet-authorized Deep SVDD is used to build a detection model.
[0079] As a preferred solution but not a limitation, the step of calculating the anomaly score of the measurement sample includes detecting FDIA by finding the measurement sample with a high anomaly score after creating a boundary hypersphere to define the normality shell. To achieve this, the method utilizes the previously trained ResNet-Deep SVDD model, which converts the data sample to be detected into a representation h embedded in the feature space F. The anomaly score is defined as:
[0080]
[0081] Where c and R are the center and radius of the learned normal shell, respectively. In order to distinguish between benign data and FDIA, a percentile threshold based on historically calculated scores is used in this method. Samples with scores below the threshold are considered benign. High anomaly scores above the threshold indicate the presence of FDIA, which triggers an alarm and forwards the data for downstream positioning. However, the consequences of missing FDIA alarms are more serious than false triggering of alarms. This method enables the locator to exclude any instrument location as a potential target for attack, which is equivalent to having no FDIA. This provides an opportunity to correct false alarms in subsequent stages by setting a strict a to minimize the possibility of missing any attack.
[0082] The second stage specifically refers to the positioning stage of FDIA. The training process of the Resnet-based locator in this method is as follows:
[0083] The FDIA localization stage is a multi-label binary classification that aims to identify specific targets of FDIA based on the instrument location. The localizer is only activated when the detector is triggered and operates on preprocessed measurement data containing suspicious values. Therefore, the training of the localizer does not require a data preprocessing step, but requires representation learning, which can still apply the modified ResNet as a representation learner in the previous stage. However, although detection and localization share the same representation learning process, it is inappropriate to directly use the first-stage ResNet for localization because the former is presence-oriented, while this ResNet should be location-oriented. However, the gap can be narrowed by fine-tuning. This technique involves using a pre-trained neural network model and then adjusting its parameters to adapt to the new task. Compared with training a new model from scratch, it has been shown to have higher accuracy and faster convergence speed, especially when the target dataset is relatively small. On the other hand, reusing the parameters of these two ResNet models can simplify the complexity of the model and save learning time. Therefore, this method proposes a novel dual architecture to implement this two-stage FDIA recognition framework.
[0084] Specifically, this embodiment first copies the ResNet parameters of the detection stage to the localization ResNet that shares the same network architecture, and then freezes the parameters of the residual module at the bottom of the ResNet locator, namely W1, W2, and WL-e. During the locator training, only the parameters of the top layer will be updated. Subsequently, the representation of the output of the ResNet locator will be fed into multiple linear layers with ReLU as the activation function. The result will be an n-dimensional binary vector indicating whether the corresponding meter is an FDIA target, where n represents the potential FDIA target. The localized ResNet is trained using the damaged data with grid-truth annotations, and the training goal is to minimize the binary cross entropy loss function:
[0085]
[0086] The predicted probability pj of taking the j-th meter as the FDIA target is compared with the ground truth attack target, which is represented by the binary variable ji ∈ {0, 1}, where yi = 1 if it is an attack target and yi = 0 otherwise. For N training data samples, both dual models can be trained in one session because the second training process only occupies a small amount of resources and requires training a small amount of training data. Therefore, the dual architecture is suitable for two-stage detection and localization tasks.
[0087] During the online inference process, once the upstream detector detects FDIA, the locator is activated to predict the attack probabilities of all possible FDIA targets and identify the fine-grained attack locations. If the predicted probability exceeds a predetermined threshold, it indicates that FDIA may exist at that location, and the operation engineer should check the situation and seek a solution in a timely manner.
[0088] The beneficial effects of the present application in power grid FDIA identification are outlined below through multiple embodiments:
[0089] Embodiment 1
[0090] The method of this embodiment was evaluated using two simulated data sets obtained from the IEEE standard 14-bus and IEEE 118-bus power systems using MATPOWER. Before injecting the attacks, a large amount of benign data was generated by simulating the load on each bus, following a normal distribution with a mean equal to the base load and a standard deviation equal to one-sixth of the base load, see
[19] . As described in 4.1, the data collected during the no-alarm period can be regarded as benign. After that, real-world data operations were simulated by injecting various types of FDIA, thereby generating corrupted data. Based on previous studies, this embodiment summarizes four typical FDIAs:
[0091] (1) Pulse: Short-term low / high value injection. This point-level attack only lasts for one time slot, while the other three types of attacks last for one cycle, denoted as (ts, te)
[0092] (2) Random: Inject data generated by a random function, modeled as Dc = D + λ·rand(t), where D represents the observed actual measurement value and Dc is the corresponding corrupted data with a scaling parameter λ.
[0093] (3) Ramp: Adjust the data level up / down through a ramp function. The model is Dc = (1 + λ·T(t))·D, where if ts < t < (ts + te) / 2, then T(t) = t - ts, otherwise T(t) = te – t.
[0094] (4) Scaling: Increase / decrease the data proportionally, which can be modeled as Dc = (1 + λ)·D, λ ∈ (0, 1).
[0095] This embodiment divides artificially injected attacks into two categories: attacks detected by traditional BDD and undetected attacks. Detected attacks are discarded to demonstrate the effectiveness of this method, which aims to identify FDIAs that evade BDD detection. A total of 45489 and 41775 damaged vectors were retained for the two IEEE power systems. This embodiment was run four times using four different data distributions, where the damaged data accounted for 0.25%, 0.5%, 0.75% and 1% of the total data. Even in systems without bridging edges, attackers with partial knowledge of the network topology can perform undetectable attacks. This attack can be optimized as a minimum cut problem that compromises a set of state variables with minimal topological knowledge. Specifically, the problem aims to partition a given undirected graph G = (2, E) into two non-intersecting vertex subsets to minimize the weight of the cut (i.e., the sum of the weights of the cut edges).
[0096] In this experiment, the number of attack targets for the IEEE 14-bus and IEEE 118-bus systems is determined by uniformly sampling a number from (1,5) and (1,10), respectively. The l2 norm of the compromised data and the actual measurement values is set to 1, and Gaussian white noise is added to simulate the measurement noise with a signal-to-noise ratio (SNR) of 90dB. In the unsupervised first stage, the training set, test set, and validation set are divided in a ratio of 7:2:1. The compromised data in the training set is used to train the second-stage model, and the ratio of the training, test, and validation sets for FDIA localization is close to 6:2:1.
[0097] Regarding model hyperparameters, this example sets the batch size to 128 and the initial learning rate to 0.0005. When using the Adam optimizer, it automatically adjusts the learning rate during training. This example only requires specifying the initial value. This example trains the model for 200 and 100 epochs, respectively, and implements an early stopping mechanism to prevent overfitting. This example determines the hyperparameter combination that achieves the highest validation F1 score for each control group. NNI supports hyperparameter tuning. Those skilled in the art will understand that NNI is a lightweight but powerful automated hyperparameter optimization toolkit.
[0098] At each time slot, the identifier outputs a binary vector to indicate the presence of FDIA at all possible locations. As mentioned above, accuracy = TP + TN is an inappropriate metric and is not applied here in this embodiment, where TN is a benign measurement of correct prediction. Since all data is highly unbalanced, accuracy can be misleading. For example, if a corrupted identifier believes that there is never a FDIA, it can still achieve an accuracy of more than 99% with less than 1% of the leaked data. Therefore, based on existing research, this embodiment uses three indicators to evaluate effectiveness:
[0099]
[0100] Where TP is the number of successfully identified FDIAs; FP is the number of falsely triggered alarms; and FN represents the number of undetected FDIAs at each location.
[0101] Table 1: Comparison of effectiveness of FDIA identification
[0102]
[0103]
[0104] As can be seen from Table 1, the method of this embodiment achieved the highest scores in all evaluation indicators, far outperforming all control group models. It is worth noting that the method of this embodiment obtained F1 scores of 0.9908 and 0.9907 in the IEEE 14-bus and 118-bus systems, respectively, which are an average improvement of 29.04% to 213.98% compared with the supervised control group. The extremely high F1 score indicates that the method of this embodiment can detect all four types of FDIA. The learning-based method of this embodiment can learn the basic representation behind the observations, rather than a simple linear relationship, so as to detect FDIA that is not detected by BDD, rather than applying naive rules to the observations like BDD.
[0105] In addition, the effectiveness of the method of this embodiment, especially minimizing missed or false positives, is demonstrated by its high recall and precision. The method of this embodiment is not only sensitive to FDIA, but also ultimately saves engineering resources, with a recall of 46.91% to 324.86% higher than the control group model, and a precision of 6.07% to 100.01% higher than the baseline model. The poor generalization performance of the baseline model in detecting FDIA is due to the highly unbalanced data, as they tend to overfit the majority class and predict the negative class more frequently, resulting in low recall. Although the baseline model performs well in terms of precision, the key minority class examples, i.e., the damaged data, are not given enough weight. The method proposed in this embodiment achieves a balance between recall and precision, and both scores are very high. On the other hand, as the system scale increases from 14 buses to 118 buses, the performance of the studied methods generally decreases to varying degrees. Specifically, in terms of F1 score, all other methods except MLP decrease by 0.46% to 20.07%, while the method of this embodiment decreases by less than 0.01%. Although the recall rate of the baseline (excluding MLP) decreases by -1.13% to 27.30% as the system scale increases, the method of this embodiment improves the recall rate and shows excellent performance in 14-bus and 118-bus systems for all three indicators. Therefore, this embodiment concludes that the scalability of the method proposed in this embodiment meets the needs of accurate FDIA identification on various system scales.
[0106] ResNet performs the best among all competitors and is the only one comparable to this embodiment. However, it is worth noting that all competitors, including ResNet, require labels for the entire dataset, with more than 35 million fine-grained labels for each potential FDIA location. In contrast, the method proposed in this application requires less than 1% of the labels, less than 20,000 in total. It can be seen that the number of labels required by the method of this embodiment gives it an incomparable and irreplaceable advantage in practical applications.
[0107] Example 2
[0108] Since the study of this embodiment is the first to propose a two-stage framework that only requires a small number of labels, there is currently no method that can achieve semi-supervised fine-grained FDIA recognition for comparison. In order to demonstrate the effectiveness of the framework proposed in this embodiment, this embodiment compares it with advanced supervised classification methods, including machine learning-based methods and deep learning-based methods, most of which have been applied in related work. For overall FDIA recognition, the control groups considered for comparison include conditional deep belief networks (CDBN), CNNs used in previous inventions, and SVMs, K nearest neighbors (KNNs), and random forests (RFs) in previous inventions. This embodiment also considers the decision trees (DTs) and multi-layer perceptrons (MLPs) mentioned in previous inventions, as well as traditional 1D ResNets in supervised settings; in terms of detection only, this embodiment compares the first-stage detector of the method of this embodiment with widely used unsupervised methods, which are specifically used to distinguish abnormalities from a large amount of normal data. These baselines were selected based on previous studies and include isolation forests, single-class SVMs, K-means, local outlier factors (LOFs), and CNN-based and MLP-based AEs.
[0109] Table 2: Comparison of effectiveness of global FDIA detection
[0110]
[0111]
[0112] As can be seen from Table 2, the method of this embodiment achieved high scores in all three indicators, with the lowest false positive rate and no missed attacks, significantly outperforming all baselines. It is worth noting that the proposed method shows an F1 score that is 9.78% to 276.15% higher than the baseline overall, and performs well in recall, indicating its effectiveness in identifying the presence of FDIA. Although engineers prefer false positives to missed attacks, in practice, too many false positives may take up a lot of resources and are undesirable. However, the high precision score of the method proposed in this embodiment shows that it strikes a balance between minimizing false positives and accurately detecting attacks.
[0113] In addition, the study shows that anomaly detection-based methods, including single-class SVM, IF, LOF, and AE, can distinguish rare anomaly data from a large amount of normal data, and outperform naive clustering-based methods such as K-means in identifying FDIA. This finding confirms the core argument of this paper that FDIA identification should not be viewed as a binary classification problem due to the highly imbalanced data, and anomaly detectors are more suitable for the first stage of FDIA identification.
[0114] Example 3
[0115] This example evaluates the robustness of the proposed method to noise. The complexity of modern power grids induces complex dynamic changes, and the non-stationary and noisy nature of the measurements poses a challenge to the accurate detection of FDIA. To simulate this situation, Gaussian white noise with zero mean and varying standard deviation (ranging from 0.1 to 0.5) is added to the normalized measurements. Since only RF, CDBN, CNN, and ResNet can produce comparable results in this section, this example excludes other methods from this evaluation.
[0116] Table 2 shows the F1 scores of the proposed method and comparable methods at different measurement noise levels. The results show that both the proposed method and the competitive methods exhibit significant stability, emphasizing the robustness of data-driven techniques, especially the proposed method. This finding strengthens the feasibility of deploying and implementing the proposed method in practical applications.
[0117] In addition, there is no obvious correlation between the effectiveness of FDIA identification and the standard deviation value of noise. The performance fluctuation is partly attributed to the stochastic nature of data-driven methods. Overall, noise has little impact on the performance of these methods.
[0118] Example 4
[0119] Since the present invention adopts a parameter sharing mechanism, the two-stage framework proposed in this embodiment can be trained in one training. This example shows the efficiency of the method of this embodiment in detail. Figure 3 The average training and inference time are shown, reflecting the efficiency of the FDIA identifier. The inference delay is negligible because all mentioned methods can provide near real-time detection results (less than 1 second). In addition, the training time of the method of this embodiment is acceptable compared to the baseline, and since the method of this embodiment adopts a lightweight and parallelizable structure, offline training can be accelerated with more computing resources. In general, this embodiment is concerned with inference efficiency rather than training efficiency because the FDIA identifier must provide timely results for incoming data. This embodiment found that the method of this embodiment is effective in both training and inference. Efficiency is closely related to its industrial prospects.
[0120] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0121] The present invention also provides a learning-based FDIA identification device 100, including a training module 110, which is used to obtain benign historical data and damaged data of the power system operation, obtain a hypersphere H through training the detector with the benign historical data, and train a locator with the damaged data; a detection module 120, which is used for the detector to receive real-time data of the power grid and map it to a high-dimensional space, and the data mapped outside the radius of the hypersphere H is determined to be FDIA; a positioning module 130, which is used for the locator to locate the attack position of the data determined to be FDIA, and generate a binary vector output to identify the specific location of the FDIA. The functions of the above-mentioned modules are completely corresponding to the aforementioned learning-based power grid FDIA identification method, and will not be repeated here.
[0122] The embodiment of the present invention further provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, a learning-based power grid FDIA identification method as described in the above embodiments is implemented.
[0123] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the method for rapid repair by mixing SDK versions as described above. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0124] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, RAM, ROM, magnetic disks or optical disks.
[0125] Corresponding to the above-mentioned computer storage medium, in one embodiment, a computer device is also provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a learning-based power grid FDIA identification method as described in the above-mentioned embodiments is implemented.
[0126] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0127] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A learning-based FDIA identification method, characterized in that: Application to highly unbalanced grid data conditions, including S1 obtains the benign historical data and damaged data of the power system operation, trains the detector with the benign historical data to obtain the hypersphere H, and trains the locator with the damaged data; S2: the detector receives the real-time data of the power grid and maps it to a high-dimensional space, and the data mapped outside the radius H of the hypersphere is determined to be FDIA; S3: The locator locates the attack position of the data determined to be FDIA, and generates a binary vector output to identify the specific position of FDIA.
2. The method according to claim 1, characterized in that The detector is configured as a Depp SVDD method, and in the stage of performing FDIA detection by the trained detector, the following steps are also included: Performing data preprocessing on the benign historical data; Representation learning for FDIA; Model learning for detectors; Calculate the anomaly score of the measured samples.
3. The method according to claim 2, characterized in that The data preprocessing of the benign historical data includes the following steps: Exclude outliers: Use the 3-sigma statistical method to exclude obviously abnormal values in the benign historical data. For each meter, if its corresponding measurement value exceeds the range of (u-3o, u+3o), the value will be regarded as an abnormal measurement point and eliminated; where u and o are the mean and standard deviation of the benign historical data, respectively; Handling missing values: Sample the measurement data of the estimated state at preset intervals and fill the missing points with the average of several sampling points adjacent in time; Data normalization: Use the maximum and minimum normalization method to normalize the data so that the minimum value is mapped to 0, the maximum value is mapped to 1, and all other values are scaled proportionally between the two points, as shown in the following formula: Where z represents the measurement data of the power grid monitoring instrument.
4. The method according to claim 2, characterized in that The representation learning of FDIA includes the following steps: Improved ResNet18 model by replacing 2D convolutional layer with 1D convolutional layer for FDIA recognition; Given a measurement vector z∈Rn of any time slot, where n is the number of meters, the improved ResNet18 model processes it in the following way: Where W represents the learnable parameters and h is the learned representation. Specifically, every two layers form a residual module R', which is calculated as follows: Where W and h represent the representation of parameters and module output respectively, ho is z, and L is the number of residual modules; The representation of the last module is successively fed into an average pooling layer and a linear layer to obtain the desired dimension h of the final representation.
5. The method according to claim 4, characterized in that The model learning of the detector includes the following steps: Using Deep SVDD, let z = (z1, ..., zn) ∈ Rn be the input measurement data and F ∈ RP be the output space. The parameters W of the improved ResNet18 model are learned by minimizing the radius R>0 of the data enclosing the hypersphere centered on c ∈ F. The goal is to minimize the following soft boundary loss function: Among them, the first term is to minimize the hypersphere, the second term is to avoid the penalty of overfitting with the hyperparameter X, and the third term jointly requires the imposition of a penalty on data points that exceed the boundary of the given sphere space, and β is a balance parameter.
6. The method according to claim 5, characterized in that The calculation of the abnormal score of the measurement sample includes the following steps: Through the trained Deep SVDD model, the data sample to be detected is converted into a representation h embedded in the feature space F, and the anomaly score is defined as follows: Here, c and R are the center and radius of the learned normal shell, respectively, and a percentile threshold based on historically calculated scores is used to distinguish between benign data and FDIA. Samples with scores below the threshold are considered benign, and high anomaly scores above the threshold indicate the presence of FDIA.
7. The method according to claim 4, characterized in that The locator is configured as a modified ResNet18 model.
8. The method according to claim 5, characterized in that Also included is adjustment of the positioner, comprising the following steps: Copy and share the improved ResNet18 model parameters in the detector to the locator, and then freeze the parameters of the bottom residual module of the ResNet locator so that only the top-level parameters are updated when training the locator; The output representation of the locator is fed into multiple linear layers with ReLU as the activation function to obtain the result of an n-dimensional binary vector for judging whether it is a FDIA, where n represents the potential FDIA target. The ResNet locator is trained using the damaged data with grid-truth annotations, and the training goal is to minimize the binary cross entropy loss function: The predicted probability pj of the jth instrument as a FDIA target is compared with the ground truth attack target, represented by a binary variable ji∈0,1, where yi=1 if it is an attack target and yi=0 otherwise.
9. A learning-based FDIA recognition device, characterized in that: include: A training module, which is used to obtain benign historical data and damaged data of the power system operation, train the detector through the benign historical data to obtain the hypersphere H, and train the locator through the damaged data; A detection module, which is used for the detector to receive real-time data of the power grid and map it to a high-dimensional space, and the data mapped outside the radius H of the hypersphere is determined to be FDIA; The positioning module is used for the locator to locate the attack position of the data determined to be FDIA, and generate a binary vector output to identify the specific position of the FDIA.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a learning-based FDIA recognition method as described in any one of claims 1 to 8 is implemented.