Federal learning method based on node selection strategy, electronic equipment and storage medium

Through the node selection strategy based on gradient evaluation values ​​and weighted local training sample number, nodes with a large impact on federated learning model training are preferred, which solves the problem of slow convergence speed of federated learning model training and realizes a more efficient training process.

CN119129780AActive Publication Date: 2024-12-13BEIJING TOPSEC NETWORK SECURITY TECH +2

Patent Information

Application Number
CN202411588672.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2024-12-13
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

In federated learning scenarios where large-scale node participation, the prior art random selection of nodes results in slower training of federated learning models, and the selection of nodes with large prediction loss values ​​may not necessarily prompt the model to converge faster.

Method used

The evaluation value based on gradient is used for random node selection strategy. By weighting the evaluation value with the number of local training samples, nodes with a large impact on the training loss of the global model are preferred to participate in this round of training, and the evaluation value is updated after each round of training.

Benefits of technology

The computational processing performance and network bandwidth requirements of the parameter server are reduced, the training convergence speed and overall training efficiency of the federated learning model are improved, the training time is reduced, and the accuracy of node selection results is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129780A_ABST
    Figure CN119129780A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a federated learning method based on a node selection strategy, electronic equipment and a storage medium, and relates to the technical field of federated learning. The method comprises the following steps: determining that client nodes in the federated learning system are not totally selected; obtaining an evaluation value corresponding to the client node, weighting the number of local training samples of the client node by taking a model of the evaluation value as a weight, and obtaining a selected probability of the client node according to the proportion of the number of the weighted local training samples in the sum of the number of the weighted local training samples in the federated learning system; selecting a plurality of client nodes according to the selected probability of each client node to obtain a training set of this round; and issuing model parameters to the client nodes in the training set in the round. According to the embodiment provided by the invention, the overall training time of the federated learning model is shortened in a mode of randomly selecting the nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of federated learning, and in particular to a federated learning method based on a node selection strategy, an electronic device, and a corresponding storage medium. Background Art

[0002] At present, with the rapid development of artificial intelligence technology, the application of artificial intelligence technology is becoming more and more extensive. It has been applied to many fields such as image analysis, speech recognition, text processing, intelligent recommendation, security detection, etc. Federated learning technology has become a frontier hotspot of artificial intelligence technology. In the scenario where large-scale nodes participate in federated learning, due to the large number of model parameters, if all nodes participate in each round of iterative training of federated learning at the same time, the computing performance and network bandwidth of the parameter server will become the bottleneck limiting the efficiency of federated learning. The common solution in the industry is to randomly select a small number of nodes to participate in the training process of this round in each round of iterative training of federated learning, so as to reduce the processing delay and communication delay caused by the limited computing performance and network bandwidth of the parameter server. However, the above solution randomly and blindly selects nodes based on the same probability, resulting in a slow training convergence speed of the federated learning model.

[0003] In the prior art, there is already a strategy of randomly selecting client nodes based on the predicted loss value, which can speed up the training convergence of the federated learning model and reduce the overall training time of the federated learning model. Although it can speed up the convergence of the federated learning model to a certain extent, when the client nodes with large predicted loss values ​​have fewer training samples and the predicted loss values ​​change less, selecting client nodes with large predicted loss values ​​does not necessarily promote model convergence faster than selecting client nodes with small predicted loss values. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a federated learning method, electronic device and storage medium based on a node selection strategy, which adopts a node random selection strategy based on a gradient evaluation value, and preferentially selects nodes that have a greater impact on reducing the overall training loss of the global model to participate in each round of local model training, so as to at least solve some of the problems in the background technology.

[0005] In order to achieve the above-mentioned purpose, a federated learning method based on a node selection strategy is provided in the present application, and the method includes: determining that not all client nodes in the federated learning system will be selected; obtaining an evaluation value corresponding to the client node, weighting the number of local training samples of the client node with the modulus of the evaluation value as the weight, and obtaining the probability of selection of the client node by the proportion of the weighted number of local training samples in the total number of weighted local training samples in the federated learning system; selecting a number of client nodes according to the selection probability of each client node to obtain a current round of training set; and sending model parameters to the client nodes in the current round of training set, and the model parameters are used by the client nodes to obtain updated gradients after local training based on the sent model parameters.

