A heterogeneous federated learning method and system for unlabeled data

By performing supervised learning on the server side to obtain a multi-branch global depth model and updating it locally on the client side, it solves the problems of low utilization efficiency and difficulty in integrating unlabeled data on clients with heterogeneous resources, and achieves efficient federated learning and model generalization. Improvement of chemical properties.

CN114707670BActive Publication Date: 2024-09-24NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210361038.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-07
Publication Date
2024-09-24
Estimated Expiration
2042-04-07

AI Technical Summary

Technical Problem

Existing federated learning methods have low utilization efficiency on clients with heterogeneous resources, and cannot effectively integrate unlabeled data features, resulting in poor model generalization.

Method used

Using the heterogeneous federated learning method, the server performs supervised learning to obtain a multi-branch global depth model, and splits it into branch sub-models and sends them to the client. The client performs local unlabeled data labeling and model updating, and the server aggregates the client model to adjust the global model.

Benefits of technology

It improves resource usage efficiency, effectively integrates unlabeled data features, reduces manual annotation costs, and improves the generalization and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114707670B
    Figure CN114707670B
Patent Text Reader

Abstract

The present invention provides a heterogeneous federated learning method and system for unlabeled data, wherein the method includes: a heterogeneous federated learning sub-method: inserting branches into a global deep model to form a multi-branch model; training the multi-branch model to obtain a trained multi-branch model; splitting the global deep model into multiple branch sub-models according to the number of branches; and allocating each branch sub-model to a client with heterogeneous resources as a teacher model. Unlabeled data learning sub-method: the client downloads the teacher model from the server; predicts and labels the unlabeled data according to the obtained teacher model; selects pseudo-label data for client training; the client uses local data for training to obtain a student model; the server receives the client student model and aggregates and fine-tunes it into a new global model. The technical solution of the present invention makes full use of the unlabeled data characteristics of the client, while ensuring the accuracy of the model, it reduces the resource overhead of computing, communication and storage in federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of heterogeneous federated learning methods, and in particular to a heterogeneous federated learning method and system for unlabeled data. Background Art

[0002] With the development of science and technology, not only the types and number of terminal devices are constantly increasing, but also the computing performance of terminal devices is constantly improving. In order to meet the needs of work, many terminal devices need to perform complex computing tasks. Taking the application scenario of unmanned driving as an example, unmanned vehicles need to be equipped with on-board terminals, which need to sense and judge the environment around the vehicle and plan the optimal route.

[0003] In a system, when a large number of such terminal devices participate in computing, a distributed computing scenario will be formed. The traditional distributed computing method is to upload the terminal user's data directly to the server to train the intelligent model. Although this method can enable each terminal device to obtain the corresponding intelligent model, it requires a lot of communication overhead. What's more serious is that most of these data contain user privacy, which directly poses a serious threat to user privacy security.

[0004] In order to solve the above problems, the federated learning method can be used to train the corresponding model locally on the terminal device to obtain the corresponding intelligent model. Since the federated method does not require a large amount of data transmission between the terminal device and the server, it can reduce communication overhead and effectively avoid data leakage, so it has become a popular distributed training framework.

[0005] In actual application scenarios, the terminal devices under the distributed framework are extremely complex. They are not only huge in number, but also diverse in types, including but not limited to mobile phones, smart wearable devices, tablets, cameras, unmanned vehicles, etc. Due to the different environments, tasks, and equipment faced by each client, there are direct differences in computing power, communication capabilities, and storage capabilities between clients. Even when performing the same type of tasks, factors such as the environment of each client are extremely heterogeneous. We call this phenomenon system heterogeneity. In the process of federated learning, the upper limit of the complexity of the model that each client can participate in learning is also different. Therefore, models of different complexities should be adapted for different client devices to maximize the use of client data for training. In the traditional federated learning framework, the global unified model is often distributed to each client, and finally the models with completely consistent structures of each client are aggregated to obtain the final model. However, this method ignores the problem of system heterogeneity, resulting in the failure of training for some clients with insufficient resources, and the final model fails to effectively integrate the data features of all clients.

[0006] In addition, the traditional federated learning framework is also based on the existence of a large amount of labeled data on the client side. However, in most cases, establishing a sufficiently large labeled database on the client side is itself a very challenging task, because data labeling not only takes a lot of time, but also requires a large number of professionals to engage in low-challenge, high-repetitive labor, which directly leads to a waste of human resources. For example, in the medical system, if each medical institution has to establish a labeled database, then a large number of doctors will need to spend time and energy on work that has nothing to do with curing diseases and saving lives. In the case of a large imbalance in the doctor-patient ratio, it is a serious waste of medical resources. In addition, in actual application scenarios, there is a large amount of unlabeled data on the client side, and a small amount of labeled data on the server side. If the model is trained only by the server side, it cannot fully integrate and utilize the unlabeled data on the client side, and the resulting model has poor generalization.

[0007] In summary, the federated learning methods in the prior art have the problems of low efficiency in client resource utilization and difficulty in integrating unlabeled data features. Summary of the invention

