Multi-source power data anomaly identification method and model training method, device and equipment
By employing a divergence-based federated learning gradient aggregation algorithm in the power system, the training and identification of anomaly identification models for multi-source power data can be completed on the client side, solving the security issues caused by data transmission and improving the security of power data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY
- Filing Date
- 2024-09-20
- Publication Date
- 2026-06-23
AI Technical Summary
When existing technologies are used to identify anomalies in multi-source power data in power systems, the frequent data transmission increases the risk of power data leakage and reduces data security.
The federated learning gradient aggregation algorithm using divergence evaluation trains a local neural network model on the participating client and uploads the local gradient and sample class distribution to the server. The server aggregates and updates the global neural network model, and then distributes it to the client for iterative training. This allows model training and recognition to be completed on the client, avoiding data transmission between the participating parties and the server.
This improves the security of power data, ensuring that no power data needs to be transmitted during model training and recognition, thus enhancing data protection.
Smart Images

Figure CN119167271B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, model training method, apparatus, and equipment for identifying anomalies in multi-source power data. Background Technology
[0002] Power systems typically have complex structures and a wide variety of data types. Power data often exhibits various anomalies, such as voltage anomalies, current anomalies, and load anomalies.
[0003] These abnormal data may lead to instability in the power system or even cause accidents. Therefore, it is usually necessary to identify anomalies in power data in order to detect problems early, avoid further losses, and improve the stability of the power system.
[0004] Current methods for anomaly identification require aggregating multi-source power business data from various subordinate units or different information systems for higher-level analysis and mining. This process involves the transmission and retrieval of power data. However, frequent transmission and retrieval often increase the risk of power data leakage and reduce the security of power data. Summary of the Invention
[0005] This application provides a method, model training method, apparatus, and equipment for identifying anomalies in multi-source power data, thereby improving the security of the power data anomaly identification process.
[0006] In a first aspect, embodiments of this application provide a training method for a multi-source power data anomaly identification model, applied to a server, the method comprising:
[0007] Obtain the local proprietary network gradient and sample category distribution obtained by each participating client from its trained anomaly detection neural network model;
[0008] Based on the divergence evaluation-based federated learning gradient aggregation algorithm and the sample class distribution, the local proprietary network gradients are aggregated to obtain the global model gradient.
[0009] The global model gradient is used to update the global neural network model on the server that is isomorphic to the anomaly detection neural network model;
[0010] The updated global neural network model is distributed to each participating client so that the participating client can iteratively train the global neural network model based on local private power data until the model converges, resulting in a trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0011] Secondly, embodiments of this application provide a training method for a multi-source power data anomaly identification model, applicable to any participating party's client, the method comprising:
[0012] The local private power data is used to train an anomaly detection neural network model for a preset network topology to obtain the local proprietary network gradient.
[0013] Determine the local sample class distribution and send the local network gradient and sample class distribution to the server;
[0014] Receive the global neural network model distributed by the server. The global neural network model is the anomaly detection neural network model updated by the server based on its local network gradient and sample category distribution.
[0015] The updated anomaly detection neural network model is iteratively trained based on local private power data until the model converges, resulting in a trained anomaly detection neural network model. This model is used to output predicted probability values based on the power data to be detected.
[0016] Thirdly, this application also provides a method for identifying anomalies in multi-source power data, applied to a participating party's client, the method comprising:
[0017] The power data to be detected from the participating client is input into the anomaly detection neural network model trained by the multi-source power data anomaly identification model training method provided in any embodiment of this application;
[0018] Obtain the predicted probability value output by the anomaly detection neural network model, and identify anomalies in the power data to be detected based on the predicted probability value.
[0019] Fourthly, this application also provides a multi-source power data anomaly identification model training device, applied to a server, the device comprising:
[0020] The first acquisition module is used to acquire the local proprietary network gradient and sample category distribution obtained by each participating client through training its own anomaly detection neural network model.
[0021] The gradient aggregation module is used to aggregate the local proprietary network gradients based on the divergence evaluation federated learning gradient aggregation algorithm and the sample class distribution to obtain the global model gradient.
[0022] The update module is used to update the global neural network model on the server that is isomorphic to the anomaly detection neural network model using the global model gradient;
[0023] The distribution module is used to distribute the updated global neural network model to each participating client, so that the participating clients can iteratively train the global neural network model based on their local private power data until the model converges, and obtain the trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0024] Fifthly, embodiments of this application also provide a training device for a multi-source power data anomaly identification model, applicable to any participating party's client. The device includes:
[0025] The training module is used to train an anomaly detection neural network model of a preset network topology using local private power data, so as to obtain the local proprietary network gradient.
[0026] The sending module is used to determine the local sample class distribution and send the local network gradient and sample class distribution to the server.
[0027] The receiving module is used to receive the global neural network model distributed by the server. The global neural network model is the anomaly detection neural network model updated by the server based on its local network gradient and sample category distribution.
[0028] The iteration module is used to iteratively train the updated anomaly detection neural network model based on local private power data until the model converges, thus obtaining the trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0029] Sixthly, embodiments of this application also provide a multi-source power data anomaly identification model device, applied to a participating party's client, the device comprising:
[0030] The input module is used to input the power data to be detected from the participating client into the anomaly detection neural network model trained by the multi-source power data anomaly identification model training method provided in any embodiment of this application;
[0031] The identification module is used to obtain the predicted probability value output by the anomaly detection neural network model, and to identify anomalies in the power data to be detected based on the predicted probability value.
[0032] In a seventh aspect, embodiments of this application also provide an electronic device, the electronic device comprising:
[0033] One or more processors;
[0034] Storage device for storing one or more programs.
[0035] When one or more programs are executed by one or more processors, the one or more processors implement the multi-source power data anomaly identification model training method or multi-source power data anomaly identification method provided in any embodiment of this application.
[0036] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, characterized in that, when the program is executed by a processor, it implements the multi-source power data anomaly identification model training method or the multi-source power data anomaly identification method provided in any embodiment of this application.
[0037] The technical solution of this application embodiment involves training the model using power data on each participating client's end. Only the local network gradients and sample category distributions of each participating client are uploaded to the server. The server then aggregates and updates the parameters of the global neural network model before distributing it to each participating client for iterative training. Furthermore, for subsequent anomaly detection, since the trained model has already been distributed to each participating client, anomaly detection can be performed locally. Therefore, model training can be achieved without transmitting power data between the participating clients and the server, and no data transmission is required during model use, significantly improving the security of power data. Attached Figure Description
[0038] Figure 1 A flowchart illustrating the training method for the multi-source power data anomaly identification model provided in Embodiment 1 of this application;
[0039] Figure 2 This is a flowchart illustrating a training method for a multi-source power data anomaly identification model provided in Embodiment 2 of this application.
[0040] Figure 3 A flowchart illustrating a multi-source power data anomaly identification model method provided in Embodiment 3 of this application;
[0041] Figure 4 This is a schematic diagram of the structure of a multi-source power data anomaly identification model training device provided in Embodiment 4 of this application;
[0042] Figure 5 This is a schematic diagram of the structure of a multi-source power data anomaly identification model training device provided in Embodiment 5 of this application;
[0043] Figure 6 This is a schematic diagram of the structure of a multi-source power data anomaly identification device provided in Embodiment Six of this application;
[0044] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 7 of this application. Detailed Implementation
[0045] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present application, not the entire structure.
[0046] Example 1
[0047] Figure 1 This is a flowchart illustrating the training method for the multi-source power data anomaly identification model provided in Embodiment 1 of this application, as shown below. Figure 1 As shown, the multi-source power data anomaly identification model training method provided in this embodiment can be applied to the server, and specifically includes the following steps:
[0048] Step 101: Obtain the local proprietary network gradient and sample category distribution obtained by each participating client from training its own anomaly detection neural network model.
[0049] It should be noted that participating clients refer to the various terminals in the power system that directly generate power data. Each participating client communicates with the server to facilitate data transmission.
[0050] In addition, each participating client will train its own anomaly detection neural network model to obtain the corresponding local proprietary network gradient. The participating clients will involve multiple sample categories, and the distribution of each sample category may be different in each participating client. Therefore, it is also necessary to obtain the sample category distribution.
[0051] It should be noted that the acquisition of local proprietary network gradients and sample class distributions will be explained in the implementation details of the client execution section, and will not be repeated here.
[0052] Step 102: Based on the divergence evaluation federated learning gradient aggregation algorithm and the sample class distribution, aggregate the local self-owned network gradients to obtain the global model gradient.
[0053] In this step, the federated learning gradient aggregation algorithm for divergence evaluation utilizes the imbalance of the class distribution of bright samples in symmetric JS divergence to evaluate the contribution of each participant to the intermediate parameters.
[0054] It should be noted that JS divergence is a variant of KL divergence, used to characterize the similarity of probability distributions, while also addressing the asymmetry problem inherent in KL divergence. Given sample distributions P and Q, the KL divergence between the two distributions can be expressed in the following form:
[0055]
[0056] The KL divergence is asymmetric, i.e., KL(P||Q)≠KL(Q||P), which does not satisfy the properties of a metric space, and therefore cannot be called a distance metric.
[0057] Therefore, JS divergence is used to evaluate the similarity of the data sample distributions across different clients, specifically in the following form:
[0058]
[0059] Expanding the above formula, we get:
[0060]
[0061] Based on the above theoretical foundation, in this step, we can first determine the standardized relative divergence evaluation score of each participating client based on the sample category distribution of each participating client; then, we can use the standardized relative divergence evaluation score to weight the gradient of each local proprietary network to obtain the global model gradient.
[0062] Specifically, when determining the standardized relative divergence evaluation score, for any participating client, the JS divergence between the participating client and other participating clients is determined; then the JS divergence is standardized to obtain the standardized relative divergence evaluation score of the parameter client.
[0063] In a specific example, assume that the data sample category distributions in each participating client are D1, D2, D3, ..., D N Then the relative JS divergence between the data sample distribution of the i-th participating client and other clients is:
[0064]
[0065] By standardizing the relative JS divergence using the Softmax function, we can obtain the standardized relative divergence evaluation scores for each participating client. The specific calculation process is as follows:
[0066]
[0067] After obtaining the standardized relative divergence evaluation score, this step can input the standardized relative divergence evaluation score and the gradients of each local proprietary network into a preset weighted aggregation algorithm to obtain the global model gradient output by the preset weighted aggregation algorithm.
[0068] The preset weighted aggregation algorithm can be:
[0069]
[0070] in, This represents the global model gradient after weighted aggregation.
[0071] Step 103: Update the global neural network model on the server that is isomorphic to the anomaly detection neural network model using the global model gradient.
[0072] In this step, when updating data, the network parameters of the global neural network model on the server can be updated using the global model gradient. The updated network parameters are then loaded into the global neural network model on the server, completing the update of the global neural network model on the server that is isomorphic to the anomaly detection neural network model.
[0073] In a specific example, the network parameter to be updated on the server can be denoted as Φ. s Then, the network parameters are updated using the aggregated global model:
[0074]
[0075] Where λ is the training learning rate of the detection model.
[0076] Step 104: Distribute the updated global neural network model to each participating client so that the participating clients can iteratively train the global neural network model based on their local private power data until the model converges.
[0077] After updating the global neural network model, the server distributes the updated global neural network model to each participating client. The participating clients then perform a new round of iterative optimization on the updated global neural network model until the model converges, thus completing the model training and obtaining the trained anomaly detection neural network model. The anomaly detection neural network model is used to output predicted probability values based on the power data to be detected.
[0078] In this embodiment, the training process using electricity data is completed on each participating client. Only the local network gradients and sample category distributions of each participating client are uploaded to the server. The server then aggregates and updates the parameters of the global neural network model before distributing it to each participating client for iterative training. Furthermore, during subsequent anomaly detection, since the trained model has already been distributed to each participating client, anomaly detection can be performed locally. Based on this, model training can be achieved without transmitting electricity data between the participating clients and the server, and no data transmission is required during model use, greatly improving the security of electricity data.
[0079] Example 2
[0080] Figure 2 This is a flowchart illustrating a training method for a multi-source power data anomaly identification model provided in Embodiment 2 of this application, as shown below. Figure 2As shown, the multi-source power data anomaly identification model training method provided in this embodiment can be applied to the clients of various participating parties, and specifically includes the following steps:
[0081] Step 201: Train the anomaly detection neural network model of the preset network topology using local private power data to obtain the local private network gradient.
[0082] In this step, the preset network topology is constructed based on Gated Recurrent Units (GRUs) and an attention mechanism. The preset network topology can be: y = GRU - Attention(X).
[0083] During training, local private power data can be input into the latest global neural network model, and then the output information can be input into a single-layer perceptron to calculate the predicted probability value of the local private power data.
[0084] In this case, the output layer of a single-layer perceptron has 1 neuron.
[0085] This single-layer perceptron can be represented as:
[0086]
[0087] Among them, W p and b p This represents the trainable parameters of a single-layer perceptron model. The predicted probability value of local private electricity data, y, is the output information of the neural network. The parameters of the single-layer perceptron are a subset of the parameters of the entire global neural network model, and are mainly responsible for the final prediction transformation. The parameters W of the single-layer perceptron p and b p This can be viewed as the final transformation after the model output. These parameters are optimized along with the parameters of other layers throughout the model training process to minimize the loss function.
[0088] Then, using a pre-constructed prediction loss function and pre-given true values, the loss value for the current iteration is determined, and the parameters of the global neural network model are adjusted based on this loss value. The prediction loss function can be constructed using cross-entropy loss, and in a specific example, it can be represented as follows:
[0089]
[0090] Where L represents the loss value; B represents the number of training samples on the client side. After the above training, the set of trainable parameters of GRU+Attention in the nth participating client can be denoted as Φ. n The loss value is denoted as L. nThen the gradient g of the model parameters of the nth client n :
[0091]
[0092] Obtain the gradient g of the model parameters n Then, the model parameters will be updated using the gradient descent optimization algorithm, and the parameter update formula is as follows:
[0093] θ=θ-ηg n
[0094] Where θ is the model parameter and η is the learning rate.
[0095] The convergence condition of the model is related to the loss function L. The model is considered convergent when the value of the loss function no longer decreases significantly over consecutive training epochs. Specifically, a very small threshold ε is set; when the change in the loss function over multiple consecutive epochs is less than ε, the model is considered convergent.
[0096] Step 202: Determine the local sample class distribution and send the local network gradient and sample class distribution to the server.
[0097] In this step, the local network gradient can be encrypted first to obtain the gradient to be uploaded; then the gradient to be uploaded and the sample class distribution can be sent to the server.
[0098] Specifically, during encryption, noise can be injected into the local network gradient to obtain the gradient to be uploaded, where the average value of the injected noise intensity is 0.
[0099] In a specific example, the encryption method can be a local differential privacy algorithm, which can be represented as follows:
[0100]
[0101] Where δ is the scaling factor; clip(g) n ,δ) is used to constrain the gradient g n The size of the gradient is used to avoid gradient explosion; Laplace(0,λ) represents Laplace noise with a mean of 0, and the parameter λ represents the noise intensity applied to the gradient.
[0102] Step 203: Receive the global neural network model distributed by the server. The global neural network model is a neural network model updated by the server based on its local network gradient and sample class distribution.
[0103] In this step, after receiving the global neural network model distributed by the server, the received application network model is the latest application network model, and the next iteration training can then begin, i.e., step 204.
[0104] Step 204: Iteratively train the updated anomaly detection neural network model based on local private power data until the model converges.
[0105] In this step, during each iteration of training, the local private power data is input into the updated anomaly detection neural network model to obtain output information; then the output information is input into a preset single-layer perceptron to obtain the predicted probability value corresponding to the local private power data.
[0106] Using a pre-constructed prediction loss function and a pre-given true value, the loss value of the current iteration process is determined, and the parameters of the global neural network model are adjusted according to the loss value until the loss value meets the convergence condition, thus obtaining a trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0107] It should be noted that the process of this step can be referred to in step 201 above, and will not be repeated here.
[0108] In this embodiment, the training process using electricity data is completed on each participating client. Only the local network gradients and sample category distributions of each participating client are uploaded to the server. The server then aggregates and updates the parameters of the global neural network model before distributing it to each participating client for iterative training. Furthermore, during subsequent anomaly detection, since the trained model has already been distributed to each participating client, anomaly detection can be performed locally. Based on this, model training can be achieved without transmitting electricity data between the participating clients and the server, and no data transmission is required during model use, greatly improving the security of electricity data.
[0109] Example 3
[0110] Figure 3 The flowchart illustrates a multi-source power data anomaly identification model method provided in Embodiment 3 of this application. This method can be applied to the participating client or server, and specifically includes the following steps:
[0111] Step 301: Input the power data to be detected from the participating client into the anomaly detection neural network model trained according to the multi-source power data anomaly identification model training method.
[0112] This step mainly involves applying the anomaly detection neural network model trained above, which requires inputting the power data to be detected into the trained anomaly detection neural network model.
[0113] Step 302: Obtain the predicted probability value output by the anomaly detection neural network model, and perform anomaly identification on the power data to be detected based on the predicted probability value.
[0114] This step will output the predicted probability values corresponding to different anomalies. The anomalies corresponding to the predicted probability values that exceed the probability threshold are identified as the anomalies.
[0115] In this example, the local power data to be detected still does not need to be uploaded to the server for identification during the identification process. Identification can be achieved locally without transmission, which improves the security of power data.
[0116] Example 4
[0117] Figure 4 This is a schematic diagram of a multi-source power data anomaly identification model training device provided in Embodiment 4 of this application. The multi-source power data anomaly identification model training device provided in this embodiment can execute the server-side multi-source power data anomaly identification model training method provided in any embodiment of this application, and possesses the corresponding functional modules and beneficial effects of the execution method. This device can be implemented in software and / or hardware, such as... Figure 4 As shown, the multi-source power data anomaly identification device specifically includes: an acquisition module 401, a gradient aggregation module 402, an update module 403, and a distribution module 404.
[0118] The acquisition module is used to acquire the local proprietary network gradient and sample category distribution obtained by each participating client through training its own anomaly detection neural network model.
[0119] The gradient aggregation module is used to aggregate the gradients of the local network based on the divergence evaluation federated learning gradient aggregation algorithm and the sample class distribution to obtain the global model gradient.
[0120] The update module is used to update the global neural network model on the server that is isomorphic to the anomaly detection neural network model using the global model gradient;
[0121] The distribution module is used to distribute the updated global neural network model to each participating client, so that the participating clients can iteratively train the global neural network model based on their local private power data until the model converges, and obtain the trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0122] Example 5
[0123] Figure 5This is a schematic diagram of a multi-source power data anomaly identification model training device provided in Embodiment 5 of this application. The multi-source power data anomaly identification model training device provided in this embodiment can execute the multi-source power data anomaly identification model training method for the participating client provided in any embodiment of this application, and possesses the corresponding functional modules and beneficial effects of the execution method. This device can be implemented in software and / or hardware, such as... Figure 5 As shown, the multi-source power data anomaly identification device specifically includes: a training module 501, a sending module 502, a receiving module 503, and an iteration module 504.
[0124] The training module is used to train an anomaly detection neural network model of a preset network topology using local private power data, so as to obtain the local proprietary network gradient.
[0125] The sending module is used to determine the local sample class distribution and send the local network gradient and sample class distribution to the server.
[0126] The receiving module is used to receive the global neural network model distributed by the server. The global neural network model is the anomaly detection neural network model updated by the server based on its local network gradient and sample category distribution.
[0127] The iteration module is used to iteratively train the updated anomaly detection neural network model based on local private power data until the model converges, thus obtaining the trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0128] Example 6
[0129] Figure 6 This is a schematic diagram of a multi-source power data anomaly identification device provided in Embodiment Six of this application. The multi-source power data anomaly identification device provided in this embodiment can execute the multi-source power data anomaly identification method for the participating client or server provided in any embodiment of this application, and possesses the corresponding functional modules and beneficial effects of the method execution. This device can be implemented in software and / or hardware, such as... Figure 5 As shown, the multi-source power data anomaly identification device specifically includes: an input module 601 and an identification module 602.
[0130] The input module is used to input the power data to be detected from the participating client into the anomaly detection neural network model trained by the multi-source power data anomaly identification model training method.
[0131] The identification module is used to obtain the predicted probability value output by the anomaly detection neural network model, and to identify anomalies in the power data to be detected based on the predicted probability value.
[0132] Example 7
[0133] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment Seven of this application, as shown below. Figure 7 As shown, the electronic device includes a processor 710, a memory 720, an input device 730, and an output device 740; the number of processors 710 in the electronic device can be one or more. Figure 7 Taking a processor 710 as an example; the processor 710, memory 720, input device 730, and output device 740 in the electronic device can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.
[0134] The memory 720, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the multi-source power data anomaly identification method in this embodiment of the invention. The processor 710 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 720, thereby implementing the aforementioned multi-source power data anomaly identification model training method.
[0135] Obtain the local proprietary network gradient and sample category distribution obtained by each participating client from its trained anomaly detection neural network model;
[0136] Based on the divergence evaluation-based federated learning gradient aggregation algorithm and the sample class distribution, the local proprietary network gradients are aggregated to obtain the global model gradient.
[0137] The global model gradient is used to update the global neural network model on the server that is isomorphic to the anomaly detection neural network model;
[0138] The updated global neural network model is distributed to each participating client so that the participating client can iteratively train the global neural network model based on local private power data until the model converges, and obtain the trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0139] or,
[0140] The local private power data is used to train an anomaly detection neural network model for a preset network topology to obtain the local proprietary network gradient.
[0141] Determine the local sample class distribution and send the local network gradient and sample class distribution to the server;
[0142] Receive the global neural network model distributed by the server. The global neural network model is the anomaly detection neural network model updated by the server based on its local network gradient and sample category distribution.
[0143] The updated anomaly detection neural network model is iteratively trained based on local private power data until the model converges, resulting in a trained anomaly detection neural network model. This model is used to output predicted probability values based on the power data to be detected.
[0144] Alternatively, the above-mentioned method for identifying anomalies in multi-source power data can be implemented as follows:
[0145] The power data to be detected from the participating client is input into the anomaly detection neural network model trained according to the multi-source power data anomaly identification model training method;
[0146] Obtain the predicted probability value output by the anomaly detection neural network model, and identify anomalies in the power data to be detected based on the predicted probability value.
[0147] The memory 720 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 720 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 720 may further include memory remotely located relative to the processor 710, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0148] Example 8
[0149] Embodiment 8 of this application also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a training method for a multi-source power data anomaly identification model:
[0150] Obtain the local proprietary network gradient and sample category distribution obtained by each participating client from its trained anomaly detection neural network model;
[0151] Based on the divergence evaluation-based federated learning gradient aggregation algorithm and the sample class distribution, the local proprietary network gradients are aggregated to obtain the global model gradient.
[0152] The global model gradient is used to update the global neural network model on the server that is isomorphic to the anomaly detection neural network model;
[0153] The updated global neural network model is distributed to each participating client so that the participating client can iteratively train the global neural network model based on local private power data until the model converges, and obtain the trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0154] or,
[0155] The local private power data is used to train an anomaly detection neural network model for a preset network topology to obtain the local proprietary network gradient.
[0156] Determine the local sample class distribution and send the local network gradient and sample class distribution to the server;
[0157] Receive the global neural network model distributed by the server. The global neural network model is the anomaly detection neural network model updated by the server based on its local network gradient and sample category distribution.
[0158] The updated anomaly detection neural network model is iteratively trained based on local private power data until the model converges, resulting in a trained anomaly detection neural network model. This model is used to output predicted probability values based on the power data to be detected.
[0159] Alternatively, the above-mentioned method for identifying anomalies in multi-source power data can be implemented as follows:
[0160] The power data to be detected from the participating client is input into the anomaly detection neural network model trained according to the multi-source power data anomaly identification model training method;
[0161] Obtain the predicted probability value output by the anomaly detection neural network model, and identify anomalies in the power data to be detected based on the predicted probability value.
[0162] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the above-described method operations, but can also perform related operations in the multi-source power data anomaly identification method provided in any embodiment of this application.
[0163] Based on the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0164] It is worth noting that in the embodiments of the search device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.
[0165] Note that the above description is merely a preferred embodiment and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments. Many other equivalent embodiments may be included without departing from the concept of this application, and the scope of this application is determined by the scope of the appended claims.
Claims
1. A training method for a multi-source power data anomaly identification model, characterized in that, Applied to the server side, the method includes: Obtain the local proprietary network gradient and sample category distribution obtained by each participating client in training the anomaly detection neural network model. The local proprietary network gradient is obtained by the client by injecting noise into the local proprietary network gradient, wherein the average value of the injected noise intensity is 0. Based on the sample category distribution of each participating client, the standardized relative divergence evaluation score of each participating client based on JS divergence is determined. The determination of the standardized relative divergence evaluation score includes: for any participating client, determining the JS divergence between the participating client and other participating clients; and standardizing the JS divergence using the Softmax function to obtain the standardized relative divergence evaluation score of the participating client. The gradients of each local proprietary network are weighted using the standardized relative divergence evaluation score to obtain the global model gradient. This allows the divergence to be used to measure the imbalance of the sample class distribution and to evaluate the contribution of each participant to the intermediate parameters. The global model gradient is used to update the global neural network model in the server that is isomorphic to the anomaly detection neural network model; The updated global neural network model is distributed to each of the participating client clients, so that the participating client clients can iteratively train the global neural network model based on local private power data until the model converges, and obtain a trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
2. The method according to claim 1, characterized in that, The determination of the standardized relative divergence evaluation score for each participating client, based on the sample category distribution of each participating client, includes: For any of the participating clients, determine the JS divergence between the participating client and other participating clients; The JS divergence is standardized to obtain the standardized relative divergence evaluation score of the participating client.
3. The method according to claim 1, characterized in that, The step of weighting the gradients of each local network using the standardized relative divergence evaluation score to obtain the global model gradient includes: The standardized relative divergence evaluation score and the gradients of each local proprietary network are input into a preset weighted aggregation algorithm to obtain the global model gradient output by the preset weighted aggregation algorithm.
4. The method according to claim 1, characterized in that, The step of updating the global neural network model in the server that is isomorphic to the anomaly detection neural network model using the global model gradient includes: The network parameters of the global neural network model in the server are updated using the global model gradient. The updated network parameters are loaded into the global neural network model on the server, thus completing the update of the global neural network model on the server that is isomorphic to the anomaly detection neural network model.
5. A training method for a multi-source power data anomaly identification model, characterized in that, Based on the method as described in any one of claims 1-4, the method is applied to any participating party client, and the method includes: The local private power data is used to train an anomaly detection neural network model for a preset network topology to obtain the local proprietary network gradient. The local sample class distribution is determined, and the local proprietary network gradient is injected with noise to obtain the gradient to be uploaded, wherein the mean value of the injected noise intensity is 0. The gradient to be uploaded and the sample class distribution are sent to the server. The server determines the standardized relative divergence evaluation score of each participating client based on the sample class distribution of each participating client. The standardized relative divergence evaluation score is used to weight each local proprietary network gradient to obtain the global model gradient, so as to use divergence to measure the imbalance of sample class distribution and thereby realize the contribution evaluation of the intermediate parameters of each participating party. Receive a global neural network model distributed by the server, wherein the global neural network model is a neural network model updated by the server based on the local proprietary network gradient and the sample category distribution; The updated global neural network model is iteratively trained based on the local private power data until the model converges, resulting in a trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
6. The method according to claim 5, characterized in that, The preset network topology is constructed based on gated recurrent units and attention mechanisms.
7. The method according to claim 5, characterized in that, The step of encrypting the local self-owned network gradient to obtain the gradient to be uploaded includes: Noise is injected into the local network gradient to obtain the gradient to be uploaded, wherein the average value of the injected noise intensity is 0.
8. The method according to claim 5, characterized in that, The iterative training of the updated anomaly detection neural network model based on the local private power data includes: During each iteration of training, the local private power data is input into the updated anomaly detection neural network model to obtain output information; The output information is input into a preset single-layer sensor to obtain the predicted probability value corresponding to the local private power data; Using a pre-constructed prediction loss function and a pre-given true value, the loss value of the current iteration process is determined, and the parameters of the global neural network model are adjusted according to the loss value until the loss value meets the convergence condition.
9. A method for identifying anomalies in multi-source power data, characterized in that, Applied to participating client devices, the method includes: The power data to be detected from the participating client is input into the anomaly detection neural network model trained by the multi-source power data anomaly identification model training method according to any one of claims 1-8; Obtain the predicted probability value output by the anomaly detection neural network model, and perform anomaly identification on the power data to be detected based on the predicted probability value.
10. A training device for a multi-source power data anomaly identification model, characterized in that, Based on the method as described in claims 1-4, the apparatus is applied to a server, and the apparatus includes: The acquisition module is used to acquire the local proprietary network gradient and sample category distribution obtained by each participating client through training the anomaly detection neural network model. The local proprietary network gradient is obtained by the client by injecting noise with a mean intensity of 0 into the local proprietary network gradient. The gradient aggregation module is used to aggregate the gradients of the local proprietary network based on the divergence evaluation federated learning gradient aggregation algorithm and the sample class distribution to obtain the global model gradient. Based on the sample class distribution of each participating client using JS divergence, it determines the standardized relative divergence evaluation score of each participating client. Determining the standardized relative divergence evaluation score includes: for any participating client, determining the JS divergence between the participating client and other participating clients; standardizing the JS divergence using the Softmax function; and weighting the gradients of each local proprietary network using the standardized relative divergence evaluation score to obtain the global model gradient. This uses divergence to measure the imbalance of the sample class distribution and thereby evaluates the contribution of each participating client to the intermediate parameters. The update module is used to update the global neural network model in the server that is isomorphic to the anomaly detection neural network model using the global model gradient; The distribution module is used to distribute the updated global neural network model to each of the participating client, so that the participating client can iteratively train the global neural network model based on local private power data until the model converges, and obtain a trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
11. A training device for a multi-source power data anomaly identification model, characterized in that, Based on the method as described in claims 5-8, the apparatus is applied to any participating party client, and the apparatus includes: The training module is used to train an anomaly detection neural network model of a preset network topology using local private power data, so as to obtain the local proprietary network gradient. A sending module is used to determine the local sample class distribution and inject noise into the local proprietary network gradient to obtain the gradient to be uploaded, wherein the average value of the injected noise intensity is 0; the gradient to be uploaded and the sample class distribution are sent to the server; so that the server determines the standardized relative divergence evaluation score of each participating client based on the sample class distribution of each participating client; and uses the standardized relative divergence evaluation score to weight each local proprietary network gradient to obtain the global model gradient, so as to use divergence to measure the imbalance of sample class distribution and thereby realize the contribution evaluation of the intermediate parameters of each participating party; The receiving module is used to receive a global neural network model distributed by the server. The global neural network model is a neural network model updated by the server based on the local network gradient and the sample category distribution. An iterative module is used to iteratively train the updated global neural network model based on the local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model. The anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
12. A multi-source power data anomaly identification device, characterized in that, Applied to a participating party's client, the device includes: The input module is used to input the power data to be detected from the participating client into the anomaly detection neural network model trained by the multi-source power data anomaly identification model training method according to any one of claims 1-8; The identification module is used to obtain the predicted probability value output by the anomaly detection neural network model, and to identify anomalies in the power data to be detected based on the predicted probability value.
13. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the multi-source power data anomaly identification model training method as described in any one of claims 1-8 or the multi-source power data anomaly identification method as described in claim 9.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the multi-source power data anomaly identification model training method as described in any one of claims 1-8 or the multi-source power data anomaly identification method as described in claim 9.