Security training model construction method, device and system based on federated learning

By obtaining the current and historical training data of nodes in the power federated learning system, using differential privacy and dimensionality reduction prediction models to judge the node status and screen out abnormal nodes, the problems of uneven node data quality and model performance degradation caused by attacks are solved, thereby improving security and efficiency.

CN114742143BActive Publication Date: 2025-10-21NANJING BRANCH OF GLOBAL ENERGY INTERNET RES INST CO LTD +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210340718.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2025-10-21
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

In the power federated learning system, the quality of node data is uneven and may be attacked, resulting in degraded model performance. An abnormal node detection method is needed to improve security and efficiency.

Method used

By obtaining the current and historical training data of the node, using differential privacy processing and dimensionality reduction models and prediction models, the node status is determined, and abnormal nodes are screened out based on the status, and abnormal nodes are eliminated to improve security and efficiency.

Benefits of technology

Node privacy is protected through differential privacy processing, and node status is judged using dimensionality reduction and prediction models to eliminate abnormal nodes, thereby improving the security and work efficiency of federated learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114742143B_ABST
    Figure CN114742143B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of computer, and particularly relate to a method, device and system for constructing a secure training model based on federated learning, and a storage medium. The method comprises: obtaining current training data uploaded by each node after being processed by differential privacy, obtaining at least one corresponding historical training data and historical dimension reduction difference of each node, determining the state of each node based on the current training data, the historical training data and the historical dimension reduction difference of each node, comparing the predicted and true results to determine whether the current node has failed, screening each node according to the state, determining a screening result, training a preconfigured initial model based on the screening result, determining a target model and distributing the target model to each node. In this way, the abnormal points in the federated learning process can be eliminated, and the work efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, system, and storage medium for constructing a secure training model based on federated learning. Background Art

[0002] Federated learning is a distributed machine learning framework that enables multiple nodes to collaboratively train models without exchanging local data. Since federated learning is still in its early stages of development, it faces numerous security issues that urgently need to be addressed. In a federated learning system for electric power, the quality of data provided by each power node can vary. Some nodes may upload incorrect parameters to the aggregation server or stop sending parameters to the aggregation server due to external attacks or internal failures, resulting in degradation of global model performance.

[0003] Therefore, a method for detecting abnormal nodes is needed to solve the above problems. Summary of the Invention

[0004] In view of this, in order to solve the above-mentioned technical problems in the prior art, the embodiments of the present invention provide a method, device, system and storage medium for constructing a secure training model based on federated learning.

[0005] In a first aspect, an embodiment of the present invention provides a method for constructing a secure training model based on federated learning, the method comprising:

[0006] Obtain the current training data uploaded by each node after differential privacy processing, where the current training data is obtained after each node trains the initial model pre-configured in each node;

[0007] Obtain at least one historical training data and historical dimensionality reduction difference corresponding to each node;

[0008] Determine the status of each node based on its current training data, historical training data, and historical dimensionality reduction difference;

[0009] Filter each node according to the status and determine the filtering results;

[0010] Based on the screening results, the pre-configured initial model is trained, the target model is determined and distributed to each node.

[0011] In one possible implementation, determining the state of each node based on the current training data, historical training data, and historical dimensionality reduction difference of each node includes:

[0012] Get the historical training data of the i-th node among all nodes;

[0013] Determine the true difference between historical training data and current training data;

[0014] The true difference is fed into the preset dimensionality reduction model to determine the true dimensionality reduction difference after dimensionality reduction;

[0015] Send at least one historical dimensionality reduction difference corresponding to the i-th node into a preset prediction model to determine a predicted dimensionality reduction difference, where i is a positive integer;

[0016] The predicted dimensionality reduction difference is sent to the preset dimensionality increase model to determine the corresponding predicted difference;

[0017] Based on the true difference, predicted difference, true dimensionality reduction difference, and predicted dimensionality reduction difference, the status of each node is determined.

