Power data backdoor detection method, device, equipment, storage medium and program product

By processing power data through feature extraction and dimensionality reduction, combined with Euclidean distance and distance constraints, the problem of high computational overhead in power data detection is solved, and real-time and accurate detection of large-scale power data is achieved.

CN119598453BActive Publication Date: 2025-09-05ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411759788.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-09-05
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

Existing technologies have too high computational overhead when detecting power data, making it difficult to achieve real-time detection of large-scale power data. Especially when defending against backdoor attacks in power monitoring systems, the input data needs to be perturbed multiple times, resulting in a waste of computing resources.

Method used

A feature extraction network is used to extract features and reduce the dimensionality of power data. The Euclidean distance between the low-dimensional data features and the benchmark clustering center of the predetermined clean power data set is calculated, combined with distance constraints, to determine whether the power data is poisoned.

Benefits of technology

The computational overhead of detecting power data is reduced, real-time detection of large-scale power data is achieved, the accuracy and efficiency of detection are improved, and the demand for computing resources is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598453B_ABST
    Figure CN119598453B_ABST
Patent Text Reader

Abstract

A method, apparatus, device, storage medium, and program product for detecting backdoors in power data are disclosed. The method comprises: inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers; performing feature dimensionality reduction processing on the data features to obtain low-dimensional data features; determining the first Euclidean distance between the low-dimensional data features and the respective benchmark cluster centers of multiple category clusters corresponding to a predetermined clean power data set; and determining a detection result for the power data to be detected based on the multiple first Euclidean distances and predetermined distance constraints for each category cluster; the detection result is determined to be clean power data or poisoned power data. This method can reduce the computational overhead of detecting power data, thereby enabling real-time detection of large-scale power data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for detecting backdoors in power data. Background Art

[0002] Neural network backdoor attacks are a type of malicious attack targeting deep learning models. Attackers can poison the training data set by injecting malicious samples with specific triggers. This allows the model to learn the strong correlation between the triggers and the target class during training, creating a model backdoor. During the inference phase, once a poisoned sample with a trigger is fed into the model, the model's backdoor is activated, causing the backdoor model to produce erroneous outputs as intended by the attacker. Backdoor attacks targeting power monitoring systems involve attackers tampering with power system data. By injecting backdoor triggers into the data through methods such as zeroing voltage, falsifying measurements, and injecting data noise, the attacker constructs a poisoned data set and covertly implants a backdoor during the power monitoring system's training process, causing the system to make erroneous decisions and severely impacting power system operations and the socioeconomic landscape.

[0003] Currently, backdoor defenses targeting power systems primarily include autoencoding preprocessing methods, STRIP detection methods, and Fine-Pruning methods. However, when using these methods to detect power data, it is necessary to superimpose multiple different patterns on the input data to obtain a set of perturbed data samples, which are then input into the model to evaluate the output changes of this set of data samples in order to detect poisoned samples. Because each input data point must be perturbed multiple times, when the number of input samples is large, a large number of perturbed samples are generated and input into the model. This results in significant computational overhead in both the data processing and model inference stages, making it unsuitable for detecting large-scale, real-time power data.

[0004] Therefore, how to reduce the computational overhead of detecting power data and thus realize real-time detection of large-scale power data has become an urgent problem to be solved. Summary of the Invention

[0005] The embodiments of the present application provide a method, apparatus, device, storage medium, and program product for detecting backdoors in power data, which can reduce the computational overhead of detecting power data, thereby enabling real-time detection of large-scale power data.

[0006] In a first aspect, an embodiment of the present application provides a method for detecting power data, the method comprising:

[0007] Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0008] Perform feature dimensionality reduction on data features to obtain low-dimensional data features;

[0009] determining the first Euclidean distance between the low-dimensional data feature and the respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0010] Based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data.

[0011] In one embodiment, based on multiple first Euclidean distances and predetermined distance constraints for each category cluster, a detection result for the power data to be detected is determined, including: when it is determined that any first Euclidean distance is less than or equal to the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, determining that the power data to be detected is clean power data; when it is determined that each first Euclidean distance is greater than the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, determining that the power data to be detected is poisoned power data.

[0012] In one embodiment, the benchmark cluster centers of the multiple category clusters corresponding to the clean power data set are determined in the following manner: the multiple power data in the acquired clean power data set are input into the feature extraction network to obtain the data feature matrix corresponding to the multiple power data; the data feature matrix is ​​subjected to feature dimensionality reduction processing to obtain a low-dimensional feature matrix; the low-dimensional feature matrix is ​​clustered to obtain multiple category clusters; the initial cluster center of each category cluster is determined based on each low-dimensional feature in each category cluster and the number of low-dimensional features in the category cluster; the initial cluster center of each category cluster is updated by minimizing the objective function to obtain the benchmark cluster center of each category cluster.