[0006] Optionally, the method further includes: updating the evaluation value of the client node after each round of training is completed.

[0007] Optionally, the evaluation value of the client node is updated, including: if the client node does not belong to the current round of training set, the current evaluation value of the client node remains unchanged; if the client node belongs to the current round of training set and the current round of training is the first round of training, the updated gradient uploaded by the client node is used as the updated evaluation value; if the client node belongs to the current round of training set but the current round of training is not the first round of training, the weighted sum of the current evaluation value of the client node and the uploaded update gradient is used as the updated evaluation value.

[0008] Optionally, determining that not all client nodes in the federated learning system will be selected includes: obtaining the round number of the current model training round; determining whether the round number belongs to a preset sequence, when the round number belongs to the preset sequence, all client nodes in the federated learning system are selected into the current training set, and when the round number does not belong to the preset sequence, determining that not all client nodes in the federated learning system will be selected.

[0009] Optionally, the preset number sequence is an arithmetic progression whose first term is 1.

[0010] Optionally, a number of client nodes are selected according to the selection probability of each client node to obtain the current round of training set, including: for each client node, the value of the cumulative distribution function is calculated according to the node sequence number and the selection probability of the client node, and a probability interval is obtained according to the selection probability of the client node and the value of the cumulative distribution function; a number of random numbers are generated within the value range of the cumulative distribution function, and the client node corresponding to the probability interval where each random number is located is selected into the current round of training set; the number of generated random numbers has a corresponding relationship with the number of client nodes in the current round of training set.

[0011] Optionally, a probability interval is obtained according to the probability of selection of the client node and the value of the cumulative distribution function, including: the difference obtained by subtracting the probability of selection from the value of the cumulative distribution function and the value of the cumulative distribution function as the end values ​​of the probability interval respectively; the probability interval includes the end value of the value of the cumulative distribution function but does not include the end value of the difference obtained by subtracting the probability of selection from the value of the cumulative distribution function.

[0012] Optionally, the client node obtains an update gradient after local training based on the model parameters sent down, which is used to generate a global model update gradient in combination with the number of local training samples of the client node; the global model update gradient is used to update the global model in combination with the model parameters.

[0013] Optionally, the method is configured to be executed in a loop when the following preset conditions are met; the preset conditions include: after updating the global model in combination with the model parameters, determining that the current state of the federated learning system does not meet the training stop condition of the federated learning.

[0014] The present application also provides a federated learning device based on a node selection strategy, which includes: a full selection determination module, which is used to determine that all client nodes in the federated learning system will not be selected; a probability calculation module, which is used to obtain an evaluation value corresponding to the client node, weight the number of local training samples of the client node with the modulus of the evaluation value as the weight, and obtain the probability of selection of the client node by the proportion of the weighted number of local training samples in the total number of weighted local training samples in the federated learning system; a set determination module, which is used to select a number of client nodes according to the selection probability of each client node to obtain a current round of training sets; and a parameter sending module, which is used to send model parameters to the client nodes in the current round of training sets, and the model parameters are used by the client nodes to obtain updated gradients after local training based on the sent model parameters.

[0015] The present application also provides an electronic device, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the aforementioned federated learning method based on the node selection strategy by executing the instructions stored in the memory.

[0016] The present application also provides a machine-readable storage medium on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned federated learning method based on the node selection strategy.

[0017] The present application also provides a computer program product, including a computer program, which implements the aforementioned federated learning method based on node selection strategy when executed by a processor.

[0018] The above technical solution has the following beneficial effects: (1) A method of randomly selecting client nodes to participate in the training of the federated learning model is adopted, which reduces the data sending and uploading processing required by the client nodes in the federated learning system in each round of training, and reduces the computing processing performance of the parameter server in the federated learning scenario and the processing delay and communication delay caused by the limited network bandwidth.

