A deep learning-based power system false data localization and recovery system
The deep learning-based power system fake data location and recovery system solves the problems of slow response and low accuracy of traditional detection methods when facing new attacks, improves the location sensitivity and data reconstruction accuracy in complex scenarios, and provides a reliable active defense technology for the security protection of smart grids.
Patent Information
- Application Number
- CN202510999425.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-07-21
AI Technical Summary
Traditional methods for detecting false measurement data in power systems are slow to respond and have low accuracy when faced with new and complex attacks, making them ineffective in dealing with the threat of false data injection attacks.
A deep learning-based system for spurious data location and recovery in power systems is adopted, comprising a data acquisition and standard processing module, a location detection module, and a data recovery module. The data acquisition and standard processing module cleans and normalizes the operating parameters of the power system; the location detection module locates spurious data using a spatiotemporal feature fusion detection model; and the data recovery module generates recovered data using a TVAE-WGANGP recovery model.
It significantly improves the positioning sensitivity and data reconstruction accuracy in complex attack scenarios, providing reliable active defense technology for smart grids and ensuring the safe and stable operation of power systems.
Smart Images

Figure CN120508996B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of data mining, and particularly relates to a power system false data positioning and recovery system based on deep learning. BACKGROUND
[0002] In recent years, the rapid development of industrial Internet of Things technology has promoted the transformation and upgrading of traditional power systems to smart grids, and a highly automated and intelligent power network has been built through deep integration of information and communication technologies. Relying on remote terminal units and phasor measurement units to collect physical measurement data, the data is transmitted to the application layer by the monitoring and data acquisition system for deep analysis and processing, realizing intelligent monitoring and real-time control of the whole system. In the operation of the smart grid, power system state estimation as the core support module of the energy management system not only provides data basis for key decisions such as load forecasting, emergency response, and economic dispatching, but also provides core algorithm support for dynamic security assessment and adaptive control strategy generation of the power grid through dynamic verification of network topology structure and parameter consistency. The integrity and reliability of measurement data are directly related to the safe and stable operation of the smart grid.
[0003] With the rapid development of new power systems, the threat of false data injection attacks (FDIAs) is increasing dramatically. FDIAs pose a serious threat to power systems by interfering with state estimation and endangering the safety and reliability of power systems. The complexity of power systems and their ever-expanding scale provide attackers with more potential attack points. Traditional methods for detecting false measurement data in power systems have slow response and low precision when facing new and complex attacks. SUMMARY
[0004] The power system false data positioning and recovery system based on deep learning provided by the embodiments of the application can solve the problem that traditional methods for detecting false measurement data in power systems have slow response and low precision when facing new and complex attacks.
[0005] In a first aspect, the embodiments of the application provide a power system false data positioning and recovery system based on deep learning, which includes a data acquisition and standard processing module, a position detection module, and a data recovery module. The data acquisition and standard processing module is configured to acquire operating parameters of a power system, clean and normalize the operating parameters, and generate standardized operating parameters. The position detection module is configured to input the standardized operating parameters into a preset spatio-temporal feature fusion detection model and output a predicted position index of false data. The data recovery module is configured to generate recovery data according to the predicted position index and a TVAE-WGANGP recovery model.
[0006] In a possible implementation manner of the first aspect, the data collection and standard processing module includes a data collection unit and a data standard processing unit.
[0007] The data collection unit is configured to collect the operation parameters of the power system.
[0008] The data standard processing unit is configured to perform missing value cleaning, outlier removal, duplicate value deduplication, and normalization processing on the collected operation parameters, and generate standardized operation parameters.
[0009] Optionally, in another possible implementation manner of the first aspect, the preset spatio-temporal feature fusion detection model includes a time feature extraction layer, a space feature extraction layer, a feature fusion layer, and a full connection layer, and the standardized operation parameters are input into the preset spatio-temporal feature fusion detection model to output a predicted position index of the false data, including:
[0010] The standardized operation parameters are input into the time feature extraction layer to extract time sequence features of each measurement point, and output a time feature vector;
[0011] The standardized operation parameters are input into the space feature extraction layer to extract spatial correlation features between nodes, and output a space feature vector;
[0012] The time feature vector and the space feature vector are input into the feature fusion layer for weighted fusion, and a fusion feature vector is output;
[0013] The fusion feature vector is input into the full connection layer to output the predicted position index of the false data.
[0014] Optionally, in another possible implementation manner of the first aspect, the time feature extraction layer includes at least one global time sequence perception module, and the global time sequence perception module includes a multi-head attention layer and a feedforward neural network layer, the standardized operation parameters are input into the time feature extraction layer to extract time sequence features of each measurement point, and output a time feature vector, including:
[0015] The standardized operation parameters are input into the multi-head attention layer to extract global dependency relationships between time steps, and output an attention representation;
[0016] The attention representation is input into the feedforward neural network layer for nonlinear mapping, and time sequence features of each measurement point are output;
[0017] Residual connection and layer normalization operations are performed on the time sequence features, and a time feature vector is output
[0018] Optionally, in another possible implementation manner of the first aspect, the spatial feature extraction layer includes a standard convolution layer, a depth separable convolution layer, and a compression-excitation attention layer, the normalized operation parameters are input into the spatial feature extraction layer, spatial correlation features between nodes are extracted, and a spatial feature vector is output, including:
[0019] The normalized operation parameters are input into the standard convolution layer after channel expansion, and a first spatial feature is output.
[0020] The local spatial feature is input into the depth separable convolution layer, and channel-in-space filtering and channel-between-feature fusion are performed respectively, and a second spatial feature is output.
[0021] The second spatial feature is input into the compression-excitation attention layer to perform global average pooling operation, to generate a channel description vector; the channel description vector is input into two fully connected layers and a nonlinear activation function to perform nonlinear transformation, and is recalibrated through a channel attention weight, to generate a third spatial feature.
[0022] The third spatial feature is input into a fully connected layer to perform feature projection, to generate a spatial feature vector.
[0023] Optionally, in another possible implementation manner of the first aspect, the time feature vector and the spatial feature vector are input into a feature fusion layer, weighted fusion is performed, and a fusion feature vector is output, including:
[0024] The time feature vector and the spatial feature vector are mapped to a common semantic space through linear projection;
[0025] Weighted summation is performed according to the projected time feature vector, the spatial feature vector, and a learnable scaling coefficient, to output a fusion feature vector.
[0026] Optionally, in another possible implementation manner of the first aspect, the fusion feature vector is input into a fully connected layer, to output a predicted position index of the fake data, including:
[0027] The fusion feature vector is input into a dimension reduction layer to compress the feature dimension, and a Dropout operation and nonlinear processing based on a GELU activation function are performed, to generate an intermediate feature representation;
[0028] The intermediate feature representation is combined with a weight vector corresponding to a category, to generate an attack position spatial output;
[0029] The attack position spatial output is activated according to a sigmoid function, to generate a multi-label prediction result, and a predicted position index of the fake data is generated according to the multi-label prediction result.
[0030] Optionally, in another possible implementation manner of the first aspect, the TVAE-WGAN GP restoration model comprises a generation network based on a self-encoder VAE and an adversarial network, the adversarial network comprises a discriminator, and the generating the restoration data according to the predicted position index and the TVAE-WGAN GP restoration model comprises:
[0031] Based on the predicted position index, data of a corresponding position in the original measurement data is set as a missing value, a missing mask matrix is constructed, Gaussian noise subject to a normal distribution is spliced, and restoration input data is obtained;
[0032] The restoration input data is input into the generation network based on the self-encoder VAE, latent variables are extracted, and reconstruction data of the missing position is output;
[0033] The reconstruction data and the real sample data are input into the adversarial network, a discrimination result is output in combination with a loss function of the discriminator, the adversarial network is optimized according to the discrimination result, and the restoration data is generated.
[0034] Optionally, in another possible implementation manner of the first aspect, the inputting the restoration input data into the generation network based on the self-encoder VAE, the extracting the latent variables, and the outputting the reconstruction data of the missing position comprise:
[0035] The restoration input data is input into a position encoding and a Transformer encoder to extract high-dimensional features related to context;
[0036] Residual connection and layer normalization operations are performed on the high-dimensional features to obtain a mean and a variance of the latent variables, and the latent variables are sampled by a reparameterization method to obtain latent space variables;
[0037] The latent space variables are respectively input into a gated MLP and a fully connected layer to obtain the reconstruction data;
[0038] A reconstruction error between the original measurement data and the reconstruction data and a KL divergence between a latent distribution and a standard normal distribution are calculated, a loss function of the VAE is constructed according to the reconstruction error and the KL divergence, and parameters of an encoder and a decoder of the generation network are optimized according to the loss function of the VAE.
[0039] Optionally, in another possible implementation manner of the first aspect, the loss function of the discriminator takes a Wasserstein distance between the reconstruction data and the real sample data as an optimization target, introduces a gradient penalty term based on an interpolation sample, and constrains the discriminator to satisfy a K-Lipschitz continuity condition to constitute a training target of the adversarial network.
[0040] Beneficial effects: in the technical scheme of the present application, the system includes a data acquisition and standard processing module, a position detection module and a data recovery module; the data acquisition and standard processing module is used for acquiring the operation parameters of the power system, and performing cleaning and normalization processing on the operation parameters to generate standardized operation parameters; the position detection module is used for inputting the standardized operation parameters into a preset spatio-temporal feature fusion detection model to output a prediction position index of the false data; the data recovery module is used for generating recovery data according to the prediction position index and a TVAE-WGANGP recovery model. The system provided in the present application can significantly improve the positioning sensitivity and data reconstruction accuracy in a complex attack scenario, and provides a reliable active defense technology for intelligent power grid security protection. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0042] Figure 1 is a structural schematic diagram of a power system false data positioning and recovery system based on deep learning provided by an embodiment of the present application. DETAILED DESCRIPTION
[0043] In the following description, specific details such as specific system structures, techniques, etc. are presented in order to thoroughly understand the embodiments of the present application, but it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits and methods are omitted to avoid unnecessary details that hinder the description of the present application.
[0044] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of the described features, whole, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, whole, steps, operations, elements, components and / or sets thereof.
[0045] It should also be understood that the term "and / or" used in the specification and the appended claims of the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0046] As used in the specification and the appended claims herein, the term “if’ can be interpreted as meaning “when” or “upon” or “in response to determining” or “in response to detecting” depending on the context. Similarly, the phrase “if it is determined” or “if [the described condition or event] is detected” can be interpreted as meaning “upon determining” or “in response to determining” or “upon detecting [the described condition or event]” or “in response to detecting [the described condition or event]” depending on the context.
[0047] In addition, in the description of the present application and the appended claims, the terms “first”, “second”, “third”, etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0048] In the present application, the reference “one embodiment” or “some embodiments” and the like means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements “in one embodiment”, “in some embodiments”, “in other some embodiments”, “in further some embodiments” and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean “one or more but not all embodiments”, unless otherwise specifically emphasized. The terms “include”, “contain”, “have” and their variants mean “include but not limited to”, unless otherwise specifically emphasized.
[0049] A deep learning-based power system false data positioning and recovery system provided by the present application is described in detail below with reference to the accompanying drawings.
[0050] Figure 1 The structure of a deep learning-based power system false data positioning and recovery system provided by an embodiment of the present application is shown.
[0051] As Figure 1 The deep learning-based power system false data positioning and recovery system 100 includes a data acquisition and standard processing module 110, a position detection module 120 and a data recovery module 130.
[0052] The data acquisition and standard processing module 110 is configured to acquire the operating parameters of the power system, and to clean and normalize the operating parameters to generate standardized operating parameters.
[0053] The identification and recovery of false data of the power system starts from efficient collection and processing of key measurement data. This module mainly provides necessary data support for attack positioning and data recovery, ensures that the detection and recovery algorithm can be trained on a comprehensive and rich data set, and thus improves the generalization ability and accuracy of the evaluation model.
[0054] Further, in the embodiments of the present application, the data acquisition and standard processing module 110 includes a data acquisition unit and a data standard processing unit;
[0055] The data acquisition unit is configured to acquire the operating parameters of the power system.
[0056] The data standard processing unit is configured to remove missing values, remove outliers, remove duplicate values, and perform normalization processing on the acquired operating parameters to generate standardized operating parameters.
[0057] It should be noted that the data acquisition unit mainly obtains data from various sensors, smart meters, protection devices, energy management systems, etc., for continuous monitoring and recording of key operating parameters of the power system, including voltage, current, frequency, power, load and other key parameters.
[0058] The data standard processing unit is configured to standardize the collected system operating state data. Data samples as input to the algorithm will inevitably affect the analysis results of the algorithm output, so good data cleaning and preprocessing work is crucial to improve the accuracy of the anomaly detection algorithm. After collecting the data to be detected, data cleaning and data preprocessing are needed. Data cleaning mainly includes:
[0059] 1) Cleaning records containing missing values;
[0060] 2) Cleaning a small number of extreme data and negative data in the detection sample;
[0061] 3) Removing duplicate values to ensure that there are no redundant or duplicate records in the data set.
[0062] After cleaning, it is necessary to ensure the accuracy and consistency of the data set, otherwise it cannot be normally processed and analyzed. After data cleaning, data preprocessing is performed, which mainly includes normalization.
[0063] In a complex power network communication environment, due to the large and complex data, linear normalization is generally needed to normalize all samples between 0 and 1. The linear normalization formula is:
[0064]
[0065] where x(i) represents any sample value, min(x(n)) is the minimum value in the data, and max(x(n)) is the maximum value in the data.
[0066] The position detection module 120 is configured to input the standardized operating parameters into a preset spatio-temporal feature fusion detection model to output a predicted position index of the false data.
[0067] For the false data injection attack of the power system, the application proposes a deep learning detection model based on spatiotemporal feature fusion. The model adopts a double-branch architecture design, including an input layer, a hidden layer, a feature fusion layer, a full connection layer, and an output. After standardization processing, the input signal is captured through the time feature extraction branch to capture the long-term time sequence dependence relationship, and through the spatial feature extraction branch to extract the local spatial feature. The interaction enhancement of the spatiotemporal features is realized in the feature fusion layer, and finally the multi-label classification task is completed through the full connection layer.
[0068] Further, in the embodiment of the application, the preset spatiotemporal feature fusion detection model includes a time feature extraction layer, a spatial feature extraction layer, a feature fusion layer, and a full connection layer. The standardized operating parameters are input into the preset spatiotemporal feature fusion detection model, and the predicted position index of the false data is output, including:
[0069] The standardized operating parameters are input into the time feature extraction layer to extract the time sequence features of each measurement point, and output the time feature vector;
[0070] The standardized operating parameters are input into the spatial feature extraction layer to extract the spatial correlation features between nodes, and output the spatial feature vector;
[0071] The time feature vector and the spatial feature vector are input into the feature fusion layer for weighted fusion, and output the fusion feature vector;
[0072] The fusion feature vector is input into the full connection layer, and the predicted position index of the false data is output.
[0073] Further, in the embodiment of the application, the time feature extraction layer includes at least one global time sequence perception module, and the global time sequence perception module includes a multi-head attention layer and a feedforward neural network layer. The standardized operating parameters are input into the time feature extraction layer to extract the time sequence features of each measurement point, and output the time feature vector, including:
[0074] The standardized operating parameters are input into the multi-head attention layer to extract the global dependence relationship between time steps, and output the attention representation;
[0075] The attention representation is input into the feedforward neural network layer for nonlinear mapping, and the time sequence features of each measurement point are output;
[0076] The time sequence features are subjected to residual connection and layer normalization operation, and the time feature vector is output.
[0077] Optionally, in an embodiment, the standardized operating parameters of the input are defined as where B is batch size and d is feature dimension. The temporal feature extraction process first maps the input raw data to a high-dimensional semantic space through linear projection, and the generation process of Query, Key, Value matrix is defined as:
[0078]
[0079] where is a trainable parameter matrix, is a bias term, is the dimension of each attention head. The association weight between different time steps is calculated by scaled dot-product attention:
[0080]
[0081] where Q, K, V represent Query, Key and Value matrix respectively, d k is the dimension of key vector.
[0082] The scaling factor here is used to alleviate the problem of excessive dot product value in high-dimensional space, avoiding the softmax function from entering the gradient saturation zone. Multi-head attention mechanism enables the model to focus on different parts of the input sequence from different subspaces in parallel, capturing global dependency relationships, and its calculation form is:
[0083]
[0084] where h is the number of attention heads, is the output projection matrix. To further enhance the non-linear expression ability, the features extracted by the attention mechanism are nonlinearly transformed through the feed-forward neural network (FFN), further mining high-level feature information, ensuring that the model can integrate global semantic information and generate a rich set of feature vectors.
[0085] The GELU activation function introduces a random regularization effect, and its formula is expressed as:
[0086]
[0087] Compared with the traditional ReLU function, GELU has a smooth gradient transition near zero, which helps to alleviate the problem of gradient explosion. In addition, after each sub-layer, residual connection and layer normalization processing are used, and the calculation process is:
[0088]
[0089] in This indicates multi-head attention or feedforward network operation. This serves as the layer index. The residual structure ensures that gradients propagate effectively in deep networks, while layer normalization accelerates model convergence and improves generalization performance by standardizing the feature dimensions of each sample. This design effectively alleviates the gradient vanishing problem in deep networks and promotes the fusion and propagation of features between layers.
[0090] The temporal feature extraction layer employs a stacked design, using two cascaded global temporal perception modules. By integrating long-range feature information, it establishes global dependencies across time steps. Within each module, multi-head self-attention, feedforward transformation, and feature fusion operations are executed sequentially. This structure enables the model to abstract temporal features layer by layer, capturing local fluctuation patterns at lower levels and extracting global dependencies at higher levels. Each perception module further extracts and optimizes feature representations based on the previous layer, ensuring that the final feature vector fully reflects the global information of the input features.
[0091] Furthermore, in this embodiment, the spatial feature extraction layer includes a standard convolutional layer, a depthwise separable convolutional layer, and a compressed-excitation attention layer. The standardized operating parameters are input to the spatial feature extraction layer to extract spatial correlation features between nodes and output a spatial feature vector, including:
[0092] The standardized operating parameters are channel-expanded and then input into a standard convolutional layer to output the first spatial features.
[0093] Local spatial features are input into a depthwise separable convolutional layer, where intra-channel spatial filtering and inter-channel feature fusion are performed to output a second spatial feature.
[0094] The second spatial features are input into the compression-excitation attention layer for global average pooling to generate channel description vectors; the channel description vectors are input into two fully connected layers and a nonlinear activation function for nonlinear transformation, and then recalibrated through channel attention weights to generate the third spatial features.
[0095] The third spatial features are input into the fully connected layer for feature projection to generate spatial feature vectors.
[0096] As one possible implementation, the fully connected layer described above can be a fully connected layer containing 512 neuron nodes, but this application does not limit this to that.
[0097] Optionally, in one embodiment, the standardized operating parameters are first converted into three-dimensional tensors through a spatial dimension reshaping operation. The newly added channel dimension is used to adapt to the one-dimensional convolution. Subsequently, a one-dimensional convolutional layer (Conv1d) with a kernel size of K1 maps the single-channel signal to a high-dimensional feature space, outputting... , The number of output channels and L (the sequence length of the output feature map) can be obtained through the analytical formula of the convolution operator, which is determined by the hyperparameter configuration of the input tensor, the size of the convolution kernel / filter, the stride, and the padding strategy.
[0098] To achieve a balance between enhanced feature representation and computational efficiency, this network architecture employs depthwise separable convolution, which consists of two stages: intra-channel spatial filtering and inter-channel fusion. The first stage performs depthwise convolution, decoupling spatial feature extraction from channel fusion. Specifically, it independently applies position-sensitive convolution kernels to each channel, focusing on extracting local spatial features without introducing inter-channel information interaction. The calculation formula is as follows:
[0099]
[0100] in Let be the weights of the depthwise convolutional kernel of layer I, j represent the sample index, and p be the index of a certain position in the input signal. The input channel number is given. Then, pointwise convolution is performed using a 1×1 convolution kernel to fuse information between channels.
[0101]
[0102] in It is a 1×1 pointwise convolution kernel. It is a certain location The input is the c-th channel. The total number of parameters for the depthwise separable convolution is... Far lower than standard convolution , Input the number of channels. K represents the number of output channels, and K represents the receptive field size when the convolutional kernel is applied to each channel, which improves computational efficiency while reducing the risk of overfitting.
[0103] To further enhance the representational power of convolutional features, the model introduces a squeeze-and-excitation (SE) attention layer, which adaptively emphasizes attack-sensitive feature channels through a dynamic channel weighting mechanism. The SE layer... Perform global average pooling to generate channel description vectors:
[0104]
[0105] in, For in position and channels The output of the vector By using a two-layer fully connected network and a non-linear activation function, the non-linear interaction relationship between channels is learned. Finally, the original feature map is recalibrated using channel attention weights s.
[0106]
[0107] in Element-wise multiplication representing the channel direction This is the final feature map after processing by the SE module. This is the feature map after pointwise convolution.
[0108] In terms of spatial feature extraction, this hybrid convolutional architecture employs the following processing flow: First, basic local pattern features are extracted using a standard 3×1 convolutional layer; then, depthwise separable convolutions are used to achieve parameter-efficient feature refinement; finally, channel-adaptive feature weight adjustment is performed using an SE attention layer. After multiple stages of progressive feature abstraction, feature projection is finally performed through a fully connected layer containing 512 neurons, thereby generating a spatial representation vector. .
[0109] Furthermore, in this embodiment, the above-mentioned input of the temporal feature vector and spatial feature vector to the feature fusion layer for weighted fusion, and output of the fused feature vector, includes:
[0110] The temporal and spatial feature vectors are mapped to a common semantic space through linear projection.
[0111] The fused feature vector is output by weighted summation of the projected temporal feature vector, spatial feature vector, and learnable scaling factor.
[0112] Optionally, in one embodiment, to effectively integrate the heterogeneous information and complementary characteristics of spatiotemporal features, this application introduces a learnable weighted fusion method, which achieves a dynamic balance of feature contributions by adaptively adjusting parameters. Let the temporal features... (B represents the batch size) (output dimension of the temporal feature extraction layer) and spatial features ( (where the output dimension is the spatial feature extraction layer), the fusion process first maps the two to a common semantic space through linear projection:
[0113]
[0114] in and For learnable projection matrix ( (for the public space dimension) This is the bias term. This projection operation not only solves the problem of feature dimension mismatch, but also enhances the expressive compatibility of features through nonlinear transformation.
[0115] Subsequently, a learnable scaling factor was introduced. A dynamic weighting mechanism is constructed to ultimately generate rich feature representations. The specific formula is shown below:
[0116] .
[0117] in, The output of the time feature layer, This is the output of the spatial feature layer.
[0118] Furthermore, in this embodiment, the above-mentioned inputting the fused feature vector into the fully connected layer and outputting the predicted location index of the fake data includes:
[0119] The fused feature vector is input into the dimensionality reduction layer to compress the feature dimension, and then Dropout operation and non-linear processing based on the GELU activation function are performed to generate intermediate feature representations.
[0120] By combining intermediate feature representations with category-specific weight vectors, an attack location space output is generated.
[0121] The attack location space output is activated by the sigmoid function to generate multi-label prediction results, and the predicted location index of the fake data is generated based on the multi-label prediction results.
[0122] Optionally, in one embodiment, the high-dimensional features output by the feature fusion layer are first... The prediction space mapped to the attack location is compressed in terms of feature dimension and nonlinearity is introduced through a dimensionality reduction layer:
[0123]
[0124] in For a dimension reduction matrix, As a bias term, the Dropout layer uses probability. To prevent overfitting, the neuron outputs are randomly masked, and the GELU activation function introduces non-linear transformation capabilities into the features. Subsequently, attack location space outputs are generated using class-specific weight vectors.
[0125]
[0126] in For the classification weight matrix ( (Total number of attack instrument locations) For bias terms, For the element-wise sigmoid function:
[0127]
[0128] in, The unprocessed scores (logits) input to the Sigmoid activation function are obtained through the network's feedforward process.
[0129] Each output unit This represents an estimated probability that an attack exists at the corresponding location. Using a sigmoid function to activate multiple output units simultaneously allows for scenarios where locations coexist due to coordinated attacks.
[0130] As one possible implementation, to address the class imbalance problem, the classifier introduces a dynamic weight adjustment strategy, with the output layer bias term... The initialization is based on the frequency of positive samples in the training set, and the formula is as follows:
[0131]
[0132] in Let N be the number of positive samples in class k, and N be the total number of samples. This initialization strategy makes the model tend to predict high-frequency classes in the early stages of training, accelerating the convergence process. As the adaptive focusing loss function is optimized, the weights of each class are automatically balanced, while the bias term is gradually adjusted to the optimal value.
[0133] Because the traditional binary cross-entropy loss function treats all classes equally, it can easily lead to a bias towards high-frequency classes. Therefore, as a possible solution, this application proposes an Adaptive Focal Loss (AFL) function. This function adjusts the sample difficulty weights through learnable class weights and a dynamic focusing factor to address the class imbalance problem of attack samples and prevent the model from biased towards conservative predictions, thereby improving the detection rate of covert attacks. Its mathematical formula is as follows:
[0134]
[0135] in Let i be the predicted probability of sample i in the k-th class. For the sample In the Unnormalized predicted scores for the class A learnable class balancing factor. This is a category-related focusing factor. Weights Update using the following formula:
[0136]
[0137] in For optimizable parameters, For learnable weight parameters, The number of positive samples in class k in the training set. Prevent division by zero errors.
[0138] The data recovery module 130 is used to generate recovery data based on the predicted location index and the TVAE-WGANGP recovery model.
[0139] Furthermore, in this embodiment, the TVAE-WGANGP recovery model includes a generative network based on an autoencoder VAE and an adversarial network. The adversarial network includes a discriminator. The above-mentioned generation of recovery data based on the predicted location index and the TVAE-WGANGP recovery model includes:
[0140] S1. Based on the predicted location index, set the data at the corresponding location in the original measurement data as missing values, construct a missing mask matrix, and concatenate it with Gaussian noise that follows a normal distribution to obtain the restored input data.
[0141] S2. Input the recovered input data into the generative network based on autoencoder VAE, extract latent variables and output the reconstructed data at the missing locations;
[0142] Furthermore, in this embodiment of the application, the above-mentioned inputting the recovered input data into a generative network based on an autoencoder VAE, extracting latent variables, and outputting reconstructed data at the missing locations further includes:
[0143] The recovered input data is used to extract context-related high-dimensional features through positional encoding and a Transformer encoder;
[0144] Residual connectivity and layer normalization operations are performed on high-dimensional features to obtain the mean and variance of latent variables, and then they are sampled using a reparameterization method to obtain latent spatial variables;
[0145] The latent spatial variables are input into the gated MLP and the fully connected layer, respectively, to obtain the reconstructed data;
[0146] Calculate the reconstruction error between the original measurement data and the reconstructed data, as well as the KL divergence between the latent distribution and the standard normal distribution. Construct the loss function of the VAE based on the reconstruction error and the KL divergence, and optimize the encoder and decoder parameters of the generator network based on the loss function of the VAE.
[0147] S3. Input the reconstructed data and real sample data into the adversarial network, combine it with the loss function of the discriminator, output the discrimination result, optimize the adversarial network based on the discrimination result, and generate the restored data.
[0148] In the embodiments of this application, the loss function of the discriminator is optimized with the Wasserstein distance between the reconstructed data and the real sample data as the optimization objective, and a gradient penalty term based on the interpolated samples is introduced to constrain the discriminator to satisfy the K-Lipschitz continuity condition, which constitutes the training objective of the adversarial network.
[0149] Optionally, an embodiment will be used below to illustrate the contents of steps S1-S3.
[0150] Standardized measurement data of power systems containing partially missing values (replaced with NaN). Gaussian noise that follows a normal distribution The mask matrix M is input into the encoding network, and the dimension is expanded to a high-dimensional space through a fully connected layer. Then, spectral normalization is used to impose constraints on the weight matrix. ,in It is the largest singular value of the weight matrix, and a batch normalization operation is performed to adjust the data distribution to zero mean and unit variance. Learnable scaling and offset parameters are introduced to enhance the model's flexibility. Then, the GELU activation function is used to introduce nonlinearity. This activation method maintains approximately linearity in the positive region while providing a smooth transition in the negative region, which helps to capture complex patterns in power data.
[0151] After adding positional encoding, the high-dimensional features are fed into the Transformer encoding layer. After residual connections and layer normalization, two outputs are obtained. and , where represent the mean and variance of the Gaussian distribution, respectively. Subsequently, the latent variable z is obtained through reparameterized sampling, and the data is reconstructed using a gated MLP and a fully connected layer;
[0152] VAE introduces KL divergence to measure the distance between consecutive data distributions. KL divergence is used to describe... and The similarity between two distributions is expressed as:
[0153]
[0154] In the formula: Let X represent the maximum likelihood estimation function. Since the KL divergence is non-negative, minimizing the KL divergence can be transformed into maximizing the variational lower bound. After transformation and derivation, the loss function of VAE is:
[0155]
[0156] In the formula: yes Reconstruction error, Represents variational distribution and prior distribution To simplify the calculation process, the difference between them is often represented by a normal distribution. As a prior distribution .
[0157] This application introduces Wasserstein distance as the objective function to address the gradient vanishing problem in traditional networks during training. Wasserstein distance can reflect the distribution of generated data. Transform to target data distribution The minimum cost required, under ideal conditions, is the Wasserstein distance. It is continuously differentiable, which helps improve the training stability of GANs, and its expression is:
[0158]
[0159] In the formula: This represents the supremum of the function value, where K is the Lipschitz constant. For the generated data, Representation function Satisfies K-Lipschitz continuity, This represents the score of the discriminator on the target data. This represents the discriminator's score on the generated data. In practical applications, WGAN can also experience gradient explosion and non-convergence, usually attributed to unreasonable constraints imposed on the adversarial network. To address this, the gradient of the adversarial network is added as a penalty term to the loss function of the adversarial network, forming the gradient-penalized generative adversarial network model WWGANGP. This avoids the problems of gradient vanishing and mode collapse, making the training process more stable and reliable. The adversarial network loss function of WWGANGP is:
[0160]
[0161] In the formula: Denotes the P-norm, Represents the gradient operator. The coefficient for the penalty term. , It follows a uniform distribution within the range [0, 1]. Represents the distribution of target data To generate data distribution The data is uniformly sampled between the given values, where D(x) is the output of the discriminator and G(Z) is the generated data. Let D(x) be the expected value of the discriminator output. Let G(Z) be the output of the discriminator on the samples G(Z) generated by the generator, where G(Z) is a sample generated from the latent variable Z by the generator network. For the discriminator D to generate samples gradient, This is used to control the impact of this item on the total loss function. Based on the distribution of real data Samples from the middle Similarly, the loss function of the generator network can be obtained as follows:
[0162]
[0163] in, The distribution representing the latent variable z, This represents the expectation of sampling all latent variables z.
[0164] During the training of WGANP, the input to the generator network is Gaussian noise, and normal measurement data is used as the generation target. The generator network and the adversarial network are trained in a mini-maximum game based on their respective loss functions. Through reconstruction loss, the data to be recovered from the zero position of the mask matrix M is obtained. With generated data Combined with the recovered data The obtained recovery data :
[0165] .
[0166] This application provides a deep learning-based system for locating and recovering spoofed data in power systems, comprising a data acquisition and standard processing module, a location detection module, and a data recovery module. The data acquisition and standard processing module collects operating parameters of the power system, cleans and normalizes these parameters to generate standardized operating parameters. The location detection module inputs the standardized operating parameters into a preset spatiotemporal feature fusion detection model and outputs a predicted location index of the spoofed data. The data recovery module generates recovered data based on the predicted location index and a TVAE-WGANGP recovery model. The system provided in this application can significantly improve the location sensitivity and data reconstruction accuracy under complex attack scenarios, providing a reliable active defense technology for smart grid security.
[0167] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0168] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A deep learning-based system for locating and recovering spurious data in a power system, characterized in that, It includes a data acquisition and standard processing module, a location detection module, and a data recovery module; The data acquisition and standard processing module is used to acquire the operating parameters of the power system, and to clean and normalize the operating parameters to generate standardized operating parameters. The location detection module is used to input standardized operating parameters into a preset spatiotemporal feature fusion detection model and output the predicted location index of the false data. The preset spatiotemporal feature fusion detection model includes a temporal feature extraction layer, a spatial feature extraction layer, a feature fusion layer, and a fully connected layer. The step of inputting standardized operating parameters into the preset spatiotemporal feature fusion detection model and outputting the predicted location index of the false data includes: The standardized operating parameters are input into the time feature extraction layer to extract the time series features of each measurement point and output the time feature vector. Standardized operating parameters are input into the spatial feature extraction layer to extract spatial correlation features between nodes and output spatial feature vectors. The temporal and spatial feature vectors are input into the feature fusion layer, weighted and fused, and the fused feature vector is output. The fused feature vector is input into the fully connected layer, and the predicted location index of the fake data is output. The time feature extraction layer includes at least one global time series awareness module, which includes a multi-head attention layer and a feedforward neural network layer. The process of inputting standardized operating parameters into the time feature extraction layer, extracting the time series features of each measurement point, and outputting a time feature vector includes: Standardized operating parameters are input into a multi-head attention layer to extract global dependencies between time steps and output attention representations. The attention representation is input into the feedforward neural network layer for nonlinear mapping, and the time series features of each measurement point are output. Perform residual connection and layer normalization operations on the time series features to output a time feature vector; The spatial feature extraction layer includes a standard convolutional layer, a depthwise separable convolutional layer, and a compressed-excitation attention layer. Standardized operating parameters are input to the spatial feature extraction layer to extract spatial correlation features between nodes and output a spatial feature vector, including: The standardized operating parameters are channel-expanded and then input into a standard convolutional layer to output the first spatial features. Local spatial features are input into a depthwise separable convolutional layer, where intra-channel spatial filtering and inter-channel feature fusion are performed to output a second spatial feature. The second spatial features are input into the compression-excitation attention layer for global average pooling to generate channel description vectors; the channel description vectors are input into two fully connected layers and a nonlinear activation function for nonlinear transformation, and then recalibrated through channel attention weights to generate the third spatial features. The third spatial features are input into the fully connected layer for feature projection to generate spatial feature vectors; The data recovery module is used to generate recovered data based on the predicted location index and the TVAE-WGANGP recovery model.
2. The system as described in claim 1, characterized in that, The data acquisition and standard processing module includes a data acquisition unit and a data standard processing unit; The data acquisition unit is used to collect the operating parameters of the power system; The data standard processing unit is used to remove missing values, eliminate outliers, remove duplicate values, and normalize the collected operating parameters to generate standardized operating parameters.
3. The system as described in claim 1, characterized in that, The step of inputting the temporal feature vector and spatial feature vector into the feature fusion layer, performing weighted fusion, and outputting a fused feature vector includes: The temporal and spatial feature vectors are mapped to a common semantic space through linear projection. The fused feature vector is output by weighted summation of the projected temporal feature vector, spatial feature vector, and learnable scaling factor.
4. The system as described in claim 3, characterized in that, The step of inputting the fused feature vector into the fully connected layer and outputting the predicted location index of the fake data includes: The fused feature vector is input into the dimensionality reduction layer to compress the feature dimension, and then Dropout operation and non-linear processing based on the GELU activation function are performed to generate intermediate feature representations. The intermediate feature representation is combined with the weight vector corresponding to the category to generate the attack location space output; The attack location space output is activated by the sigmoid function to generate multi-label prediction results, and the predicted location index of the fake data is generated based on the multi-label prediction results.
5. The system as described in claim 4, characterized in that, The TVAE-WGANGP recovery model includes a generative network based on an autoencoder VAE and an adversarial network. The adversarial network includes a discriminator. The generation of recovery data based on the predicted location index and the TVAE-WGANGP recovery model includes: Based on the predicted location index, the data at the corresponding location in the original measurement data are set as missing values, and a missing mask matrix is constructed. Gaussian noise following a normal distribution is then concatenated to obtain the restored input data. The recovered input data is fed into a generative network based on an autoencoder VAE to extract latent variables and output reconstructed data at the missing locations. The reconstructed data and real sample data are input into the adversarial network, combined with the loss function of the discriminator, and the discrimination result is output. The adversarial network is optimized based on the discrimination result, and the restored data is generated.
6. The system as described in claim 5, characterized in that, The process of inputting the recovered input data into a generative network based on an autoencoder VAE, extracting latent variables, and outputting reconstructed data at missing locations includes: The recovered input data is used to extract context-related high-dimensional features through positional encoding and a Transformer encoder; Residual connectivity and layer normalization operations are performed on high-dimensional features to obtain the mean and variance of latent variables, and then they are sampled using a reparameterization method to obtain latent spatial variables; The latent spatial variables are input into the gated MLP and the fully connected layer, respectively, to obtain the reconstructed data; Calculate the reconstruction error between the original measurement data and the reconstructed data, as well as the KL divergence between the latent distribution and the standard normal distribution. Construct the loss function of the VAE based on the reconstruction error and the KL divergence, and optimize the encoder and decoder parameters of the generator network based on the loss function of the VAE.
7. The system as described in claim 5, characterized in that, The loss function of the discriminator is optimized by the Wasserstein distance between the reconstructed data and the real sample data, and a gradient penalty term based on the interpolated samples is introduced to constrain the discriminator to satisfy the K-Lipschitz continuity condition, which constitutes the training objective of the adversarial network.
Citation Information
Patent Citations
Deep learning-driven anomaly recognition and repair method and intelligent system
CN113240011A
Space-time detection method for power grid false data injection attack
CN116578903A