[0008] The purpose of the present invention is to provide a heterogeneous federated learning method and system for unlabeled data, at least to solve the problems of low client resource utilization efficiency and difficulty in integrating unlabeled data features existing in the above-mentioned federated learning methods in the prior art.

[0009] To achieve the above-mentioned object, on the one hand, the present invention provides a heterogeneous federated learning method for unlabeled data, including a heterogeneous federated learning sub-method applied to a server and an unlabeled data learning sub-method applied to a client;

[0010] The heterogeneous federated learning sub-method includes: obtaining a multi-branch global deep model; training the multi-branch global deep model with label data to obtain a trained multi-branch global deep model; splitting the trained multi-branch global deep model into multiple branch sub-models, and using each branch sub-model as a teacher model of a corresponding client and sending it to the corresponding client; receiving a client model of each client, and aggregating each client model to obtain a global multi-branch student model; in response to the accuracy of the global multi-branch student model being less than a set accuracy, adjusting the global multi-branch student model according to the label data; splitting the adjusted global multi-branch student model to obtain updated teacher models, and sending each updated teacher model to the corresponding client respectively;

[0011] The unlabeled data learning sub-method includes: obtaining a corresponding teacher model; using the teacher model to label the local unlabeled data of the client to obtain pseudo-labeled data; updating the corresponding teacher model according to the pseudo-labeled data to obtain a corresponding client model; and sending the corresponding client model to the server.

[0012] According to one embodiment of the present invention, the method of obtaining a multi-branch global depth model includes: obtaining a single-exit global depth model; inserting several early-exit branch sub-models into the single-exit global depth model to obtain a multi-branch global depth model.

[0013] According to another embodiment of the present invention, updating the corresponding teacher model according to the pseudo-label data includes: obtaining the accuracy of the corresponding teacher model; determining a set number of values ​​according to the accuracy of the corresponding teacher model and the number of the pseudo-label data; and selecting a set number of pseudo-label data to update the corresponding teacher model.

[0014] Furthermore, according to yet another embodiment of the present invention, in the process of selecting a set amount of pseudo-label data to update the corresponding teacher model according to the accuracy of the corresponding teacher model, the loss function adopted is a loss function that introduces a regularization term.

[0015] According to another embodiment of the present invention, aggregating the client models to obtain a global multi-branch student model includes: internally weighting the same type of client models to perform homogeneous aggregation, and performing heterogeneous aggregation between different types of client models.

[0016] On the other hand, the present invention also provides a heterogeneous federated learning system for unlabeled data, comprising a server and multiple clients; the server is used to execute the following heterogeneous federated learning sub-methods: obtaining a multi-branch global deep model; training the multi-branch global deep model with labeled data to obtain a trained multi-branch global deep model; splitting the trained multi-branch global deep model into multiple branch sub-models, and using each branch sub-model as a teacher model of a corresponding client and sending it to the corresponding client; receiving a client model of each client, and aggregating each client model to obtain a global multi-branch student model; in response to the accuracy of the global multi-branch student model being less than a set accuracy, adjusting the global multi-branch student model according to the labeled data; splitting the adjusted global multi-branch student model to obtain updated teacher models, and sending the updated teacher models to the corresponding clients respectively;

[0017] The client is used to execute the following sub-method of unlabeled data learning: obtain the corresponding teacher model; use the teacher model to mark the local unlabeled data of the client to obtain pseudo-label data; update the corresponding teacher model according to the pseudo-label data to obtain the corresponding client model; send the corresponding client model to the server.

[0018] According to one embodiment of the present invention, the method of obtaining a multi-branch global depth model includes: obtaining a single-exit global depth model; inserting several early-exit branch sub-models into the single-exit global depth model to obtain a multi-branch global depth model.

[0019] According to another embodiment of the present invention, updating the corresponding teacher model according to the pseudo-label data includes: obtaining the accuracy of the corresponding teacher model; determining a set number of values ​​according to the accuracy of the corresponding teacher model and the number of the pseudo-label data; and selecting a set number of pseudo-label data to update the corresponding teacher model.

[0020] Furthermore, according to yet another embodiment of the present invention, in the process of selecting a set amount of pseudo-label data to update the corresponding teacher model according to the accuracy of the corresponding teacher model, the loss function adopted is a loss function that introduces a regularization term.

[0021] According to another embodiment of the present invention, aggregating the client models to obtain a global multi-branch student model includes: internally weighting the same type of client models to perform homogeneous aggregation, and performing heterogeneous aggregation between different types of client models.

[0022] The technical solution provided by the present invention, when performing federated learning, the server executes a heterogeneous federated learning sub-method to perform supervised learning, trains a multi-branch global deep model, and then splits the trained multi-branch global deep model into multiple branch sub-models, and sends each branch sub-model as a teacher model to the corresponding client. The client can execute the sub-method of unlabeled learning, use local unlabeled data to update the corresponding teacher model to obtain the corresponding client model and send it to the server; the server can also aggregate each trained client model to obtain a global multi-branch student model, and update each teacher model according to the global multi-branch student model. The technical solution of the present invention can carry out personalized federated learning for clients with heterogeneous resources based on unlabeled data, while improving resource utilization efficiency, effectively integrating unlabeled data features into the global model. In addition, the technical solution of the present application does not require manual labeling of local unlabeled data on the client, so it can also reduce labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0024] Figure 1 is a flowchart of a heterogeneous federated learning sub-method applied on a server according to an embodiment of the present invention;