[0019] (2) In the process of selecting client nodes, the number of local training samples and evaluation values ​​are used as influencing factors. Nodes that have a greater impact on reducing the overall training loss of the global model are preferentially selected to participate in each round of local model training, which accelerates the training convergence speed of the federated learning model and reduces the overall training time of the federated learning model.

[0020] (3) After a certain number of training rounds, the evaluation values ​​of all client nodes are updated to solve the problem of outdated or distorted evaluation values ​​of some client nodes caused by random selection of client nodes, thereby improving the accuracy of the random selection results of nodes.

[0021] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings: Figure 1 The schematic diagram shows the steps of the federated learning method based on the node selection strategy according to the implementation mode of the present application; Figure 2 The schematic diagram schematically shows the implementation process of the federated learning method based on the node selection strategy according to the implementation mode of the present application; Figure 3 The schematic diagram shows the structure of a federated learning device based on a node selection strategy according to an embodiment of the present application; Figure 4 The internal structure of an electronic device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0023] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present application, and is not used to limit the embodiment of the present application.

[0024] Figure 1The following schematically shows the steps of the federated learning method based on the node selection strategy according to the embodiment of the present application. Figure 1 As shown, a federated learning method based on a node selection strategy includes: S01. Ensure that all client nodes in the federated learning system will not be selected; S02, obtaining an evaluation value corresponding to the client node, weighting the number of local training samples of the client node with the modulus of the evaluation value as a weight, and obtaining the probability of the client node being selected by the proportion of the weighted number of local training samples in the total number of weighted local training samples in the federated learning system; S03, selecting a number of client nodes according to the probability of each client node being selected to obtain a training set for this round; S04: Send model parameters to the client nodes in the current round of training set, where the model parameters are used by the client nodes to obtain updated gradients after local training based on the sent model parameters.

[0025] In step S01, according to the user's selection or the user's predetermined strategy, if all client nodes are selected to participate in the training in this round of training, there will be no client node selection, and the subsequent steps cannot be executed. Therefore, it is necessary to determine in this step whether client node selection is required for this round of training.

[0026] In some scenarios, it may be necessary to perform model initialization. The parameter server S initializes the parameters of the adopted deep neural network model. The initialization parameters are . In step S02, the client node i In the r The corresponding evaluation value of the round is Since the evaluation value is in the form of a vector, it needs to be modulo processed. The number of local training samples is , the probability of being selected is calculated by the following formula: , is the total number of client nodes in the federated learning system, a positive integer, .

[0027] The federated learning method based on the node selection strategy in the above implementation reduces the number of client nodes participating in each round of model training, thereby reducing the computing performance of the parameter server in the federated learning scenario and the processing delay and communication delay caused by the limited network bandwidth. At the same time, this implementation implements the selection of client nodes based on the probability of selection generated by combining the evaluation value with the number of local training samples, and preferentially selects nodes that have a greater impact on reducing the overall training loss of the global model to participate in each round of local model training, which speeds up the training convergence speed of the federated learning model and reduces the overall training time of the federated learning model.

[0028] In some optional implementations of the present application, the method further includes: updating the evaluation value of the client node after each round of training. This implementation provides a mechanism for updating the evaluation value after each round of training, thereby avoiding the relative fixity of the evaluation value, making it more able to reflect the characteristics of each client node, and dynamically updating and adjusting its probability of being selected.

[0029] In some optional implementations of the present application, a strategy for updating the evaluation value of the client node is provided, including: In the round model training cycle, the parameter server S receives the set The local model parameters uploaded by the client nodes in the aggregation generate the global model parameters , update the evaluation value of each client node .

[0030]

[0031] The above formula is explained as follows: If the client node does not belong to the current round of training set, that is , the current evaluation value of the client node remains unchanged, = ; If the client node belongs to the current round of training set and this round of training is the first round of training, that is , taking the updated gradient uploaded by the client node as the updated evaluation value, ; If the client node belongs to the current round of training set but this round of training is not the first round of training, that is , the weighted sum of the current evaluation value of the client node and the uploaded update gradient is taken as the updated evaluation value, = ,in β is a constant coefficient, . Through the above method, the evaluation value can reflect the gradient characteristics of the client node. At the same time, through the second round and subsequent weighted calculations, the evaluation value also reflects the transformation continuity based on the gradient characteristics. It can be seen that the evaluation value in this application is based on the gradient. Due to the use of the gradient-based evaluation value, nodes that have a greater impact on reducing the overall training loss of the global model are preferentially selected to participate in each round of local model training, which speeds up the training convergence speed of the federated learning model and reduces the overall training time of the federated learning model.