[0013] In one embodiment, the distance constraint of each category cluster is determined by: determining the second Euclidean distance between each low-dimensional feature in each category cluster and the benchmark cluster center of the category cluster; and determining the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster.

[0014] In one embodiment, based on multiple second Euclidean distances corresponding to each category cluster, the distance constraint of each category cluster is determined, including: for each category cluster, determining the average value of the multiple second Euclidean distances corresponding to the category cluster; and using the product of the average value and a preset value as the distance constraint of the category cluster.

[0015] In one embodiment, performing feature dimensionality reduction processing on data features to obtain low-dimensional data features includes: performing feature dimensionality reduction processing on data features using principal component analysis to obtain low-dimensional data features.

[0016] In a second aspect, the present application provides a power data backdoor detection device, the device comprising:

[0017] A feature extraction module is used to input the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0018] Feature dimensionality reduction module, used to perform feature dimensionality reduction processing on data features to obtain low-dimensional data features;

[0019] a determination module, configured to determine a first Euclidean distance between the low-dimensional data feature and respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0020] The determination module is further configured to determine a detection result of the power data to be detected based on multiple first Euclidean distances and a predetermined distance constraint of each category cluster; the detection result is clean power data or poisoned power data.

[0021] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0022] Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0023] Perform feature dimensionality reduction on data features to obtain low-dimensional data features;

[0024] determining the first Euclidean distance between the low-dimensional data feature and the respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0025] Based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data.

[0026] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0027] Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0028] Perform feature dimensionality reduction on data features to obtain low-dimensional data features;

[0029] determining the first Euclidean distance between the low-dimensional data feature and the respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0030] Based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data.

[0031] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0032] Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0033] Perform feature dimensionality reduction on data features to obtain low-dimensional data features;

[0034] determining the first Euclidean distance between the low-dimensional data feature and the respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0035] Based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data.

[0036] The above-mentioned power data backdoor detection method, device, equipment, storage medium and program product, the computer device can input the power data to be detected into the feature extraction network to obtain the data features of the power data to be detected; the feature extraction network includes multiple hidden layers; the data features are subjected to feature dimensionality reduction processing to obtain low-dimensional data features; the first Euclidean distance between the low-dimensional data features and the respective benchmark cluster centers of multiple category clusters corresponding to a predetermined clean power data set is determined; based on the multiple first Euclidean distances and the predetermined distance constraints of each category cluster, the detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data. Using this method, the computer device can extract the deep data features of the power data to be detected and perform dimensionality reduction processing on the deep data features to obtain low-dimensional deep data features. Thereafter, the Euclidean distance between the low-dimensional deep data features and the benchmark cluster centers of each category cluster corresponding to the predetermined clean power data set is determined to determine whether the distance constraints are met, thereby determining the detection result for the power data to be detected. In this way, compared with the existing power data detection method, there is no need to perform complex data processing on the input data, thereby reducing the computational overhead of detecting power data and realizing real-time detection of large-scale power data. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1 This is a schematic diagram of an application scenario of a power data backdoor detection method provided by an embodiment of the present application;

[0039] Figure 2 This is a flow chart of a method for detecting a backdoor in power data provided by an embodiment of the present application;

[0040] Figure 3 This is a flow chart of another method for detecting backdoors in power data provided by an embodiment of the present application;

[0041] Figure 4 This is a structural diagram of a power data backdoor detection device provided by an embodiment of the present application;

[0042] Figure 5 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0044] The following introduces the application scenarios of the power data detection method provided in the embodiments of the present application.

[0045] See Figure 1 , Figure 1 This is a schematic diagram of an application scenario of a power data backdoor detection method provided by an embodiment of the present application. Figure 1 As shown, the computer device 101 ( Figure 1 In the figure, the computer device 101 is drawn as an example of a terminal device) and a database server 102, wherein data can be transmitted between the computer device 101 and the database server 102 through a network.

[0046] The database server 102 may be used to store the power data to be detected, the reference cluster centers of the respective multiple category clusters corresponding to the predetermined clean power data set, and the distance constraints of each category cluster.

[0047] The computer device 101 can first obtain the power data to be detected from the database server 102, and then input the power data to be detected into a feature extraction network including multiple hidden layers to obtain the deep data features of the power data to be detected; secondly, perform feature dimensionality reduction on the deep data features to obtain low-dimensional deep data features of the power data to be detected; thereafter, the computer device 101 can obtain the respective benchmark clustering centers of multiple category clusters corresponding to a predetermined clean power data set from the database server 102, and determine the Euclidean distance between the low-dimensional deep data features and the benchmark clustering center of each category cluster; finally, obtain the distance constraint of each category cluster from the database server 102, and determine the detection result of the power data to be detected based on the multiple Euclidean distances and the distance constraint of each category cluster; the detection result is clean power data, or poisoned power data. Using this method, a computer device extracts deep data features from the power data to be tested and performs dimensionality reduction on these features to obtain low-dimensional deep data features. The computer then determines the Euclidean distance between the low-dimensional deep data features and the benchmark cluster center of each category cluster corresponding to a predetermined clean power data set, determines whether the distance constraint is met, and thus determines the detection result for the power data to be tested. Compared to existing power data detection methods, this method eliminates the need for complex data processing on the input data, thereby reducing the computational overhead of detecting power data and enabling real-time detection of large-scale power data.