[0025] Figure 2 is a flowchart of a sub-method for unlabeled data learning applied on a client according to an embodiment of the present invention;

[0026] Figure 3 is a schematic diagram of secondary isomerization experimental results according to an embodiment of the present invention;

[0027] Figure 4 is a schematic diagram of multi-stage heterogeneous experimental results according to an embodiment of the present invention;

[0028] Figure 5 is a schematic diagram of comparative experimental results of different heterogeneous situations according to an embodiment of the present invention;

[0029] Figure 6 is a schematic diagram of comparing accuracy test and resource overhead according to an embodiment of the present invention;

[0030] Figure 7 It is a schematic diagram comparing the effects of adding a regularization term to a loss function according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Those skilled in the art should know that the embodiments described below are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0032] On the one hand, the present invention provides a heterogeneous federated learning system for unlabeled data, which has a server and multiple clients. The server and the clients are communicated with each other to exchange information. The heterogeneous federated learning system provided by the present invention adopts a heterogeneous federated learning method for unlabeled data for learning, so that each client obtains a corresponding client model.

[0033] The heterogeneous federated learning method for unlabeled data in the present invention includes a heterogeneous federated learning sub-method for the server and an unlabeled data learning sub-method for each client, that is, the learning method of the global deep model on the server is a supervised process, while the learning process of the client model on the client is an unsupervised process, so it is called semi-supervised learning. The technical solution of the present invention is described in detail below in conjunction with specific application scenarios.

[0034] The process of the heterogeneous federated learning sub-method applied on the server is as follows Figure 1 As shown, including:

[0035] In step S11, a multi-branch global deep model is obtained, and the multi-branch global deep model is trained using label data to obtain a trained multi-branch global deep model.

[0036] In this embodiment, the server stores a small amount of labeled historical data, which will be used to train the multi-branch global deep model. The multi-branch global deep model has n branch sub-models, where n is a positive integer greater than 1. Let the branch global deep model be ω(t), where the i-th branch sub-model is ω i (t), the value range of i is 1 to n, then the various branch sub-models are arranged in order from low to high complexity, and the branch sub-model sequence of the multi-branch global deep model can be obtained as follows:

[0037] {ω 1 (t),ω 2 (t),...,ω n (t)}

[0038] That is, in the multi-branch global depth model, its i+1th branch sub-model ω i+1 The complexity of (t) is greater than the i-th branch sub-model ω i (t), where t represents the number of iterations.

[0039] In step S12, the trained multi-branch global deep model is split according to the resource adaptation model of each client to obtain the teacher model of each client, and each teacher model is sent to the corresponding client. Due to the differences in the environment and assembly equipment, there are large differences in computing, communication, and storage resources among clients. The more complex the model, the more resources it requires. Therefore, each resource situation corresponds to a branch sub-model, and the branch sub-model corresponding to the local resources of one of the clients is the resource adaptation model of the client. Therefore, in this embodiment, after obtaining the trained multi-branch global deep model, the server splits it into multiple branch sub-models that match the resources of each client, respectively. Since each branch sub-model obtained by splitting has been trained with labeled data, it can be used as the teacher model of the corresponding client.

[0040] In addition, since there are multiple client resource situations corresponding to one branch sub-model, in this embodiment, it is assumed that the number of clients corresponding to the i-th branch sub-model of the global depth model is l i , where the branch sub-model of the j-th client can be expressed as The value range of j is 1 to l i .

[0041] In step S13, the client models of each client are received, and the client models of each client are aggregated to obtain a global multi-branch student model. In this embodiment, the client model received by the server refers to the model obtained after each teacher model is updated on the corresponding client through the local data on the corresponding client. Since each teacher model is obtained by splitting the multi-branch global deep model, each client model is also a branch sub-model. After the server receives the client models of each client, the client models are aggregated to obtain a global multi-branch student model.

[0042] In step S14, it is determined whether the accuracy of the global multi-branch student model is greater than the set accuracy. If it is greater, it means that the accuracy of the client models on each client has met the requirements and the heterogeneous federated learning is completed; if it is less than, it means that the accuracy of the client models on some clients cannot meet the requirements and it is necessary to continue training the client models of each client. Therefore, when the accuracy of the global multi-branch student model is less than the set accuracy, the global multi-branch student model is first adjusted according to the label data on the server to improve the accuracy of the global multi-branch student model, and then the adjusted global multi-branch model is obtained.