[0032] In some optional implementations, determining that all client nodes in the federated learning system will not be selected includes: obtaining the round number sequence of the current round of model training; determining whether the round number sequence belongs to a preset sequence, when the round number sequence belongs to the preset sequence, all client nodes in the federated learning system are selected into the current round of training set, and when the round number sequence does not belong to the preset sequence, determining that all client nodes in the federated learning system will not be selected. The round number sequence of the current round of model training is r ,when r When the value of belongs to the preset sequence, the parameter server S selects all Client nodes form a collection , the parameters of the global model of the deep neural network model Send to The client nodes in the preset sequence here only need to ensure that the values ​​in the preset sequence are positive integers. It can be set arbitrarily according to user needs, and commonly used recursive sequences, garant numbers, Pascal's triangles, etc. can also be selected. It should be noted here that the present embodiment can also be implemented in the opposite way, that is, when the round number sequence does not belong to the preset sequence, the client nodes in the federated learning system are all selected to the current round of training set, and when the round number sequence belongs to the preset sequence, it is determined that the client nodes in the federated learning system will not be fully selected. This embodiment also ensures that the evaluation values ​​of all client nodes are fully updated every certain number of training rounds, which is a simple variation of the claim implementation method in this application, and therefore should also belong to the scope of protection of this application. This embodiment updates the evaluation values ​​of all client nodes every certain number of training rounds to solve the problem of outdated or distorted evaluation values ​​of some client nodes caused by random selection of client nodes, and improves the accuracy of the node random selection algorithm.

[0033] In some optional implementations, the preset sequence is an arithmetic sequence with the first term being 1. The expression of the arithmetic sequence can be nT +1; T is a positive integer, n is a non-negative integer. r = nT +1, the parameter server S selects all Client nodes form a collection , the parameters of the global model of the deep neural network model Send to The client node in T For example, if 1 is equal to 4, all selections will be implemented in the 1st, 5th, 9th, 13th, etc. rounds, thereby ensuring that each client node will be selected to participate in at least one training within a fixed training round. This arithmetic sequence starts with 1, which can ensure that in the first round Each client node is trained, so that each client node can get its own , and , and then get the corresponding evaluation value . This implementation method updates all evaluation values ​​of all client nodes every certain number of training rounds to solve the problem of outdated or distorted evaluation values ​​of some client nodes caused by random selection of client nodes, and improves the accuracy of the node random selection algorithm. Compared with the method of presetting the series in the previous implementation method, this implementation method has better periodicity and can ensure that the evaluation values ​​of all client nodes are fully updated every fixed number of training rounds.

[0034] In step S03, selecting several client nodes according to the probability of selection of each client node to obtain the current round of training set can be carried out in the following various ways, for example, selecting several client nodes with a high ranking of the probability of selection to obtain the current round of training set, or setting a probability threshold, selecting several client nodes near the probability threshold to obtain the current round of training set, or setting a probability interval, selecting several client nodes within the probability interval to obtain the current round of training set. In this optional implementation, a more optimal selection method is provided, which includes: for each client node, calculating the value of the cumulative distribution function according to the node sequence number and the probability of selection of the client node, that is: .

[0035] in, The node serial number of the client node The probability function of Based on i The cumulative distribution function of .