[0048] Optionally, the computer device 101 may be a terminal device or a server. The terminal devices mentioned herein may include, but are not limited to, smartphones, tablet computers, laptop computers, desktop computers, smart watches, smart TVs, and smart car terminals. The server mentioned herein may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers.

[0049] See Figure 2 , Figure 2 This is a flow chart of a method for detecting a backdoor in power data provided by an embodiment of the present application. The method can be executed by a computer device (for example, the computer device 101 described above). Figure 2 As shown, the power data backdoor detection method may include but is not limited to the following steps:

[0050] S201. Input the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers.

[0051] Because the feature extraction network includes multiple hidden layers, the computer device inputs the power data to be tested into the feature extraction network, and the data features obtained for the power data to be tested are deep data features. These deep data features contain richer semantic information and are more helpful in distinguishing clean power data from corrupted power data. This improves the accuracy of subsequent detection results based on the deep data features.

[0052] S202: Perform feature dimensionality reduction processing on the data features to obtain low-dimensional data features.

[0053] In this way, the computer device can obtain low-dimensional data features by reducing the dimensions of the data features, thereby helping to reduce the computational overhead of detecting power data.

[0054] S203 : Determine a first Euclidean distance between the low-dimensional data feature and respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set.

[0055] In an optional implementation, before step S203 , the computer device may further determine respective benchmark cluster centers of a plurality of category clusters corresponding to the clean power data set.

[0056] S204 : Determine a detection result of the power data to be detected based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster; the detection result is clean power data or poisoned power data.

[0057] In an optional embodiment, before step S204 , the computer device may further determine distance constraints for each of the multiple category clusters corresponding to the clean power data set.

[0058] In an embodiment of the present application, a computer device can input the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers; the data features are subjected to feature dimensionality reduction processing to obtain low-dimensional data features; the first Euclidean distance between the low-dimensional data features and the respective reference cluster centers of multiple category clusters corresponding to a predetermined clean power data set is determined; based on the multiple first Euclidean distances and the predetermined distance constraints of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data. Using this method, the computer device can extract the deep data features of the power data to be detected and perform dimensionality reduction processing on the deep data features to obtain low-dimensional deep data features. Thereafter, the Euclidean distance between the low-dimensional deep data features and the reference cluster centers of each category cluster corresponding to the predetermined clean power data set is determined to determine whether the distance constraints are met, thereby determining the detection result for the power data to be detected. In this way, compared with existing power data detection methods, there is no need to perform complex data processing on the input data, thereby reducing the computational overhead of detecting power data, thereby achieving real-time detection of large-scale power data.

[0059] See Figure 3 , Figure 3 This is a flow chart of another method for detecting backdoors in power data provided by an embodiment of the present application. Figure 2 Compared with the power data backdoor detection method shown in the figure, Figure 3 The method also describes how the computer device determines the benchmark cluster centers of the multiple category clusters corresponding to the clean power data set, and how to determine the distance constraints of each category cluster. Figure 3 As shown, the power data backdoor detection method may include but is not limited to the following steps:

[0060] S301: Obtain a clean power data set.

[0061] In the process of defending against backdoor attacks on the power system, assuming that the defender cannot access the original training power dataset, but can access a set of clean verification power datasets (or clean power datasets), the computer device can obtain the clean power dataset and verify the basic performance of the power system based on the clean power dataset.

[0062] S302: Inputting multiple power data in the obtained clean power data set into a feature extraction network to obtain a data feature matrix corresponding to the multiple power data; the feature extraction network includes multiple hidden layers.

[0063] Since the feature extraction network includes multiple hidden layers, the computer device inputs multiple power data in the clean power data set into the feature extraction network, and the obtained data feature matrix of the multiple power data includes deep data features of each power data in the multiple power data.

[0064] S303: Perform feature dimensionality reduction processing on the data feature matrix to obtain a low-dimensional feature matrix.

[0065] In an optional embodiment, the computer device performs feature dimensionality reduction processing on the data feature matrix to obtain a low-dimensional feature matrix, which may include: using a principal component analysis method to perform feature dimensionality reduction processing on the data feature matrix to obtain a low-dimensional feature matrix.

[0066] Principal Component Analysis (PCA), also known as principal component analysis, utilizes the concept of dimensionality reduction to transform multiple indicators into a small number of comprehensive indicators (i.e., principal components). Each principal component captures the majority of the original variable's information, and the information contained within is unique. This method, while introducing multiple variables, reduces complex factors to a few principal components, simplifying the problem and producing more scientific and effective data.