[0018] In one possible implementation, determining the status of each node based on the true difference, the predicted difference, the true dimensionality reduction difference, and the predicted dimensionality reduction difference includes:

[0019] Determine the relationship between a first Euclidean distance between the actual difference and the predicted difference and a preset first threshold value, and determine a first determination result;

[0020] Determine the relationship between the second Euclidean distance between the actual dimensionality reduction difference and the predicted dimensionality reduction difference and a preset second threshold value, and determine a second determination result;

[0021] Based on the first judgment result and the second judgment result, the state of the i-th node is determined.

[0022] In one possible implementation, determining the state of the i-th node based on the first judgment result and the second judgment result includes:

[0023] When the first Euclidean distance is less than a first threshold value and the second Euclidean distance is less than a second threshold value, determining that the state of the i-th node is the first state;

[0024] When the first Euclidean distance is greater than a first threshold and the second Euclidean distance is less than a second threshold, or when the first Euclidean distance is less than the first threshold and the second Euclidean distance is greater than the second threshold, determining that the state of the i-th node is the second state;

[0025] When the first Euclidean distance is greater than a first threshold and the second Euclidean distance is greater than a second threshold, it is determined that the state of the i-th node is the third state.

[0026] In one possible implementation, based on the screening results, a preconfigured initial model is trained, a target model is determined, and the target model is distributed to each node, including:

[0027] Filter out nodes whose node status is the first state and nodes whose node status is the second state;

[0028] Training a preconfigured model based on training data of nodes whose node states are in the first state to determine a target model;

[0029] The target model is sent to each node whose node state is the first state and each node whose node state is the second state respectively.

[0030] In one possible implementation, it further includes:

[0031] Filter out nodes whose status is the third state;

[0032] Error data is sent to the node whose node status is the third state.

[0033] In one possible implementation, obtaining the current training data uploaded by each node after differential privacy processing includes:

[0034] Send the initial model to each node separately so that the node can train the initial model and determine the gradient data generated during the training process;

[0035] Receive the privacy gradient data uploaded by each node after differential privacy processing, and use the privacy gradient data as the current training data.

[0036] In a second aspect, an embodiment of the present invention provides a device for constructing a security training model based on federated learning, comprising:

[0037] An acquisition module is used to obtain the current training data uploaded by each node after differential privacy processing, wherein the current training data is obtained after each node trains the initial model pre-configured in each node; and obtain at least one historical training data and historical dimensionality reduction difference corresponding to each node;

[0038] A processing module is used to determine the status of each node based on the current training data, historical training data and historical dimensionality reduction difference of each node; filter each node according to the status and determine the filtering result;

[0039] The determination module is used to train the preconfigured initial model based on the screening results, determine the target model and distribute it to each node.

[0040] In a third aspect, the present application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of any method in the first aspect.

[0041] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any one of the methods in the first aspect when the computer program is executed by a processor.

[0042] The present invention provides a method for constructing a secure training model based on federated learning. The method obtains current training data uploaded by each node after differential privacy processing. Through differential privacy processing, the privacy between each node is greatly protected. At least one historical training data and historical dimensionality reduction difference corresponding to each node are obtained. Based on the current training data, historical training data, and historical dimensionality reduction difference of each node, the status of each node is determined. The predicted and actual results are compared to determine whether the current node has failed. Each node is screened according to the status to determine the screening results. Based on the screening results, a pre-configured initial model is trained, and a target model is determined and distributed to each node. In this way, abnormal points that appear in the federated learning process can be eliminated. These points may have been attacked. Eliminating these abnormal nodes can greatly improve the security of federated learning and greatly improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of a method flow for constructing a secure training model based on federated learning provided in an embodiment of the present invention;

[0044] Figure 2 A schematic flow chart of a method for determining the status of each node provided in an embodiment of the present invention;

[0045] Figure 3 A schematic flow chart of a method for determining the status of each node provided in an embodiment of the present invention;