[0036] A probability interval is obtained according to the probability of the client node being selected and the value of the cumulative distribution function; the difference between the value of the cumulative distribution function and the value of the cumulative distribution function are respectively used as the end values ​​of the probability interval; the probability interval includes the end value of the value of the cumulative distribution function but does not include the end value of the difference between the value of the cumulative distribution function and the value of the selected probability; that is, ( ] Generate a number of random numbers within the range of the cumulative distribution function, including: since the range of the cumulative distribution function is , so through a A random number generator uniformly distributed between Random number between The client node corresponding to the probability interval of each random number is selected into the current round of training set; for example, if , then The number of random numbers generated corresponds to the number of client nodes in the current training set. When the distribution is ideal, repeat the above process You can get it by random draw. The selection method based on the probability of being selected in this embodiment has the advantage of better randomness. , Is a positive integer.

[0037] In the implementation mode of the present application, the client node obtains the updated gradient through the following process based on the model parameters sent down after local training: In the round of model training cycle, the parameter server will Send to Client nodes in the collection The The client nodes use the slave parameter server Received global model parameters Update the local model, use the gradient descent algorithm to train the local model on the local training data set, and update the gradient of the parameters of the local model Upload to the parameter server S. The update gradient obtained in the above process is used to generate the global model update gradient in combination with the number of local training samples of the client node, including: ; in, is a constant coefficient, .

[0038] The global model update gradient is used to update the global model in combination with the model parameters, including: ; in, and Respectively r Round and r -1 round of global model parameters.

[0039] In some embodiments of the present application, the method is configured to be executed in a loop when the following preset conditions are met; the preset conditions include: after updating the global model in combination with the model parameters, it is determined that the current state of the federated learning system does not meet the training stop condition of the federated learning. The training stop condition includes: the parameters of the global model Convergence or If the parameters of the global model Convergence or , then terminate the training process, otherwise The value of is increased by 1, and the steps of training node selection, model parameter distribution, local model training and model parameter update are repeated to start the next round of model parameter distribution, local model training and model parameter update. is the preset training cycle threshold constant, is a positive integer greater than 1.

[0040] Figure 2 The schematic diagram shows the implementation process of the federated learning method based on the node selection strategy according to the implementation mode of the present application. Figure 2 As shown, it includes the following implementation steps: the parameter server initializes the model parameters. The parameter server determines the set , send the latest global model parameters to the nodes in the set. The nodes in the training process train the local model and upload the updated gradient of the local model. The parameter server aggregates and generates global model parameters, updates the evaluation value of the node, and determines the termination condition of the training process.

[0041] The following is an example of applying the present application to the training of a spam detection model for federated learning. According to the method described in the detailed description of the present application, the specific process is as follows: (1) Assume that the total number of client hosts that install the neural network-based spam detection system is The email security monitoring center S initializes the parameters of the deep neural network model (such as Bert, LSTM, RNN, etc.) used. The initialization parameters are .

[0042] (2) In round model training cycle, if , then the email security monitoring center S selects all Client hosts form a collection , the parameters of the deep neural network model Send to Otherwise, the email security monitoring center S will calculate the client host based on the evaluation value of each client host. , calculate the The probability that a client host is randomly selected According to the above probability, Randomly select from client hosts Client hosts form a collection , the parameters Send to The client host in Is a positive integer.

[0043] (3) In the Round model training cycle, collection The The client host uses the global model parameters received from the email security monitoring center S Update the local model, use the gradient descent algorithm to train the local model on the local spam training data set, and update the gradient of the local model parameters Upload to the email security monitoring center S.

[0044] (4) In In the round model training cycle, the email security monitoring center S receives the collection The local model parameters uploaded by the client host in the aggregation generate the global model parameters , update the evaluation value of each client host If the parameters of the global model Convergence or , then terminate the entire federated learning model training process, otherwise , repeat all sub-steps of steps (2), (3), and (4) to start the next round of model training cycle.

[0045] In the above implementation, the processing delay and communication delay of the spam detection model in the federated learning process are reduced, while the training convergence speed of the federated learning model is accelerated, and the overall training time of the federated learning model is reduced.