[0067] Next, we use the principal component analysis method to analyze the data feature matrix (denoted as f l ) to perform feature dimensionality reduction processing and introduce the process of obtaining a low-dimensional feature matrix.

[0068] Step 1: Determine the data feature matrix f l The covariance matrix of .

[0069] Step 2: Through the covariance matrix, the data feature matrix f l Perform eigenvalue decomposition and determine f l The principal components in .

[0070] Step 3: Select the largest m principal components and convert the original data features f l Projected onto m principal components, thus forming a matrix P=(P1,P2,...,P m ).

[0071] Step 4: Process the matrix P to obtain the low-dimensional feature matrix Z corresponding to multiple power data pca .

[0072] Optionally, the computer device processes the matrix P to obtain a low-dimensional feature matrix Z corresponding to multiple power data pca When , the following formula (1) can be used.

[0073] (1)

[0074] In formula (1), Z represents the data feature matrix f l The data standardization results.

[0075] In this application, computer equipment performs dimensionality reduction processing on the deep data feature matrix of power data and maps high-dimensional features to low-dimensional space, which enables k-means clustering to more effectively distinguish different categories of data while reducing the noise present in high-dimensional data features.

[0076] S304: Cluster the low-dimensional feature matrix to obtain multiple category clusters.

[0077] In an optional embodiment, the computer device may use a K-mean clustering method to cluster multiple low-dimensional features to obtain multiple category clusters.

[0078] Each cluster contains one or more low-dimensional features of clean power data, and the clean power data corresponding to the low-dimensional features in each cluster have the same or similar properties. In addition, each cluster has a cluster center, which represents the average point of the cluster.

[0079] S305 : Determine an initial cluster center of each category cluster based on each low-dimensional feature in each category cluster and the number of low-dimensional features in the category cluster.

[0080] In an optional embodiment, the computer device may use the following formula (2) when determining the initial cluster center of each category cluster based on each low-dimensional feature in each category cluster and the number of low-dimensional features in the category cluster.

[0081] (2)

[0082] In formula (2), C j It represents the set of the j-th category cluster; It represents the number of data points (low-dimensional features) belonging to the j-th category cluster. i Indicates that it is assigned to the j-th category cluster (i.e. C j ) in the data points (low-dimensional features), z i From the low-dimensional feature matrix Z determined above pca ;u j It represents the initial cluster center of the j-th category cluster.

[0083] S306 , updating the initial cluster center of each category cluster by minimizing the objective function to obtain the benchmark cluster center of each category cluster.

[0084] In an optional implementation, the objective function may be shown as the following formula (3).

[0085] (3)

[0086] In formula (3), C represents the total number of category clusters; C j represents the set of the j-th category cluster; z i Indicates that it is assigned to the j-th category cluster (i.e. C j ) in the data points (low-dimensional features); u j It represents the initial cluster center of the j-th category cluster; E represents the objective function.

[0087] Optionally, the computer device determines the benchmark cluster center (denoted as ) After that, the benchmark cluster centers corresponding to all category clusters can be determined , where C represents the total number of category clusters.

[0088] S307 : Determine the second Euclidean distance between each low-dimensional feature in each category cluster and the benchmark cluster center of the category cluster.

[0089] In an optional embodiment, when the computer device determines the second Euclidean distance between each low-dimensional feature in each category cluster and the reference cluster center of the category cluster, the following formula (4) may be used.

[0090] (4)

[0091] In formula (4), z i It represents the i-th low-dimensional feature assigned to the j-th category cluster; It represents the benchmark cluster center of the j-th category cluster; d i It represents the Euclidean distance between the i-th low-dimensional feature in the j-th category cluster and the benchmark cluster center of the j-th category cluster.

[0092] S308 : Determine the distance constraint of each category cluster based on the multiple second Euclidean distances corresponding to each category cluster.

[0093] In an optional embodiment, the computer device determines the distance constraint of each category cluster based on the multiple second Euclidean distances corresponding to each category cluster, which may include: determining, for each category cluster, the average value of the multiple second Euclidean distances corresponding to the category cluster; and using the product of the average value and a preset value as the distance constraint of the category cluster.

[0094] In this embodiment, when the computer device determines the average value of multiple second Euclidean distances corresponding to each category cluster, the following formula (5) may be used.

[0095] (5)

[0096] In formula (5), It represents the average value of multiple Euclidean distances corresponding to the j-th category cluster; d i It represents the Euclidean distance between the i-th low-dimensional feature in the j-th category cluster and the benchmark cluster center of the j-th category cluster; the physical meanings of other letters can be referred to the above explanation of the physical meanings of the letters in formula (4), which will not be repeated here.