[0046] Figure 4 A schematic diagram of node status screening provided by an embodiment of the present invention;

[0047] Figure 5 A schematic diagram of the structure of a device for constructing a secure training model based on federated learning provided in an embodiment of the present invention;

[0048] Figure 6 A schematic diagram of the system structure for constructing a secure training model based on federated learning is provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0050] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.

[0051] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below with reference to the accompanying drawings. The embodiments do not limit the embodiments of the present invention.

[0052] Figure 1 This is a flow chart of a method for constructing a secure training model based on federated learning provided by an embodiment of the present invention. For details on the execution process of this method, please refer to Figure 1 As shown, the method includes:

[0053] Step 110: Obtain the current training data uploaded by each node after differential privacy processing.

[0054] Specifically, the current training data is obtained after each node trains an initial model pre-configured in each node.

[0055] It should be noted that in actual applications, various data can be used as, for example, model gradients, model loss function results, etc., which are not limited here and are subject to actual applications.

[0056] Optionally, in one example, the initial model is sent to each node separately so that the node trains the initial model and determines the gradient data generated during the training process. The privacy gradient data uploaded by each node after differential privacy processing is received, and the privacy gradient data is used as the current training data.

[0057] These current training data are the basis for judging whether the node is normal in the subsequent steps.

[0058] Step 120: Obtain at least one historical training data and historical dimensionality reduction difference corresponding to each node.

[0059] Specifically, historical training data and historical dimensionality reduction differences can be directly obtained from the database.

[0060] Furthermore, it should be noted that, in one embodiment, when each child node first uploads its current training data to the aggregation server, there is no so-called historical data, and there is no way to talk about the subsequent steps of using historical training data and historical dimensionality reduction differences for security testing. Therefore, in this case, under the default initial conditions, that is, the data initially uploaded by each child node is correct.

[0061] In the initial state, the status of each child node is normal.

[0062] When enough historical training data and historical dimensionality reduction differences have accumulated, we start using these data to execute the next steps.

[0063] Step 130 : determining the status of each node based on the current training data, historical training data, and historical dimensionality reduction difference of each node.

[0064] Specifically, since historical data must be correct, the prediction results obtained based on historical data should not be much different from the current actual results. Based on this concept and combined with the data obtained in the above steps, we have the following Figure 2 Follow the steps shown to determine the status of each node:

[0065] Step 210: Obtain historical training data of the i-th node among all nodes.

[0066] Specifically, historical training data can be directly obtained from the database.

[0067] Furthermore, historical training data is obtained to calculate the true difference in step 220 and the prediction in step 240 .

[0068] Step 220: Determine the true difference between the historical training data and the current training data.

[0069] Specifically, in this step, the historical training data used is only the training data before the current training data.

[0070] In one embodiment, assuming that federated learning has reached the eighth round, the current training data is recorded as g8, and the historical training data referenced in step 220 only needs to be g7.

[0071] Furthermore, after obtaining historical training data, the true difference D can be calculated according to the following formula: j :

[0072] D j =g j -g j-1

[0073] Among them, g j is the training data of the jth round.

[0074] In step 230 , the true difference is fed into a preset dimensionality reduction model to determine the true dimensionality reduction difference after dimensionality reduction.

[0075] Specifically, the dimensionality reduction model includes but is not limited to the following models, such as: autoencoder, principal component analysis model, etc., which are not limited here.

[0076] In an alternative embodiment, it is assumed that there is a true difference D j, and assuming that the dimensionality reduction model is an autoencoder, then the true interpolation D j Send it to the autoencoder to generate the real dimensionality reduction difference d after dimensionality reduction j The actual dimensionality reduction difference will also be used in subsequent calculations.

[0077] Step 240: Send at least one historical dimensionality reduction difference corresponding to the i-th node into a preset prediction model to determine a predicted dimensionality reduction difference.

