Multi-source power data anomaly identification method, model training method, device and equipment
By using the federated learning gradient aggregation algorithm and sample category distribution of divergence evaluation in power data anomaly recognition, the anomaly detection neural network model is trained and distributed, and the problem of data leakage risk during power data anomaly recognition is solved, and the local model is realized The training and identification of power data improves the security and system stability of power data.
Patent Information
- Application Number
- CN202411314683.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The prior art has the risk of data leakage in the process of identifying power data abnormalities, which reduces the security of power data, especially during multi-source data aggregation and transmission.
Using federated learning gradient aggregation algorithm based on divergence evaluation and sample category distribution, train anomaly detection neural network model, aggregate local gradients through the server and distribute global models, the client performs iterative training to realize localized training and recognition of the model to avoid Frequent transmission of data between participant clients and servers.
It improves the security of power data, ensures data security during model training and identification, reduces the risk of data leakage, and improves the stability of the power system.
Smart Images

Figure CN119167271A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a multi-source power data anomaly identification method, model training method, device, and equipment. Background Art
[0002] The power system usually has a complex structure and rich and diverse data types, and the power data often has various abnormal conditions, such as voltage abnormality, current abnormality, load abnormality, etc.
[0003] These abnormal data may cause instability in the power system and even cause accidents. Therefore, it is usually necessary to identify abnormalities in power data in order to discover problems early, avoid further losses, and improve the stability of the power system.
[0004] The current method of anomaly identification requires the aggregation of multi-source power business data from various subordinate units or different information systems to conduct higher-level analysis and mining. This process involves the transmission and call of power data. However, frequent transmission and call often increase the risk of power data leakage and reduce the security of power data. Summary of the invention
[0005] The embodiments of the present application provide a multi-source power data anomaly identification method, model training method, device, and equipment to improve the security in the power data anomaly identification process.
[0006] In a first aspect, an embodiment of the present application provides a multi-source power data anomaly recognition model training method, which is applied to a server, and the method includes:
[0007] Obtain the local network gradient and sample category distribution obtained by each participating client training the anomaly detection neural network model;
[0008] Based on the divergence evaluation federated learning gradient aggregation algorithm and sample category distribution, the local self-network gradient is aggregated to obtain the global model gradient;
[0009] The global neural network model on the server side that is isomorphic to the anomaly detection neural network model is updated using the global model gradient;
[0010] The updated global neural network model is distributed to each participating client, so that the participating client iteratively trains the global neural network model based on the local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
[0011] In a second aspect, an embodiment of the present application provides a multi-source power data anomaly recognition model training method, which is applied to any participating client, and the method includes:
[0012] Use local private power data to train the anomaly detection neural network model of the preset network topology to obtain the local proprietary network gradient;
[0013] Determine the local sample category distribution and send the local network gradient and sample category distribution to the server;
[0014] Receive the global neural network model distributed by the server. The global neural network model is an anomaly detection neural network model updated by the server based on the local network gradient and sample category distribution;
[0015] The updated anomaly detection neural network model is iteratively trained based on the local private power data until the model converges to obtain a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
[0016] In a third aspect, the embodiment of the present application further provides a method for identifying anomalies in multi-source power data, which is applied to a client of a participant, and the method includes:
[0017] Inputting the power data to be detected of the participant client into the anomaly detection neural network model trained by the multi-source power data anomaly recognition model training method provided in any embodiment of the present application;
[0018] The predicted probability value output by the anomaly detection neural network model is obtained, and anomalies are identified for the power data to be detected based on the predicted probability value.
[0019] In a fourth aspect, the embodiment of the present application further provides a multi-source power data anomaly recognition model training device, which is applied to a server, and the device includes:
[0020] The first acquisition module is used to obtain the local network gradient and sample category distribution obtained by each participating client training the anomaly detection neural network model;
[0021] A gradient aggregation module is used to aggregate the local network gradient based on the federated learning gradient aggregation algorithm evaluated by divergence and the sample category distribution to obtain the global model gradient;
[0022] An update module, used to update a global neural network model in the server that is isomorphic to the anomaly detection neural network model using a 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 client can iteratively train the global neural network model based on local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
[0024] In a fifth aspect, the embodiment of the present application further provides a multi-source power data anomaly recognition model training device, which is applied to any participating client, and the device includes:
[0025] A training module is used to train an anomaly detection neural network model of a preset network topology using local private power data to obtain a local proprietary network gradient;
[0026] The sending module is used to determine the local sample category distribution and send the local network gradient and sample category distribution to the server;
[0027] A receiving module is used to receive the global neural network model distributed by the server. The global neural network model is an anomaly detection neural network model updated by the server according to the local network gradient and sample category distribution.
[0028] The iterative module is used to iteratively train the updated anomaly detection neural network model based on the local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model, wherein the anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0029] In a sixth aspect, the embodiment of the present application further provides a multi-source power data anomaly identification model device, which is applied to a client of a participant, and the device includes:
[0030] An input module, used for inputting the power data to be detected of the participant client into the anomaly detection neural network model trained by the multi-source power data anomaly recognition model training method provided in any embodiment of the present application;
[0031] The recognition module is used to obtain the predicted probability value output by the anomaly detection neural network model and perform anomaly recognition on the power data to be detected based on the predicted probability value.
[0032] In a seventh aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:
[0033] one or more processors;
[0034] a 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 a multi-source power data anomaly identification model training method or a multi-source power data anomaly identification method as provided in any embodiment of the present application.
[0036] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, it implements a multi-source power data anomaly identification model training method or a multi-source power data anomaly identification method as provided in any embodiment of the present application.
[0037] The technical solution of the embodiment of the present application is that the process of training using power data will be completed on the client side of each participant, and only the local network gradient and sample category distribution of each participant's client side will be uploaded to the server side, and the server side will aggregate and update the parameters of the global neural network model, and then distribute it to each participant's client side for iterative training. Moreover, when performing subsequent abnormality identification, since the trained model has been distributed to each participant's client side, abnormality identification can be achieved locally. Based on this, during the model training process, the model can be trained without transmitting power data between the participant's client side and the server side, and there is no need to transmit the model during use, which greatly improves the security of power data. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of a multi-source power data anomaly recognition model training method provided in Example 1 of the present application;
[0039] Figure 2 A flowchart of a multi-source power data anomaly recognition model training method provided in Example 2 of the present application;
[0040] Figure 3 A flowchart of a multi-source power data anomaly identification model method provided in Example 3 of the present application;
[0041] Figure 4 A structural diagram of a multi-source power data anomaly recognition model training device provided in Embodiment 4 of the present application;
[0042] Figure 5 A schematic diagram of the structure of a multi-source power data anomaly recognition model training device provided in Embodiment 5 of the present application;
[0043] Figure 6 A schematic diagram of the structure of a multi-source power data anomaly identification device provided in Example 6 of the present application;
[0044] Figure 7 A schematic diagram of the structure of an electronic device provided in Example 7 of the present application. DETAILED DESCRIPTION
[0045] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0046] Embodiment 1
[0047] Figure 1 A flowchart of a multi-source power data anomaly recognition model training method provided in Example 1 of the present application is shown in FIG. Figure 1 As shown, the multi-source power data anomaly recognition model training method provided in this embodiment can be applied to the server, and specifically may include the following steps:
[0048] Step 101: Obtain the local network gradient and sample category distribution obtained by each participating client through training the anomaly detection neural network model.
[0049] It should be noted that the participating client refers to each terminal in the power system that directly generates power data, and each participating client is connected to the server for communication to facilitate data transmission.
[0050] In addition, for any participating client, its own anomaly detection neural network model will be trained to obtain the corresponding local network gradient. The participating client 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 the local network gradient and sample category distribution will be described in the embodiment of the client execution part and will not be repeated here.
[0052] Step 102: Based on the divergence-evaluated federated learning gradient aggregation algorithm and sample category distribution, the local network gradient is aggregated to obtain the global model gradient.
[0053] In this step, the divergence-evaluated federated learning gradient aggregation algorithm uses the symmetric JS divergence to highlight the imbalance of sample category distribution, and thereby evaluates the contribution of the intermediate parameters of each participant.
[0054] It should be noted that JS divergence is a variant of KL divergence, which is used to characterize the similarity of probability distributions and solves the asymmetry problem faced by KL divergence itself. Given sample distributions P and Q, the KL divergence of the two distributions can be expressed as follows:
[0055]
[0056] KL divergence is asymmetric, that is, KL(P||Q)≠KL(Q||P), which does not satisfy the properties of the metric space and therefore cannot be called a distance metric.
[0057] Therefore, JS divergence is used to evaluate the similarity of the distribution of data samples of each client. The specific form is:
[0058]
[0059] Expanding the above formula, we get:
[0060]
[0061] Based on the above theoretical foundation, in this step, the standardized relative divergence evaluation score of each participant's client can be determined based on the sample category distribution of each participant's client; then the standardized relative divergence evaluation score is used to weight the gradient of each local proprietary network to obtain the global model gradient.
[0062] When determining the standardized relative divergence evaluation score, for any participant client, the JS divergence between the participant client and other participant clients is determined; then the JS divergence is standardized to obtain the standardized relative divergence evaluation score of the parameter party client.
[0063] In a specific example, assume that the data sample categories in the client of each participant are distributed as D1, D2, D3, ..., D N , then the relative JS divergence between the data sample distribution of the client of the i-th participant and other clients is:
[0064]
[0065] By using the Softmax function to normalize the relative JS divergence, we can get the standardized relative divergence evaluation score of each participating client. The specific calculation process is:
[0066]
[0067] After obtaining the above-mentioned standardized relative divergence evaluation score, this step can input the standardized relative divergence evaluation score and each local self-network gradient 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 may be:
[0069]
[0070] in, Represents the global model gradient after weighted aggregation.
[0071] Step 103: Use the global model gradient to update the global neural network model in the server that is isomorphic to the anomaly detection neural network model.
[0072] In this step, when updating data, the global model gradient can be used to update the network parameters of the global neural network model in the server; the updated network parameters are loaded into the global neural network model in the server to complete the update of the global neural network model in 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 side can be recorded as Φ s , and then use the aggregated global model to update the network parameters:
[0074]
[0075] Among them, λ is the learning rate of detection model training.
[0076] Step 104: Distribute the updated global neural network model to each participating client, so that the participating client iteratively trains the global neural network model based on local private power data until the model converges.
[0077] After updating the entire global neural network model, the server distributes the updated global neural network model to each participating client, and the participating clients perform a new round of iterative optimization on the updated global neural network model until the model converges to complete the model training 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.
[0078] In this embodiment, the process of training using power data will be completed on the client side of each participant, and only the local network gradient and sample category distribution of each participant's client side will be uploaded to the server side, which will aggregate and update the parameters of the global neural network model, and then distribute it to each participant's client side for iterative training. Moreover, when performing subsequent abnormality identification, since the trained model has been distributed to each participant's client side, abnormality identification can be achieved locally. Based on this, during the model training process, the model can be trained without transmitting power data between the participant's client side and the server side, and there is no need to transmit the model during use, which greatly improves the security of power data.
[0079] Embodiment 2
[0080] Figure 2 A flowchart of a multi-source power data anomaly recognition model training method provided in Example 2 of the present application is shown in FIG. Figure 2As shown, the multi-source power data anomaly recognition model training method provided in this embodiment can be applied to each participating client, and specifically may include the following steps:
[0081] Step 201: Use local private power data to train an anomaly detection neural network model of a preset network topology structure to obtain a local proprietary network gradient.
[0082] In this step, the preset network topology is constructed based on the gated recurrent unit (GRU) and the attention mechanism (Attention), and the preset network topology can be: y=GRU-Attention(X).
[0083] During training, the local private power data can be first 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] Among them, the number of neurons in the output layer of a single-layer perceptron is 1.
[0085] The single-layer perceptron can be expressed as:
[0086]
[0087] Among them, W p and b p Represents the trainable parameters of the single-layer perceptron model, The predicted probability value of local private power data, y is the output information of the neural network. The parameters of the single-layer perceptron are a subset of the entire global neural network model parameter set, which is mainly responsible for the final prediction conversion. The parameters of the single-layer perceptron W p and b p It can be seen as the last layer of 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, the loss value of the current iteration process is determined using the pre-built prediction loss function and the pre-given true value, and the parameters of the global neural network model are adjusted according to the loss value. Among them, the prediction loss function can be constructed using cross entropy loss. In a specific example, it can be expressed as follows:
[0089]
[0090] Where L represents the loss value; B represents the number of client training samples. After the above training, the set of GRU+Attention trainable parameters in the nth participant client can be recorded as Φ n , the loss value is recorded as L n, then the model parameter gradient g of the nth client n :
[0091]
[0092] Get the model parameter gradient g n After that, the model parameters will be updated using the gradient descent optimization algorithm. The parameter update formula is as follows:
[0093] θ=θ-ηg n
[0094] Among them, θ is the model parameter and η is the learning rate.
[0095] The convergence condition of the model is related to the loss function L. When the value of the loss function no longer decreases significantly in consecutive training rounds, the model can be considered to have converged. Specifically, a very small threshold ε is set. When the change in the loss function for multiple consecutive epochs is less than ε, the model is considered to have converged.
[0096] Step 202: Determine the local sample category distribution, and send the local network gradient and sample category 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 category distribution are sent to the server.
[0098] Specifically, during encryption, noise may be injected into the local network gradient to obtain the gradient to be uploaded, wherein 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 specifically expressed as follows:
[0100]
[0101] Where δ is the scaling factor; clip(g n ,δ) is used to limit the gradient g n The size of , to avoid gradient explosion; Laplace(0,λ) represents Laplace noise with mean 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, where the global neural network model is a neural network model updated by the server according to the local own network gradient and sample category 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 iterative training can be started immediately, that is, step 204.
[0104] Step 204: iteratively train the updated anomaly detection neural network model based on the local private power data until the model converges.
[0105] In this step, during each iterative 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] The loss value of the current iteration process is determined by using a pre-constructed prediction loss function and a pre-given true value, and the parameters of the global neural network model are adjusted according to the loss value until the loss value meets the convergence condition, thereby obtaining a trained anomaly detection neural network model, which 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 refer to the aforementioned step 201 and will not be repeated here.
[0108] In this embodiment, the process of training using power data will be completed on the client side of each participant, and only the local network gradient and sample category distribution of each participant's client side will be uploaded to the server side, which will aggregate and update the parameters of the global neural network model, and then distribute it to each participant's client side for iterative training. Moreover, when performing subsequent abnormality identification, since the trained model has been distributed to each participant's client side, abnormality identification can be achieved locally. Based on this, during the model training process, the model can be trained without transmitting power data between the participant's client side and the server side, and there is no need to transmit the model during use, which greatly improves the security of power data.
[0109] Embodiment 3
[0110] Figure 3 A flowchart of a multi-source power data anomaly identification model method provided in Embodiment 3 of the present application is provided. The method can be applied to a client or a server of a participant, and specifically may include the following steps:
[0111] Step 301: input the power data to be detected of the participant client into the anomaly detection neural network model trained according to the multi-source power data anomaly recognition model training method.
[0112] In this step, the anomaly detection neural network model obtained through the above training is mainly applied, and the power data to be detected needs to be input 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 abnormal situations, and the abnormal situation corresponding to the predicted probability value exceeding the probability threshold will be determined as the identified abnormal situation.
[0115] In this example, during the identification process, there is still no need to upload the local power data to be detected to the server for identification. Identification can be achieved locally without transmission, thereby improving the security of the power data.
[0116] Embodiment 4
[0117] Figure 4 This is a structural diagram of a multi-source power data anomaly identification model training device provided in the fourth embodiment of the present application. The multi-source power data anomaly identification model training device provided in the embodiment of the present application can execute the multi-source power data anomaly identification model training method provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. The 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 obtain the local network gradient and sample category distribution obtained by each participating client training the anomaly detection neural network model;
[0119] Gradient aggregation module, which is used for federated learning gradient aggregation algorithm based on divergence evaluation and sample category distribution, aggregates local network gradients to obtain global model gradients;
[0120] An update module, used to update a global neural network model in the server that is isomorphic to the anomaly detection neural network model using a 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 client can iteratively train the global neural network model based on local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
[0122] Embodiment 5
[0123] Figure 5This is a structural diagram of a multi-source power data anomaly identification model training device provided in Example 5 of the present application. The multi-source power data anomaly identification model training device provided in the present application embodiment can execute the multi-source power data anomaly identification model training method provided in any embodiment of the present application by the participant client, and has the corresponding functional modules and beneficial effects of the execution method. The 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] Among them, the training module is used to train the anomaly detection neural network model of the preset network topology structure using local private power data to obtain the local proprietary network gradient;
[0125] The sending module is used to determine the local sample category distribution and send the local network gradient and sample category distribution to the server;
[0126] A receiving module is used to receive the global neural network model distributed by the server. The global neural network model is an anomaly detection neural network model updated by the server according to the local network gradient and sample category distribution.
[0127] The iterative module is used to iteratively train the updated anomaly detection neural network model based on the local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model, wherein the anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
[0128] Embodiment 6
[0129] Figure 6 This is a structural diagram of a multi-source power data anomaly identification device provided in Example 6 of the present application. The multi-source power data anomaly identification device provided in the embodiment of the present application can execute the multi-source power data anomaly identification method provided in any embodiment of the present application by the client or server of the participant, and has the corresponding functional modules and beneficial effects of the execution method. The 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 of the client of the participant into the anomaly detection neural network model trained by the multi-source power data anomaly recognition model training method;
[0131] The recognition module is used to obtain the predicted probability value output by the anomaly detection neural network model and perform anomaly recognition on the power data to be detected based on the predicted probability value.
[0132] Embodiment 7
[0133] Figure 7 A schematic diagram of the structure of an electronic device provided in Embodiment 7 of the present application is shown in FIG. 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 the processor 710 in the electronic device can be one or more. Figure 7 A processor 710 is taken as an example; the processor 710, the memory 720, the input device 730 and the output device 740 in the electronic device can be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0134] The memory 720, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the multi-source power data anomaly identification method in the embodiment of the present 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, that is, to implement the above-mentioned multi-source power data anomaly identification model training method:
[0135] Obtain the local network gradient and sample category distribution obtained by each participating client training the anomaly detection neural network model;
[0136] Based on the divergence evaluation federated learning gradient aggregation algorithm and sample category distribution, the local self-network gradient is aggregated to obtain the global model gradient;
[0137] The global neural network model on the server side that is isomorphic to the anomaly detection neural network model is updated using the global model gradient;
[0138] Distribute the updated global neural network model to each participating client, so that the participating client iteratively trains the global neural network model based on the local private power data until the model converges, and obtains a trained anomaly detection neural network model, wherein 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] Use local private power data to train the anomaly detection neural network model of the preset network topology to obtain the local proprietary network gradient;
[0141] Determine the local sample category distribution and send the local network gradient and sample category distribution to the server;
[0142] Receive the global neural network model distributed by the server. The global neural network model is an anomaly detection neural network model updated by the server based on the local network gradient and sample category distribution;
[0143] The updated anomaly detection neural network model is iteratively trained based on the local private power data until the model converges to obtain a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
[0144] Alternatively, the above-mentioned multi-source power data anomaly identification method is implemented:
[0145] Inputting the power data to be detected of the client of the participant into the anomaly detection neural network model trained according to the multi-source power data anomaly recognition model training method;
[0146] The predicted probability value output by the anomaly detection neural network model is obtained, and anomalies are identified for the power data to be detected based on the predicted probability value.
[0147] The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 720 may further include a memory remotely arranged relative to the processor 710, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0148] Embodiment 8
[0149] Embodiment 8 of the present application further provides a storage medium comprising computer executable instructions, which are used to execute a multi-source power data anomaly recognition model training method when executed by a computer processor:
[0150] Obtain the local network gradient and sample category distribution obtained by each participating client training the anomaly detection neural network model;
[0151] Based on the divergence evaluation federated learning gradient aggregation algorithm and sample category distribution, the local self-network gradient is aggregated to obtain the global model gradient;
[0152] The global neural network model on the server side that is isomorphic to the anomaly detection neural network model is updated using the global model gradient;
[0153] Distribute the updated global neural network model to each participating client, so that the participating client iteratively trains the global neural network model based on the local private power data until the model converges, and obtains a trained anomaly detection neural network model, wherein 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] Use local private power data to train the anomaly detection neural network model of the preset network topology to obtain the local proprietary network gradient;
[0156] Determine the local sample category distribution and send the local network gradient and sample category distribution to the server;
[0157] Receive the global neural network model distributed by the server. The global neural network model is an anomaly detection neural network model updated by the server based on the local network gradient and sample category distribution;
[0158] The updated anomaly detection neural network model is iteratively trained based on the local private power data until the model converges to obtain a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
[0159] Alternatively, the above-mentioned multi-source power data anomaly identification method is implemented:
[0160] Inputting the power data to be detected of the client of the participant into the anomaly detection neural network model trained according to the multi-source power data anomaly recognition model training method;
[0161] The predicted probability value output by the anomaly detection neural network model is obtained, and anomalies are identified for the power data to be detected based on the predicted probability value.
[0162] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the above method operations, can also execute related operations in the multi-source power data anomaly identification method provided in any embodiment of the present application.
[0163] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the 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 (FLASH), hard disk or optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0164] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0165] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A multi-source power data anomaly recognition model training method, It is characterized in that Applied to the server, the method includes: Obtain the local network gradient and sample category distribution obtained by each participant's client training the anomaly detection neural network model; Based on the divergence evaluation federated learning gradient aggregation algorithm and sample category distribution, the local self-network gradient is aggregated to obtain the global model gradient; Using the global model gradient, updating a 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 clients, so that the participating clients iteratively train the global neural network model based on the local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
2. The method according to claim 1, It is characterized in that The federated learning gradient aggregation algorithm based on divergence evaluation and sample category distribution aggregates the local network gradient to obtain the global model gradient, including: Based on the sample category distribution of each participant's client, determine the standardized relative divergence evaluation score of each participant's client; The standardized relative divergence evaluation score is used to weight each local self-network gradient to obtain the global model gradient.
3. The method according to claim 2, It is characterized in that The step of determining the standardized relative divergence evaluation score of each participant's client based on the sample category distribution of each participant's client includes: For any of the participant clients, determine the JS divergence between the participant client and other participant clients; The JS divergence is normalized to obtain a normalized relative divergence evaluation score of the parameter party client.
4. The method according to claim 2, It is characterized in that The method of weighting each local self-network gradient by using the standardized relative divergence evaluation score to obtain a global model gradient includes: The standardized relative divergence evaluation score and each local self-network gradient are input into a preset weighted aggregation algorithm to obtain a global model gradient output by the preset weighted aggregation algorithm.
5. The method according to claim 1, It is characterized in that The updating of the global neural network model in the server that is isomorphic to the anomaly detection neural network model by using the global model gradient includes: Using the global model gradient, the network parameters of the global neural network model in the server are updated; The updated network parameters are loaded into the global neural network model of the server, completing the update of the global neural network model in the server that is isomorphic to the anomaly detection neural network model.
6. A multi-source power data anomaly recognition model training method, It is characterized in that Applied to any client of a participant, the method includes: Use local private power data to train the anomaly detection neural network model of the preset network topology to obtain the local proprietary network gradient; Determine the local sample category distribution, and send the local network gradient and the sample category distribution to the server; Receive a global neural network model distributed by a server, wherein the global neural network model is a neural network model updated by the server according to the local own 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 to obtain a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
7. The method according to claim 6, It is characterized in that The preset network topology is constructed based on gated recurrent units and an attention mechanism.
8. The method according to claim 6, It is characterized in that The sending the local network gradient and the sample category distribution to the server includes: Encrypting the local network gradient to obtain the gradient to be uploaded; The gradient to be uploaded and the sample category distribution are sent to the server.
9. The method according to claim 8, It is characterized in that The step of encrypting the local network gradient to obtain the gradient to be uploaded includes: Noise is injected into the local network gradient to obtain a gradient to be uploaded, wherein the average value of the injected noise intensity is 0.
10. The method according to claim 6, It is characterized in that The iterative training of the updated abnormality detection neural network model based on the local private power data comprises: During each iterative training, the local private power data is input into the updated anomaly detection neural network model to obtain output information; Inputting the output information into a preset single-layer perceptron to obtain a predicted probability value corresponding to the local private power data; The loss value of the current iteration process is determined by using a pre-constructed prediction loss function and a pre-given true value, and the parameters of the global neural network model are adjusted according to the loss value until the loss value meets the convergence condition.
11. A method for identifying anomalies in multi-source power data. It is characterized in that Applied to a client of a participant, the method comprises: Inputting the power data to be detected of the participant client into the anomaly detection neural network model trained by the multi-source power data anomaly recognition model training method according to any one of claims 1 to 10; The predicted probability value output by the abnormality detection neural network model is obtained, and abnormality identification is performed on the power data to be detected according to the predicted probability value.
12. A multi-source power data anomaly recognition model training device, It is characterized in that Applied to the server, the device comprises: An acquisition module is used to obtain the local network gradient and sample category distribution obtained by each participating client through training the anomaly detection neural network model; A gradient aggregation module is used to aggregate the local network gradient based on the federated learning gradient aggregation algorithm evaluated by divergence and the sample category distribution to obtain the global model gradient; An updating module, configured to update a global neural network model in the server that is isomorphic to the anomaly detection neural network model using the global model gradient; A distribution module is used to distribute the updated global neural network model to each of the participating clients, so that the participating clients can iteratively train the global neural network model based on local private power data until the model converges, thereby obtaining a trained anomaly detection neural network model, which is used to output a predicted probability value based on the power data to be detected.
13. A multi-source power data anomaly recognition model training device, It is characterized in that Applied to any client of a participant, the device comprises: A training module is used to train an anomaly detection neural network model of a preset network topology using local private power data to obtain a local proprietary network gradient; A sending module, used to determine the local sample category distribution, and send the local network gradient and the sample category distribution to the server; A receiving module, used to receive a global neural network model distributed by a server, wherein the global neural network model is a neural network model updated by the server according to the local own network gradient and the sample category distribution; An iteration 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, wherein the anomaly detection neural network model is used to output a predicted probability value based on the power data to be detected.
14. A device for identifying abnormalities in multi-source power data, It is characterized in that Applied to a client of a participant, the device comprises: An input module, used for inputting the power data to be detected of the participant client into the anomaly detection neural network model trained by the multi-source power data anomaly recognition model training method according to any one of claims 1 to 10; The identification module is used to obtain the predicted probability value output by the abnormality detection neural network model, and to identify abnormalities of the power data to be detected according to the predicted probability value.
15. An electronic device, It is characterized in that include: one or more processors; a 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-10 or the multi-source power data anomaly identification method as described in claim 11.
16. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, it implements the multi-source power data anomaly identification model training method as described in any one of claims 1 to 10 or the multi-source power data anomaly identification method as described in claim 11.
Citation Information
Patent Citations
Heterogeneous model aggregation method and system based on federated learning
CN113705610A
Electric power inspection image anomaly detection method and system based on federal learning
CN113962988A
Federal learning client scheduling method based on weight divergence and update increment
CN115454608A
Power business model updating method and device, computer equipment and storage medium
CN115936139A
Federal learning-based training method and device for power data anomaly detection model
CN116049662A