[0043] Since the reliability of the pseudo-label data on the client is poor, the accuracy of the client model trained on the client is low. In step S14, the present application adjusts the global multi-branch student model according to the label data on the server, which can improve the accuracy of each branch model in the global multi-branch student model. And in the above step S14, if the accuracy corresponding to each branch sub-model is higher, the accuracy of its inference result is higher, and the number of samples exiting its corresponding branch should be more. Therefore, this embodiment adopts the sample ratio exit method in the reasoning process, and stipulates the number of samples exiting at each exit. That is, after the server receives the client model of each client, each branch sub-model of the multi-branch student model obtained by aggregation is tested, and the ratio of the accuracy of the branch sub-model to the sum of the accuracy rates of all branch sub-models is used as the sample exit ratio of the corresponding exit of the branch sub-model:

[0044]

[0045] where p i is the sample exit ratio of the i-th branch sub-model, acc i The accuracy of the i-th branch model, acc r The accuracy of the r-th branch model.

[0046] In step S15, the adjusted global multi-branch student model is split to obtain an adjusted teacher model, and each teacher model is sent to the corresponding client. In this step S15, the method in the above step S12 can be used to split the trained multi-branch student model according to the resource adaptation model of each client to obtain the teacher model of each client. Since the global multi-branch student model has been adjusted in the above step S14 to improve the accuracy of the global multi-branch student model, the adjusted teacher model obtained in this step has a higher accuracy.

[0047] The above article has introduced the heterogeneous federated learning sub-methods used on the server in detail. Figure 2 The process shown in FIG. 1 illustrates the unlabeled data learning sub-method used on the client server. Figure 2 As shown, the unlabeled data learning sub-method includes:

[0048] Step S21, obtain the corresponding teacher model, and use the teacher model to mark the local unlabeled data of the corresponding client to obtain pseudo-labeled data. In this step S21, the obtained teacher model can be the teacher model corresponding to the above step S12, or it can be the adjusted teacher model corresponding to the above step S15. Since the teacher model has been trained on the server using labeled data, it has a strong data recognition ability. Therefore, each branch model can be used to identify the local unlabeled data on the client, and the local unlabeled data can be marked according to the recognition result to obtain pseudo-labeled data.

[0049] Step S22, use pseudo-label data to train the corresponding teacher model to obtain an updated teacher model, and use the updated teacher model as the corresponding client model. In this embodiment, the client is assumed to be the jth client corresponding to the i-th branch sub-model in the multi-branch global deep model, that is, the branch sub-model of the client is Then the process of updating the corresponding teacher model on the client can be expressed as:

[0050]

[0051] in is the loss function used in the update process, and η is the learning rate.

[0052] Step S23, sending the corresponding client model to the server. This step S23 corresponds to the above step S13, sending the trained client model to the server so that the server can obtain the client model of each client and aggregate each client model to obtain a global multi-branch student model.

[0053] In summary, due to the technical solution of the present invention, personalized federated learning can be carried out for clients with heterogeneous resources based on unlabeled data, which effectively integrates the unlabeled data features into the global model while improving resource utilization efficiency. In addition, the technical solution of the present application does not require manual labeling of local unlabeled data on the client side, so it can also reduce labor costs.

[0054] The technical solution of the present invention is introduced in detail above. The method for the server to obtain a multi-branch global depth model in the above step S11 is described in detail below in combination with a specific application scenario. It can be understood that the implementation method shown below is exemplary and not restrictive, and the method for the multi-branch global depth model in the above text is also applicable to the description below.

[0055] In one embodiment, in the above step S11, the server can directly obtain the global depth model of multiple branches, for example, by copying the already established global depth model of multiple branches from the storage device, or by adopting the following method to obtain the global depth model of multiple branches: first obtain the global depth model of a single exit, and then insert several branch sub-models that exit early into the global depth model of the single exit to obtain the global depth model of multiple branches. Through the setting method of this embodiment, the corresponding branch sub-model can be inserted into the global depth model of the single exit according to the requirements, so as to obtain the required global depth model of multiple branches.

[0056] In one embodiment, when the corresponding teacher model is updated according to the pseudo-label data, a set number of values ​​is obtained according to the accuracy of the teacher model and the amount of pseudo-label data, and then the set number of pseudo-label data is selected to train and update the corresponding teacher model to obtain the corresponding client model. For example, if the accuracy of a branch model in the teacher model is acc, and the amount of pseudo-label data obtained on the client is D, then the set number obtained is D*acc, and then pseudo-label data of D*acc is selected.

[0057] In one embodiment, when the client updates the corresponding teacher model, in order to make the updated teacher model not only integrate the features of the local data but also avoid the overfitting phenomenon of the local training model, a regularization term can be introduced into the loss function of the local training to balance the relationship between the local model and the global model, that is:

[0058]

[0059] in When the client updates the corresponding teacher model, there is no loss function with regularization term. μ is the regularization term coefficient, which can be 0.3. Then the goal of global deep model optimization is:

[0060]

[0061] The following describes the method of aggregating the client models to obtain a global multi-branch student model in the above step S13 in combination with specific application scenarios. It can be understood that the method of aggregating the client models introduced below is exemplary rather than restrictive, and the description of the method of aggregating the client models above is also applicable to the description of the method of aggregating the client models below.