[0078] Specifically, in an optional embodiment, the prediction model may select a long short-term memory (LSTM) model. When using LSTM, it is necessary to input historical dimensionality reduction differences to generate current prediction dimensionality reduction differences.

[0079] For example, suppose there is a historical dimensionality reduction difference set [d j-1 , d j-2 , d j-3 ], based on the three historical dimensionality reduction differences contained in the set, the LSTM model will output a predicted dimensionality reduction difference for the jth round of federated learning, denoted as d′ j .

[0080] It should be noted that, in this embodiment, the LSTM model is used as the prediction model. However, in practical applications, it is not limited to this model and can be any prediction model, which is not limited here.

[0081] Step 250: Send the predicted dimensionality reduction difference to a preset dimensionality increase model to determine the corresponding predicted difference.

[0082] Specifically, after obtaining the predicted dimensionality reduction difference through step 240, it is necessary to obtain the predicted difference through the dimensionality increase model.

[0083] In an optional example, the decoder can be used as a dimensionality increase model, and the predicted dimensionality reduction difference d′ can be j Input into the decoder to obtain the predicted difference D′ after dimensionality increase j .

[0084] Step 260 : Determine the status of each node based on the true difference, the predicted difference, the true reduced dimensionality difference, and the predicted reduced dimensionality difference.

[0085] Specifically, through the processing of steps 210 to 250, the true difference D can be obtained. j , predicted difference D′ j , the true dimension reduction difference d j , and the predicted dimensionality reduction difference d′ j , the status of each node can be determined. The specific node status judgment process can be based on the following Figure 3Make a judgment according to the steps shown.

[0086] Step 310 : Determine the relationship between a first Euclidean distance between the actual difference and the predicted difference and a preset first threshold value, and determine a first determination result.

[0087] Specifically, the first Euclidean distance between the true difference and the predicted difference can be calculated by the following formula:

[0088]

[0089] Among them, i is the i-th node, The true difference of the i-th node and the j-th round, The prediction difference of the i-th node and the j-th round.

[0090] Furthermore, the magnitude relationship between the first Euclidean distance and a preset first threshold is recorded as a first judgment result for subsequent state judgment.

[0091] Step 320 , determining the relationship between the second Euclidean distance between the actual dimensionality reduction difference and the predicted dimensionality reduction difference and a preset second threshold value, and determining a second determination result.

[0092] Specifically, the second Euclidean distance between the true difference and the predicted difference can be calculated using the following formula:

[0093]

[0094] Among them, i is the i-th node, The true dimensionality reduction difference of the i-th node and the j-th round, The predicted dimensionality reduction difference of the i-th node and the j-th round.

[0095] Furthermore, the magnitude relationship between the second Euclidean distance and a preset second threshold is recorded as a second judgment result for subsequent state judgment.

[0096] Step 330: Determine the state of the i-th node based on the first judgment result and the second judgment result.

[0097] Specifically, after the above steps 310 and 320 are completed, the following three situations may occur:

[0098] (1) When the first Euclidean distance is less than a first threshold value and the second Euclidean distance is less than a second threshold value, the state of the i-th node is determined to be the first state.

[0099] (2) When the first Euclidean distance is greater than the first threshold and the second Euclidean distance is less than the second threshold, or when the first Euclidean distance is less than the first threshold and the second Euclidean distance is greater than the second threshold, the i-th node state is determined to be the second state.

[0100] (3) When the first Euclidean distance is greater than the first threshold and the second Euclidean distance is greater than the second threshold, the state of the i-th node is determined to be the third state.

[0101] Step 140: Screen each node according to its status and determine the screening result.

[0102] Specifically, according to the method described in the above step 130 , the status of each node is determined, and the nodes are filtered and classified according to the node status.

[0103] In an alternative embodiment, see Figure 4 As shown, it is assumed that there are 5 nodes, namely A, B, C, D, and E, among which A is the first state, B is the third state, C is the first state, D is the second state, and E is the third state. After screening and classifying the above nodes, A and C are in one category, D is in one category, and B and E are in one category.