[0097] In this embodiment, the preset value is, for example, 3. 3 is an empirical value obtained based on multiple experiments. When the preset value is 3, the computer device can determine the distance constraint of the j-th category cluster as .

[0098] S309: Input the power data to be detected into a feature extraction network to obtain data features of the power data to be detected.

[0099] In an optional implementation, the relevant description of step S309 can be found in the description of the aforementioned step S301, which will not be repeated here.

[0100] S310: Use principal component analysis to perform feature dimensionality reduction on the data features to obtain low-dimensional data features.

[0101] S311 : Determine a first Euclidean distance between the low-dimensional data feature and respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set.

[0102] In an optional embodiment, the computer device can calculate the benchmark cluster centers corresponding to all category clusters corresponding to the low-dimensional data features and the clean power data set. The first Euclidean distance between each base cluster center in .

[0103] S312 : Determine a detection result of the power data to be detected based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster; the detection result is clean power data or poisoned power data.

[0104] In an optional embodiment, the computer device determines the detection results of the power data to be detected based on multiple first Euclidean distances and predetermined distance constraints for each category cluster, which may include: when it is determined that any first Euclidean distance is less than or equal to the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, determining that the power data to be detected is clean power data; when it is determined that each first Euclidean distance is greater than the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, determining that the power data to be detected is poisoned power data.

[0105] For example, assuming that among the multiple first Euclidean distances, the first Euclidean distance 1 is the Euclidean distance between the low-dimensional data features of the power data to be detected and the benchmark cluster center of the first category cluster in the predetermined clean power data set, the first Euclidean distance 1 is 0.18, and the distance constraint of the first category cluster is =0.21. In this case, the computer device may determine that the first Euclidean distance 1 (0.18) is smaller than the distance constraint (0.21) of the first category cluster. In this case, the computer device may determine that the power data to be detected is clean power data.

[0106] For another example, assume that multiple category clusters include category cluster 1, category cluster 2, and category cluster 3, where the distance constraint of category cluster 1 is 0.21, the distance constraint of category cluster 2 is 0.24, and the distance constraint of category cluster 3 is 0.18, and assume that multiple first Euclidean distances include first Euclidean distance 1, first Euclidean distance 2, and first Euclidean distance 3, where the first Euclidean distance 1 is the Euclidean distance between the low-dimensional data features of the power data to be detected and the benchmark cluster center of category cluster 1, and the first Euclidean distance 1 is 0.22; the first Euclidean distance 2 is the Euclidean distance between the low-dimensional data features of the power data to be detected and the benchmark cluster center of category cluster 2, and the first Euclidean distance 2 is 0.26; the first Euclidean distance 3 is the Euclidean distance between the low-dimensional data features of the power data to be detected and the benchmark cluster center of category cluster 2, and the first Euclidean distance 2 is 0.20. In this case, the computer device can determine that the first Euclidean distance 1 (0.22) is greater than the distance constraint of category cluster 1 (0.21), the first Euclidean distance 2 (0.26) is greater than the distance constraint of category cluster 2 (0.24), and the first Euclidean distance 3 (0.20) is greater than the distance constraint of category cluster 3 (0.18). At this time, the computer device can determine that the power data to be detected is poisoned power data.

[0107] In an embodiment of the present application, a computer device can obtain a clean power data set and determine the respective benchmark cluster centers of multiple category clusters corresponding to the clean power data set, and then determine the Euclidean distance between all samples in each category cluster and the benchmark cluster center of the category cluster, and based on multiple Euclidean distances, determine the distance constraint of each category cluster. Afterwards, in the process of detecting the power data to be detected, determine the low-dimensional data features of the power data to be detected, and determine the Euclidean distance between the low-dimensional data features and the benchmark cluster center of each category cluster. Finally, based on multiple Euclidean distances and the distance constraint of each category cluster, determine whether the power data to be detected is clean power data or poisoned power data. In this way, compared with the existing power data detection method, there is no need to perform complex data processing on the input data, thereby reducing the computational overhead of detecting power data, and thus realizing real-time detection of large-scale power data.

[0108] In addition, the present application utilizes a feature extraction network comprising multiple hidden layers to perform feature extraction on power data, and can extract deep features of the power data (or use the last hidden layer in the feature extraction network to output the deep features of the power data). Subsequently, the deep features are used as the basis for backdoor analysis. Since the deep features are the highest-order features of the input power data, they determine the decision-making process of the model, and also imply how the backdoor model correctly identifies clean samples and why the backdoor samples are incorrectly predicted as target categories. Therefore, analyzing the deep features can improve the accuracy of detecting the power data to be detected, or in other words, can more accurately distinguish between poisoned power data and clean power data.

[0109] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0110] Based on the same inventive concept, embodiments of the present application also provide a power data backdoor detection device for implementing the aforementioned power data backdoor detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more power data backdoor detection device embodiments provided below can be found in the limitations of the power data backdoor detection method described above and will not be repeated here.