[0046] Based on the same inventive concept, the present application also provides a federated learning device based on a node selection strategy. Figure 3 The schematic diagram shows the structure of the federated learning device based on the node selection strategy according to the embodiment of the present application. Figure 3As shown, the device includes: a full selection determination module, which is used to determine that the client nodes in the federated learning system will not be fully selected; a probability calculation module, which is used to obtain the evaluation value corresponding to the client node, weight the number of local training samples of the client node with the modulus of the evaluation value as the weight, and obtain the probability of the client node being selected by the proportion of the weighted number of local training samples in the total number of weighted local training samples in the federated learning system; a set determination module, which is used to select a number of client nodes according to the selection probability of each client node to obtain the current round of training sets; and a parameter sending module, which is used to send model parameters to the client nodes in the current round of training sets, and the model parameters are used by the client nodes to obtain updated gradients after local training based on the sent model parameters.

[0047] In some optional implementations of the present application, the device further includes an evaluation update module, which is used to update the evaluation value of the client node after each round of training is completed.

[0048] In some optional implementations of the present application, the evaluation value of the client node is updated, including: if the client node does not belong to the current round of training set, the current evaluation value of the client node remains unchanged; if the client node belongs to the current round of training set and the current round of training is the first round of training, the updated gradient uploaded by the client node is used as the updated evaluation value; if the client node belongs to the current round of training set but the current round of training is not the first round of training, the weighted sum of the current evaluation value of the client node and the uploaded update gradient is used as the updated evaluation value.

[0049] In some optional embodiments of the present application, determining that not all client nodes in the federated learning system will be selected includes: obtaining the round number of the current round of model training; determining whether the round number belongs to a preset sequence, when the round number belongs to the preset sequence, all client nodes in the federated learning system are selected into the current round of training set, and when the round number does not belong to the preset sequence, determining that not all client nodes in the federated learning system will be selected.

[0050] In some optional implementations of the present application, the preset number sequence is an arithmetic progression whose first term is 1.

[0051] In some optional embodiments of the present application, a number of client nodes are selected according to the selection probability of each client node to obtain the current round of training set, including: for each client node, the value of the cumulative distribution function is calculated according to the node sequence number and the selection probability of the client node, and a probability interval is obtained according to the selection probability of the client node and the value of the cumulative distribution function; a number of random numbers are generated within the value range of the cumulative distribution function, and the client node corresponding to the probability interval of each random number is selected into the current round of training set; the number of generated random numbers has a corresponding relationship with the number of client nodes in the current round of training set.

[0052] In some optional embodiments of the present application, a probability interval is obtained based on the probability of selection of the client node and the value of the cumulative distribution function, including: the difference between the value of the cumulative distribution function and the value of the cumulative distribution function are the end values ​​of the probability interval respectively; the probability interval includes the end value of the value of the cumulative distribution function but does not include the end value of the difference between the value of the cumulative distribution function and the probability of selection.

[0053] In some optional embodiments of the present application, the update gradient obtained by the client node after local training based on the model parameters sent down is used to generate a global model update gradient in combination with the number of local training samples of the client node; the global model update gradient is used to update the global model in combination with the model parameters.

[0054] In some optional embodiments of the present application, the device is configured to execute in a loop when the following preset conditions are met; the preset conditions include: after updating the global model in combination with the model parameters, determining that the current state of the federated learning system does not meet the training stop condition of the federated learning.

[0055] The specific definition of each functional module in the above-mentioned federated learning device based on the node selection strategy can be found in the above definition of the federated learning method based on the node selection strategy, which will not be repeated here. Each module in the above-mentioned system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It also realizes the random selection of nodes based on the evaluation value of the gradient, thereby having the advantages of reducing processing delay and communication delay, and also has the advantages of accelerating the training convergence speed of the federated learning model and reducing the overall training time of the federated learning model.

[0056] In some embodiments of the present application, an electronic device is also provided, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the aforementioned federated learning method based on the node selection strategy. Its internal structure diagram can be as follows Figure 4 shown. Figure 4 The internal structure diagram of an electronic device according to an embodiment of the present application is schematically shown. The electronic device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected via a system bus. Among them, the processor A01 of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The network interface A02 of the electronic device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a federated learning method based on a node selection strategy is implemented.

[0057] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0058] In one embodiment provided in the present application, a machine-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned federated learning method based on the node selection strategy.