[0104] Step 150: Based on the screening results, the pre-configured initial model is trained, the target model is determined and distributed to each node.

[0105] Specifically, according to the screening results in step 140, the preconfigured model is trained based on the training data of each node whose node status is the first state to determine the target model. Obviously, for the node whose node status is the first state, the aggregation server only uses the data sent by the node for training.

[0106] Furthermore, the target model is sent to each node in the first state and each node in the second state. Obviously, for the node in the first state, the aggregation server receives data and sends data to it, while for the node in the second state, the aggregation server only sends data to it and does not receive data sent by it.

[0107] Furthermore, the nodes whose node status is the third state are screened out, and the aggregation server determines that these nodes are no longer safe, and will add these nodes to the blacklist, refuse to use the data sent by the node, and send wrong data to the nodes whose node status is the third state.

[0108] It should be noted that after being added to the blacklist, the aggregation server can not only send error data to the node with the node status in the third state, but also close the channel with the node with the node status in the third state, and refuse to interact with the node with the node status in the third state.

[0109] The present invention provides a method for constructing a secure training model based on federated learning. The method obtains current training data uploaded by each node after differential privacy processing. Through differential privacy processing, the privacy between each node is greatly protected. At least one historical training data and historical dimensionality reduction difference corresponding to each node are obtained. Based on the current training data, historical training data, and historical dimensionality reduction difference of each node, the status of each node is determined. The predicted and actual results are compared to determine whether the current node has failed. Each node is screened according to the status to determine the screening results. Based on the screening results, a pre-configured initial model is trained, and a target model is determined and distributed to each node. In this way, abnormal points that appear in the federated learning process can be eliminated. These points may have been attacked. Eliminating these abnormal nodes can greatly improve the security of federated learning and greatly improve work efficiency.

[0110] Figure 5 An embodiment of the present invention provides a device for constructing a security training model based on federated learning, which includes: an acquisition module 501, a processing module 502, and a determination module 503.

[0111] Acquisition module 501 is used to obtain the current training data uploaded by each node after differential privacy processing, where the current training data is obtained after each node trains the initial model pre-configured in each node; obtain at least one historical training data and historical dimensionality reduction difference corresponding to each node;

[0112] Processing module 502 is used to determine the status of each node based on the current training data, historical training data and historical dimensionality reduction difference of each node; filter each node according to the status and determine the filtering result;

[0113] The determination module 503 is used to train the pre-configured initial model based on the screening results, determine the target model and distribute it to each node.

[0114] Processing module 502, for obtaining historical training data of the i-th node among all nodes;

[0115] Determine the true difference between historical training data and current training data;

[0116] The true difference is fed into the preset dimensionality reduction model to determine the true dimensionality reduction difference after dimensionality reduction;

[0117] Send at least one historical dimensionality reduction difference corresponding to the i-th node into a preset prediction model to determine a predicted dimensionality reduction difference, where i is a positive integer;

[0118] The predicted dimensionality reduction difference is sent to the preset dimensionality increase model to determine the corresponding predicted difference;

[0119] Based on the true difference, predicted difference, true dimensionality reduction difference, and predicted dimensionality reduction difference, the status of each node is determined.

[0120] A processing module 502 is configured to determine a relationship between a first Euclidean distance between the actual difference and the predicted difference and a preset first threshold value, and determine a first determination result;

[0121] Determine the relationship between the second Euclidean distance between the actual dimensionality reduction difference and the predicted dimensionality reduction difference and a preset second threshold value, and determine a second determination result;

[0122] Based on the first judgment result and the second judgment result, the state of the i-th node is determined.

[0123] A processing module 502 is configured to determine that the state of the i-th node is a first state when the first Euclidean distance is less than a first threshold and the second Euclidean distance is less than a second threshold;