[0062] In one embodiment, the method of aggregating the client models to obtain the global multi-branch student model includes: weighting the client models of the same type to perform homogeneous aggregation, and performing heterogeneous aggregation between the client models of the same type. In this embodiment, each branch sub-model in the multi-branch global deep model includes the model parameters of the corresponding trunk network part and the model parameters of the branch network part. Let the branch sub-model ω i The model parameters of the backbone network part of (t) are θ i (t), model parameter λ of the branch network part i (t), and in the i-th branch sub-model, the backbone network θ between the k-th branch network part and the k-1-th branch network part i(k) (t). When weighting each client model internally for homogeneous aggregation, the following formula is used:

[0063]

[0064] in is the data volume of the jth client in the i-th client cluster, D i is the sum of the data volume of all clients under the i-th client cluster. The above heterogeneous aggregation between different client models includes trunk network aggregation and branch network aggregation. Since a branch network only exists in one branch sub-model, it is completed in the homogeneous aggregation stage, which is expressed as:

[0065]

[0066] The aggregation method of the backbone network during heterogeneous aggregation is expressed as:

[0067]

[0068] where θ *(i) (t+1) is the backbone network parameter between the main network of the i-th branch sub-model and the main network of the i-1-th branch sub-model. The backbone network parameters of the aggregated global multi-branch student model are:

[0069] θ(t+1)=θ *(1) (t+1)∪θ *(2) (t+1)∪......∪θ *(n) (t+1) (8)

[0070] The network parameters of the aggregated global multi-branch student model are the union of the parameters of the backbone network and the parameters of each branch, that is:

[0071] ω(t+1)=θ(t+1)∪λ 1 (t+1)∪λ 2 (t+1)∪......∪λn (t+1) (9)

[0072] The technical solution of the present invention is introduced in detail above. The convergence of the technical solution of the present invention is analyzed below to obtain the convergence of the technical solution of the present invention. Before the convergence analysis, this paper makes the following assumptions:

[0073] Assumption 1: During each round of federated iterations, the number of local trainings of each client remains consistent and unchanged, and the learning rate of each training remains unchanged.

[0074] Assumption 2: During one iteration of federated learning, all clients participate in the learning.

[0075] Assumption 3: In the multi-branch sub-model, compared with the main network, since the number of branch layers is very small, it is assumed that there is no need to connect branches at the end. The decomposed parts of the main network are sub-models that can independently complete the training and reasoning tasks. They are distributed to each client for training during the federated learning process. The split parts of the main network model are regarded as independent models, and the relationship between them is a sequential input and output relationship, that is, for the two adjacent parts, the output of the previous model is the input of the next model.

[0076] Assumption 4: When updating the corresponding teacher model and performance on each client, the loss function used is a convex function.

[0077] Assumption 5: On each client, the local loss function is M-smooth, then the following properties exist:

[0078] (i)

[0079] (ii)

[0080] Where x and y are random variables, and M is the smoothness coefficient.

[0081] Assumption 6: The stochastic gradient G(θ j The mean and variance of (t,e)) satisfy the following relationship:

[0082]

[0083]

[0084] Among them G j () is the stochastic gradient of client j; θ j(t, e) is the model parameter obtained by the client j in the e-th local update during the t-th round of federated iteration (described in the algorithm section of the given material); δ is used to represent the upper limit of the variance and is a constant; β is used to represent the upper limit of the second norm and is a constant.

[0085] Assumption 7: There is an upper limit on the binary norm of the gradient of each client model and the gradient of the global deep model:

[0086]

[0087] For the convergence analysis of the backbone network, mathematical induction can be used to analyze each part of the decomposed backbone network from front to back. The entire decomposed backbone network can be expressed as {θ *(1) (t),θ *(2) (t),…,θ *(n) (t)},θ *(k) (t) is the kth part of the decomposed backbone network. Then, according to the induction method, we only need to prove the following two points to prove the convergence of the global model:

[0088] (1)θ *(1) (t) converges, that is, when k = 1, θ *(k) (t) Convergence.

[0089] (2) When θ *(k) When (t) converges, θ *(k+1) (t) Convergence.

[0090] According to the above assumption 3, it can be considered that θ *(1) (t) is a branch sub-model that can independently complete training and reasoning tasks. *(1) (t) is located at the very beginning of the trunk model. During the training process, its input is the client data and is not affected by other branch sub-models. Therefore, θ *(1) (t) The proof of convergence is the traditional federated learning proof, taking FedAvg (weighted average aggregation method) as an example:

[0091]

[0092]

[0093] Where N is the number of clients.

[0094] Therefore, the key to proving the convergence of the function is to prove that the gap between the average loss value of each round of iteration and the global minimum loss value decreases with the increase of the number of iterations, that is, to prove the upper limit B in the following formula k It decreases with the increase of T.

[0095]

[0096] Where E[Z] is the function for finding the expectation of Z, is the optimal parameter, B k is the upper bound of formula 18, and the value of B decreases as T increases. is the loss function value of the average model obtained by the local client in the e-th training in the t-th federated learning. To prove the above formula, the following two conditions need to be met:

[0097] Condition 1 (central training condition): In the process of optimization iterations, the model parameters should be gradually optimized, that is, There is an upper bound, and the upper bound is related to the number of federation iterations t. Represents all historical information before the start of the tth federated learning.