[0111] See Figure 4 , Figure 4 This is a schematic diagram of the structure of a power data backdoor detection device provided by an embodiment of the present application. Figure 4 As shown, the power data detection device may include but is not limited to:

[0112] The feature extraction module 401 is used to input the power data to be detected into the feature extraction network to obtain the data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0113] The feature dimensionality reduction module 402 is used to perform feature dimensionality reduction processing on the data features to obtain low-dimensional data features;

[0114] A determination module 403 is configured to determine a first Euclidean distance between the low-dimensional data feature and respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0115] The determination module 403 is further configured to determine a detection result of the power data to be detected based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster; the detection result is clean power data or poisoned power data.

[0116] In one embodiment, when the determination module 403 is used to determine the detection result for the power data to be detected based on multiple first Euclidean distances and the predetermined distance constraints of each category cluster, it is specifically used to: when it is determined that any first Euclidean distance is less than or equal to the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, determine that the power data to be detected is clean power data; when it is determined that each first Euclidean distance is greater than the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, determine that the power data to be detected is poisoned power data.

[0117] In one embodiment, the feature extraction module 401 is also used to input multiple power data in the acquired clean power data set into the feature extraction network to obtain a data feature matrix corresponding to the multiple power data; the feature dimension reduction module 402 is also used to perform feature dimension reduction processing on the data feature matrix to obtain a low-dimensional feature matrix; cluster the low-dimensional feature matrix to obtain multiple category clusters; the determination module 403 is also used to determine the initial cluster center of each category cluster based on each low-dimensional feature in each category cluster and the number of low-dimensional features in the category cluster; the initial cluster center of each category cluster is updated by minimizing the objective function to obtain the benchmark cluster center of each category cluster.

[0118] In one embodiment, the determination module 403 is further used to: determine the second Euclidean distance between each low-dimensional feature in each category cluster and the benchmark cluster center of the category cluster; and determine the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster.

[0119] In one embodiment, when the determination module 403 is used to determine the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster, it is specifically used to: determine, for each category cluster, the average value of the multiple second Euclidean distances corresponding to the category cluster; and use the product of the average value and a preset value as the distance constraint of the category cluster.

[0120] In one embodiment, when the feature dimension reduction module 402 is used to perform feature dimension reduction processing on data features to obtain low-dimensional data features, it is specifically used to: use principal component analysis to perform feature dimension reduction processing on data features to obtain low-dimensional data features.

[0121] Each module in the aforementioned power data backdoor detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a terminal device in hardware form, or can be stored in a memory in the terminal device in software form, so that the processor can call and execute the corresponding operations of each module.

[0122] In an exemplary embodiment, the present application provides a computer device, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for detecting backdoors in power data.

[0123] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0124] In an exemplary embodiment, the present application provides a computer device including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0125] Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0126] Perform feature dimensionality reduction on data features to obtain low-dimensional data features;

[0127] determining the first Euclidean distance between the low-dimensional data feature and the respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0128] Based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data.

[0129] In one embodiment, when a processor executes a computer program to determine a detection result for the power data to be detected based on multiple first Euclidean distances and predetermined distance constraints for each category cluster, the following steps are specifically implemented: when it is determined that any first Euclidean distance is less than or equal to the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, the power data to be detected is determined to be clean power data; when it is determined that each first Euclidean distance is greater than the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, the power data to be detected is determined to be poisoned power data.

[0130] In one embodiment, the processor executes the computer program to further implement the following steps: inputting multiple power data in the acquired clean power data set into the feature extraction network to obtain a data feature matrix corresponding to the multiple power data; performing feature dimensionality reduction processing on the data feature matrix to obtain a low-dimensional feature matrix; clustering the low-dimensional feature matrix to obtain multiple category clusters; determining the initial cluster center of each category cluster based on each low-dimensional feature in each category cluster and the number of low-dimensional features in the category cluster; updating the initial cluster center of each category cluster by minimizing the objective function to obtain a benchmark cluster center of each category cluster.

[0131] In one embodiment, the processor executing the computer program further implements the following steps: determining the second Euclidean distance between each low-dimensional feature in each category cluster and the benchmark cluster center of the category cluster; and determining the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster.

[0132] In one embodiment, when a processor executes a computer program to determine the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster, the following steps are specifically implemented: for each category cluster, the average value of the multiple second Euclidean distances corresponding to the category cluster is determined; and the product of the average value and a preset value is used as the distance constraint of the category cluster.

[0133] In one embodiment, when the processor executes a computer program to perform feature dimensionality reduction processing on data features and obtains low-dimensional data features, the following steps are specifically implemented: using principal component analysis to perform feature dimensionality reduction processing on data features and obtain low-dimensional data features.

[0134] In an exemplary embodiment, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the following steps are implemented:

