False data injection attack detection method and device based on federal learning and comparative learning, and storage medium
Through the federated learning and contrast learning methods, combined with exponential moving average method and time series data enhancement technology, the problem of false data injection attack detection in smart grids is solved, and effective detection in the unmarked data and multi-region data island scenarios is realized. Improves the recognition ability and robustness of the model.
Patent Information
- Application Number
- CN202411507346.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to effectively detect false data injection attacks in smart grids, especially under labeled data conditions. Due to the data island problem, the risk of overfitting of machine learning models is high, making it difficult to effectively collaboratively train among different regions.
Using a method based on federated learning and contrast learning, the power grid data is collected and preprocessed through the local center, the comparison learning model is used for local training, and the model parameters are uploaded to the control center for aggregation, and the global model is generated, and the local model is updated using the exponential moving average method. The model is finally trained to the binary classifier with a small amount of label data for detection of false data injection attacks.
Effectively capture subtle changes in the data, improve the ability to identify secret attacks, reduce data silos, enhance the generalization ability of the model, and improve the robustness and adaptability of the model through time-series data augmentation technology.
Smart Images

Figure CN119030798A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a false data injection attack detection method, device and storage medium based on federated learning and contrastive learning, belonging to the technical field of smart grid network security. Background Art
[0002] Smart grids are vital to modern society because they ensure a stable power supply to industrial and residential areas. However, their distributed nature makes them vulnerable to cybersecurity threats, including denial of service, malware injection, and time-delay attacks. Among these threats, false data injection attacks (FDIA) are particularly destructive to the monitoring and control of smart grids. The injected false data can mislead the state estimation process, which may have disastrous consequences such as equipment overload, line congestion, and large-scale power outages. Therefore, it is imperative to develop an effective detection mechanism for FDIA to protect smart grids.
[0003] With the widespread application of data-driven methods, machine learning has become a promising alternative for detecting FDIA. Machine learning can learn the unique patterns of these attacks, thereby enhancing the flexibility and generalization ability of FDIA detection models. However, the effectiveness of some machine learning methods is limited by their reliance on large labeled datasets. Since labeling FDIA data requires a lot of domain expertise and human and material resources, the data labeling process is both time-consuming and misleading.
[0004] The emergence of unsupervised learning offers the possibility to address the limitations of supervised machine learning methods. Recent studies have adopted unsupervised learning methods to detect FDIA, using techniques such as clustering, dimensionality reduction, and representation learning to identify attack patterns without relying on labeled instances. These methods allow the development of powerful detection mechanisms by leveraging the large amount of available unlabeled data. However, these unsupervised learning methods often have difficulty capturing subtle patterns in the data, making it difficult to establish decision boundaries and hindering the accurate identification of stealthy attacks.
[0005] On the other hand, in smart grids, companies in different regions usually maintain their unique datasets, which are not shared due to competition or regulatory issues, resulting in data silos. However, machine learning methods require a large amount of data to effectively learn their hidden features. Relying only on local data from a single region increases the risk of overfitting, thereby limiting the overall performance and generalization ability of the model. Many previous studies assume that the raw data from distributed areas can be transmitted to the control center, which is obviously not reliable in the scenario of smart grids. Therefore, there is a need for collaborative training of models without large amounts of remote data transmission. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a false data injection attack detection method, device and storage medium based on federated learning and contrastive learning to overcome the shortcomings of the prior art.
[0007] The technical solution of the present invention is: A first aspect: A false data injection attack detection method based on federated learning and contrastive learning, comprising the following steps: S1. The local center in each region collects the power grid data in the region and performs data preprocessing; S2. The local center downloads the initial neural network model with the same parameters from the control center and uses the preprocessed power grid data to perform local model training based on contrastive learning; S3. After the local center completes the local model training, it uploads the trained model to the control center, which aggregates the model parameters and generates a new global model. S4. The control center sends a new global model, and the local center updates the local model using the exponential moving average method and uses the updated model for training until the preset training rounds are reached; S5. Based on the trained local model, the local center uses a small amount of labeled data to train a binary classifier to detect false data injection attacks.
[0008] Specifically, the process of data preprocessing in step S1 is as follows: Consider the The power grid data set collected by the local center , for the sample data , using a size of The window from the sample The length extracted is Each fragment contains the current time point and the past The window slides forward from the current time point to extract the power grid data at each historical time point. Next, we use time series data enhancement technology to extract data from the sliding window. Generate two data augmented views and , ; in, The size is , for The length of time included, The number of attributes collected for the local hub.
[0009] Specifically, the local model training process in step S2 is as follows: Based on the data augmented view and , each local center independently learns its local grid dataset using an unsupervised contrastive learning model Representation: For , encode it using an online network in an unsupervised contrastive learning model to obtain a representation , where the online network includes an online encoder and online predictor ;for , encode it using the target network to obtain the representation , where the target network only contains the target encoder .
[0010] Specifically, the model aggregation method performed by the control center in step S3 is: First, each local center Set the parameters of the local online encoder and the parameters of the online predictor Upload to the control center; then, the control center will The weighted parameters are averaged with the dataset size to generate a new global online encoder and the global predictor : , in and They are Wheel global online encoder and the global predictor Parameters, and They are Round The parameters of the online encoder and online predictor are local centers, and M represents the total number of local centers.
[0011] Specifically, the method for updating the local model in step S4 is: After the control center completes model aggregation, it distributes the parameters of the global encoder and predictor to all local centers; each local center Use EMA to update its local online encoder and online predictor ,Right now: , in, and are the parameters of the online encoder and online predictor of the k-th local center in the t-th round, and its Round has not yet been Local centers have not been uploaded to the control center. is the momentum coefficient between 0 and 1.
[0012] Specifically, the specific method of step S5 is: Each local center uses a binary classifier , for the input sample , using the trained global encoder Get its characterization , and then characterize the Input binary classifier, and finally output binary prediction through binary classifier , which indicates the probability of a sample being normal or attacked; for this classification task, cross entropy is used as the loss function: in, It is a sample The true label of is 0 or 1, 0 means normal, 1 means attacked, and N represents the number of samples input into the binary classifier. By minimizing the loss using a small amount of labeled data, a binary classifier capable of detecting FDIA is finally obtained.
[0013] The second aspect: provides a false data injection attack detection device based on federated learning and contrastive learning, characterized in that: the device includes: a processor and a memory, wherein the memory stores computer program instructions suitable for execution by the processor, and when the computer program instructions are executed by the processor, the processor executes the false data injection attack detection method based on federated learning and contrastive learning as any one of the first aspects.
[0014] A third aspect: A storage medium is provided, comprising computer program instructions stored on the storage medium, wherein the computer program instructions are executed by a processor when running a method for detecting false data injection attacks based on federated learning and contrastive learning as described in any one of the first aspects.
[0015] The beneficial effects of the present invention are: compared with the prior art, 1) The present invention proposes a method based on federated learning and contrastive learning to detect FDIA. Contrastive learning learns a deep representation of data features by minimizing the distance between similar pairs and maximizing the distance between dissimilar pairs. This process helps to capture subtle changes and fine-grained details in the data, which is crucial for identifying and distinguishing hidden FDIA. Based on the learned representation and a small amount of labeled data, a binary classifier can be used to construct a decision boundary, further enhancing the model's ability to distinguish between normal and attacked instances. At the same time, federated learning only exchanges model parameters instead of a large amount of raw data, and local models are independently trained at different local centers to eliminate data islands. During the training process, each local center independently trains a model using its own data, and the control center aggregates these models to build a global model and update the local models. After the update is completed, each local model is fine-tuned using a small amount of labeled data with its local data distribution characteristics to train a binary classifier to better detect FDIA;
[0016] 2) This paper uses time series data enhancement techniques such as cropping, inversion, masking, and adding noise to change the representation of time series data, forcing the model to learn time dependencies under different "perspectives". These time series data enhancement techniques can effectively address the challenges of BYOL models in processing time series data;
[0017] 3) By designing enhancement strategies suitable for time series data, such as cropping, inversion, masking, adding noise, etc., the model can not only learn local and global time dependencies, but also improve robustness in the face of data variation or loss. Ultimately, these technologies make the BYOL model more efficient and stable in the application of time series data, and can extract meaningful time-dependent features from unlabeled data;
[0018] 4) The present invention provides the introduction of Exponential Moving Average (EMA) as an update strategy. The core advantage of EMA is that it can ensure that the local model remains stable during the update and reduce excessive reliance on global aggregation parameters. Traditional update methods usually directly replace the local model with the global model, which may ignore local-specific patterns; while EMA retains the characteristics of the local model through a gradual parameter update method, while integrating the knowledge of the global model to avoid model performance degradation due to sudden changes in global parameters. By balancing the influence of local and global models, EMA can enable the local model to benefit from global data without excessively weakening its adaptability to local data. In other words, the update process adopted by the present invention can help the local model generalize better, improve its adaptability to different data distributions, and achieve optimal performance on its proprietary data set;
[0019] 5) This invention seamlessly integrates federated learning with contrastive learning, solving the data island problem in FDIA detection in multi-regional power grid scenarios. Local models are aggregated into a powerful global model, thereby enhancing detection capabilities without sharing raw data between local centers. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flow chart of Embodiment 1 of the present disclosure; Figure 2 This is the attack model used in the experiment of Example 1 of the present disclosure; Figure 3 is a schematic block diagram of Embodiment 2 of the present disclosure; Figure 4 This is a schematic block diagram of Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0021] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings of this specification.
[0022] Embodiment 1: As attached Figure 1 As shown, a false data injection attack detection method based on federated learning and contrastive learning is provided, comprising the following steps: Generally speaking, the BYOL model (the contrastive learning model selected by the present invention) is mostly used to process image data. It generates different perspectives to allow the network to learn robust representations of features. However, time series data is different from images. Its biggest feature is time dependency, that is, the data points in the time series have a sequential relationship, and there is a strong correlation between the previous and next points. Traditional image enhancement methods cannot be directly applied to time series data. If the time series dependency is not considered, the model may not be able to effectively learn the patterns in the data. In order to solve this problem, before performing local model training, the time series data needs to be processed by data enhancement technology, as shown in step S1.
[0023] S1. The local center in each region collects the power grid data in the region and performs data preprocessing; Specifically, in step S1, a data preprocessing process is performed, and the specific steps are as follows: Step 1: Extract data using sliding windows Consider the The power grid data set collected by the local center , for the sample data , using a sliding window to extract data fragments; where, The size is , for The length of time included, The number of attributes collected for the local center; specifically, using size The window from the sample The length extracted is Each fragment contains the current time point and the past The window slides forward from the current time point to extract the power grid data at each historical time point. Second-rate; Step 2: Data enhancement Data enhancement technology is the process of generating new data by performing a series of transformations on the original data. For time series data, commonly used methods include jitter, time flipping, time scaling, etc. By introducing these transformations, data enhancement can increase the diversity of the training set, reduce the risk of model overfitting, and improve the performance of the model on unknown data. Therefore, the present invention adopts the classic time series data enhancement technology, namely time flipping and time scaling, to extract the data from the sliding window. Generate two data augmented views and , .
[0024] In the above steps, in order to make the Bootstrap Your Own Latent (BYOL) model adapt to the characteristics of time series data, we used time series data enhancement techniques such as cropping, reversing, masking, and adding noise. By changing the representation of time series data, we forced the model to learn time dependencies from different "perspectives".
[0025] Through these time series data enhancement techniques, we can effectively address the challenges of BYOL models in processing time series data. By designing enhancement strategies suitable for time series data, such as cropping, reversing, masking, adding noise, etc., the model can not only learn local and global time dependencies, but also improve its robustness in the face of data variation or loss. Ultimately, these techniques make the BYOL model more efficient and stable in the application of time series data, and can extract meaningful time-dependent features from unlabeled data.
[0026] S2. The local center downloads the initial neural network model with the same parameters from the control center and uses the preprocessed power grid data to train the local model based on contrastive learning; Specifically, in step S2, a local model training process is performed, and the specific steps are as follows: Based on the data augmented view, each local center independently learns its local grid dataset using an unsupervised contrastive learning model BootstrapYour Own Latent (BYOL) Representation: For , encode it using the online network in BYOL to obtain the representation , where the online network includes an online encoder and online predictor ;for , encode it using the target network to obtain the representation , where the target network only contains the target encoder ; The online network aims to learn from unlabeled data and update the model parameters by minimizing the following loss function : The target network (containing only the target encoder) is used as a positive regression target to provide the online network with an object for comparison. Considering that the challenge of contrastive learning is to prevent the network from collapsing into a trivial solution that does not contain information, BYOL uses EMA to update the parameters of the target network in order to stabilize the training. This ensures that the target network evolves at a slow speed, thereby providing a consistent target representation for the online network. Specifically, Parameters of the target encoder of the wheel , based on the parameters of the online encoder Update using EMA: in, is a momentum coefficient between 0 and 1; using BYOL, each local center can learn an effective representation from its local unlabeled data.
[0027] S3. After the local center completes the local model training, it uploads the trained model to the control center, which aggregates the model parameters and generates a new global model. Specifically, the model aggregation method performed by the control center in step S3 comprises the following steps: Step 1: Upload model parameters to the local center Compared to the target network, the online network (i.e., the online encoder and online predictor ) can better reflect the distribution characteristics of local data, and uploading it for model aggregation can more accurately capture the characteristics of the data, thereby better optimizing the performance of the overall model. Therefore, in the upload stage, each local center Only the local online encoder and online predictor Upload the parameters to the control center;
[0028] Step 2: Control center performs model aggregation The control center uses FedAvg, which is widely used in federated learning, for model aggregation. FedAvg ensures that regions with more data will have a greater impact on the global model, thereby better capturing the distribution of power grid data; specifically, the control center aggregates the data based on each region. The weighted parameters are averaged with the dataset size to generate a new global online encoder and the global predictor : ,
[0029] in and They are Wheel global online encoder and the global predictor Parameters, and They are Round The parameters of the online encoder and online predictor are local to the local center.
[0030] In the federated learning scenario, each local center has its own data, which is usually not independent and identically distributed. This data heterogeneity often causes challenges for the model during training and may cause changes in the learning process. Specifically, there are large differences in data distribution between different clients, which may cause the global model to fail to maintain local features when updating the local model, thereby affecting the detection accuracy and generalization ability of the model. In order to solve this problem, the present invention proposes a solution to step S4.
[0031] S4. The local center updates the local model using the exponential moving average (EMA) method for the new global model issued by the control center, and uses the updated model for training until the preset training rounds are reached; Specifically, the method for updating the local model in step S4 comprises the following steps: After completing the center aggregation, the control center distributes the parameters of the global encoder and predictor to all local centers; each local center Use EMA to update its local online encoder and online predictor , to get better performance, namely: , in, and are the parameters of the local online encoder and online predictor, which are Round has not yet been Local centers have not been uploaded to the control center.
[0032] Step S4 introduces the Exponential Moving Average (EMA) as an update strategy. The core advantage of EMA is that it ensures that the local model remains stable during the update and reduces the over-reliance on the global aggregation parameters. Traditional update methods usually directly replace the local model with the global model, which may ignore the local-specific patterns; while EMA preserves the characteristics of the local model through a gradual parameter update method, while integrating the knowledge of the global model to avoid the degradation of model performance due to sudden changes in global parameters.
[0033] By balancing the influence of local and global models, EMA enables local models to benefit from global data without overly weakening their adaptability on local data, ensuring that updates to local models are smooth and not overly affected by aggregated global parameters to help mitigate these distribution changes. In addition, by using EMA, local models can benefit from broader collective data insights, thereby enhancing their generalization capabilities and reducing the bias inherent in local data sets. The update process supported by EMA allows local models to generalize better while still achieving optimal performance on their specific data sets. In other words, the update process adopted by the present invention can help local models generalize better, improve their adaptability to different data distributions, and achieve optimal performance on their proprietary data sets.
[0034] S5. Based on the trained local model, the local center uses a small amount of labeled data to train a binary classifier to detect false data injection attacks (FDIA).
[0035] Specifically, the specific steps of step S5 are as follows: Based on the learned representation of power grid data, a small amount of labeled data is used to perform the downstream task of FDIA detection; specifically, each local center uses a binary classifier (usually a multilayer perceptron with multiple fully connected layers), for the input sample , using the trained global encoder Get its characterization , and then characterize the Input is a binary classifier, undergoes a series of nonlinear transformations in the classifier, and finally outputs a binary prediction , which indicates the probability of a sample being normal or attacked; for this classification task, cross entropy is used as the loss function: in, It is a sample The true label of is 0 (normal) or 1 (attacked), and N represents the number of samples input into the binary classifier. By minimizing the loss using a small amount of labeled data, a binary classifier capable of detecting FDIA is finally obtained.
[0036] In general, the present invention implements an unsupervised federated method based on contrastive learning for FDIA detection. Specifically, the present invention improves data efficiency by utilizing unlabeled data through contrastive learning, and retains the original data locally through the federated learning paradigm, only uploading model parameters, thereby solving the label scarcity and data island problems at the same time; at the same time, the inherent characteristics of the global model and the local model are retained through the update strategy of the exponential moving average method.
[0037] Test results: In order to illustrate the feasibility of the proposed method, the performance of the method in detecting FDIA against Automatic Generation Control (AGC) is evaluated. We use an industrial simulator to generate an attack of FDIA against AGC in a 37-bus power grid. FDIA uses Figure 2 The attack model in is modeled as follows: there are 3 regions and 8 regional connection lines. The attacker randomly selects one of the 8 regional connection lines to attack, which causes the frequency and regional power output to deviate significantly from their respective set values. Measurement data (e.g., regional load) are collected from the three regions and labeled as "normal" or "attacked" respectively. A total of 450,000 records are collected at different time points, and the dataset is divided into a training set and a test set in a ratio of 7:3. The training set is used for unsupervised contrastive learning; in addition, a small amount of data in the training set is selected to train a binary classifier for FDIA detection, which is the downstream task.
[0038] We compared the performance of the present invention with five unsupervised baseline models with different labeling ratios, namely, Principal Component Analysis (PCA), t-distributed Stochastic Neighbor Embedding (t-SNE), Autoencoder (AE), Variational Autoencoder (VAE) and Generative Adversarial Networks (GAN). The labeling ratio a was set to 0.01%, 0.05% and 0.1%. As shown in Tables 1-3, at all labeling ratios, the present invention significantly outperforms the comparison methods in terms of accuracy, precision, recall and F1 score. It is worth noting that even at extremely low data labeling ratios, the present invention shows significant performance advantages, indicating that it has excellent learning and generalization capabilities when processing small amounts of labeled data.
[0039] Table 1 Performance comparison of different methods (a=0.05%) Table 2 Performance comparison of different methods (a=0.1%) Table 3 Performance comparison of different methods (a=1%) The above results demonstrate the effectiveness of the proposed method in detecting FDIA and also highlight its potential use in situations where labeling data are limited.
[0040] Embodiment 2: refer to Figure 3 At least one embodiment of the present disclosure further provides a schematic block diagram of a false data injection attack detection device based on federated learning and contrastive learning. The false data injection attack detection device based on federated learning and contrastive learning includes: a processor and a memory, wherein the memory stores computer program instructions suitable for execution by the processor, and when the computer program instructions are executed by the processor, the processor executes the robustness evaluation method for power system integrated tree application as described in any one of the first embodiments.
[0041] For example, the processor is, for example, a central processing unit (CPU), a graphics processor GPU, a tensor processing unit (TPU), or other forms of processing units with data processing capabilities and / or instruction execution capabilities. For example, the processor can be implemented as a general-purpose processor, and can also be a single-chip microcomputer, a microprocessor, a digital signal processor, a dedicated image processing chip, or a field programmable logic array, etc. For example, the memory may include at least one of a volatile memory and a non-volatile memory, for example, the memory may include a read-only memory (ROM), a hard disk, a flash memory, etc. Accordingly, the memory may be implemented as one or more computer program products, and the computer program product may include various forms of computer-readable storage media, and one or more computer program instructions may be stored on the computer-readable storage medium. The processor may run the program instructions to execute any of the false data injection attack detection methods based on federated learning and contrastive learning provided in at least one embodiment of the present disclosure. The memory may also store various other applications and various data, for example, various data used and / or generated by the application, etc.
[0042] Embodiment 3: At least one embodiment of the present disclosure also provides a storage medium (eg, a non-transitory storage medium). Figure 4 is a schematic block diagram of a storage medium provided by at least one embodiment of the present disclosure. Figure 4 As shown, the storage medium includes computer program instructions stored on the storage medium. When the computer program instructions are executed by the processor, the false data injection attack detection method based on federated learning and contrastive learning provided by at least one embodiment of the present disclosure is executed.
[0043] For example, storage media may have many forms, including tangible storage media, carrier media or physical transmission media. Stable storage media may include: optical or magnetic disks, and other storage systems used in computers or similar devices that can implement the system components described in the figure. Unstable storage media may include dynamic memory, such as the main memory of a computer platform. Tangible transmission media may include coaxial cables, copper cables, and optical fibers, such as the lines that form a bus inside a computer system. Carrier transmission media can transmit electrical signals, electromagnetic signals, acoustic signals, or light signals. These signals can be generated by radio frequency or infrared data communication methods. Common storage media (e.g., computer readable media) include hard disks, floppy disks, magnetic tapes, any other magnetic media; CD-ROMs, DVDs, DVD-ROMs, any other optical media; punch cards, any other physical storage media containing a pattern of small holes; RAM, PROM, EPROM, FLASH-EPROM, any other memory chip or tape; carriers that transmit data or instructions, cables or connecting devices that transmit carriers, and any other data that can be read by computer program instructions (e.g., program code) and / or computers.
[0044] Computer program instructions (e.g., program code) for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0045] In some examples, the functions described in at least one embodiment of the present disclosure may also be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0046] The parts not described in detail in the present invention are all known technologies to those skilled in the art. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A false data injection attack detection method based on federated learning and contrastive learning, It is characterized in that The steps include: S1. The local center in each region collects the power grid data in the region and performs data preprocessing; S2. The local center downloads the initial neural network model with the same parameters from the control center and uses the preprocessed power grid data to perform local model training based on contrastive learning; S3. After the local center completes the local model training, it uploads the trained model to the control center, which aggregates the model parameters and generates a new global model. S4. The control center sends a new global model, and the local center updates the local model using the exponential moving average method and uses the updated model for training until the preset training rounds are reached; S5. Based on the trained local model, the local center uses a small amount of labeled data to train a binary classifier to detect false data injection attacks.
2. According to the false data injection attack detection method based on federated learning and contrastive learning according to claim 1, It is characterized in that The process of data preprocessing in step S1 is as follows: Consider the The power grid data set collected by the local center , for the sample data , using a size of The window from the sample The length extracted is Each fragment contains the current time point and the past The window slides forward from the current time point to extract the power grid data at each historical time point. Next, we use time series data enhancement technology to extract data from the sliding window. Generate two data augmented views and , ; in, The size is , for The length of time included, The number of attributes collected for the local hub.
3. According to the false data injection attack detection method based on federated learning and contrastive learning according to claim 2, It is characterized in that The local model training process in step S2 is as follows: Based on the data augmented view and , each local center independently learns its local grid dataset using an unsupervised contrastive learning model Representation: For , encode it using an online network in an unsupervised contrastive learning model to obtain a representation , where the online network includes an online encoder and online predictor ;for , encode it using the target network to obtain the representation , where the target network only contains the target encoder .
4. According to claim 3, the false data injection attack detection method based on federated learning and contrastive learning, It is characterized in that The model aggregation method performed by the control center in step S3 is: First, each local center Set the parameters of the local online encoder and the parameters of the online predictor Upload to the control center; then, the control center will The weighted parameters are averaged with the dataset size to generate a new global online encoder and the global predictor : in and They are Wheel global online encoder and the global predictor Parameters, and They are Round The parameters of the online encoder and online predictor are local centers, and M represents the total number of local centers.
5. According to the false data injection attack detection method based on federated learning and contrastive learning according to claim 4, It is characterized in that The updating method of the local model in step S4 is: After the control center completes model aggregation, it distributes the parameters of the global encoder and predictor to all local centers; each local center Use EMA to update its local online encoder and online predictor ,Right now: in, and are the parameters of the online encoder and online predictor of the k-th local center in the t-th round, and its Round has not yet been Local centers have not been uploaded to the control center. is the momentum coefficient between 0 and 1.
6. According to claim 5, the false data injection attack detection method based on federated learning and contrastive learning, It is characterized in that The specific method of step S5 is: Each local center uses a binary classifier , for the input sample , using the trained global encoder Get its characterization , and then characterize the Input binary classifier, and finally output binary prediction through binary classifier , which indicates the probability of a sample being normal or attacked; for this classification task, cross entropy is used as the loss function: in, It is a sample The true label of is 0 or 1, 0 means normal, 1 means attacked, and N represents the number of samples input into the binary classifier. By minimizing the loss using a small amount of labeled data, a binary classifier capable of detecting FDIA is finally obtained.
7. A false data injection attack detection device based on federated learning and contrastive learning, Features: The device includes: a processor and a memory, wherein the memory stores computer program instructions suitable for execution by the processor, and when the computer program instructions are executed by the processor, the processor executes the false data injection attack detection method based on federated learning and contrastive learning as described in any one of claims 1 to 6.
8. A storage medium comprising computer program instructions stored on said storage medium, in, When the computer program instructions are executed by the processor, the false data injection attack detection method based on federated learning and contrastive learning as described in any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
AMI network intrusion detection method based on DCGAN federated semi-supervised learning
CN116155592A
Federal unsupervised image classification model training method, classification method and equipment based on semantic clustering
CN116310530A
Safe and efficient power system abnormal state detection terminal
CN116405333A
Multi-party privacy data joint pixel level labeling method and system based on federal learning
CN117409270A
Federal learning backdoor defense method and system based on comparative learning
CN117422130A
Cited By
False data injection attack detection and positioning method based on TGRU model
CN119272205A
False data injection attack detection method, device and system and storage medium
CN119696867A
Network-photovoltaic climbing cooperative attack identification method and system based on tensor decomposition personalized federated learning, and storage medium
CN119865328A
Large-scale federated multi-view clustering method, system, equipment and medium
CN120086634A