[0098] Condition 2 (considering distributed scenarios): The range of variation of each teacher's model parameters should also be bounded, that is, the variance of the model parameters in each round of local learning iteration There is an upper bound. Represents all historical information before the start of the tth federated learning.

[0099] Condition 1 is the condition for centralized training, which means that each iteration process will make the model parameters closer to the optimal model parameters. Condition 2 is based on condition 1 and specifically targets the characteristics of distributed learning, limiting the range of variation of model parameters on each client. Through analysis, we find that when the learning rate hour:

[0100]

[0101]

[0102] Combining the above formula, we can get that when hour:

[0103]

[0104] in,

[0105] From the above formula, we can see that as the number of iterations T increases, the upper limit of the difference between the average loss value of local training and the optimal loss value continues to decrease, indicating that in the federated learning framework, the model θ *(1) (t) Convergence.

[0106] Furthermore, we continue to prove that when θ *(k) When (t) converges, θ *(k+1) (t) converges. According to the above assumption 3, we can get:

[0107] input(θ *(k+1) (t,0))=output(θ *(k) (t,E)) (21)

[0108] If t is large enough, given the input, because the model θ *(k) (t,E) converges, then output(θ *(k) (t,E)) will also converge to a specific value, so input(θ *(k+1) (t,0)) is also determined. At this time, if θ *(k+1) (t) convergence, should satisfy:

[0109]

[0110] Among them B k+1 The value of decreases as t increases. *(k) (t) converges, that is, θ *(k+1) (t) When the input is given, *(1) The analysis process of (t) is the same, and we can prove that θ *(k+1) (t) is convergent.

[0111] Therefore, through the above process, we can analyze:

[0112] (i)θ *(1) (t) converges, that is, when k = 1, θ *(k) (t) convergence;

[0113] (ii) When θ *(k) When (t) converges, θ *(k+1) (t) Convergence.

[0114] By mathematical induction, it can be obtained that every part of the backbone network converges and the entire backbone network converges.

[0115] In addition to the backbone network, since a single type of branch network only exists under one heterogeneous client cluster, it only participates in homogeneous aggregation in the federated learning process, which is consistent with the traditional federated learning process. The specific convergence analysis process is consistent with the model θ *(1) The method of convergence analysis of (t) is the same.

[0116] The convergence of the technical solution of the present invention is introduced in detail above. The following will analyze the technical effect of the technical solution of the present invention for image and text classification tasks based on MNIST, Cifar10 and MR datasets. The analysis includes feasibility analysis, resource overhead analysis and ablation experiment analysis.

[0117] 1. Feasibility analysis:

[0118] 1.1. Secondary isomerism:

[0119] First, the effect of the secondary federated heterogeneity is analyzed. A branch is inserted in the middle of the global deep model with a single exit to form an early exit exit. After the global deep model is split according to the exit, two branch sub-models with different computational complexity are formed. Both branch sub-models can independently complete the training and reasoning tasks. In the selection of the insertion position of the early exit branch, it is possible to try to insert branches at two different positions to form a secondary heterogeneous model. To a certain extent, the universality of the heterogeneous model formed by the scheme framework of the present invention for different insertion positions can be verified. The branch sub-models corresponding to MNIST (black and white images) and Cifar10 (color image dataset) are inserted at different positions corresponding to branch 1 and branch 2. The secondary heterogeneous model has the following two situations: one is a heterogeneous model composed of branch 1 and branch 3 (represented by "1+3"), and the other is a heterogeneous model composed of branch 2 and branch 3 (represented by "2+3"). The MR (film review text dataset) model is relatively small, and only one branch is inserted to form a secondary heterogeneous model.

[0120] The experimental results are as follows Figure 3 As shown, in Figure 3 In the figure, “1+3” and “2+3” represent two-level heterogeneous models, which are composed of the 1st and 3rd outlets, and the 2nd and 3rd outlets, respectively. “FedAvg_1”, “FedAvg_2”, and “FedAvg_3” represent single-outlet homogeneous models composed of the 1st, 2nd, and 3rd outlets and their previous backbone networks, respectively. Figure 3The results show that, whether it is MNIST, Cifar10 or MR data, whether the data heterogeneity of the client is independent and identically distributed (iid) or non-independent and identically distributed (non-iid), under the same semi-supervised learning method, after fine-tuning the labeled data on the server side, the model test accuracy obtained by the two-level heterogeneous federated learning is not lower than that of the homogeneous federated learning, but can be higher by about 1 percentage point in the MNIST dataset, nearly 10 percentage points in the Cifar10 dataset, and 1-5 percentage points in the MR dataset. This is because the heterogeneous federated learning proposed in this paper divides the global snake venom model into branch sub-models of different depths by splitting the network. In the local learning process of each branch sub-model, each branch sub-model searches for its own optimal solution without considering other parts of the network, which reduces the coupling between the parts of the branch sub-model and the constraints between the parameters in the update process of the branch sub-model, so that the optimization of the model parameters of the branch sub-model can be carried out in a larger search space. In the homogeneous learning method, since each client model is the same, all parameters of each client model are updated in the direction of maximizing the accuracy of the last export, which is a collaborative optimization process. Therefore, the constraints are greater and the search space is smaller, resulting in the final model performance being inferior to the heterogeneous learning method. This to a certain extent illustrates the feasibility and generalization of the technical solution of the present invention in performing various tasks on different data distributions. In addition, Figure 3 It can be seen from the (c) and (d) views that the final convergence of "1+3" is obviously better than that of "2+3". This is because the branch sub-model corresponding to exit 1 performs better than exit 2 in the Cifar10 dataset, and the convergence of "FedAvg_1" in the corresponding figure is better than that of "FedAvg_2". Therefore, different locations of branch insertion lead to different training results. Generally speaking, if the branch model is better under the homogeneous training method, the heterogeneous model composed of the branch is also better.