[0135] Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0136] Perform feature dimensionality reduction on data features to obtain low-dimensional data features;

[0137] determining the first Euclidean distance between the low-dimensional data feature and the respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0138] Based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data.

[0139] In one embodiment, a computer program is executed by a processor to implement, when determining the detection result for the power data to be detected based on multiple first Euclidean distances and predetermined distance constraints for each category cluster, the following steps are specifically implemented: when it is determined that any first Euclidean distance is less than or equal to the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, the power data to be detected is determined to be clean power data; when it is determined that each first Euclidean distance is greater than the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, the power data to be detected is determined to be poisoned power data.

[0140] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: multiple power data in the acquired clean power data set are input into the feature extraction network to obtain a data feature matrix corresponding to the multiple power data; feature dimensionality reduction processing is performed on the data feature matrix to obtain a low-dimensional feature matrix; the low-dimensional feature matrix is ​​clustered to obtain multiple category clusters; based on each low-dimensional feature in each category cluster and the number of low-dimensional features in the category cluster, the initial cluster center of each category cluster is determined; the initial cluster center of each category cluster is updated by minimizing the objective function to obtain the benchmark cluster center of each category cluster.

[0141] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining the second Euclidean distance between each low-dimensional feature in each category cluster and the benchmark cluster center of the category cluster; and determining the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster.

[0142] In one embodiment, when a computer program is executed by a processor to determine the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster, the following steps are specifically implemented: for each category cluster, the average value of the multiple second Euclidean distances corresponding to the category cluster is determined; and the product of the average value and a preset value is used as the distance constraint of the category cluster.

[0143] In one embodiment, when a computer program is executed by a processor to perform feature dimensionality reduction processing on data features and obtain low-dimensional data features, the following steps are specifically implemented: using principal component analysis to perform feature dimensionality reduction processing on data features and obtain low-dimensional data features.

[0144] In an exemplary embodiment, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the following steps:

[0145] Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers;

[0146] Perform feature dimensionality reduction on data features to obtain low-dimensional data features;

[0147] determining the first Euclidean distance between the low-dimensional data feature and the respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set;

[0148] Based on the multiple first Euclidean distances and the predetermined distance constraint of each category cluster, a detection result of the power data to be detected is determined; the detection result is clean power data or poisoned power data.

[0149] In one embodiment, a computer program is executed by a processor to implement, when determining the detection result for the power data to be detected based on multiple first Euclidean distances and predetermined distance constraints for each category cluster, the following steps are specifically implemented: when it is determined that any first Euclidean distance is less than or equal to the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, the power data to be detected is determined to be clean power data; when it is determined that each first Euclidean distance is greater than the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, the power data to be detected is determined to be poisoned power data.

[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: multiple power data in the acquired clean power data set are input into the feature extraction network to obtain a data feature matrix corresponding to the multiple power data; feature dimensionality reduction processing is performed on the data feature matrix to obtain a low-dimensional feature matrix; the low-dimensional feature matrix is ​​clustered to obtain multiple category clusters; based on each low-dimensional feature in each category cluster and the number of low-dimensional features in the category cluster, the initial cluster center of each category cluster is determined; the initial cluster center of each category cluster is updated by minimizing the objective function to obtain the benchmark cluster center of each category cluster.

[0151] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining the second Euclidean distance between each low-dimensional feature in each category cluster and the benchmark cluster center of the category cluster; and determining the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster.

[0152] In one embodiment, when a computer program is executed by a processor to determine the distance constraint of each category cluster based on multiple second Euclidean distances corresponding to each category cluster, the following steps are specifically implemented: for each category cluster, the average value of the multiple second Euclidean distances corresponding to the category cluster is determined; and the product of the average value and a preset value is used as the distance constraint of the category cluster.

[0153] In one embodiment, when a computer program is executed by a processor to perform feature dimensionality reduction processing on data features and obtain low-dimensional data features, the following steps are specifically implemented: using principal component analysis to perform feature dimensionality reduction processing on data features and obtain low-dimensional data features.

[0154] It should be noted that the data involved in this application (including but not limited to power data to be tested, clean power data sets, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0155] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0156] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0157] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for detecting backdoors in power data, characterized in that: The method comprises: Inputting the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers; Performing feature dimensionality reduction processing on the data features to obtain low-dimensional data features; Determining a first Euclidean distance between the low-dimensional data feature and respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set; Determining a detection result of the power data to be detected based on the plurality of first Euclidean distances and a predetermined distance constraint of each of the category clusters; the detection result is clean power data or poisoned power data; The distance constraint of each of the category clusters is determined by: Determining the second Euclidean distance between each low-dimensional feature in each of the category clusters and the benchmark cluster center of the category cluster; For each of the category clusters, determining an average value of a plurality of the second Euclidean distances corresponding to the category cluster; The product of the average value and a preset value is used as the distance constraint of the category cluster; For each category cluster, the average value of the plurality of second Euclidean distances corresponding to the category cluster can be determined by the following formula: in, It represents the average value of multiple Euclidean distances corresponding to the j-th category cluster; C j represents the set of the j-th category cluster; d i It represents the Euclidean distance between the i-th low-dimensional feature in the j-th category cluster and the benchmark cluster center of the j-th category cluster; i Represents the i-th low-dimensional feature assigned to the j-th category cluster; μ′ j It represents the benchmark cluster center of the j-th category cluster; d i It represents the Euclidean distance between the i-th low-dimensional feature in the j-th category cluster and the benchmark cluster center of the j-th category cluster.