[0124] When the first Euclidean distance is greater than a first threshold and the second Euclidean distance is less than a second threshold, or when the first Euclidean distance is less than the first threshold and the second Euclidean distance is greater than the second threshold, determining that the state of the i-th node is the second state;

[0125] When the first Euclidean distance is greater than a first threshold and the second Euclidean distance is greater than a second threshold, it is determined that the state of the i-th node is the third state.

[0126] Determining module 503, configured to filter out nodes whose node status is the first state and nodes whose node status is the second state;

[0127] Training a preconfigured model based on training data of nodes whose node states are in the first state to determine a target model;

[0128] The target model is sent to each node whose node state is the first state and each node whose node state is the second state respectively.

[0129] The determination module 503 is used to filter out nodes whose node status is the third state;

[0130] Error data is sent to the node whose node status is the third state.

[0131] An acquisition module 501 is used to send the initial model to each node respectively, so that the node trains the initial model and determines the gradient data generated during the training process;

[0132] Receive the privacy gradient data uploaded by each node after differential privacy processing, and use the privacy gradient data as the current training data.

[0133] See also Figure 6 , Figure 6 is a structural diagram of an electronic device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the electronic device may include: at least one processor 61, such as a CPU

[0134] (Central Processing Unit, central processing unit), at least one communication interface 63, memory 64, at least one communication bus 62. The communication bus 62 is used to realize the connection and communication between these components. The communication interface 63 may include a display screen (Display), a keyboard (Keyboard), and the optional communication interface 63 may also include a standard wired interface and a wireless interface. The memory 64 may be a high-speed RAM memory (Random Access Memory, volatile random access memory) or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 64 may optionally be at least one storage device located away from the aforementioned processor 61. The processor 61 may be combined with Figure 6 In the described apparatus, the memory 64 stores an application program, and the processor 61 calls the program code stored in the memory 64 to execute any of the above method steps.

[0135] The communication bus 62 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 62 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0136] Among them, the memory 64 may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM); the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory), hard disk drive (English: hard disk drive, abbreviated: HDD) or solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 64 may also include a combination of the above types of memory.

[0137] The processor 61 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.

[0138] The processor 61 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0139] Optionally, the memory 64 is further configured to store program instructions. The processor 61 may call the program instructions to implement the method shown in any embodiment of the present application.

[0140] An embodiment of the present invention further provides a non-transitory computer storage medium storing computer-executable instructions that can execute the method of any of the above method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the storage medium can also include a combination of the above types of memory.

[0141] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for constructing a security training model based on federated learning, characterized in that: Applied to power federated learning systems, including: Obtaining current training data uploaded by each node after differential privacy processing, wherein the current training data is obtained after each node trains an initial model pre-configured in each node, and the node is a power node in the power federated learning system; Obtaining at least one historical training data and a historical dimensionality reduction difference corresponding to each node; Determine the status of each node based on the current training data, historical training data, and historical dimensionality reduction difference of each node, wherein the status is used to indicate whether each node has a fault; Screening each of the nodes according to the status and determining a screening result; Based on the screening results, the preconfigured initial model is trained, a target model is determined and distributed to each of the nodes; The determining of the status of each node based on the current training data, historical training data, and historical dimensionality reduction difference of each node includes: Obtaining historical training data of the i-th node among all the nodes; Determining a true difference between the historical training data and the current training data; The true difference is fed into a preset dimensionality reduction model to determine the true dimensionality reduction difference after dimensionality reduction; Sending at least one historical dimensionality reduction difference corresponding to the i-th node into a preset prediction model to determine a predicted dimensionality reduction difference, wherein i is a positive integer; The predicted dimensionality reduction difference is sent to a preset dimensionality increase model to determine the corresponding predicted difference; Determining the state of each of the nodes based on the true difference, the predicted difference, the true reduced dimensionality difference, and the predicted reduced dimensionality difference; The determining the state of each node based on the true difference, the predicted difference, the true dimensionality reduction difference, and the predicted dimensionality reduction difference includes: Determine a relationship between a first Euclidean distance between the actual difference and the predicted difference and a preset first threshold value, and determine a first determination result; Determine a relationship between a second Euclidean distance between the true dimensionality reduction difference and the predicted dimensionality reduction difference and a preset second threshold value, and determine a second determination result; Based on the first judgment result and the second judgment result, the state of the i-th node is determined.