[0121] 1.2. Multi-level heterogeneity:

[0122] In order to further test the feasibility of Horse in more complex heterogeneous situations, we can Figure 4 The method of inserting branches at exit 1 and exit 2 increases the number of branches, forming a multi-level heterogeneous model (represented by "1+2+3"). Since the text model used in this article is relatively small, only LeNet (model of MNIST dataset) and ResNet (model of Cifar10 dataset) models are used to explore the multi-level heterogeneous situation.

[0123] Figure 4The results of the multi-level heterogeneous model on the two datasets MNIST and Cifar10, and two different data distributions: independent and identically distributed and non-independent and identically distributed. It can also be seen that when the heterogeneous situation is more complex and there are more types of branch sub-models, the client model trained by the technical solution of the present invention also has obvious advantages, which are about 1 and 10 percentage points higher on the MNIST and Cifar10 datasets, respectively. In addition, this experiment also shows the change of the accuracy of all client models after local training and before federated aggregation with the number of iterations in different heterogeneous situations, such as Figure 5 As shown in the figure, within a certain heterogeneity limit, the increase in the degree of heterogeneity has no significant impact on the performance of the model, that is, the final convergence value has no significant change. However, the higher the degree of heterogeneity, the more types of branch sub-models involved in training, the slower the convergence speed, and the greater the difference in the accuracy of client models.

[0124] 2. Resource expenditure study:

[0125] The initial motivation for introducing heterogeneous federated learning was to meet the heterogeneous needs of client storage, computing, communication and other resources. Different model sizes will bring different resource overhead pressures to the client. Since the distribution of data does not directly affect the resource overhead, this section assumes that the data distribution is independent and identically distributed. The storage, computing and communication resources consumed by the MNIST, Cifar10 and MR datasets under different calculation methods are calculated, and are measured in model space (model storage space size), FLOPS (floating point operations per second) and parameters (model parameter size). Finally, we get the following Figure 6 The Test Accuracy VS. Resource Overhead scatter plot is shown in the figure. Each point in the figure represents the corresponding resource overhead of all clients participating in a round of iteration under a specific training method. It is worth noting that in the scatter plot of computing resource overhead, since each client is assigned the same number of samples in the experiment, this experiment only calculates the computing resource overhead of a single sample of each client participating in the training.

[0126] It can be clearly seen from the figure that, whether it is MNIST, Cifar10 or MR data sets, the model accuracy obtained by the heterogeneous training method is not only higher than that of the homogeneous training method, but also significantly reduced in terms of storage, computing and communication resource overhead. This is because, in the technical solution of the present invention, more branch sub-models obtained by splitting are used for local training and communication, thereby reducing the resource overhead as a whole. In addition, in the MNIST and Cifar10 data sets, it can also be found that in the case of heterogeneity at the same level, the larger the composed sub-model, the more resources are consumed overall. For example, "2+3" consumes more resources than "1+3" overall. At different heterogeneous levels, the more heterogeneous levels, the more evenly the consumed resources are distributed. For example, the resource distribution consumed by "1+2+3" in the figure is the most even.

[0127] 3. Ablation experiment

[0128] In the technical solution of the invention, since the sub-model trained locally is a part of the global model, in order to prevent the sub-model from being too far away from the global model, we can try to add a regularization term to the loss function when training the client model to balance the difference between the local model and the global model. In order to explore whether it is necessary to add this regularization term, this paper will conduct ablation experiments on three datasets.

[0129] In this experiment, we take the "1+3" isomerization case as an example and obtain the following Figure 7 The experimental results are shown in Figure 1. Each picture corresponds to the training results of the client model with and without regularization terms under different distribution conditions for a data set. It can be seen that there is no obvious difference between the two in the MNIST and MR data sets. However, in the cifar10 data set, the performance of the client with regularization terms is significantly better than that without regularization terms, whether in independent and identically distributed or non-independent and identically distributed distribution conditions. Especially when the client data presents a non-independent and identically distributed distribution, the gap between the two is more obvious. This is because local data skew can easily lead to overfitting of the local training client model, resulting in poor results on the test data set.

[0130] On the other hand, the present invention also provides a heterogeneous federated learning method for unlabeled data, which includes the above-mentioned heterogeneous federated learning sub-method applied to the server and the unlabeled data learning sub-method applied to the client.