[0059] In one embodiment provided in the present application, a computer program product is provided, including a computer program, which implements the aforementioned federated learning method based on node selection strategy when executed by a processor.

[0060] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0061] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0062] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0064] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0065] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0066] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0067] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0068] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A federated learning method based on node selection strategy, characterized in that: The method includes: Make sure that not all client nodes in the federated learning system are selected; Obtain an evaluation value corresponding to the client node, weight the number of local training samples of the client node using the modulus of the evaluation value as a weight, and obtain the probability of the client node being selected based on the proportion of the weighted number of local training samples in the total number of weighted local training samples in the federated learning system; According to the probability of each client node being selected, a number of client nodes are selected to obtain the current round of training sets; The model parameters are sent to the client nodes in the current round of training set, and the model parameters are used by the client nodes to obtain updated gradients after local training based on the sent model parameters.

2. The method according to claim 1, characterized in that The method further includes: updating the evaluation value of the client node after each round of training is completed.

3. The method according to claim 2, characterized in that Update the evaluation value of the client node, including: If the client node does not belong to the current round of training set, the current evaluation value of the client node remains unchanged; If the client node belongs to the current round of training set and this round of training is the first round of training, the updated gradient uploaded by the client node is used as the updated evaluation value; If the client node belongs to the current round of training set but the current round of training is not the first round of training, the weighted sum of the current evaluation value of the client node and the uploaded update gradient is used as the updated evaluation value.

4. The method according to claim 1, characterized in that: Make sure that not all client nodes in the federated learning system are selected, including: Get the round number of this round of model training; It is determined whether the round number sequence belongs to a preset sequence. When the round number sequence belongs to the preset sequence, all client nodes in the federated learning system are selected into the current round training set. When the round number sequence does not belong to the preset sequence, it is determined that all client nodes in the federated learning system will not be selected.

5. The method according to claim 4, characterized in that The preset number sequence is an arithmetic progression whose first term is 1.

6. The method according to claim 1, characterized in that According to the probability of each client node being selected, several client nodes are selected to obtain the current round of training set, including: For each client node, the value of the cumulative distribution function is calculated according to the node sequence number and the probability of being selected of the client node, and a probability interval is obtained according to the probability of being selected of the client node and the value of the cumulative distribution function; Generate a number of random numbers within the value range of the cumulative distribution function, and the client node corresponding to the probability interval of each random number is selected into the current round training set; The number of generated random numbers corresponds to the number of client nodes in the current round of training set.

7. The method according to claim 6, characterized in that According to the probability of the client node being selected and the value of the cumulative distribution function, a probability interval is obtained, including: The difference between the value of the cumulative distribution function and the value of the cumulative distribution function is respectively taken as the end value of the probability interval; The probability interval includes the end value of the value of the cumulative distribution function but does not include the end value of the difference between the value of the cumulative distribution function and the selected probability.

8. The method according to claim 1, characterized in that: The client node obtains the update gradient after local training based on the model parameters sent down, which is used to generate the global model update gradient in combination with the number of local training samples of the client node; The global model update gradient is used to update the global model in combination with the model parameters.

9. The method according to claim 8, characterized in that The method is configured to be executed cyclically when the following preset conditions are met; The preset condition includes: after updating the global model in combination with the model parameters, determining that the current state of the federated learning system does not meet the training stop condition of the federated learning.

10. An electronic device, characterized in that: include: at least one processor; a memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the steps of the federated learning method based on the node selection strategy as described in any one of claims 1 to 9 by executing the instructions stored in the memory.

11. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the federated learning method based on the node selection strategy described in any one of claims 1 to 9 are implemented.

12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the federated learning method based on the node selection strategy described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Federation modeling method based on non-uniform distribution data and related equipment

    CN112464278A

  • Method, system and device for optimizing federated learning compression communication

    CN114861790A

  • Asynchronous federated learning method and system based on multi-agent model

    CN115130683A

  • Enhanced federated learning dynamic sampling method and device based on data quality evaluation

    CN116451593A

  • Federal learning privacy protection method and system

    CN116467747A

Cited By

  • Federal learning method of junk mail detection model based on random strategy

    CN120151315A