Federated learning model training method for privacy computing in large-scale industrial chains
By dividing and distributing the industrial chain business training data set in federated learning, and optimizing node participation based on the target profit function and earthquake distance EMD, the problem of inefficient worker nodes affecting the federated learning effect is solved, and the model accuracy and industrial chain are improved. Operational efficiency.
Patent Information
- Application Number
- CN202111397160.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-23
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-11-23
AI Technical Summary
When the existing technology applies federated learning to the industrial chain network system, the inefficient worker learning nodes affect the training effect of the entire federated learning model and reduce the accuracy of the model.
The industrial chain business training data set is divided by the federated learning center server node, distributed to multiple federated learning worker nodes, and the local model is iteratively trained based on the target profit function, the ground motion distance EMD of each worker node is calculated, and nodes that exceed the preset threshold are eliminated. , optimize the model training process.
It improves the accuracy of the federated learning model, optimizes the intelligent application and service quality of the industrial chain, and improves operating efficiency.
Smart Images

Figure CN114169412B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of federated learning technology, and in particular to a federated learning model training method for privacy computing in large-scale industrial chains. Background Art
[0002] The industrial chain is a concept that includes four dimensions: value chain, enterprise chain, supply and demand chain, and space chain. The industrial chain is formed in the process of mutual docking and equilibrium of these four dimensions. There are a large number of upstream and downstream relationships and mutual value exchanges in the industrial chain. The upstream links deliver products or services to the downstream links, and the downstream links feedback information to the upstream links to adjust strategies. The information interaction needs in the industrial chain form a large-scale mesh topology structure, which faces severe privacy barriers and security challenges. It also means that the distributed privacy computing tasks of the industrial chain need to be solved urgently.
[0003] At present, a machine learning technology developed on the basis of parallel computing has become an effective way to solve the above problems. This collaborative training method that uses encryption technology to ensure that device data does not leave the local area is called federated learning. However, when the existing technology applies federated learning to the industrial chain network system, due to the existence of some inefficient worker learning nodes, the training effect of the entire federated learning model is affected, and the accuracy of the federated learning model is reduced. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a federated learning model training method for privacy computing in large-scale industrial chains, including:
[0005] Step 101, obtaining an industrial chain business training data set, dividing the industrial chain business training data set by a federated learning center server node with a non-independent and identically distributed (non-iid) target, obtaining multiple industrial chain business training sub-data sets, and distributing the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes;
[0006] Step 102, the federated learning worker node takes the industrial chain business training sub-dataset distributed by the federated learning center server as input, iteratively trains the local model based on the target profit function, updates the local model weight, and sends the updated local model weight to the aggregation server node;
[0007] Step 103, after aggregating the updated local model weights sent by each federated learning worker node, the aggregation server node calculates the EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and removes the federated learning worker nodes that exceed the preset EMD threshold;
[0008] Step 104, the remaining federated learning worker nodes repeat steps 101 to 103 until the federated learning model converges or reaches a preset number of iterations.
[0009] Optionally, the server node of the federated learning center divides the industrial chain business training data set based on non-independent and identically distributed (non-iid) as the goal to obtain multiple industrial chain business training sub-data sets, including:
[0010] The industrial chain business training data set is sorted according to the digital labels, and the sorted industrial chain business training data set is divided into industrial chain business training sub-data sets containing a preset number of industrial chain business training data.
[0011] Optionally, the objective profit function for:
[0012]
[0013]
[0014] Among them, g n is the reward factor R of the federated learning worker node n and the integrated expression of the federated learning worker node type, including a series of reward packages for the federated learning center server for the computing resource provision rate and data provision rate of the federated learning worker node, q n The data volume contribution of the federated learning worker node, T max is the maximum tolerance time of the federated learning center server node for this federated learning task, is the parameter transmission time after the local model is updated, μ is the correlation coefficient, which is related to the number of iterations of the local model, and c n The number of CPU cycles required to train the local model, f n is the CPU cycle frequency, θ n is the federated learning worker node qualification, K is the federated learning worker node type, ρ is the unit reward cost of the federated learning center server node to the federated learning worker node, is the transmission energy consumption of the federated learning worker nodes in the iteration of the federated learning model, and τ represents the computing iteration energy consumption parameter of the central server and the federated learning workers.
[0015] Optionally, the ground motion distance EMD corresponding to each federated learning worker node is calculated according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, including:
[0016] The EMD between the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes is calculated according to the following formula:
[0017]
[0018] Where p(y=i) is the overall local model weight distribution of all federated learning worker nodes, p k (y=i) is the local model weight distribution of the kth federated learning worker node.
[0019] The present invention also provides a federated learning model training device for large-scale industrial chain privacy computing, including:
[0020] The first processing module is used to obtain an industrial chain business training data set, and the server node of the federated learning center divides the industrial chain business training data set according to the non-independent and identically distributed (non-iid) target to obtain multiple industrial chain business training sub-data sets, and distribute the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes;
[0021] The second processing module is used for the federated learning worker node to take the industrial chain business training sub-dataset distributed by the federated learning center server as input, iteratively train the local model based on the target profit function, update the local model weight, and send the updated local model weight to the aggregation server node;
[0022] A third processing module is used for the aggregation server node to calculate the EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes after aggregating the updated local model weight sent by each federated learning worker node, and to remove the federated learning worker nodes that exceed the preset EMD threshold;
[0023] The fourth processing module is used to repeatedly execute the first processing module to the third processing module by the remaining federated learning worker nodes until the federated learning model converges or reaches a preset number of iterations.
[0024] Optionally, the first processing module is specifically used to:
[0025] The industrial chain business training data set is sorted according to the digital labels, and the sorted industrial chain business training data set is divided into industrial chain business training sub-data sets containing a preset number of industrial chain business training data.
[0026] Optionally, the third processing module is specifically used to:
[0027] The EMD between the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes is calculated according to the following formula:
[0028]
[0029] Where p(y=i) is the overall local model weight distribution of all federated learning worker nodes, p k (y=i) is the local model weight distribution of the kth federated learning worker node.
[0030] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the steps of the federated learning model training method for large-scale industrial chain privacy computing as described in any of the above-mentioned methods are implemented.
[0031] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the federated learning model training method for large-scale industrial chain privacy computing as described in any of the above-mentioned methods.
[0032] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned federated learning model training methods for large-scale industrial chain privacy computing.
[0033] The federated learning model training method for large-scale industrial chain privacy computing provided by the present invention first divides the industrial chain business training data set by the federated learning center server node with non-independent and identically distributed non-iid as the goal, obtains multiple industrial chain business training sub-data sets, and distributes the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes. In order to ensure efficient and reliable federated learning, the federated learning worker node uses the industrial chain business training sub-data set distributed by the federated learning center server as input, and iteratively trains the local model based on the target profit function, thereby motivating more federated worker learning nodes to participate in the federated learning task with higher enthusiasm. Finally, in the federated aggregation model stage, the present invention provides a weighted federated average algorithm based on earth mover's distances (EMD), calculates the earth mover's distance EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and removes the federated learning worker nodes that exceed the preset EMD threshold, thereby reducing the weight dispersion of the aggregation model, thereby training a more accurate federated learning model, thereby optimizing the intelligent application of the industrial chain, and improving the service quality and operation efficiency of the industrial chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 It is a flowchart of a federated learning model training method for large-scale industrial chain privacy computing provided by the present invention;
[0036] Figure 2 It is a schematic diagram of the structure of a federated learning model for privacy computing in large-scale industrial chains provided by the present invention;
[0037] Figure 3 It is a schematic diagram of non-iid partitioning provided by the present invention;
[0038] Figure 4 Schematic diagram of the EMD-based federated averaging algorithm provided by the present invention;
[0039] Figure 5 This is a comparison chart of the accuracy of the trained federated learning model provided by the present invention and the traditional federated learning model;
[0040] Figure 6It is a structural schematic diagram of a federated learning model training device for large-scale industrial chain privacy computing provided by the present invention;
[0041] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] like Figure 1 As shown, the present invention provides a federated learning model training method for large-scale industrial chain privacy computing, including:
[0044] Step 101, obtaining an industrial chain business training data set, dividing the industrial chain business training data set by a federated learning center server node with a non-independent and identically distributed (non-iid) target, obtaining multiple industrial chain business training sub-data sets, and distributing the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes;
[0045] In this step, it should be noted that various parties in the industry chain are both data providers and data demanders according to their own business needs. Therefore, the data providers in the industry chain can be modeled as local model providers of federated learning (federated learning user nodes), and the task publishers can be modeled as model users of federated learning (federated learning center server nodes). A task publisher needs to collaborate with multiple federated learning worker nodes to complete a federated learning task.
[0046] In this step, first obtain the industry chain business training data set, which is used to train the entire federated learning model and may include different business data of the industry chain. Figure 3As shown in the figure, in order to simulate the non-iid data distribution in real scenes, the 60,000 handwritten digit images of the MNIST training set can be sorted in order from small to large using labels from 0 to 9. After sorting, the training set is divided into 200 slices, each containing 300 images. After division, the images contained in each slice are the same number (label). The 300*2 pieces of training data (industry chain business training sub-dataset) are distributed to 100 federated learning worker nodes (N=100). At this time, there are two possibilities for the training data set assigned to each federated learning worker node: 300 images each containing only two numbers, or a total of 600 images containing 3 numbers, the latter being a minority case. Therefore, the data types and the number of images of the corresponding types of each participant are different, thus forming a non-iid data distribution type.
[0047] Step 102, the federated learning worker node takes the industrial chain business training sub-dataset distributed by the federated learning center server as input, iteratively trains the local model based on the target profit function, updates the local model weight, and sends the updated local model weight to the aggregation server node;
[0048] In this step, each federated learning worker node uses the distributed industrial chain business training sub-dataset as local data to iteratively train the local model. Among them, when conducting local model training, in order to carry out reliable federated learning tasks and promote data sharing transactions, it is necessary for the federated learning center server node to give corresponding rewards to the federated learning worker nodes that perform well in training tasks, so that they can more actively contribute data and train models with good quality when future tasks come. In the model transaction of federated learning collaborative computing, two stakeholders need to be considered, namely the profit of the federated learning center server node (which is also the model user) and the utility of the federated learning worker node (model provider). Therefore, the present invention provides a model co-directional incentive mechanism based on multi-objective utility. Specifically, the local model is iteratively trained based on the target profit function. The target profit function for:
[0049]
[0050]
[0051] Among them, g n is the reward factor R of the federated learning worker node n and the integrated expression of the federated learning worker node type, including a series of reward packages for the federated learning center server for the computing resource provision rate and data provision rate of the federated learning worker node, q n The data volume contribution of the federated learning worker node, Tmax is the maximum tolerance time of the federated learning center server node for this federated learning task, is the parameter transmission time after the local model is updated, μ is the correlation coefficient, which is related to the number of iterations of the local model, and c n The number of CPU cycles required to train the local model, f n is the CPU cycle frequency, θ n is the federated learning worker node qualification, K is the federated learning worker node type, ρ is the unit reward cost of the federated learning center server node to the federated learning worker node, is the transmission energy consumption of the federated learning worker nodes in the iteration of the federated learning model, and τ represents the computing iteration energy consumption parameter of the central server and the federated learning workers.
[0052] Step 103, after aggregating the updated local model weights sent by each federated learning worker node, the aggregation server node calculates the EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and removes the federated learning worker nodes that exceed the preset EMD threshold;
[0053] In this step, it should be noted that Figure 4 As shown, the present invention provides a method for defining the weight divergence of industrial chain business training data based on the earthquake distance EMD, and reducing the model loss in the training process through a certain elimination mechanism. j = (m j ,w j ) represents a series of feature categories, s is a feature class, m is the center of the class, and w is the weight of the feature class. Federated learning worker nodes are divided into k categories based on the data provision rate and computing power of the data holder. Assume that there are two types of training data sets P and Q, let P = (p1, w p1 ),…,(p i ,w pi ), indicating a signature with i clusters; let Q = (q1,w q1 ),…,(q j ,w qj ), which represents a signature with j clusters.
[0054] D=[d ij ] is the distance between individual features, each d ij Indicates p i to p j The distance between them can be found to be an I×J matrix. Define a workflow matrix F = [f ij ], where each item f ijDenote \(p\) i to \(p\) j as the number of flows between them, then the EMD distance can be further transformed into a linear programming problem, that is, to find the matrix \(F\) to minimize the global cost from \(P\) to \(Q\):
[0055]
[0056] Therefore, the EMD distance between two federated learning nodes with different distributions is
[0057]
[0058] It should be noted that in practical applications, the differences in training datasets may lead to different ways of using EMD, but all need to ensure compliance with the above constraints. Let \(N\) be the total number of candidates for federated learning worker nodes, and \(K(\leq N)\) be the maximum number of devices participating in each round of communication, with the stipulation that \((1 < K\leq N)\). \(R\) is the total number of SGDs in federated learning, and \(E\) is the number of local iterations performed by the device during the two communication processes of "server - client". Therefore is the number of communications. Assume that the \(k\)-th worker locally stores \(z\) training data: Therefore, the local model objective is defined as:
[0059]
[0060] where \(l(\cdot;\cdot)\) is the specified loss function. Assume that the data in the \(k\)-th device is iid sampled from the distribution , then it can be considered that the overall distribution is a mixture of all local data distributions, that is The SGD weight divergence is defined using the following formula:
[0061]
[0062] In this step, the EMD distance is used to measure the degree of weight divergence. After the aggregation server node broadcasts the latest model \(w\) t to the worker candidates, an EMD value is calculated based on the local model sample weight distribution of each worker and the overall model sample weight distribution, and this EMD value is sorted from small to large. The group behind the third quartile is considered to have too large a difference from the overall distribution and will be eliminated as it will reduce the effect of the federated model. Let \(p(y = i)\) be the overall probability distribution, and \(p\) k (y = i) be the local probability distribution of the \(k\)-th worker participating in the task, then the EMD distance between them is:
[0063]
[0064] Next, \(K\) workers perform local model updates (\(E\geq1\)), and at the same time let The workers with large data distribution differences are removed by EMD distance. Let the number of workers eliminated in round t be h. t , the remaining set of workers is P t (|P t |≤K), then the new parameters obtained by the workers who are not eliminated in round t are:
[0065]
[0066] Among them, η t+i is the learning rate (also called step size).
[0067] In this step, in order to make workers with smaller data distribution gaps more likely to be selected, the devices that contribute more in the EMD distance calculation are given a greater weight. In the aggregation step, the following is performed:
[0068]
[0069] Among them, it can be proved is equal to 1. Each E iteration of EMD-FedAvg requires two rounds of communication: one broadcast and one aggregation. If R iterations are fully executed, the number of communications is During the broadcast, the central server will w t sent to the device; during aggregation, the worker executing the task outputs it (e.g., w t+E ) to the server.
[0070] Step 104, the remaining federated learning worker nodes repeat steps 101 to 103 until the federated learning model converges or reaches a preset number of iterations.
[0071] In this step, after removing the federated learning worker nodes with lower utility, the remaining nodes enter the next round of federated model training until the federated learning model converges or reaches the preset number of iterations. Figure 5 As shown in the figure, the convergence speed of the improved algorithm based on EMD and the traditional federated average algorithm is similar at the beginning, and then there is a more obvious difference within 20 rounds. The improved algorithm is stronger than the traditional federated average algorithm in terms of convergence rate and prediction accuracy, and convergence is achieved in about 40 rounds. Overall, even if the amount of training data is reduced, the test accuracy of EMD-CW is still better than that of the FedAvg algorithm, which is improved by 2-4%.
[0072] The federated learning model training method for large-scale industrial chain privacy computing provided by the present invention first divides the industrial chain business training data set by the federated learning center server node with non-independent and identically distributed non-iid as the goal, obtains multiple industrial chain business training sub-data sets, and distributes the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes. In order to ensure efficient and reliable federated learning, the federated learning worker node uses the industrial chain business training sub-data set distributed by the federated learning center server as input, and iteratively trains the local model based on the target profit function, thereby motivating more federated worker learning nodes to participate in the federated learning task with higher enthusiasm. Finally, in the federated aggregation model stage, the present invention provides a weighted federated average algorithm based on earth mover's distances (EMD), calculates the earth mover's distance EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and removes the federated learning worker nodes that exceed the preset EMD threshold, thereby reducing the weight dispersion of the aggregation model, thereby training a more accurate federated learning model, thereby optimizing the intelligent application of the industrial chain, and improving the service quality and operation efficiency of the industrial chain.
[0073] Based on the content of the above embodiment, in this embodiment, the federated learning center server node divides the industrial chain business training data set based on non-independent and identically distributed (non-iid) as the goal to obtain multiple industrial chain business training sub-data sets, including:
[0074] The industrial chain business training data set is sorted according to the digital labels, and the sorted industrial chain business training data set is divided into industrial chain business training sub-data sets containing a preset number of industrial chain business training data.
[0075] Based on the content of the above embodiment, in this embodiment, the target profit function for:
[0076]
[0077]
[0078] Among them, g n is the reward factor R of the federated learning worker node n and the integrated expression of the federated learning worker node type, including a series of reward packages for the federated learning center server for the computing resource provision rate and data provision rate of the federated learning worker node, q n The data volume contribution of the federated learning worker node, T max is the maximum tolerance time of the federated learning center server node for this federated learning task, is the parameter transmission time after the local model is updated, μ is the correlation coefficient, which is related to the number of iterations of the local model, and c n The number of CPU cycles required to train the local model, f n is the CPU cycle frequency, θ n is the federated learning worker node qualification, K is the federated learning worker node type, ρ is the unit reward cost of the federated learning center server node to the federated learning worker node, is the transmission energy consumption of the federated learning worker nodes in the iteration of the federated learning model, and τ represents the computing iteration energy consumption parameter of the central server and the federated learning workers.
[0079] Based on the content of the above embodiment, in this embodiment, according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, the ground motion distance EMD corresponding to each federated learning worker node is calculated, including:
[0080] The EMD between the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes is calculated according to the following formula:
[0081]
[0082] Where p(y=i) is the overall local model weight distribution of all federated learning worker nodes, p k (y=i) is the local model weight distribution of the kth federated learning worker node.
[0083] The following is described by specific embodiments:
[0084] Embodiment 1:
[0085] In this embodiment, the present invention provides a multi-party collaborative federated learning model for the industry chain with respect to the threat model, such as Figure 2 The purpose of the multi-party collaborative computing committee is to help task publishers train a federated learning model through federated learning. Federated learning workers will use the locally trained model Sent to the data requester. On the one hand, in order to achieve fair and efficient federated learning, the present invention provides an incentive mechanism based on the data sharing rate and computing resource sharing rate of workers to distribute rewards, so as to maximize the profit of model users. Under specific resource constraints, the performance of federated learning is optimized. On the other hand, in order to achieve reliable and robust federated learning, the data proxy node will eliminate the model with a large difference between the class distribution and the population distribution on a certain device according to the weight divergence during the aggregation step. The model consumer will Req = {w1,w2,...,wx} as a model The corresponding output result is obtained The iteration cycle continues until the model converges. Finally, the task publisher will use the trained global model to conduct decision analysis to improve the efficiency of the industrial chain.
[0086] Embodiment 2:
[0087] In this embodiment, the present invention also provides a federated learning communication model and a computing model, including: considering a group of devices with federated computing capabilities The computing power (i.e. CPU cycle frequency) is expressed as f n , the number of CPU cycles required to train the local model is c n ,q n represents the sample data size, so the computation time of one iteration of worker n is expressed as follows:
[0088]
[0089] in, is the effective capacitance parameter of worker n chipset. The transmission rate of federated learning parameters is expressed as Where B is the transmission bandwidth, ρ n is the transmission power of worker n, h n is the channel gain of the point-to-point link between the federated learning worker node and the federated learning central server node, and N0 is the possible noise. n The quality of the local model trained by the worker mainly depends on the contribution of local data and computing resources, i.e., ε n The larger the value of , the fewer local and global iterations can be achieved, and the lower the time cost of completing the federated learning task. In order to better analyze the problem, we use log(1 / ε n ) is used to represent the number of local model iterations when the global model converges. The logarithmic function is understood as follows: due to the existence of overfitting barriers, the accuracy of local learning cannot increase with the increase of the number of training data sets, and the accuracy tends to be flat in the later stage.
[0090] Assume that the shared model parameters are of the same size. Let the number of training model parameters obtained by the federated learning worker node in each iteration be q n =σ, which is a fixed value. Then the parameter transmission time after the local model is updated is The energy consumption of worker n in the global iteration is Then the total time required for one global iteration of federated learning is the communication time plus the model training time, that is:
[0091]
[0092] Accordingly, the energy consumption of one global iteration is:
[0093]
[0094] According to parameters such as training data size and computing power, a federated learning worker qualification evaluation function is designed, that is, the definition of n-type workers is defined.
[0095] Definition 1 (Worker Type): Federated learning nodes are divided into K types, and the qualification of each worker is set to θ k Let θ = {θ1, θ2, ..., θ k}. The Θ set is ordered and arranged in ascending order of the quality of the trained model: θ1<θ2<...<θ k ,. θ k The larger the value, the stronger the worker's ability and the higher the sharing enthusiasm. Then the worker evaluation of each node is
[0096]
[0097] Here, μ is the correlation coefficient, which is related to the number of local model iterations.
[0098] Embodiment three:
[0099] In this embodiment, in order to conduct reliable federated learning tasks and promote data sharing transactions, it is necessary for the task publisher to give corresponding rewards to the nodes that perform well in the training tasks, so that they can more actively contribute data and train models with good quality when future tasks come. In the model transaction of federated learning collaborative computing, two stakeholders need to be considered, namely the profit of the task publisher (also the model user) and the utility of the federated learning worker (model provider).
[0100] For the task publisher, it needs to design a personalized contract for each type of worker. Each time, the task publisher will pay the federated learning workers who make contributions to meet its own needs. The contract signed by the task publisher and worker n is represented as {R n (q n ),q n}, R n is the reward factor for the worker, which includes a series of reward packages for the worker's computing resource provision rate and data provision rate. It should be noted that since the task publisher does not know the data provision rate of the node, it is impossible to determine the worker type of the node, but the task publisher can use the probability p n Determine whether the node belongs to a certain worker type, and That’s because the task publisher can observe the distribution of worker types and the past work behavior of the node.
[0101] The profit function of the task publisher consists of two parts: satisfaction function and cost function. Generally speaking, the more computing resources a worker contributes, the faster the training model can be and the higher the satisfaction of the task publisher. Therefore, the present invention defines the profit obtained by the task publisher from a worker of type n as:
[0102]
[0103] Where δ is the set task publisher satisfaction parameter, and δ>0. max is the maximum tolerance time of the task publisher for this federated learning task. is the total time of a global stochastic gradient descent, including and Generally, It is expressed as the satisfaction function of the task publisher for the total time of a global iteration of the worker of this data type. When the total time of the global iteration is When ρR decreases, the satisfaction of task publishers will increase. For task publishers, more high-level workers joining federated learning will bring more profits, but at the same time it means generating greater reward costs ρR n , where ρ represents the unit reward cost of the task publisher for the k-type worker.
[0104] Obviously, the task publisher will not accept negative profits when performing federated learning tasks, that is, U tp (n) ≥ 0. The goal of the task publisher is to maximize its profit in the federated learning task. Assuming that there are K types of federated learning workers in the system, the target profit of the task publisher in the system is expressed as:
[0105]
[0106] The utility function of a federated learning worker mainly considers the income from training the model, the energy consumption of iteration, and the cost of the task publisher's evaluation of the model quality, expressed as U w Represents the utility function generated by the worker, recorded as:
[0107]
[0108] Among them, ω is a predefined weight parameter for energy consumption, R n is the worker's income, is the energy consumed by one iteration of the worker, including and represents the fee charged by the task publisher for the model quality evaluation provided by the worker. The purpose of the worker is to maximize its utility when performing the joint learning task. Therefore, the overall goal of contracting worker n is expressed as:
[0109]
[0110] The evaluation fee is proportional to the model quality, so the cost of quality evaluation is:
[0111]
[0112] where χ is the price per model evaluation, β is the sampling ratio, and A n is the number of times the worker model quality is evaluated. Combined with Definition 1, the overall goal of the federated learning worker is expressed as:
[0113]
[0114] Workers choose and sign the provided contracts according to their own abilities and needs, and complete the given federated learning tasks. If the worker fails to complete the specified federated learning tasks, the rewards of the corresponding accounts will be deducted.
[0115] In the process of model trading, the task publisher provides the federated learning task requirements and reward package prices, and is considered the leader of the transaction; then, the federated learning worker chooses the appropriate contract to sign based on the information provided by the task publisher and makes his own decision, which can be considered the follower of the transaction. The contract signed by the worker must meet two conditions: 1) individual rationality; 2) incentive compatibility.
[0116] Theorem 1 (Individual Rationality): Each worker will only participate in the joint learning task that makes its utility not less than zero, that is:
[0117]
[0118] Theorem 2 (Incentive compatibility): To maximize utility, each type of worker can only choose the contract tailored for itself, that is, θ n Type, will not choose other contracts {R m (q m ),q m},Right now:
[0119]
[0120]
[0121] Without loss of generality, in a similar wireless network environment, the present invention regards the transmission bandwidth, transmission power and channel gain as measurable and having approximate values, so there is Based on the above analysis, the federated learning incentive scheme provided can be expressed as a multi-objective programming problem. Combining Definition 1 and Theorems 1 and 2, the following optimization problem can be written:
[0122]
[0123] st
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130]
[0131] Where R max is the total amount of rewards given by the task publisher. This is a multi-objective optimization problem involving a leader and multiple followers. By iterating the IR and IC constraints, the resource reward package R n (q n ) is expressed as:
[0132]
[0133] where Δ k represents the energy consumption difference of two nodes with the same worker type, i.e. It is proved that when the data size is the same, the node computing resources and contract rewards are monotonic. Similarly, when the worker computing resources are uniformly distributed, it can be assumed that the data provision rate and reward are also monotonic. n Replace it, and the original problem can be rewritten as:
[0134]
[0135] st
[0136]
[0137]
[0138] in,
[0139]
[0140]
[0141] Objective function U tp The decision variable is q n , we can get Therefore, this problem is a concave optimization problem, which can be solved with the help of convex optimization tools (such as CVX). The solution space of this optimization problem is the data provision rate of the optimal node and its corresponding incentive factors
[0142] It can be seen that the present invention constructs a multi-party collaborative computing architecture that supports data privacy sharing. Model sharing is carried out between each industrial chain entity; in a single federated learning task, each data holder independently updates the local model locally and interacts with the server where the aggregator is located. In addition, a model free trading market is simulated, and more nodes are encouraged to contribute their data by designing an optimization contract. Rewards are distributed through data contribution rate and computing resource contribution rate. The greater the contribution of the node, the more rewards it gets, and ultimately the goal of improving the quality of federated learning tasks is achieved. In addition, the present invention also provides an aggregation weighted federated averaging algorithm based on non-iid data. Data distributions with excessive distribution differences are eliminated to reduce the precision loss caused by heterogeneous data and improve the application reliability of the FedAvg algorithm in the industrial chain.
[0143] The following is a description of the federated learning model training device for large-scale industrial chain privacy computing provided by the present invention. The federated learning model training device for large-scale industrial chain privacy computing described below and the federated learning model training method for large-scale industrial chain privacy computing described above can be referenced to each other.
[0144] like Figure 6 As shown, the present invention provides a federated learning model training device for large-scale industrial chain privacy computing, including:
[0145] The first processing module 1 is used to obtain an industrial chain business training data set, and the server node of the federated learning center divides the industrial chain business training data set according to the non-independent and identically distributed (non-iid) target to obtain multiple industrial chain business training sub-data sets, and distribute the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes;
[0146] The second processing module 2 is used for the federated learning worker node to take the industrial chain business training sub-dataset distributed by the federated learning center server as input, iteratively train the local model based on the target profit function, update the local model weight, and send the updated local model weight to the aggregation server node;
[0147] The third processing module 3 is used for the aggregation server node to calculate the EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes after aggregating the updated local model weight sent by each federated learning worker node, and to remove the federated learning worker nodes that exceed the preset EMD threshold;
[0148] The fourth processing module 4 is used to repeatedly execute the first processing module to the third processing module by the remaining federated learning worker nodes until the federated learning model converges or reaches a preset number of iterations.
[0149] The federated learning model training device for large-scale industrial chain privacy computing provided by the present invention first divides the industrial chain business training data set by the federated learning center server node with non-independent and identically distributed non-iid as the target, obtains multiple industrial chain business training sub-data sets, and distributes the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes. In order to ensure efficient and reliable federated learning, the federated learning worker node uses the industrial chain business training sub-data set distributed by the federated learning center server as input, and iteratively trains the local model based on the target profit function, thereby motivating more federated worker learning nodes to participate in the federated learning task with higher enthusiasm. Finally, in the federated aggregation model stage, the present invention provides a weighted federated average algorithm based on earth mover's distances (EMD), calculates the earth mover's distance EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and removes the federated learning worker nodes that exceed the preset EMD threshold, thereby reducing the weight dispersion of the aggregation model, thereby training a more accurate federated learning model, thereby optimizing the intelligent application of the industrial chain, and improving the service quality and operation efficiency of the industrial chain.
[0150] Based on the content of the above embodiment, in this embodiment, the first processing module is specifically used to:
[0151] The industrial chain business training data set is sorted according to the digital labels, and the sorted industrial chain business training data set is divided into industrial chain business training sub-data sets containing a preset number of industrial chain business training data.
[0152] Based on the content of the above embodiment, in this embodiment, the third processing module is specifically used for:
[0153] The EMD between the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes is calculated according to the following formula:
[0154]
[0155] Where p(y=i) is the overall local model weight distribution of all federated learning worker nodes, p k (y=i) is the local model weight distribution of the kth federated learning worker node.
[0156] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communications interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a federated learning model training method for large-scale industrial chain privacy computing, the method comprising: step 101, obtaining an industrial chain business training data set, and the federated learning center server node divides the industrial chain business training data set according to the non-independent and identically distributed (non-iid) target to obtain multiple industrial chain business training sub-data sets, and distributes the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes; step 102, the federated learning worker node uses the industrial chain business training sub-data set distributed by the federated learning center server as input, and iterates the training based on the target profit function. local model, updating the local model weight, and sending the updated local model weight to the aggregation server node; step 103, after aggregating the updated local model weight sent by each federated learning worker node, the aggregation server node calculates the ground motion distance EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and removes the federated learning worker nodes that exceed the preset EMD threshold; step 104, the remaining federated learning worker nodes repeat steps 101 to 103 until the federated learning model converges or reaches a preset number of iterations.
[0157] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0158] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the federated learning model training method for large-scale industrial chain privacy computing provided by the above methods. The method includes: step 101, obtaining an industrial chain business training data set, and the federated learning center server node divides the industrial chain business training data set with non-independent and identically distributed (non-iid) as the goal to obtain multiple industrial chain business training sub-data sets, and distributes the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes; step 102, the federated learning worker node uses the industrial chain business training sub-data set distributed by the federated learning center server as input, iteratively trains the local model based on the target profit function, updates the local model weight, and sends the updated local model weight to the aggregation server node; step 103, after aggregating the updated local model weight sent by each federated learning worker node, the aggregation server node calculates the geomagnetic distance EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and eliminates those exceeding the preset EMD A federated learning worker node with a threshold; step 104, the remaining federated learning worker nodes repeat steps 101 to 103 until the federated learning model converges or reaches a preset number of iterations.
[0159] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the federated learning model training method for large-scale industrial chain privacy computing provided by the above methods, the method comprising: step 101, obtaining an industrial chain business training data set, and having a federated learning center server node divide the industrial chain business training data set according to the non-independent and identically distributed (non-iid) target to obtain multiple industrial chain business training sub-data sets, and distributing the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes; step 102, the federated learning worker node distributes the industrial chain business training sub-data sets distributed by the federated learning center server The data set is used as input, the local model is iteratively trained based on the target profit function, the local model weight is updated, and the updated local model weight is sent to the aggregation server node; step 103, after aggregating the updated local model weight sent by each federated learning worker node, the aggregation server node calculates the ground motion distance EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and eliminates the federated learning worker nodes that exceed the preset EMD threshold; step 104, the remaining federated learning worker nodes repeat steps 101 to 103 until the federated learning model converges or reaches a preset number of iterations.
[0160] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0161] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A federated learning model training method for privacy computing in large-scale industrial chains, characterized in that: include: Step 101, obtaining an industrial chain business training data set, dividing the industrial chain business training data set by a federated learning center server node with a non-independent and identically distributed (non-iid) target, obtaining multiple industrial chain business training sub-data sets, and distributing the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes; Step 102, the federated learning worker node takes the industrial chain business training sub-dataset distributed by the federated learning center server as input, iteratively trains the local model based on the target profit function, updates the local model weight, and sends the updated local model weight to the aggregation server node; Step 103, after aggregating the updated local model weights sent by each federated learning worker node, the aggregation server node calculates the EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, and removes the federated learning worker nodes that exceed the preset EMD threshold; Step 104, the remaining federated learning worker nodes repeat steps 101 to 103 until the federated learning model converges or reaches a preset number of iterations.
2. The method for training a federated learning model for privacy computing in a large-scale industrial chain according to claim 1, characterized in that: The server node of the federated learning center divides the industrial chain business training data set based on non-independent and identically distributed (non-iid) as the goal to obtain multiple industrial chain business training sub-data sets, including: The industrial chain business training data set is sorted according to the digital labels, and the sorted industrial chain business training data set is divided into industrial chain business training sub-data sets containing a preset number of industrial chain business training data.
3. The method for training a federated learning model for privacy computing in a large-scale industrial chain according to claim 1, characterized in that: The objective profit function for: Among them, g n is the reward factor R of the federated learning worker node n and the integrated expression of the federated learning worker node type, including a series of reward packages for the federated learning center server for the computing resource provision rate and data provision rate of the federated learning worker node, q n The data volume contribution of the federated learning worker node, T max is the maximum tolerance time of the federated learning center server node for this federated learning task, is the parameter transmission time after the local model is updated, μ is the correlation coefficient, which is related to the number of iterations of the local model, and c n The number of CPU cycles required to train the local model, f n is the CPU cycle frequency, θ n is the federated learning worker node qualification, K is the federated learning worker node type, ρ is the unit reward cost of the federated learning center server node to the federated learning worker node, is the transmission energy consumption of the federated learning worker nodes in the iteration of the federated learning model, and τ represents the computing iteration energy consumption parameter of the central server and the federated learning workers.
4. The method for training a federated learning model for privacy computing in a large-scale industrial chain according to claim 1, characterized in that: According to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes, the ground motion distance EMD corresponding to each federated learning worker node is calculated, including: The EMD between the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes is calculated according to the following formula: Where p(y=i) is the overall local model weight distribution of all federated learning worker nodes, p k (y=i) is the local model weight distribution of the kth federated learning worker node.
5. A federated learning model training device for privacy computing in large-scale industrial chains, characterized in that: include: The first processing module is used to obtain an industrial chain business training data set, and the server node of the federated learning center divides the industrial chain business training data set according to the non-independent and identically distributed (non-iid) target to obtain multiple industrial chain business training sub-data sets, and distribute the multiple industrial chain business training sub-data sets to multiple federated learning worker nodes; The second processing module is used for the federated learning worker node to take the industrial chain business training sub-dataset distributed by the federated learning center server as input, iteratively train the local model based on the target profit function, update the local model weight, and send the updated local model weight to the aggregation server node; A third processing module is used for the aggregation server node to calculate the EMD corresponding to each federated learning worker node according to the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes after aggregating the updated local model weight sent by each federated learning worker node, and to remove the federated learning worker nodes that exceed the preset EMD threshold; The fourth processing module is used to repeatedly execute the first processing module to the third processing module by the remaining federated learning worker nodes until the federated learning model converges or reaches a preset number of iterations.
6. The federated learning model training device for large-scale industrial chain privacy computing according to claim 5 is characterized in that: The first processing module is specifically used for: The industrial chain business training data set is sorted according to the digital labels, and the sorted industrial chain business training data set is divided into industrial chain business training sub-data sets containing a preset number of industrial chain business training data.
7. The federated learning model training device for large-scale industrial chain privacy computing according to claim 5 is characterized in that: The third processing module is specifically used for: The EMD between the local model weight distribution of each federated learning worker node and the overall local model weight distribution of all federated learning worker nodes is calculated according to the following formula: Where p(y=i) is the overall local model weight distribution of all federated learning worker nodes, p k (y=i) is the local model weight distribution of the kth federated learning worker node.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the steps of the federated learning model training method for large-scale industrial chain privacy computing as described in any one of claims 1 to 4.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of the federated learning model training method for large-scale industrial chain privacy computing as described in any one of claims 1 to 4 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by the processor, the steps of the federated learning model training method for large-scale industrial chain privacy computing as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Target detection method and device based on federated learning, equipment and storage medium
CN112257774A
Electrocardiogram analysis method and device based on federated learning and related equipment
CN112617855A
Federal learning method based on EMD distance fusion multi-source heterogeneous data
CN113139603A
Target detection method and apparatus based on federated learning, and device and storage medium
WO2021189906A1
Federated learning data processing method and apparatus, and device and storage medium
WO2021204040A1