[0131] The terms "first" or "second" and the like used in this specification to refer to numbers or ordinals are used for descriptive purposes only and are not to be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this specification, "plurality" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0132] Although this specification has shown and described a plurality of embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will think of many changes, modifications and alternatives without departing from the thought and spirit of the present invention. It should be understood that in the process of practicing the present invention, various alternatives to the embodiments of the present invention described herein may be adopted. The attached claims are intended to define the scope of protection of the present invention, and therefore cover the modular composition, equivalent or alternatives within the scope of protection of these claims.

Claims

1. A heterogeneous federated learning method for unlabeled data, characterized in that: It includes a heterogeneous federated learning sub-method applied to the server and an unlabeled data learning sub-method applied to the client; The heterogeneous federated learning sub-method includes: Obtain a multi-branch global deep model; Using the label data to train the multi-branch global deep model to obtain a trained multi-branch global deep model; Splitting the trained multi-branch global deep model into multiple branch sub-models, and using each branch sub-model as a teacher model of a corresponding client and sending it to the corresponding client; Receiving client models from each client, and aggregating the client models to obtain a global multi-branch student model; In response to the accuracy of the global multi-branch student model being less than a set accuracy, adjusting the global multi-branch student model according to the label data; Split the adjusted global multi-branch student model to obtain updated teacher models, and send the updated teacher models to the corresponding clients respectively; The unlabeled data learning sub-method includes: Get the corresponding teacher model; The teacher model is used to label the local unlabeled data of the client to obtain pseudo-labeled data; updating the corresponding teacher model according to the pseudo-label data to obtain the corresponding client model; The corresponding client model is sent to the server.

2. The heterogeneous federated learning method for unlabeled data according to claim 1, characterized in that: The obtaining of a multi-branch global depth model comprises: Get the global depth model of a single export; Inserting several early-exit branch sub-models into the single-exit global deep model to obtain a multi-branch global deep model.

3. The heterogeneous federated learning method for unlabeled data according to claim 1, characterized in that: The updating of the corresponding teacher model according to the pseudo-label data includes: Get the accuracy of the corresponding teacher model; Determining a value of a set number according to the accuracy of the corresponding teacher model and the amount of the pseudo-label data; Select a set amount of pseudo-label data to update the corresponding teacher model.

4. The heterogeneous federated learning method for unlabeled data according to claim 3 is characterized in that: In the process of updating the corresponding teacher model by selecting a set amount of pseudo-label data according to the accuracy of the corresponding teacher model, the loss function used is the loss function that introduces the regularization term.

5. The heterogeneous federated learning method for unlabeled data according to claim 1, characterized in that: The aggregating of the client models to obtain the global multi-branch student model includes: internally weighting the same type of client models to perform homogeneous aggregation, and performing heterogeneous aggregation between different types of client models.

6. A heterogeneous federated learning system for unlabeled data, characterized in that: Includes a server and multiple clients; The server is used to execute the following heterogeneous federated learning sub-method: Obtain a multi-branch global deep model; Using the label data to train the multi-branch global deep model to obtain a trained multi-branch global deep model; Splitting the trained multi-branch global deep model into multiple branch sub-models, and using each branch sub-model as a teacher model of a corresponding client and sending it to the corresponding client; Receiving client models from each client, and aggregating the client models to obtain a global multi-branch student model; In response to the accuracy of the global multi-branch student model being less than a set accuracy, adjusting the global multi-branch student model according to the label data; Split the adjusted global multi-branch student model to obtain updated teacher models, and send the updated teacher models to the corresponding clients respectively; The client is used to execute the following sub-method of unlabeled data learning: Get the corresponding teacher model; The teacher model is used to label the local unlabeled data of the client to obtain pseudo-labeled data; updating the corresponding teacher model according to the pseudo-label data to obtain the corresponding client model; The corresponding client model is sent to the server.

7. The heterogeneous federated learning system for unlabeled data according to claim 6, characterized in that: The obtaining of a multi-branch global depth model comprises: Get the global depth model of a single export; Inserting several early-exit branch sub-models into the single-exit global deep model to obtain a multi-branch global deep model.

8. The heterogeneous federated learning system for unlabeled data according to claim 6, characterized in that: The updating of the corresponding teacher model according to the pseudo-label data includes: Get the accuracy of the corresponding teacher model; Determining a value of a set number according to the accuracy of the corresponding teacher model and the amount of the pseudo-label data; Select a set amount of pseudo-label data to update the corresponding teacher model.

9. The heterogeneous federated learning system for unlabeled data according to claim 8, characterized in that: In the process of updating the corresponding teacher model by selecting a set amount of pseudo-label data according to the accuracy of the corresponding teacher model, the loss function used is the loss function that introduces the regularization term.

10. The heterogeneous federated learning system for unlabeled data according to claim 6, characterized in that: The aggregating of the client models to obtain the global multi-branch student model includes: internally weighting the same type of client models to perform homogeneous aggregation, and performing heterogeneous aggregation between different types of client models.