A model fusion method and system for horizontal federated learning
By screening and merging local models in horizontal federated learning, model parameter transmission is reduced, communication overhead is reduced, and data security is ensured through encrypted transmission, solving the problem of high communication overhead in horizontal federated learning and improving model fusion performance.
Patent Information
- Application Number
- CN202210498743.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-09
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-05-09
AI Technical Summary
In existing horizontal federated learning technology, model parameters need to be frequently transferred between end-user devices and cloud servers, resulting in high communication overhead.
By initializing the global service model on the global cloud server node, and using the local model training loss to select the best local model, the average fusion or adaptive fusion algorithm is used to calculate the global model parameters, reducing the number of transmissions of model parameters, and throughout the system. Transfer encrypted data.
It effectively reduces communication overhead, improves the performance of model fusion, and ensures the security of data and models through encrypted transmission.
Smart Images

Figure CN115034356B
Abstract
Description
Technical Field
[0001] The present invention relates to a model fusion method and system based on horizontal federated learning, which are used to solve the model degradation problem caused by the fusion of cloud service node and terminal user node models into a global model in federated learning technology, and belongs to the field of horizontal federated learning. Background Art
[0002] As an important theory in the field of artificial intelligence, machine learning is widely used in various fields such as data mining, speech recognition and computer vision. The machine learning network model needs to be trained to obtain the final model before it can be put into use.
[0003] The computing power of end-user devices is limited, and existing machine learning network models are trained in the cloud using cloud services. The images, audio or text data contained in the end-user devices need to be uploaded to the cloud service center to train the model. However, on the one hand, this method requires a higher communication bandwidth to upload data and a higher storage space to manage data. On the other hand, there is a risk of leakage of end-user data during the upload process, and the uploaded real data is also prone to leaking its privacy. In the long run, this hinders the implementation and application of machine learning technology.
[0004] In order to protect the privacy data of end-user devices and enhance the learning ability of the model, federated learning came into being. In the federated learning framework, the terminal device does not need to upload local data to the cloud server, but only needs to share the locally trained model. The cloud server collects the models of the end-user devices and fuses them to obtain a global model. After multiple iterative calculations, the final complete model is obtained. However, in the existing horizontal federated learning technology, model parameters need to be frequently transmitted between the end-user device and the cloud server, resulting in high communication overhead. Summary of the invention
[0005] The technical problem to be solved by the present invention is that in the existing horizontal federated learning technology, model parameters need to be frequently transmitted between the end-user device and the cloud server, resulting in high communication overhead.
[0006] In order to solve the above technical problems, a technical solution of the present invention is to provide a model fusion method for horizontal federated learning, which is characterized by comprising the following steps:
[0007] Step S1: Initializing the global cloud server node, including initializing the global model parameter ω1 after building the global service model, thereby obtaining the global service model W1 for the first round of iteration, and initializing the iteration round t=1;
[0008] Step S2: The global cloud server node takes the global service model W of the tth iteration tSent to the device node set U = {u1,u2,…,u i ,…,u m Each end-user device node in} uses local data to perform local model training on the model, thereby obtaining the local model set of the tth iteration And calculate the model training loss of each local model in the local model set at the tth iteration, where u i represents the i-th terminal user device node, i=1,2,…,m, It means that the i-th local model of the t-th iteration is obtained by training the i-th terminal user device node;
[0009] Step S3: The arbitration scheduling module in the global cloud server node collects the model training losses uploaded by each terminal user device node, and then obtains the model training loss set L of the tth iteration t , The arbitration scheduling module is based on the model training loss set L t Select the best K local models from the local model set M, and redefine each terminal user device node corresponding to the K local models as a policy node. Then all policy nodes constitute the policy node set of the tth iteration Indicates the kth policy node of the tth iteration; the global cloud server node authorizes each policy node to upload the local local model;
[0010] Step S4: The global cloud server node is based on the fusion strategy S e Based on the model parameters of the local model uploaded by each strategy node at the tth iteration, the average fusion algorithm or the adaptive fusion algorithm is used to calculate the global model parameters ω at the tth iteration t ;
[0011] Step S5: The global cloud server node uses the arbitration incentive algorithm to determine the fusion strategy S required by the global cloud server node in the t+1th iteration for the selected K local models. e ;
[0012] Step S6: The global cloud server node calculates the global model parameter ω at the tth iteration according to step S45 t Update the global service model, t←t+1, return to step S2, and the global service model training enters the next round of iteration until the global service model converges and the model training ends.
[0013] Preferably, in step S3, the global cloud server node calculates the number of models K to be screened according to K=β·m, where β is a preset screening factor, and then selects the model from the model training loss set Lt Select the local models corresponding to the K smallest model training losses.
[0014] Preferably, in step S4, the global cloud server node calculates the global model parameter ω at the tth iteration according to the adaptive fusion algorithm. t It includes the following sub-steps:
[0015] Step S4-1-1: Calculate the difference between the weight parameters of each layer of the global service model in the tth iteration and the weight parameters of each layer of the local model uploaded by each policy node, where the weight parameter ω of the lth layer of the global service model is l The weight parameters of the local model layer l uploaded by the k-th strategy node The difference is expressed as Then we have:
[0016]
[0017] Where JS(·) represents the Jensen-Shannon divergence, KL(·) represents the Kullback-Leible divergence, and || represents the relative entropy of the weights of the two models.
[0018] Step S4-1-2: Calculate the contribution of each policy node to the weight parameters of each layer of the global service model in the tth iteration, where the kth policy node contributes to the weight parameter ω of the lth layer of the global service model l The contribution of Then we have:
[0019]
[0020] Step S4-1-3: Calculate the weight parameters of each layer of the global service model in the tth iteration. Suppose the weight parameter of the lth layer of the global service model in the tth iteration is expressed as Then we have:
[0021]
[0022] In the formula, η represents the learning rate of model training, represents the gradient operator, and L(·) represents the loss of the global serving model.
[0023] Preferably, in step S4, the global cloud server node calculates the global model parameter ω at the tth iteration according to the average fusion algorithm. t , as shown below:
[0024]
[0025] Where n k is the data volume of the kth strategy node, n is the total data volume, It is the model parameters of the local model uploaded by the k-th strategy node in the t-th iteration.
[0026] Preferably, the step S5 comprises the following steps:
[0027] Step S5-1: The global cloud server node calculates the loss difference Δ between the t-1th iteration and the tth iteration, Δ←|L(ω t )-L(ω t-1 )|;
[0028] Step S5-2, calculate the fusion strategy S required for the global cloud server node according to the loss difference Δ e , then:
[0029]
[0030] Where ω is the loss threshold for selecting the average fusion algorithm or the adaptive fusion algorithm.
[0031] Preferably, in the steps S1 to S6, encrypted data is transmitted between the global cloud server node and each terminal user device node.
[0032] Another technical solution of the present invention is to provide a model fusion system based on horizontal federated learning, which is characterized by comprising:
[0033] Initialization module, used to initialize global cloud server nodes
[0034] Terminal device model training module: Each terminal user device node obtains the t-th iteration global service model W issued by the global cloud server node through the terminal device model training module. t , then each end-user device node uses the terminal device model training module to perform local model training on the model using local data, thereby obtaining the local model set of the tth iteration And the terminal device model training module calculates the model training loss of each local model in the local model set at the tth iteration, where u i represents the i-th terminal user device node, i=1,2,…,m, It means that the i-th local model of the t-th iteration is obtained by training the i-th terminal user device node;
[0035] The arbitration scheduling module further includes the following sub-modules:
[0036] The local model loss input submodule is used to collect the model training losses uploaded by each end-user device node, and then obtain the model training loss set L for the tth iteration. t ,
[0037] The compression strategy submodule is used to train the loss set L according to the model t Screen the best K local models;
[0038] The model selection submodule is used to authorize the end-user device nodes corresponding to the K local models to upload the local local models to the global cloud server node. The authorized end-user device nodes are defined as policy nodes.
[0039] The local model data volume input submodule is used to obtain the local data volume of each strategy node;
[0040] The global model update strategy module further includes the following sub-modules:
[0041] The arbitration threshold input submodule is used to obtain the loss threshold ∈ of the fusion algorithm;
[0042] Model update judgment submodule: The model update judgment submodule calculates the loss difference Δ between the t-th iteration and the t-1-th iteration, Δ←|L(ω t )-L(ω t-1 )|, and then calculate the fusion strategy S required for the global cloud server node based on the loss difference Δ e , then:
[0043]
[0044] When S e =1, enter the adaptive fusion update submodule; when S e =0, enter the average fusion update submodule;
[0045] Adaptive fusion update submodule: Calculate the difference between the weight parameters of each layer of the global service model in the tth iteration and the weight parameters of each layer of the local model uploaded by each policy node, calculate the contribution of each policy node to the weight parameters of each layer of the global service model in the tth iteration based on the difference, and then calculate the weight parameters of each layer of the global service model in the tth iteration based on the contribution;
[0046] Average fusion update submodule: Calculate the global model parameter ω at the tth iteration according to the average fusion algorithm t , as shown below:
[0047]
[0048] Where n k is the data volume of the kth strategy node, n is the total data volume, The model parameters of the local model uploaded by the k-th strategy node in the t-th iteration;
[0049] Termination determination submodule: used to determine whether the global service model has converged. If so, the model training ends; otherwise, the t+1th round of model training begins.
[0050] Preferably, the initialization module further comprises:
[0051] The global model construction submodule is used to construct the initial global service model, including designing the input unit, hidden unit, output unit, number of neural nodes of the input unit, hidden unit and output unit, and the connection path of each neural node;
[0052] A global model initialization submodule is used to initialize the global service model, including initializing the global model parameter ω1, so as to obtain a global service model W1 for the first round of iteration;
[0053] The global variable initialization submodule is used to initialize the global federal variable, which includes a device node set U={u1,u2,…,u i ,…,u m},u i represents the i-th terminal user device node, i = 1, 2, ..., m; the number of local training times ε; the screening factor β; and the number of iterations t.
[0054] Preferably, the terminal device model training module further includes:
[0055] Global model input submodule: Each end-user device node communicates with the global cloud server node through the global model input submodule, and obtains the global service model W of the tth iteration after the identity authentication of the global cloud server node. t ;
[0056] Local model training submodule: Each end-user device node uses the local model training submodule to train the model obtained using local data ε times to obtain the local model of the tth iteration. At the same time, the model training loss of the current local model at the tth iteration is calculated and uploaded to the global cloud service node;
[0057] The parallel training submodule is used to execute the global model input submodule and the local model training submodule in parallel to obtain the local model set of the tth iteration.
[0058] In the present invention, the cloud server first initializes the global model and sends the model to the user terminal device. Then, the user terminal device uses local data to train the local model and uploads the trained local model to the cloud server. Finally, the cloud server performs fusion update based on the uploaded local model according to the designed model fusion strategy, and calculates an accurate global model to replace the local model.
[0059] The present invention performs adaptive model fusion optimization according to the quality of the local model trained by the terminal user device node, and designs a global model update strategy by combining adaptive fusion and average fusion mechanisms. The cloud server uses a compression strategy to select the best terminal device model to update the global model, which solves the high communication overhead caused by the frequent transmission of model parameters between the user terminal device and the cloud server in the horizontal federated learning technology, and improves the performance of model fusion. In the method and system provided by the present invention, encrypted data is transmitted during the operation of the entire system, which can avoid data leakage, thereby ensuring the security of data and models. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A flow chart of the overall method provided for an embodiment of the present invention;
[0061] Figure 2 A schematic diagram of the overall principle provided for an embodiment of the present invention;
[0062] Figure 3 This is a schematic diagram of the module design of the model fusion system based on horizontal federated learning in an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The present invention is further described below in conjunction with specific examples. It should be understood that these examples are only to help those of ordinary skill in the art understand the principles and knowledge of the present invention, and are not intended to limit the scope of the present invention, and cannot be considered to limit the application scenarios of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art may make various changes or modifications to the present invention, but the deformation, changes and conversions made to the embodiments based on the principles and purposes of the present invention also fall within the scope defined by the claims attached to this application. And it is obvious that this specification is only exemplified by preferred embodiments, and there is no need to exhaust all embodiments.
[0064] The following takes the joint training of a long-term and short-term neural network model by 100 terminal user devices as an example to illustrate the specific implementation steps of the present invention.
[0065] Combination Figure 1 as well as Figure 2 The specific steps of the embodiment of the model fusion method based on horizontal federated learning of the present invention include:
[0066] Step S1: Initialization of global cloud server nodes, including building an initial model, initializing the global service model and required hyperparameters, and further including the following sub-steps:
[0067] Step S1-1: construct an initial global service model, including designing the number of neural nodes and connection paths of the input units, hidden units, and output units in the global service model.
[0068] In this embodiment, the global service model is a long-short term neural network model. When constructing the initial long-short term neural network model, the model input layer and the model output layer are designed to have 298 and 1 neuron nodes respectively, and the connection path of the 298 neuron nodes in the model input layer is designed.
[0069] Step S1 - 2 : Initializing the global service model established in step S1 - 1 , including initializing the global model parameter ω1 of the global service model, thereby obtaining a global service model W1 for the first round of iteration.
[0070] Step S1-3: Initialize global federation variables, which include: a device node set U consisting of m terminal user device nodes = {u1, u2, ..., u i ,…,u m},u i represents the i-th terminal user device node, i = 1, 2, ..., m; the number of local training times ε; the screening factor β; and the number of iterations t.
[0071] In this embodiment: m = 100, then U = {u1,u,...,u 100}; ε=10; β=0.8; t=1.
[0072] Step S2: End user device node model training. The global cloud server node sends the initialized global service model to the device node set U = {u1, u2, ..., u i ,…,u m Each end-user device node in} uses local data to perform local model training on the model, thereby obtaining the local model set of the tth iteration
[0073] The i-th local model of the t-th iteration is obtained by training the i-th end-user device node It includes the following sub-steps:
[0074] Step S2-1: End user device node u i Communicate with the global cloud server node and obtain the global service model W after the identity authentication of the global cloud server node t , W t It is the global service model of the tth iteration.
[0075] In this embodiment, assuming that the current iteration round t = 10, the terminal user device node u 50Get the global service model W from the global cloud server node 10 .
[0076] Step S2-2: End user device node u i Use local data to train the global service model W t , training ε times in total, and obtaining the local model after the tth round of iteration update At the same time, the end user device node u i Calculate the model training loss for the tth iteration And upload it to the global cloud server node.
[0077] In this embodiment, assuming that the current iteration round t = 10, the terminal user device node u 50 Use local data to train the global service model W 10 , 10 times in total, and the local model of the t=10th iteration is obtained
[0078] Step S3: Local model screening. The arbitration scheduling module collects the model training losses uploaded by the terminal user device nodes, selects the best K local models of the tth iteration using the compression strategy algorithm, and authorizes the corresponding terminal user device nodes to upload the local local models to the global cloud server node. Step S3 specifically includes the following sub-steps:
[0079] Step S3-1: The global cloud server node is designed with an arbitration scheduling module for managing the terminal user device nodes. The arbitration scheduling module obtains the model training loss uploaded by each terminal user device node. All model training losses constitute the model training loss set L of the tth iteration. t ,
[0080] In this embodiment, the model training loss set obtained by the arbitration scheduling module
[0081] Step S3-2: The global cloud server node calculates the number K of models that need to be screened according to the formula K=β·m.
[0082] In this embodiment, K=β·m=0.8×100=80.
[0083] Step S3-3: According to the formula Screen the K local network models with the best model quality in the tth iteration. Formula Represents the loss set L from model training t Select the local models corresponding to the K smallest model training losses.
[0084] In this embodiment, 80 local models with the best model quality are screened out.
[0085] Step S3-4: Redefine each terminal user device node corresponding to the local model selected in step 3-3 as a policy node, and the policy node set of the tth iteration composed of all policy nodes is recorded as Indicates the kth policy node in the tth iteration. The global cloud server node authorizes each policy node to upload the local local model.
[0086] In this embodiment, the selected policy node set is recorded as
[0087] Step S4: The global cloud server node collects the terminal user device model and the fusion strategy S selected in the previous round. e Perform global model integration to obtain the global model parameters ω at the tth iteration t The global model parameters include the weight parameters of each layer of the global service model, which specifically include the following sub-steps:
[0088] Step S4-1: If the fusion strategy S e = 0, the global cloud server node calculates the global model parameter ω at the tth iteration according to the average fusion algorithm t .
[0089] If the fusion strategy S e =1, the global cloud server node calculates the global model parameter ω at the tth iteration according to the adaptive fusion algorithm t .
[0090] Among them, the global cloud server node calculates the global model parameter ω at the tth iteration according to the adaptive fusion algorithm t It includes the following sub-steps:
[0091] Step S4-1-1: Calculate the difference between the weight parameters of each layer of the global service model in the tth iteration and the weight parameters of each layer of the local model uploaded by each policy node, where the weight parameter ω of the lth layer of the global service model is l The weight parameters of the local model layer l uploaded by the k-th strategy node The difference is expressed as Then we have:
[0092]
[0093] Where JS(·) represents the Jensen-Shannon divergence, KL(·) represents the Kullback-Leible divergence, and || represents the relative entropy of the weights of the two models.
[0094] Step S4-1-2: Calculate the contribution of each policy node to the weight parameters of each layer of the global service model in the tth iteration, where the kth policy node contributes to the weight parameter ω of the lth layer of the global service model l The contribution of Then we have:
[0095]
[0096] Step S4-1-3: Calculate the weight parameters of each layer of the global service model in the tth iteration. Suppose the weight parameter of the lth layer of the global service model in the tth iteration is expressed as Then we have:
[0097]
[0098] In the formula, η represents the model learning rate, represents the gradient operator, and L(·) represents the loss of the global serving model.
[0099] The global cloud server node calculates the global model parameter ω at the tth iteration according to the average fusion algorithm t , as shown below:
[0100]
[0101] Where n k is the data volume of the kth strategy node, n is the total data volume, It is the model parameters of the local model uploaded by the k-th strategy node in the t-th iteration.
[0102] Step S5: The global cloud server node uses the arbitration incentive algorithm to determine the fusion strategy S required by the global cloud server node in the t+1th iteration for the selected K local models. e , specifically including the following sub-steps:
[0103] Step S5-1: The global cloud server node calculates the global model parameter loss difference Δ between the previous round t-1 iteration and the current round t iteration, Δ←|L(ω t )-L(ω t-1 )|.
[0104] In this embodiment, assuming that the current iteration round t=10, the global cloud server node uses the training loss to calculate the loss difference Δ=0.2 between round 9 and round 10.
[0105] Step S5-2, calculate the fusion strategy S required for the global cloud server node according to the loss difference Δ e , then:
[0106]
[0107] Where ∈ is the loss threshold for selecting the average fusion algorithm or the adaptive fusion algorithm.
[0108] In this embodiment, if ∈=0.5, when Δ=0.2, the calculated fusion strategy S for the next round is e =0.
[0109] Step S6: The global cloud server node updates the global service model according to the global model parameter ω at the tth iteration obtained in step S4, t←t+1, returns to step S2, and the global service model training enters the next round of iteration until the global service model converges and the model training ends.
[0110] In the above steps S1 to S6, encrypted data is transmitted between the global cloud server node and each terminal user device node.
[0111] The above method provided in the embodiment of the present invention can use computer theory technology to realize automatic execution process, which is common knowledge of those skilled in the art and will not be described in detail here.
[0112] It should be noted that the description terms "example", "embodiment" or "sample" in this specification are intended to illustrate the structure, function or feature of the embodiment of the present invention. The above terms are exemplary and do not have the limitation of the embodiment of the present invention. Moreover, the described structure, function or feature can be combined in a plurality of examples in a practical manner.
Claims
1. A model fusion method for horizontal federated learning, characterized in that: The following steps are involved: Step S1: Initializing the global cloud server node, including initializing the global model parameter ω1 after building the global service model, thereby obtaining the global service model W1 for the first round of iteration, and initializing the iteration round t=1; Step S2: The global cloud server node takes the global service model W of the tth iteration t Sent to the device node set U = {u1, u2, ..., u i , ..., u m Each end-user device node in} uses local data to perform local model training on the model, thereby obtaining the local model set of the tth iteration And calculate the model training loss of each local model in the local model set at the tth iteration, where u i represents the i-th terminal user device node, i = 1, 2, ..., m, It means that the i-th local model of the t-th iteration is obtained by training the i-th terminal user device node; Step S3: The arbitration scheduling module in the global cloud server node collects the model training losses uploaded by each terminal user device node, and then obtains the model training loss set L of the tth iteration t , The arbitration scheduling module is based on the model training loss set L t Select the best K local models from the local model set M, and redefine each terminal user device node corresponding to the K local models as a policy node. Then all policy nodes constitute the policy node set of the tth iteration Represents the kth policy node of the tth iteration; the global cloud server node authorizes each policy node to upload the local local model; Step S4: The global cloud server node is based on the fusion strategy S e Based on the model parameters of the local model uploaded by each strategy node at the tth iteration, the average fusion algorithm or the adaptive fusion algorithm is used to calculate the global model parameters ω at the tth iteration t ; Step S5: The global cloud server node uses the arbitration incentive algorithm to determine the fusion strategy S required by the global cloud server node in the tth iteration for the selected K local models. e ; Step S6: The global cloud server node calculates the global model parameter ω at the tth iteration according to step S4. t Update the global service model, t←t+1, return to step S2, and the global service model training enters the next round of iteration until the global service model converges and the model training ends.
2. A model fusion method for horizontal federated learning according to claim 1, characterized in that: In step S3, the global cloud server node calculates the number of models K to be screened according to K = β m, where β is a preset screening factor, and then selects the model from the model training loss set L t Select the local models corresponding to the K smallest model training losses.
3. A model fusion method for horizontal federated learning according to claim 1, characterized in that: In step S4, the global cloud server node calculates the global model parameter ω at the tth iteration according to the adaptive fusion algorithm. t It includes the following sub-steps: Step S4-1-1: Calculate the difference between the weight parameters of each layer of the global service model in the tth iteration and the weight parameters of each layer of the local model uploaded by each policy node, where the weight parameter ω of the lth layer of the global service model is l The weight parameters of the local model layer l uploaded by the k-th strategy node The difference is expressed as Then we have: Where JS(·) represents the Jensen-Shannon divergence, KL(·) represents the Kullback-Leible divergence, and || represents the relative entropy of the weights of the two models; Step S4-1-2: Calculate the contribution of each policy node to the weight parameters of each layer of the global service model in the tth iteration, where the kth policy node contributes to the weight parameter ω of the lth layer of the global service model l The contribution of Then we have: Step S4-1-3: Calculate the weight parameters of each layer of the global service model in the tth iteration. Suppose the weight parameter of the lth layer of the global service model in the tth iteration is expressed as Then we have: In the formula, η represents the model learning rate, represents the gradient operator, and L(·) represents the loss of the global serving model.
4. A model fusion method for horizontal federated learning according to claim 1, characterized in that: The step S5 comprises the following steps: Step S5-1: The global cloud server node calculates the loss difference Δ between the t-th iteration and the t-1-th iteration, Δ←|L(ω t )-L(ω t-1 )|; Step S5-2, calculate the fusion strategy S required for the global cloud server node according to the loss difference Δ e , then: Where ∈ is the loss threshold for selecting the average fusion algorithm or the adaptive fusion algorithm.
5. A model fusion method for horizontal federated learning according to claim 1, characterized in that: In step S4, the global cloud server node calculates the global model parameter ω at the tth iteration according to the average fusion algorithm. t , as shown below: Where n k is the data volume of the kth strategy node, n is the total data volume, It is the model parameters of the local model uploaded by the k-th strategy node in the t-th iteration.
6. A model fusion method for horizontal federated learning according to claim 1, characterized in that: In the steps S1 to S6, encrypted data is transmitted between the global cloud server node and each terminal user device node.
7. A model fusion system based on horizontal federated learning, characterized in that: include: Initialization module, used to initialize the global cloud server nodes Terminal device model training module: Each terminal user device node obtains the t-th iteration global service model W issued by the global cloud server node through the terminal device model training module. t , then each end-user device node uses the terminal device model training module to perform local model training on the model using local data, thereby obtaining the local model set of the tth iteration And the terminal device model training module calculates the model training loss of each local model in the local model set at the tth iteration, where u i represents the i-th terminal user device node, i = 1, 2, ..., m, It means that the i-th local model of the t-th iteration is obtained by training the i-th terminal user device node; The arbitration scheduling module further includes the following sub-modules: The local model loss input submodule is used to collect the model training losses uploaded by each end-user device node, and then obtain the model training loss set L for the tth iteration. t , The compression strategy submodule is used to train the loss set L according to the model t Screen the best K local models; The model selection submodule is used to authorize the end-user device nodes corresponding to the K local models to upload the local local models to the global cloud server node. The authorized end-user device nodes are defined as policy nodes. The local model data volume input submodule is used to obtain the local data volume of each strategy node; The global model update strategy module further includes the following sub-modules: The arbitration threshold input submodule is used to obtain the loss threshold ∈ of the fusion algorithm; Model update judgment submodule: The model update judgment submodule calculates the loss difference Δ between the t-th iteration and the t-1-th iteration, Δ←|L(ω t )-L(ω t-1 )|, and then calculate the fusion strategy S required for the global cloud server node based on the loss difference Δ e , then: When S e =1, enter the adaptive fusion update submodule; when S e =0, enter the average fusion update submodule; Adaptive fusion update submodule: Calculate the difference between the weight parameters of each layer of the global service model in the tth iteration and the weight parameters of each layer of the local model uploaded by each policy node, calculate the contribution of each policy node to the weight parameters of each layer of the global service model in the tth iteration based on the difference, and then calculate the weight parameters of each layer of the global service model in the tth iteration based on the contribution; Average fusion update submodule: Calculate the global model parameter ω at the tth iteration according to the average fusion algorithm t , as shown below: Where n k is the data volume of the kth strategy node, n is the total data volume, The model parameters of the local model uploaded by the k-th strategy node in the t-th iteration; Termination determination submodule: used to determine whether the global service model has converged. If so, the model training ends; otherwise, the t+1th round of model training begins.
8. A model fusion system based on horizontal federated learning as claimed in claim 7, characterized in that: The initialization module further comprises: The global model construction submodule is used to construct the initial global service model, including designing the input unit, hidden unit, output unit, number of neural nodes of the input unit, hidden unit and output unit, and the connection path of each neural node; A global model initialization submodule is used to initialize the global service model, including initializing the global model parameter ω1, so as to obtain a global service model W1 for the first round of iteration; The global variable initialization submodule is used to initialize the global federated variable, which includes a device node set U={u1, u2, ..., u i , ..., u m },u i represents the i-th terminal user device node, i=1, 2, ..., m; the number of local training times ε; the screening factor β; and the number of iterations t.
9. A model fusion system based on horizontal federated learning as claimed in claim 8, characterized in that: The terminal device model training module further includes: Global model input submodule: Each end-user device node communicates with the global cloud server node through the global model input submodule, and obtains the global service model W of the tth iteration after the identity authentication of the global cloud server node. t ; Local model training submodule: Each end-user device node uses the local model training submodule to train the model obtained using local data ε times to obtain the local model of the tth iteration. At the same time, the model training loss of the current local model at the tth iteration is calculated and uploaded to the global cloud service node; The parallel training submodule is used to execute the global model input submodule and the local model training submodule in parallel to obtain the local model set of the tth iteration.