2. The method according to claim 1, characterized in that The determining the state of the i-th node based on the first judgment result and the second judgment result includes: When the first Euclidean distance is less than the first threshold value, and the second Euclidean distance is less than the second threshold value, determining that the state of the i-th node is the first state; When the first Euclidean distance is greater than the first threshold and the second Euclidean distance is less than the second threshold, or when the first Euclidean distance is less than the first threshold and the second Euclidean distance is greater than the second threshold, determining that the state of the i-th node is the second state; When the first Euclidean distance is greater than the first threshold and the second Euclidean distance is greater than the second threshold, it is determined that the state of the i-th node is the third state.

3. The method according to claim 1, characterized in that The pre-configured initial model is trained based on the screening result, and the target model is determined and distributed to each of the nodes, including: Filter out the nodes whose node status is the first state and the nodes whose node status is the second state; Training the preconfigured model based on the training data of each node whose node state is the first state to determine a target model; The target model is sent to each node whose node state is the first state and each node whose node state is the second state respectively.

4. The method according to claim 3, characterized in that Also includes: Filter out nodes whose node status is the third state; Sending error data to the node whose node status is the third state.

5. The method according to claim 1, wherein The acquisition of the current training data uploaded by each node after differential privacy processing includes: Sending the initial model to each of the nodes respectively, so that the node trains the initial model and determines the gradient data generated during the training process; Receive the privacy gradient data uploaded by each node after differential privacy processing, and use the privacy gradient data as the current training data.

6. A device for constructing a security training model based on federated learning, characterized in that: Applied to power federated learning systems, including: An acquisition module is configured to acquire current training data uploaded by each node after differential privacy processing, wherein the current training data is obtained after each node trains an initial model pre-configured in each node, and the node is a power node in the power federated learning system; and acquire at least one historical training data and historical dimensionality reduction difference corresponding to each node; a processing module, configured to determine a status of each of the nodes based on current training data, historical training data, and historical dimensionality reduction differences of each of the nodes, wherein the status indicates whether each of the nodes has failed; and to screen each of the nodes according to the status to determine a screening result; A determination module, configured to train the preconfigured initial model based on the screening result, determine the target model, and distribute the target model to each of the nodes; The processing module is specifically configured to: Obtaining historical training data of the i-th node among all the nodes; Determining a true difference between the historical training data and the current training data; The true difference is fed into a preset dimensionality reduction model to determine the true dimensionality reduction difference after dimensionality reduction; Sending at least one historical dimensionality reduction difference corresponding to the i-th node into a preset prediction model to determine a predicted dimensionality reduction difference, wherein i is a positive integer; The predicted dimensionality reduction difference is sent to a preset dimensionality increase model to determine the corresponding predicted difference; Determining the state of each of the nodes based on the true difference, the predicted difference, the true reduced dimensionality difference, and the predicted reduced dimensionality difference; The determining the state of each node based on the true difference, the predicted difference, the true dimensionality reduction difference, and the predicted dimensionality reduction difference includes: Determine a relationship between a first Euclidean distance between the actual difference and the predicted difference and a preset first threshold value, and determine a first determination result; Determine a relationship between a second Euclidean distance between the true dimensionality reduction difference and the predicted dimensionality reduction difference and a preset second threshold value, and determine a second determination result; Based on the first judgment result and the second judgment result, the state of the i-th node is determined.

7. An electronic device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1 to 5.

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

Citation Information

Patent Citations

  • Model training method and device, text classification method, computer equipment and medium

    CN112256874A

  • Federated learning defense method based on block chain

    CN112434280A