2. The method according to claim 1, characterized in that The determining of a detection result for the power data to be detected based on the plurality of first Euclidean distances and a predetermined distance constraint of each of the category clusters includes: In a case where it is determined that any one of the first Euclidean distances is less than or equal to the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, determining that the power data to be detected is clean power data; In a case where it is determined that each of the first Euclidean distances is greater than the distance constraint corresponding to the category cluster corresponding to the first Euclidean distance, it is determined that the power data to be detected is poisoned power data.

3. The method according to claim 1, characterized in that The benchmark cluster centers of the multiple category clusters corresponding to the clean power dataset are determined in the following way: Inputting multiple power data in the obtained clean power data set into a feature extraction network to obtain data feature matrices corresponding to the multiple power data; Performing feature dimensionality reduction processing on the data feature matrix to obtain a low-dimensional feature matrix; Clustering the low-dimensional feature matrix to obtain multiple category clusters; Determining an initial cluster center of each of the category clusters based on each low-dimensional feature in each of the category clusters and the number of the low-dimensional features in the category cluster; The initial cluster center of each of the category clusters is updated by minimizing the objective function to obtain the benchmark cluster center of each of the category clusters.

4. The method according to any one of claims 1 to 3, characterized in that The performing feature dimensionality reduction processing on the data features to obtain low-dimensional data features includes: The principal component analysis method is used to perform feature dimensionality reduction processing on the data features to obtain low-dimensional data features.

5. The method according to claim 4, characterized in that The principal component analysis method is used to perform feature dimensionality reduction processing on the data feature matrix to obtain a low-dimensional feature matrix, including: Determining a covariance matrix of the data feature matrix; Performing eigendecomposition on the data feature matrix using the covariance matrix to determine the principal components of the data feature matrix; Selecting and retaining a plurality of the largest principal components, projecting the data feature matrix onto the plurality of principal components to obtain a new matrix; The new matrix is ​​processed to obtain a low-dimensional feature matrix corresponding to the plurality of power data.

6. The method according to claim 5, characterized in that The new matrix is ​​processed to obtain a low-dimensional feature matrix corresponding to a plurality of power data, including: performing standardization processing on the data feature matrix to obtain a standardized data feature matrix; The new matrix is ​​multiplied by the standardized data feature matrix to obtain a low-dimensional feature matrix corresponding to the plurality of power data.

7. A power data backdoor detection device, characterized in that: The device comprises: A feature extraction module is used to input the power data to be detected into a feature extraction network to obtain data features of the power data to be detected; the feature extraction network includes multiple hidden layers; A feature dimensionality reduction module is used to perform feature dimensionality reduction processing on the data features to obtain low-dimensional data features; a determination module, configured to determine a first Euclidean distance between the low-dimensional data feature and respective benchmark cluster centers of a plurality of category clusters corresponding to a predetermined clean power data set; The determination module is further configured to determine a detection result of the power data to be detected based on the plurality of first Euclidean distances and a predetermined distance constraint of each of the category clusters; the detection result is clean power data or poisoned power data; The distance constraint of each of the category clusters is determined by: Determining the second Euclidean distance between each low-dimensional feature in each of the category clusters and the benchmark cluster center of the category cluster; For each of the category clusters, determining an average value of a plurality of the second Euclidean distances corresponding to the category cluster; The product of the average value and a preset value is used as the distance constraint of the category cluster; For each category cluster, the average value of the plurality of second Euclidean distances corresponding to the category cluster can be determined by the following formula: in, It represents the average value of multiple Euclidean distances corresponding to the j-th category cluster; C j represents the set of the j-th category cluster; d i It represents the Euclidean distance between the i-th low-dimensional feature in the j-th category cluster and the benchmark cluster center of the j-th category cluster; i Represents the i-th low-dimensional feature assigned to the j-th category cluster; μ′ j It represents the benchmark cluster center of the j-th category cluster; d i It represents the Euclidean distance between the i-th low-dimensional feature in the j-th category cluster and the benchmark cluster center of the j-th category cluster.

8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Improved K-means abnormal value detection method and device

    CN109978070A

  • Data processing method and device, electronic equipment and storage medium

    CN115270957A