CN111291897A - Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium - Google Patents

Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium Download PDF

Info

Publication number
CN111291897A
CN111291897A CN202010084917.XA CN202010084917A CN111291897A CN 111291897 A CN111291897 A CN 111291897A CN 202010084917 A CN202010084917 A CN 202010084917A CN 111291897 A CN111291897 A CN 111291897A
Authority
CN
China
Prior art keywords
model
parameters
trained
training
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010084917.XA
Other languages
Chinese (zh)
Inventor
魏锡光
李�权
鞠策
高大山
曹祥
刘洋
陈天健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010084917.XA priority Critical patent/CN111291897A/en
Publication of CN111291897A publication Critical patent/CN111291897A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a semi-supervised-based horizontal federal learning optimization method, equipment and a storage medium, wherein the method comprises the following steps: receiving global model parameters of the current non-label global model update sent by a server; performing self-supervision training on a local model to be trained according to the global model parameters and the training samples, and updating encoder parameters and decoder parameters in the model to be trained to obtain local model parameters; sending the local model parameters to a server, so that the server carries out supervised training on the model to be trained according to the local model parameters sent by each client, obtains global model parameters updated by the new unlabeled global model and sends the global model parameters to each client; and circulating until the preset condition is met, stopping training to obtain the target model. According to the invention, when the client has only a small amount of tag data or even no tag data, the client can also perform horizontal federal learning, so that the method is suitable for a real scene lacking tag data, and the labor cost is saved.

Description

Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium
Technical Field
The invention relates to the technical field of machine learning, in particular to a semi-supervised transverse federated learning optimization method, equipment and a storage medium.
Background
With the development of artificial intelligence, people provide a concept of 'federal learning' for solving the problem of data islanding, so that both federal parties can train a model to obtain model parameters without providing own data, and the problem of data privacy disclosure can be avoided. Horizontal federated learning, also called feature-aligned federated learning, is to extract a part of data with the same client data features but not identical users for joint machine learning, in case that the data features of the respective clients overlap more (i.e. the data features are aligned), and the users overlap less.
The existing horizontal federal learning usually assumes that a client has a large amount of labeled data, and can ensure that a training mode of horizontal federal learning is used for model training, but the actual situation is that the client has a small amount of labeled data or even no labeled data, and in fact, the client is difficult to request to label the data, so that the existing horizontal federal learning training mode is difficult to obtain a high-quality model.
Disclosure of Invention
The invention mainly aims to provide a semi-supervised-based horizontal federal learning optimization method, equipment and a storage medium, and aims to solve the problem that a model cannot be trained by horizontal federal learning under the condition that a small amount of label data exist in an existing client and even part of clients do not have label data.
In order to achieve the above object, the present invention provides a semi-supervised-based optimization method for horizontal federal learning, which is applied to a client participating in horizontal federal learning, wherein a local training sample of the client comprises an unlabelled sample, and the client is in communication connection with a server participating in horizontal federal learning, and the method comprises:
receiving global model parameters of the current non-label global model update sent by a server;
performing self-supervision training on a local model to be trained according to the global model parameters and the training samples, and updating encoder parameters and decoder parameters in the model to be trained to obtain local model parameters;
sending the local model parameters to a server side, so that the server side carries out supervised training on a model to be trained according to the local model parameters sent by each client side, obtains global model parameters updated by a new unlabeled global model and sends the global model parameters to each client side;
and circulating until the preset condition is met, stopping training to obtain the target model.
Optionally, the step of performing self-supervision training on the local model to be trained according to the global model parameter and the training sample, and updating the encoder parameter and the decoder parameter in the model to be trained to obtain the local model parameter includes:
after updating a local model to be trained by adopting the global model parameters, inputting the training sample into the model to be trained, and sequentially calling an encoder and a decoder in the model to be trained to process the training sample to obtain decoded data;
calculating an auto-supervised loss function from the training samples and the decoded data;
and updating the parameters of the encoder and the parameters of the decoder in the model to be trained according to the self-supervision loss function to obtain the parameters of the local model.
Optionally, the target model is used for identifying the heart disease type of the patient, and after the step of stopping training to obtain the target model when the preset condition is met, the method further includes:
and inputting the electrocardiogram data of the target patient into the target model, and sequentially calling an encoder and a predictor in the target model to process the electrocardiogram data to obtain the heart disease type identification result of the target patient.
In order to achieve the above object, the present invention further provides a semi-supervised optimization method for horizontal federal learning, which is applied to a server participating in horizontal federal learning, wherein the server is in communication connection with each client participating in horizontal federal learning, and a local training sample of each client includes an unlabelled sample, and the method includes:
issuing the first global model parameter updated by the current unlabeled global model to each client, so that each client performs self-supervision training on the respective local model to be trained according to the first global model parameter and the training sample, updating the encoder parameter and the decoder parameter in the respective local model to be trained, obtaining the first local model parameter and returning;
receiving the first local model parameters returned by each client, performing supervised training on the model to be trained according to the first local model parameters, obtaining first global model parameters updated by the new unlabeled global model, and issuing the first global model parameters to each client;
and circulating until the preset condition is met, stopping training to obtain the target model.
Optionally, when the training samples of some of the clients include a labeled sample, the step of performing supervised training on the model to be trained according to the first local model parameter to obtain a first global model parameter updated by the new unlabeled global model and sending the first global model parameter to each client includes:
fusing the first local model parameters, and taking the fused model parameters obtained by fusion as second global model parameters of the new labeled global model;
sending the second global model parameter to each client with a labeled sample, so that each client can perform supervised training on the local model to be trained by adopting the labeled sample, updating the encoder parameter and the predictor parameter in the local model to be trained, obtaining a second local model parameter and returning;
and receiving the second local model parameters returned by each client, fusing the second local model parameters, and sending a fused result to each client as a first global model parameter updated by the new unlabeled global model.
Optionally, when the server side has the labeled sample and the model to be trained with the same structure as the model to be trained local to each client side, the step of performing supervised training on the model to be trained according to the first local model parameter to obtain a first global model parameter updated by the new unlabeled global model and sending the first global model parameter to each client side includes:
fusing the first local model parameters to obtain fused model parameters;
and after updating the model to be trained of the server based on the fusion model parameters, performing supervised training on the model to be trained of the server by using the labeled sample, updating the encoder parameters and the predictor parameters in the model to be trained of the server, obtaining the first global model parameters updated by the new global model, and issuing the first global model parameters to each client.
Optionally, the step of performing supervised training on the model to be trained of the server by using the labeled sample, and updating the encoder parameter and the predictor parameter in the model to be trained of the server includes:
inputting the labeled sample into a model to be trained of the server, and sequentially calling a coder and a predictor in the model to be trained of the server to process the labeled sample to obtain a predicted label;
calculating a supervised loss function according to the predicted label and the real label corresponding to the labeled sample;
and updating the encoder parameters and the predictor parameters in the model to be trained of the server side according to the supervised loss function.
Optionally, the step of fusing each of the first local model parameters to obtain a fused model parameter includes:
and carrying out weighted average on each first local model parameter to obtain a fusion model parameter.
In order to achieve the above object, the present invention further provides a semi-supervised based lateral federal learning optimization device, including: a memory, a processor, and a semi-supervised based lateral federated learning optimization program stored on the memory and executable on the processor, the semi-supervised based lateral federated learning optimization program when executed by the processor implementing the steps of the semi-supervised based lateral federated learning optimization method as described above.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, on which a semi-supervised based lateral federated learning optimization program is stored, which when executed by a processor implements the steps of the semi-supervised based lateral federated learning optimization method as described above.
In the invention, a client receives a global model parameter issued by a server, performs self-supervision training on a local model to be trained based on global model parameter updating and a training sample, updates an encoder parameter and a decoder parameter of the model to be trained, and obtains the local model parameter, so that the client can participate in transverse federal learning when label data does not exist, and the function of a label-free sample is fully exerted; the client side sends the local model parameters to the server side, and the server side conducts supervised training on the model to be trained according to the local model parameters sent by the client sides to obtain global model parameters updated by the new unlabeled global model and sends the global model parameters to the client sides; the supervision training is inserted in the self-supervision training of the client, so that a guidance direction is provided for the self-supervision training of the client, and the deviation of the self-supervision training result of the client is avoided; the method has the advantages that the self-supervision training can utilize the characteristics of the labeled samples learned by the supervision training and the characteristics of a large number of unlabeled samples learned by the self-supervision training, so that the transverse federal learning can be carried out when only part of clients have a small number of labeled samples, the models meeting performance requirements are obtained by training, the practical scene lacking of label data is adapted, and the labor cost is saved.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a semi-supervised-based lateral federated learning optimization method of the present invention;
FIG. 3 is a schematic diagram of a training sample distribution according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a training sample distribution according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a training sample distribution according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an auto-supervised training process according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a supervised training process according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that, in the embodiment of the present invention, the horizontal federal learning optimization device based on semi-supervision may be a smart phone, a personal computer, a server, and the like, which is not limited herein.
As shown in fig. 1, the semi-supervised based lateral federal learning optimization device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the plant architecture shown in fig. 1 does not constitute a limitation of semi-supervised based lateral federal learning optimization plants, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, the memory 1005, which is a type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a semi-supervised based horizontal federal learning optimization program.
When the device shown in fig. 1 is a client participating in horizontal federal learning, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing communication connection with a server participating in horizontal federal learning; and the processor 1001 may be configured to invoke a semi-supervised based lateral federated learning optimization program stored in the memory 1005 and perform the following operations:
receiving global model parameters of the current non-label global model update sent by a server;
performing self-supervision training on a local model to be trained according to the global model parameters and the training samples, and updating encoder parameters and decoder parameters in the model to be trained to obtain local model parameters;
sending the local model parameters to a server side, so that the server side carries out supervised training on a model to be trained according to the local model parameters sent by each client side, obtains global model parameters updated by a new unlabeled global model and sends the global model parameters to each client side;
and circulating until the preset condition is met, stopping training to obtain the target model.
Further, the step of performing self-supervision training on the local model to be trained according to the global model parameter and the training sample, and updating the encoder parameter and the decoder parameter in the model to be trained to obtain the local model parameter includes:
after updating a local model to be trained by adopting the global model parameters, inputting the training sample into the model to be trained, and sequentially calling an encoder and a decoder in the model to be trained to process the training sample to obtain decoded data;
calculating an auto-supervised loss function from the training samples and the decoded data;
and updating the parameters of the encoder and the parameters of the decoder in the model to be trained according to the self-supervision loss function to obtain the parameters of the local model.
Further, the target model is used for identifying the heart disease type of the patient, and after the step of stopping training to obtain the target model when the preset condition is met, the method further comprises the following steps:
and inputting the electrocardiogram data of the target patient into the target model, and sequentially calling an encoder and a predictor in the target model to process the electrocardiogram data to obtain the heart disease type identification result of the target patient.
When the device shown in fig. 1 is a server participating in horizontal federal learning, the user interface 1003 is mainly used for data communication with a user terminal; the network interface 1004 is mainly used for establishing communication connection with a client participating in horizontal federal learning; and the processor 1001 may be configured to invoke a semi-supervised based lateral federated learning optimization program stored in the memory 1005 and perform the following operations:
issuing the first global model parameter updated by the current unlabeled global model to each client, so that each client performs self-supervision training on the respective local model to be trained according to the first global model parameter and the training sample, updating the encoder parameter and the decoder parameter in the respective local model to be trained, obtaining the first local model parameter and returning;
receiving the first local model parameters returned by each client, performing supervised training on the model to be trained according to the first local model parameters, obtaining first global model parameters updated by the new unlabeled global model, and issuing the first global model parameters to each client;
and circulating until the preset condition is met, stopping training to obtain the target model.
Further, when part of the training samples of the clients include a labeled sample, the step of performing supervised training on the model to be trained according to the first local model parameter to obtain a first global model parameter updated by the new unlabeled global model and sending the first global model parameter to each client includes:
fusing the first local model parameters, and taking the fused model parameters obtained by fusion as second global model parameters of the new labeled global model;
sending the second global model parameter to each client with a labeled sample, so that each client can perform supervised training on the local model to be trained by adopting the labeled sample, updating the encoder parameter and the predictor parameter in the local model to be trained, obtaining a second local model parameter and returning;
and receiving the second local model parameters returned by each client, fusing the second local model parameters, and sending a fused result to each client as a first global model parameter updated by the new unlabeled global model.
Further, when the server side has the labeled sample and the model to be trained with the structure same as that of the model to be trained local to each client side, the step of performing supervised training on the model to be trained according to the first local model parameter to obtain a first global model parameter updated by the new unlabeled global model and sending the first global model parameter to each client side comprises the following steps:
fusing the first local model parameters to obtain fused model parameters;
and after updating the model to be trained of the server based on the fusion model parameters, performing supervised training on the model to be trained of the server by using the labeled sample, updating the encoder parameters and the predictor parameters in the model to be trained of the server, obtaining the first global model parameters updated by the new global model, and issuing the first global model parameters to each client.
Further, the step of performing supervised training on the model to be trained of the server by using the labeled sample, and updating the encoder parameter and the predictor parameter in the model to be trained of the server includes:
inputting the labeled sample into a model to be trained of the server, and sequentially calling a coder and a predictor in the model to be trained of the server to process the labeled sample to obtain a predicted label;
calculating a supervised loss function according to the predicted label and the real label corresponding to the labeled sample;
and updating the encoder parameters and the predictor parameters in the model to be trained of the server side according to the supervised loss function.
Further, the step of fusing each of the first local model parameters to obtain a fused model parameter includes:
and carrying out weighted average on each first local model parameter to obtain a fusion model parameter.
Based on the structure, various embodiments of the semi-supervised-based horizontal federal learning optimization method are provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the semi-supervised-based lateral federated learning optimization method of the present invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than presented herein.
The first embodiment of the horizontal federal learning optimization method based on semi-supervision is applied to a client participating in horizontal federal learning, local training samples of the client comprise unlabeled samples, the client is in communication connection with a server participating in the horizontal federal learning, and the server and the client related to the embodiment of the invention can be equipment such as a smart phone, a personal computer and a server. In this embodiment, the semi-supervised-based horizontal federal learning optimization method includes:
step S10, receiving the global model parameter of the current non-label global model update sent by the server;
in this embodiment, the server and each client may establish a communication connection in advance through handshaking and identity authentication, and determine a model to be trained in the federal learning, such as a neural network model. The determined model to be trained can be issued to each client by the server, so that each client locally has the model to be trained with the same structure, and the server locally can also have the model to be trained with the same structure. As shown in fig. 3, 4 and 5, three possible sample cases in a real scene, respectively; in fig. 3, each client locally has a training sample for training the model to be trained, the training samples are all unlabeled samples, and the server has a small number of labeled samples; in fig. 4, the local training samples of each client include unlabeled samples, the training samples of some clients include a small number of labeled samples, and the server does not have a training sample; in fig. 5, the training samples local to each client include unlabeled samples, the training samples of some clients include a small number of labeled samples, and the server also includes a small number of labeled samples. It should be noted that the unlabeled sample and the labeled sample are collectively referred to as a training sample, one unlabeled sample includes one piece of data, and one labeled sample includes one piece of data and a label corresponding to the data. The number of the non-labeled samples can be far greater than that of the labeled samples, so that manpower and material resources for manually labeling are saved. Different training samples may be used depending on the specific training task. For example, if the training task is to perform face detection on an image by using a neural network model, the training samples are images, and the labeled samples further include a label indicating whether a face exists in the image. For another example, if the training task is to predict the purchasing intention of the user by using a decision tree model, the training samples are user data, and the labeled samples further include a purchasing intention label of the user.
Based on the training sample distribution scenarios shown in fig. 3, 4 and 5, a semi-supervised-based horizontal federal learning optimization method in the embodiment of the present invention is proposed.
Specifically, in the horizontal federal learning, the server and the client cooperate with each other to perform multiple global model updates on the model to be trained, and finally, the target model meeting the quality requirement is obtained. The model updating means updating model parameters of the model to be trained, if the model to be trained is a neural network model, the model parameters are connection weight values among neurons, and the final model parameters are determined through multiple times of global model updating, so that the target model is determined. It should be noted that, a process in which the server and the client perform model update on the model to be trained is called global model update, a case in which the client performs training using a labeled sample in the global model update is called labeled global model update, and a case in which the client performs training using a non-labeled sample in the global model update is called non-labeled global model update, so as to distinguish the two types of model updates.
In one non-label global model updating, the client receives global model parameters of the non-label global model updating sent by the server. It should be noted that, if the global model is updated for the first time, the server may initialize the model to be trained of the server using random model parameters, or may initialize the model to be trained of the server using model parameters set by a developer according to experience. And then, the server side can directly send the initialized model parameters of the model to be trained as the global model parameters of the current unlabeled global model update, and can also adopt different schemes to obtain the global model parameters of the current unlabeled global model update according to different distributions of labeled samples.
Specifically, when the distribution of the labeled samples is as shown in fig. 3, the server may perform supervised training on the initialized model to be trained by using the labeled samples, update the model parameters of the model to be trained after one or more iterations, and use the updated model parameters as the global model parameters of the current unlabeled global model update. When the distribution of the labeled samples is as shown in fig. 4, the server may perform one or more labeled global model updates in combination with the client having the labeled samples, and then use the updated model parameters as global model parameters of the current unlabeled global model update. When the distribution of the labeled samples is shown in fig. 5, the server may perform supervised training by using local labeled samples, perform one or more labeled global model updates by combining with the client having the labeled samples, and then use the updated model parameters as the global model parameters of the current unlabeled global model update.
When the federal learning starts, the server firstly carries out supervised training on the model to be trained, and carries out self-supervised training in an initial direction for each subsequent client, so that the training time is shortened, namely, the model to be trained obtained after the supervised training has learned some characteristics of the labeled sample, the prediction result in the self-supervised training process of the client is relatively accurate, the updating times of the unlabeled global model are further shortened, the training time is shortened, and meanwhile, the quality and the performance of the target model obtained by training are also improved.
Step S20, performing self-supervision training on a local model to be trained according to the global model parameters and the training samples, and updating the encoder parameters and the decoder parameters in the model to be trained to obtain local model parameters;
after the client side obtains the global model parameters, the client side carries out self-supervision training on the local model to be trained according to the global model parameters and the training samples, and updates the encoder parameters and the decoder parameters in the model to be trained to obtain the local model parameters. The model to be trained at least comprises an encoder, a decoder and a predictor, wherein the output of the encoder is respectively connected with the input of the decoder and the input of the predictor; the encoder is used for extracting the characteristics of the input data, which is equivalent to encoding the input data; the decoder is used for decoding the result coded by the coder and aims at restoring the input data; the predictor is used for outputting a prediction result of the model based on the characteristics extracted by the encoder; in the stage of training the model, the parameters of the coder, the parameters of the decoder and the parameters of the predictor need to be updated, and in the stage of using the model, the coder and the predictor are adopted to complete the prediction task.
If the training samples comprise the label samples, the client can remove labels from the label samples and convert the label samples into label-free samples, and all the training samples are taken as label-free samples to perform self-supervision training on the model to be trained.
The local model parameters are relative to the global model parameters, each client respectively adopts a local training sample to update the local model to be trained, the model parameters of each client are consistent when the local training is started, and the model parameters of the model to be trained of each client are different after the training is finished, namely, the local model parameters obtained by each client are different, and the difference is just caused by the fact that each client has the training samples of different users.
Further, step S20 includes:
step S201, after updating a local model to be trained by using the global model parameters, inputting the training sample into the model to be trained, and sequentially calling an encoder and a decoder in the model to be trained to process the training sample to obtain decoded data;
step S202, calculating an auto-supervision loss function according to the training sample and the decoding data;
and step S203, updating the encoder parameters and the decoder parameters in the model to be trained according to the self-supervision loss function to obtain local model parameters.
And the client updates the local model to be trained by adopting the global model parameters. The global model parameters may include encoder parameters, decoder parameters, and predictor parameters. As shown in fig. 6, after updating the model parameters of the local model to be trained, the client inputs the training samples into the model to be trained to obtain the prediction labels, and sequentially invokes the encoder and the decoder in the model to be trained to process the training samples to obtain the decoded data. Specifically, an encoder in the model to be trained extracts features in the training samples, and a decoder restores the features based on the features extracted by the encoder to obtain decoded data. The client calculates an auto-supervision loss function according to the decoded data and the training samples, calculates gradients corresponding to the encoder parameters and the decoder parameters respectively according to the auto-supervision loss function, and updates the encoder parameters and the decoder parameters respectively according to the gradients. After one or more rounds of updating, the client uses the finally updated model parameters of the model to be trained as local model parameters. The calculation method of the self-supervision loss function can adopt a conventional loss function calculation method, and is different from the supervised loss function in that the self-supervision loss function mainly represents errors of training samples and decoding data.
It should be noted that the local model parameters may include an encoder parameter, a predictor parameter, and a decoder parameter, where the predictor parameter is still a predictor parameter in the global model parameters sent by the server, that is, the predictor parameter is not updated in the process of updating the unlabeled global model. Under the ideal state, the decoded data restored by the decoder is close to or even the same as the input training samples, the self-supervision loss function represents the error between the decoded data and the training samples, and the self-supervision training aims to continuously adjust the parameters of the decoder and the parameters of the encoder, so that the value of the self-supervision loss function is continuously reduced, and the feature extraction accuracy of the encoder and the decoder is improved.
Step S30, the local model parameters are sent to a server side, so that the server side can perform supervised training on the model to be trained according to the local model parameters sent by each client side, obtain the global model parameters updated by the new unlabeled global model and send the global model parameters to each client side;
and the client sends the local model parameters to the server. And the server receives the local model parameters sent by each client, performs supervised training according to the local model parameters sent by each client, obtains the global model parameters updated by the new unlabeled global model, and sends the global model parameters to each client.
Specifically, the process of performing supervised training on the model to be trained by the server may be different according to different distributions of labeled samples.
When the distribution of the labeled samples is as shown in fig. 3, the server side may fuse the local model parameters to obtain fusion model parameters; the server side updates the model to be trained of the server side by adopting the fusion model parameters; after updating, the server side adopts the local labeled samples of the server side to perform supervised training on the model to be trained of the server side, updates the encoder parameters and the predictor parameters of the model to be trained of the server side through one or more rounds of training, and takes the updated model parameters of the model to be trained as the global model parameters of the new label-free global model.
When the distribution of the labeled samples is as shown in fig. 4, the server side may fuse the local model parameters to obtain fusion model parameters; the fusion model parameters are used as global model parameters of a new labeled global model update and are issued to each client with a labeled sample; after each client updates a local model to be trained by adopting the received global model parameters, supervised training is carried out on the model to be trained by adopting a local labeled sample, the encoder parameters and the prediction period parameters of the model to be trained are updated, the updated model parameters of the model to be trained are used as local model parameters, and the local model parameters are sent to the server; the server receives the local model parameters sent by each client with the label samples, performs fusion, and takes the fusion result as the global model parameter updated by the new non-label global model; and the server side issues the global model parameters of the new non-label global model update to each client side so as to enter the new non-label global model update.
When the distribution of the labeled samples is as shown in fig. 5, the server may first fuse the local model parameters to obtain fused model parameters; the server side updates the model to be trained of the server side by adopting the fusion model parameters; after updating, the server side adopts a local labeled sample of the server side to perform supervised training on the model to be trained of the server side, updates the encoder parameters and the predictor parameters of the model to be trained of the server side through one or more rounds of training, and sends the updated model parameters of the model to be trained to each client side as the global model parameters of the new labeled global model; after each client updates a local model to be trained by adopting the received global model parameters, supervised training is carried out on the model to be trained by adopting a local labeled sample, the encoder parameters and the prediction period parameters of the model to be trained are updated, the updated model parameters of the model to be trained are used as local model parameters, and the local model parameters are sent to the server; the server receives the local model parameters sent by each client with the label samples, performs fusion, and takes the fusion result as the global model parameter updated by the new non-label global model; and the server side issues the global model parameters of the new non-label global model update to each client side so as to enter the new non-label global model update.
After the client side adopts the local unlabelled sample to update the unlabelled model each time, the server side carries out supervised training on the model to be trained so as to adjust the result of updating the unlabelled model of each client side, so that the guidance of the labeled sample on model prediction or classification effect is inserted in the whole process of federal learning, the deviation of the result of training by adopting the unlabelled sample at the client side is avoided, the time of model training is shortened, the performance of a target model obtained by training is also improved, and the deviation of the model performance is avoided while the function of the unlabelled sample is exerted most importantly.
And step S40, circulating until the preset condition is met, stopping training to obtain the target model.
And circulating the steps until the client side detects that the preset conditions are met, and stopping training to obtain the target model. The preset condition may be preset according to needs, for example, when it is detected that a local model to be trained of the client converges, or when it is detected that the number of cycles reaches a preset number, or when it is detected that the training time reaches a preset time, or when a training stopping instruction sent by the server is received, etc. The server side can also send a global model parameter to the client side and a training stopping instruction when detecting that the model to be trained of the server side is converged, and the client side updates the local model to be trained by adopting the global model parameter after receiving the training stopping instruction and the global model parameter and then stops training. The client side takes the model to be trained with the finally determined model parameters as a target model, and then the target model can be used for completing a prediction or classification task.
It should be noted that, the server may perform multiple times of labeled global model updating by combining the clients having labeled samples, and then perform multiple times of unlabeled global model updating by combining each client, that is, after at least one time of labeled global model updating, at least one time of unlabeled global model updating is not necessary, and the operations are performed alternately until the training is stopped.
In the embodiment, the client receives the global model parameters issued by the server, performs self-supervision training on the local model to be trained based on global model parameter updating and training samples, updates the encoder parameters and the decoder parameters of the model to be trained, and obtains the local model parameters, so that the client can participate in transverse federal learning even when label data does not exist, the function of a label-free sample is fully exerted, and the utilization rate of the label-free sample is improved; the client side sends the local model parameters to the server side, and the server side conducts supervised training on the model to be trained according to the local model parameters sent by the client sides to obtain global model parameters updated by the new unlabeled global model and sends the global model parameters to the client sides; the supervision training is inserted in the self-supervision training of the client, so that a guidance direction is provided for the self-supervision training of the client, and the deviation of the self-supervision training result of the client is avoided; the method has the advantages that the self-supervision training can utilize the characteristics of the labeled samples learned by the supervision training and the characteristics of a large number of unlabeled samples learned by the self-supervision training, so that the transverse federal learning can be carried out when only part of clients have a small number of labeled samples, the models meeting performance requirements are obtained by training, the practical scene lacking of label data is adapted, and the labor cost is saved.
Further, in a medical scenario, it is necessary to identify the type of heart disease of a patient according to the electrocardiogram of the patient, so that a recognition model can be trained to identify the electrocardiogram. However, doctors rarely have time to label data, but doctors do not know how to label data, so that the labeled samples are lacked, the recognition effect of the trained recognition model is poor, and the unlabeled data cannot be utilized. To solve this problem, in this embodiment, the target model may be used to identify a heart disease type of the patient, and after step S40, the method further includes:
and step S50, inputting the electrocardiogram data of the target patient into the target model, and sequentially calling an encoder and a predictor in the target model to process the electrocardiogram data to obtain the heart disease type identification result of the target patient.
The target model can be used for identifying the heart disease type of the patient, the input of the target model can be electrocardiogram data of the patient, the output can be the heart disease type identification result of the patient, the client can be equipment of multiple hospitals, the client can locally own the electrocardiogram data of the multiple patients, and the server is a third-party server independent of the multiple hospitals. The server and each client train the model to be trained according to the federal learning process in the embodiment, and finally the type of the heart disease of the patient is identified. Each hospital may use the trained target model to identify the type of heart disease of the target patient. Specifically, the client inputs electrocardiogram data of a target patient into a target model, and sequentially calls an encoder and a predictor in the target model to process the electrocardiogram data to obtain a heart disease type identification result of the target patient. In the process of joint training, the server and the client are trained in an alternative mode of self-supervision training and supervision training, so that in the training process, a small number of labeled samples are possessed at part of the clients or a small number of labeled samples are possessed at the server, and a large number of unlabeled samples are added to train to obtain a target model with a good identification effect, so that the training cost of the heart disease type identification model is reduced, the heart disease type identification model is more suitable for a real scene lacking of labeled data, and the utilization rate of the unlabeled data is improved.
Further, the target model can be used for predicting credit risk of the user, the input of the target model can be characteristic data of the user, the output can be risk scoring of the user, the client can be equipment of multiple banks, sample data of the multiple users are locally owned by the client, and the server is a third-party server independent of the multiple banks. And the server and each client train the model to be trained according to the federal learning process in the embodiment to obtain a target model finally used for credit risk prediction. And the trained target model can be adopted by various banks to predict the credit risk of the target user. Specifically, the client inputs the feature data of the target user into the target model, and sequentially calls the encoder and the predictor in the target model to process the feature data to obtain the risk score of the target user. In the process of joint training, the server and the client are trained in an alternating mode of self-supervision training and supervision training, so that in the training process, a small number of labeled samples are owned by part of the clients or a small number of labeled samples are owned by the server, and a large number of unlabeled samples are added to train to obtain a target model with a high risk prediction effect, so that the training cost of a credit risk prediction model is reduced, and the method is more suitable for a real scene lacking of labeled data.
It should be noted that the target model may also be used in other application scenarios besides credit risk assessment, such as performance level prediction, paper value evaluation, and the like, and the embodiment of the present invention is not limited herein.
Further, based on the first and second embodiments, a third embodiment of the semi-supervised-based horizontal federal learning optimization method of the present invention is provided, in this embodiment, the semi-supervised-based horizontal federal learning optimization method is applied to a server participating in horizontal federal learning, the server is in communication connection with a client participating in horizontal federal learning, local training samples of each client include unlabelled samples, and the server and the client related to the embodiment of the present invention may be devices such as a smart phone, a personal computer, and a server. In this embodiment, the semi-supervised-based horizontal federal learning optimization method includes the following steps:
step A10, issuing the first global model parameter updated by the current unlabeled global model to each client, so that each client performs self-supervision training on the respective local model to be trained according to the first global model parameter and the training sample, updating the encoder parameter and the decoder parameter in the respective local model to be trained, obtaining the first local model parameter, and returning;
in this embodiment, the server and each client may establish a communication connection in advance through handshaking and identity authentication, and determine a model to be trained in the federal learning, such as a neural network model. The determined model to be trained can be issued to each client by the server, so that each client locally has the model to be trained with the same structure, and the server locally can also have the model to be trained with the same structure. As shown in fig. 3, 4 and 5, three possible sample cases in a real scene, respectively; in fig. 3, each client locally has a training sample for training the model to be trained, the training samples are all unlabeled samples, and the server has a small number of labeled samples; in fig. 4, the local training samples of each client include unlabeled samples, the training samples of some clients include a small number of labeled samples, and the server does not have a training sample; in fig. 5, the training samples local to each client include unlabeled samples, the training samples of some clients include a small number of labeled samples, and the server also includes a small number of labeled samples. It should be noted that the unlabeled sample and the labeled sample are collectively referred to as a training sample, one unlabeled sample includes one piece of data, and one labeled sample includes one piece of data and a label corresponding to the data. The number of the non-labeled samples can be far greater than that of the labeled samples, so that manpower and material resources for manually labeling are saved. Different training samples may be used depending on the specific training task. For example, if the training task is to perform face detection on an image by using a neural network model, the training samples are images, and the labeled samples further include a label indicating whether a face exists in the image. For another example, if the training task is to predict the purchasing intention of the user by using a decision tree model, the training samples are user data, and the labeled samples further include a purchasing intention label of the user.
Based on the training sample distribution scenarios shown in fig. 3, 4 and 5, a semi-supervised-based horizontal federal learning optimization method in the embodiment of the present invention is proposed.
Specifically, in the horizontal federal learning, the server and the client cooperate with each other to perform multiple global model updates on the model to be trained, and finally, the target model meeting the quality requirement is obtained. The model updating means updating model parameters of the model to be trained, if the model to be trained is a neural network model, the model parameters are connection weight values among neurons, and the final model parameters are determined through multiple times of global model updating, so that the target model is determined. It should be noted that, a process in which the server and the client perform model update on the model to be trained is called global model update, a case in which the client performs training using a labeled sample in the global model update is called labeled global model update, a case in which the client performs training using a non-labeled sample in the global model update is called non-labeled global model update, a concept in the non-labeled global model update is called "first", and a concept involved in the labeled global model update is called "second", so as to distinguish them.
In one non-label global model updating, a client receives a first global model parameter of the non-label global model updating sent by a server. It should be noted that, if the global model is updated for the first time, the server may initialize the model to be trained of the server using random model parameters, or may initialize the model to be trained of the server using model parameters set by a developer according to experience. Then, the server side can directly send the initialized model parameters of the model to be trained as the first global model parameters of the current unlabeled global model update, and can also obtain the first global model parameters of the current unlabeled global model update by adopting different schemes according to different distributions of labeled samples.
Specifically, when the distribution of the labeled samples is as shown in fig. 3, the server may perform supervised training on the initialized model to be trained by using the labeled samples, update the model parameters of the model to be trained after one or more iterations, and use the updated model parameters as the first global model parameters of the current unlabeled global model update. When the distribution of the labeled samples is as shown in fig. 4, the server may perform one or more labeled global model updates in combination with the client having the labeled samples, and then use the updated model parameters as the first global model parameters of the current unlabeled global model update. When the distribution of the labeled samples is shown in fig. 5, the server may perform supervised training by using local labeled samples, perform one or more labeled global model updates by combining with the client having the labeled samples, and then use the updated model parameters as the first global model parameters of the current unlabeled global model update.
When the federal learning starts, the server firstly carries out supervised training on the model to be trained, and carries out self-supervised training in an initial direction for each subsequent client, so that the training time is shortened, namely, the model to be trained obtained after the supervised training has learned some characteristics of the labeled sample, the prediction result in the self-supervised training process of the client is relatively accurate, the updating times of the unlabeled global model are further shortened, the training time is shortened, and meanwhile, the quality and the performance of the target model obtained by training are also improved.
After the client side obtains the first global model parameter, the client side carries out self-supervision training on the local model to be trained according to the first global model parameter and the training sample, and updates the encoder parameter and the decoder parameter in the model to be trained to obtain the first local model parameter. The model to be trained at least comprises an encoder, a decoder and a predictor, wherein the output of the encoder is respectively connected with the input of the decoder and the input of the predictor; the encoder is used for extracting the characteristics of the input data, which is equivalent to encoding the input data; the decoder is used for decoding the result coded by the coder and aims at restoring the input data; the predictor is used for outputting a prediction result of the model based on the characteristics extracted by the encoder; in the stage of training the model, the parameters of the coder, the parameters of the decoder and the parameters of the predictor need to be updated, and in the stage of using the model, the coder and the predictor are adopted to complete the prediction task.
If the training samples comprise the label samples, the client can remove labels from the label samples and convert the label samples into label-free samples, and all the training samples are taken as label-free samples to perform self-supervision training on the model to be trained.
Specifically, the client updates the local model to be trained by using the first global model parameter. The first global model parameter may include an encoder parameter, a decoder parameter, and a predictor parameter. After updating the model parameters of the local model to be trained, the client inputs the training samples into the model to be trained to obtain the prediction labels, and sequentially calls the encoder and the decoder in the model to be trained to process the training samples to obtain decoded data. Specifically, an encoder in the model to be trained extracts features in the training samples, and a decoder restores the features based on the features extracted by the encoder to obtain decoded data. The client calculates an auto-supervision loss function according to the decoded data and the training samples, calculates gradients corresponding to the encoder parameters and the decoder parameters respectively according to the auto-supervision loss function, and updates the encoder parameters and the decoder parameters respectively according to the gradients. After one or more rounds of updating, the client takes the finally updated model parameters of the model to be trained as the first local model parameters. The calculation method of the self-supervision loss function can adopt a conventional loss function calculation method, and is different from the supervised loss function in that the self-supervision loss function mainly represents errors of training samples and decoding data.
It should be noted that the first local model parameter may include an encoder parameter, a predictor parameter, and a decoder parameter, where the predictor parameter is still a predictor parameter in the first global model parameter sent by the server, that is, the predictor parameter is not updated in the process of updating the unlabeled global model. Under the ideal state, the decoded data restored by the decoder is close to or even the same as the input training samples, the self-supervision loss function represents the error between the decoded data and the training samples, and the self-supervision training aims to continuously adjust the parameters of the decoder and the parameters of the encoder, so that the value of the self-supervision loss function is continuously reduced, and the feature extraction accuracy of the encoder and the decoder is improved.
The local model parameters are relative to the global model parameters, each client respectively adopts a local training sample to update the local model to be trained, the model parameters of each client are consistent when the local training is started, and the model parameters of the model to be trained of each client are different after the training is finished, namely, the local model parameters obtained by each client are different, and the difference is just caused by the fact that each client has the training samples of different users.
Step A20, receiving the first local model parameters returned by each client, and performing supervised training on the model to be trained according to the first local model parameters to obtain first global model parameters updated by the new unlabeled global model and sending the first global model parameters to each client;
and the server receives the first local model parameters sent by each client, performs supervised training according to the first local model parameters sent by each client, obtains the global model parameters updated by the new unlabeled global model, and sends the global model parameters to each client.
Specifically, the process of performing supervised training on the model to be trained by the server may be different according to different distributions of labeled samples. For example, when the distribution of the labeled samples is as shown in fig. 5, the server may first fuse each first local model parameter to obtain a fused model parameter; the server side updates the model to be trained of the server side by adopting the fusion model parameters; after updating, the server side adopts a local labeled sample of the server side to perform supervised training on the model to be trained of the server side, updates the encoder parameter and the predictor parameter of the model to be trained of the server side through one or more rounds of training, and sends the updated model parameter of the model to be trained to each client side as a second global model parameter updated by the new labeled global model; after each client updates the local model to be trained by adopting the received second global model parameter, the supervised training is carried out on the model to be trained by adopting the local labeled sample, the encoder parameter and the prediction period parameter of the model to be trained are updated, the updated model parameter of the model to be trained is used as the second local model parameter, and the second local model parameter is sent to the server; the server receives the second local model parameters sent by each client with the label samples, performs fusion, and takes the fusion result as a first global model parameter updated by the new non-label global model; and the server side issues the first global model parameters of the new non-label global model update to each client side so as to enter the new non-label global model update.
After the client side adopts the local unlabelled sample to update the unlabelled model each time, the server side carries out supervised training on the model to be trained so as to adjust the result of updating the unlabelled model of each client side, so that the guidance of the labeled sample on model prediction or classification effect is inserted in the whole process of federal learning, the deviation of the result of training by adopting the unlabelled sample at the client side is avoided, the time of model training is shortened, the performance of a target model obtained by training is also improved, and the deviation of the model performance is avoided while the function of the unlabelled sample is exerted most importantly.
And step A30, circulating until the preset condition is met, stopping training to obtain the target model.
And circulating the steps until the server side detects that the preset conditions are met, and stopping training to obtain the target model. The preset condition may be preset according to a need, for example, convergence of a model to be trained of the server is detected, or the number of detected cycles reaches a preset number, or training time reaches a preset time. The server side can also send a global model parameter to the client side and a training stopping instruction when detecting that the model to be trained is converged, and the client side updates the local model to be trained by adopting the global model parameter after receiving the training stopping instruction and the global model parameter and then stops training. The client side takes the model to be trained with the finally determined model parameters as a target model, and then the target model can be used for completing a prediction or classification task.
It should be noted that, the server may perform multiple times of labeled global model updating by combining the clients having labeled samples, and then perform multiple times of unlabeled global model updating by combining each client, that is, after at least one time of labeled global model updating, at least one time of unlabeled global model updating is not necessary, and the operations are performed alternately until the training is stopped.
In the embodiment, the server side issues global model parameters to each client side, the client sides perform self-supervision training on local models to be trained based on global model parameter updating and training samples, encoder parameters and decoder parameters of the models to be trained are updated, and the local model parameters are obtained, so that the client sides can participate in transverse federal learning when label data does not exist, the function of label-free samples is fully played, and the utilization rate of the label-free samples is improved; the server side carries out supervised training on the model to be trained according to the local model parameters sent by each client side to obtain global model parameters updated by the new unlabeled global model and sends the global model parameters to each client side; the supervision training is inserted in the self-supervision training of the client, so that a guidance direction is provided for the self-supervision training of the client, and the deviation of the self-supervision training result of the client is avoided; the method has the advantages that the self-supervision training can utilize the characteristics of the labeled samples learned by the supervision training and the characteristics of a large number of unlabeled samples learned by the self-supervision training, so that the transverse federal learning can be carried out when only part of clients have a small number of labeled samples, the models meeting performance requirements are obtained by training, the practical scene lacking of label data is adapted, and the labor cost is saved.
Further, when the training samples of the partial clients include the labeled sample, the step a20 includes:
step A201, fusing each first local model parameter, and taking the fused model parameter obtained by fusion as a second global model parameter of a new labeled global model update;
step A202, sending the second global model parameter to each client with a labeled sample, so that each client can perform supervised training on the respective local model to be trained by using the labeled sample, updating the encoder parameter and the predictor parameter in the respective local model to be trained, obtaining a second local model parameter, and returning;
step a203, receiving the second local model parameters returned by each client, fusing the second local model parameters, and sending the fused result to each client as the first global model parameter of the new unlabeled global model update.
Specifically, when part of the training samples of the client includes the labeled sample, that is, when the distribution of the labeled sample is as shown in fig. 4, the server may first fuse each first local model parameter to obtain a fused model parameter; the fusion model parameter is used as a second global model parameter updated by a new labeled global model and is sent to each client with a labeled sample; after each client updates the local model to be trained by adopting the received second global model parameter, the supervised training is carried out on the model to be trained by adopting the local labeled sample, the encoder parameter and the prediction period parameter of the model to be trained are updated, the updated model parameter of the model to be trained is used as the second local model parameter, and the second local model parameter is sent to the server; the server receives the second local model parameters sent by each client with the label samples, performs fusion, and takes the fusion result as a first global model parameter updated by the new non-label global model; and the server side issues the first global model parameters of the new non-label global model update to each client side so as to enter the new non-label global model update.
Further, when the server side has the labeled sample and has the model to be trained with the same structure as the model to be trained local to each client side, step a20 includes:
step A204, fusing each first local model parameter to obtain a fused model parameter;
step A205, after the model to be trained of the server is updated based on the fusion model parameters, the labeled sample is adopted to perform supervised training on the model to be trained of the server, encoder parameters and predictor parameters in the model to be trained of the server are updated, and first global model parameters updated by the new global model are obtained and sent to each client.
Specifically, when the server has the labeled sample, that is, when the distribution of the labeled sample is as shown in fig. 3, the server may fuse the first local model parameters to obtain a fused model parameter; the server side updates the model to be trained of the server side by adopting the fusion model parameters; after updating, the server side adopts a local labeled sample of the server side to perform supervised training on the model to be trained of the server side, updates the encoder parameters and the predictor parameters of the model to be trained of the server side through one or more rounds of training, and takes the updated model parameters of the model to be trained as the first global model parameters of the new label-free global model updating. The server performs supervised training on the model to be trained of the server by using the local labeled sample of the server, and the process of updating the encoder parameter and the predictor parameter of the model to be trained of the server specifically may be as follows: as shown in fig. 7, the server inputs data with a labeled sample into a model to be trained of the server, and sequentially calls an encoder and a predictor in the model to be trained of the server to process the labeled sample to obtain a predicted label; calculating a supervised loss function according to the predicted label and the real label corresponding to the labeled sample; and updating the encoder parameters and the predictor parameters in the model to be trained of the server side according to the supervised loss function.
Further, the process of fusing the local model parameters (the first local model parameter or the second local model parameter) sent by each client by the server may be to perform weighted average on each local model parameter, and the weight value corresponding to each client may be set in advance according to specific needs, for example, the weight value may be set according to the data volume proportion of the training sample of each client, and the larger the data volume proportion is, the larger the weight is.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a semi-supervised based lateral federated learning optimization program is stored, which, when executed by a processor, implements the steps of the semi-supervised based lateral federated learning optimization method as described below.
The embodiments of the semi-supervised-based horizontal federal learning optimization device and the computer-readable storage medium of the present invention can refer to the embodiments of the semi-supervised-based horizontal federal learning optimization method of the present invention, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A semi-supervised-based optimization method for horizontal federal learning is applied to a client participating in horizontal federal learning, local training samples of the client comprise unlabeled samples, and the client is in communication connection with a server participating in the horizontal federal learning, and the method comprises the following steps:
receiving global model parameters of the current non-label global model update sent by a server;
performing self-supervision training on a local model to be trained according to the global model parameters and the training samples, and updating encoder parameters and decoder parameters in the model to be trained to obtain local model parameters;
sending the local model parameters to a server side, so that the server side carries out supervised training on a model to be trained according to the local model parameters sent by each client side, obtains global model parameters updated by a new unlabeled global model and sends the global model parameters to each client side;
and circulating until the preset condition is met, stopping training to obtain the target model.
2. The semi-supervised-based lateral federated learning optimization method of claim 1, wherein the step of performing self-supervised training on the local model to be trained according to the global model parameters and the training samples, and updating encoder parameters and decoder parameters in the model to be trained to obtain local model parameters comprises:
after updating a local model to be trained by adopting the global model parameters, inputting the training sample into the model to be trained, and sequentially calling an encoder and a decoder in the model to be trained to process the training sample to obtain decoded data;
calculating an auto-supervised loss function from the training samples and the decoded data;
and updating the parameters of the encoder and the parameters of the decoder in the model to be trained according to the self-supervision loss function to obtain the parameters of the local model.
3. The semi-supervised-based lateral federal learning optimization method of any one of claims 1 and 2, wherein the objective model is used for identifying the type of heart disease of the patient, and the loop further comprises, after the step of stopping training to obtain the objective model when the preset condition is met:
and inputting the electrocardiogram data of the target patient into the target model, and sequentially calling an encoder and a predictor in the target model to process the electrocardiogram data to obtain the heart disease type identification result of the target patient.
4. A semi-supervised-based optimization method for horizontal federal learning is applied to a server participating in horizontal federal learning, the server is in communication connection with clients participating in horizontal federal learning, training samples local to the clients comprise unlabelled samples, and the method comprises the following steps:
issuing the first global model parameter updated by the current unlabeled global model to each client, so that each client performs self-supervision training on the respective local model to be trained according to the first global model parameter and the training sample, updating the encoder parameter and the decoder parameter in the respective local model to be trained, obtaining the first local model parameter and returning;
receiving the first local model parameters returned by each client, performing supervised training on the model to be trained according to the first local model parameters, obtaining first global model parameters updated by the new unlabeled global model, and issuing the first global model parameters to each client;
and circulating until the preset condition is met, stopping training to obtain the target model.
5. The semi-supervised-based horizontal federated learning optimization method of claim 4, wherein when the training samples of some clients include labeled samples, the step of performing supervised training on the model to be trained according to the first local model parameter to obtain a first global model parameter updated by a new unlabeled global model and sending the first global model parameter to each client comprises:
fusing the first local model parameters, and taking the fused model parameters obtained by fusion as second global model parameters of the new labeled global model;
sending the second global model parameter to each client with a labeled sample, so that each client can perform supervised training on the local model to be trained by adopting the labeled sample, updating the encoder parameter and the predictor parameter in the local model to be trained, obtaining a second local model parameter and returning;
and receiving the second local model parameters returned by each client, fusing the second local model parameters, and sending a fused result to each client as a first global model parameter updated by the new unlabeled global model.
6. The semi-supervised-based horizontal federated learning optimization method of claim 4, wherein when the server side has labeled samples and has models to be trained with the same structure as local models to be trained of each client side, the step of performing supervised training on the models to be trained according to the first local model parameters to obtain first global model parameters updated by a new unlabeled global model and sending the first global model parameters to each client side comprises:
fusing the first local model parameters to obtain fused model parameters;
and after updating the model to be trained of the server based on the fusion model parameters, performing supervised training on the model to be trained of the server by using the labeled sample, updating the encoder parameters and the predictor parameters in the model to be trained of the server, obtaining the first global model parameters updated by the new global model, and issuing the first global model parameters to each client.
7. The semi-supervised-based lateral federated learning optimization method of claim 6, wherein the supervised training of the server-side model to be trained using the labeled samples, the step of updating the encoder parameters and predictor parameters in the server-side model to be trained comprises:
inputting the labeled sample into a model to be trained of the server, and sequentially calling a coder and a predictor in the model to be trained of the server to process the labeled sample to obtain a predicted label;
calculating a supervised loss function according to the predicted label and the real label corresponding to the labeled sample;
and updating the encoder parameters and the predictor parameters in the model to be trained of the server side according to the supervised loss function.
8. The semi-supervised-based lateral federated learning optimization method of any one of claims 5 to 7, wherein the step of fusing each of the first local model parameters to obtain fused model parameters includes:
and carrying out weighted average on each first local model parameter to obtain a fusion model parameter.
9. A semi-supervised-based lateral federal learning optimization device, comprising: a memory, a processor, and a semi-supervised lateral federated learning optimization program stored on the memory and executable on the processor, the semi-supervised lateral federated learning optimization program when executed by the processor implementing the steps of the semi-supervised lateral federated learning optimization method recited in any one of claims 1 to 8.
10. A computer readable storage medium having stored thereon a semi-supervised lateral federated learning optimization program which, when executed by a processor, implements the steps of the semi-supervised lateral federated learning optimization method recited in any one of claims 1 to 8.
CN202010084917.XA 2020-02-10 2020-02-10 Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium Pending CN111291897A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010084917.XA CN111291897A (en) 2020-02-10 2020-02-10 Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010084917.XA CN111291897A (en) 2020-02-10 2020-02-10 Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111291897A true CN111291897A (en) 2020-06-16

Family

ID=71024545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010084917.XA Pending CN111291897A (en) 2020-02-10 2020-02-10 Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111291897A (en)

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111768008A (en) * 2020-06-30 2020-10-13 平安科技(深圳)有限公司 Federal learning method, device, equipment and storage medium
CN111967607A (en) * 2020-07-31 2020-11-20 中国科学院深圳先进技术研究院 Model training method and device, electronic equipment and machine-readable storage medium
CN112364919A (en) * 2020-11-11 2021-02-12 深圳前海微众银行股份有限公司 Data processing method, device, equipment and storage medium
CN112560991A (en) * 2020-12-25 2021-03-26 中山大学 Personalized federal learning method based on hybrid expert model
CN112598311A (en) * 2020-12-29 2021-04-02 中国农业银行股份有限公司 Risk operation identification model construction method and risk operation identification method
CN112819177A (en) * 2021-01-26 2021-05-18 支付宝(杭州)信息技术有限公司 Personalized privacy protection learning method, device and equipment
CN112885337A (en) * 2021-01-29 2021-06-01 深圳前海微众银行股份有限公司 Data processing method, device, equipment and storage medium
CN113051608A (en) * 2021-03-11 2021-06-29 佳讯飞鸿(北京)智能科技研究院有限公司 Method for transmitting virtualized sharing model for federated learning
CN113095513A (en) * 2021-04-25 2021-07-09 中山大学 Double-layer fair federal learning method, device and storage medium
CN113112026A (en) * 2021-04-02 2021-07-13 佳讯飞鸿(北京)智能科技研究院有限公司 Optimization method and device for federated learning model
CN113133768A (en) * 2021-04-21 2021-07-20 东南大学 Cardiovascular disease auxiliary diagnosis model and training method based on federal learning
CN113221470A (en) * 2021-06-10 2021-08-06 南方电网科学研究院有限责任公司 Federal learning method for power grid edge computing system and related device thereof
CN113240128A (en) * 2021-04-07 2021-08-10 睿蜂群(北京)科技有限公司 Collaborative training method and device for data imbalance, electronic equipment and storage medium
CN113268524A (en) * 2021-05-25 2021-08-17 平安科技(深圳)有限公司 Method and device for detecting abnormal oil consumption data, electronic equipment and storage medium
CN113344131A (en) * 2021-06-30 2021-09-03 商汤国际私人有限公司 Network training method and device, electronic equipment and storage medium
CN113688862A (en) * 2021-07-09 2021-11-23 深圳大学 Brain image classification method based on semi-supervised federal learning and terminal equipment
CN113705712A (en) * 2021-09-02 2021-11-26 广州大学 Network traffic classification method and system based on federal semi-supervised learning
WO2022002059A1 (en) * 2020-06-30 2022-01-06 北京灵汐科技有限公司 Initial neural network training method and apparatus, image recognition method and apparatus, device, and medium
CN113963186A (en) * 2021-10-29 2022-01-21 北京百度网讯科技有限公司 Training method of target detection model, target detection method and related device
WO2022019885A1 (en) * 2020-07-20 2022-01-27 Google Llc Unsupervised federated learning of machine learning model layers
US20220060235A1 (en) * 2020-08-18 2022-02-24 Qualcomm Incorporated Federated learning for client-specific neural network parameter generation for wireless communication
WO2022094884A1 (en) * 2020-11-05 2022-05-12 浙江大学 Horizontal federated learning method for decision tree
WO2022111639A1 (en) * 2020-11-30 2022-06-02 华为技术有限公司 Federated learning method and apparatus, device, system, and computer-readable storage medium
WO2022268656A1 (en) * 2021-06-25 2022-12-29 Bayer Aktiengesellschaft Federated representation learning with consistency regularization
CN116108491A (en) * 2023-04-04 2023-05-12 杭州海康威视数字技术股份有限公司 Data leakage early warning method, device and system based on semi-supervised federal learning
WO2023097522A1 (en) * 2021-11-30 2023-06-08 Oppo广东移动通信有限公司 Model updating method and apparatus for wireless channel processing, device, and medium
WO2023169167A1 (en) * 2022-03-09 2023-09-14 华为技术有限公司 Model training method and apparatus, and device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284313A (en) * 2018-08-10 2019-01-29 深圳前海微众银行股份有限公司 Federal modeling method, equipment and readable storage medium storing program for executing based on semi-supervised learning
CN109325584A (en) * 2018-08-10 2019-02-12 深圳前海微众银行股份有限公司 Federation's modeling method, equipment and readable storage medium storing program for executing neural network based
CN110163235A (en) * 2018-10-11 2019-08-23 腾讯科技(深圳)有限公司 Training, image enchancing method, device and the storage medium of image enhancement model
CN110377587A (en) * 2019-07-15 2019-10-25 腾讯科技(深圳)有限公司 Method, apparatus, equipment and medium are determined based on the migrating data of machine learning
CN110647765A (en) * 2019-09-19 2020-01-03 济南大学 Privacy protection method and system based on knowledge migration under collaborative learning framework

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284313A (en) * 2018-08-10 2019-01-29 深圳前海微众银行股份有限公司 Federal modeling method, equipment and readable storage medium storing program for executing based on semi-supervised learning
CN109325584A (en) * 2018-08-10 2019-02-12 深圳前海微众银行股份有限公司 Federation's modeling method, equipment and readable storage medium storing program for executing neural network based
CN110163235A (en) * 2018-10-11 2019-08-23 腾讯科技(深圳)有限公司 Training, image enchancing method, device and the storage medium of image enhancement model
CN110377587A (en) * 2019-07-15 2019-10-25 腾讯科技(深圳)有限公司 Method, apparatus, equipment and medium are determined based on the migrating data of machine learning
CN110647765A (en) * 2019-09-19 2020-01-03 济南大学 Privacy protection method and system based on knowledge migration under collaborative learning framework

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ABDULLATIF ALBASEER ET AL.: "exploiting unlabeled data in smart cities using federated learning", 《ARXIV》, 10 January 2020 (2020-01-10), pages 1 - 6 *
徐晓青;武娟;刘晓军;: "网络人工智能关键技术与应用研究", 广东通信技术, no. 04, 15 April 2019 (2019-04-15), pages 6 - 10 *

Cited By (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022002059A1 (en) * 2020-06-30 2022-01-06 北京灵汐科技有限公司 Initial neural network training method and apparatus, image recognition method and apparatus, device, and medium
CN111768008A (en) * 2020-06-30 2020-10-13 平安科技(深圳)有限公司 Federal learning method, device, equipment and storage medium
WO2022019885A1 (en) * 2020-07-20 2022-01-27 Google Llc Unsupervised federated learning of machine learning model layers
CN111967607B (en) * 2020-07-31 2023-09-01 中国科学院深圳先进技术研究院 Model training method and device, electronic equipment and machine-readable storage medium
CN111967607A (en) * 2020-07-31 2020-11-20 中国科学院深圳先进技术研究院 Model training method and device, electronic equipment and machine-readable storage medium
US20220060235A1 (en) * 2020-08-18 2022-02-24 Qualcomm Incorporated Federated learning for client-specific neural network parameter generation for wireless communication
US11909482B2 (en) * 2020-08-18 2024-02-20 Qualcomm Incorporated Federated learning for client-specific neural network parameter generation for wireless communication
WO2022094884A1 (en) * 2020-11-05 2022-05-12 浙江大学 Horizontal federated learning method for decision tree
CN112364919A (en) * 2020-11-11 2021-02-12 深圳前海微众银行股份有限公司 Data processing method, device, equipment and storage medium
WO2022111639A1 (en) * 2020-11-30 2022-06-02 华为技术有限公司 Federated learning method and apparatus, device, system, and computer-readable storage medium
CN112560991A (en) * 2020-12-25 2021-03-26 中山大学 Personalized federal learning method based on hybrid expert model
CN112560991B (en) * 2020-12-25 2023-07-07 中山大学 Personalized federal learning method based on mixed expert model
CN112598311A (en) * 2020-12-29 2021-04-02 中国农业银行股份有限公司 Risk operation identification model construction method and risk operation identification method
CN112819177A (en) * 2021-01-26 2021-05-18 支付宝(杭州)信息技术有限公司 Personalized privacy protection learning method, device and equipment
CN112885337A (en) * 2021-01-29 2021-06-01 深圳前海微众银行股份有限公司 Data processing method, device, equipment and storage medium
CN113051608A (en) * 2021-03-11 2021-06-29 佳讯飞鸿(北京)智能科技研究院有限公司 Method for transmitting virtualized sharing model for federated learning
CN113112026B (en) * 2021-04-02 2024-05-28 佳讯飞鸿(北京)智能科技研究院有限公司 Federal learning model optimization method and device
CN113112026A (en) * 2021-04-02 2021-07-13 佳讯飞鸿(北京)智能科技研究院有限公司 Optimization method and device for federated learning model
CN113240128A (en) * 2021-04-07 2021-08-10 睿蜂群(北京)科技有限公司 Collaborative training method and device for data imbalance, electronic equipment and storage medium
CN113133768A (en) * 2021-04-21 2021-07-20 东南大学 Cardiovascular disease auxiliary diagnosis model and training method based on federal learning
CN113095513A (en) * 2021-04-25 2021-07-09 中山大学 Double-layer fair federal learning method, device and storage medium
CN113268524A (en) * 2021-05-25 2021-08-17 平安科技(深圳)有限公司 Method and device for detecting abnormal oil consumption data, electronic equipment and storage medium
CN113221470A (en) * 2021-06-10 2021-08-06 南方电网科学研究院有限责任公司 Federal learning method for power grid edge computing system and related device thereof
WO2022268656A1 (en) * 2021-06-25 2022-12-29 Bayer Aktiengesellschaft Federated representation learning with consistency regularization
CN113344131A (en) * 2021-06-30 2021-09-03 商汤国际私人有限公司 Network training method and device, electronic equipment and storage medium
CN113688862A (en) * 2021-07-09 2021-11-23 深圳大学 Brain image classification method based on semi-supervised federal learning and terminal equipment
CN113688862B (en) * 2021-07-09 2023-07-04 深圳大学 Brain image classification method based on semi-supervised federal learning and terminal equipment
CN113705712A (en) * 2021-09-02 2021-11-26 广州大学 Network traffic classification method and system based on federal semi-supervised learning
CN113705712B (en) * 2021-09-02 2024-01-05 广州大学 Network traffic classification method and system based on federal semi-supervised learning
CN113963186A (en) * 2021-10-29 2022-01-21 北京百度网讯科技有限公司 Training method of target detection model, target detection method and related device
WO2023097522A1 (en) * 2021-11-30 2023-06-08 Oppo广东移动通信有限公司 Model updating method and apparatus for wireless channel processing, device, and medium
WO2023169167A1 (en) * 2022-03-09 2023-09-14 华为技术有限公司 Model training method and apparatus, and device and storage medium
CN116108491A (en) * 2023-04-04 2023-05-12 杭州海康威视数字技术股份有限公司 Data leakage early warning method, device and system based on semi-supervised federal learning
CN116108491B (en) * 2023-04-04 2024-03-22 杭州海康威视数字技术股份有限公司 Data leakage early warning method, device and system based on semi-supervised federal learning

Similar Documents

Publication Publication Date Title
CN111291897A (en) Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium
CN111275207B (en) Semi-supervision-based transverse federal learning optimization method, equipment and storage medium
CN111310938A (en) Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium
CN110263681B (en) Facial expression recognition method and device, storage medium and electronic device
US20190188573A1 (en) Training of artificial neural networks using safe mutations based on output gradients
CN111242097B (en) Face recognition method and device, computer readable medium and electronic equipment
CN110070029B (en) Gait recognition method and device
CN108460365B (en) Identity authentication method and device
CN113313215B (en) Image data processing method, image data processing device, computer equipment and storage medium
US10599975B2 (en) Scalable parameter encoding of artificial neural networks obtained via an evolutionary process
CN115511501A (en) Data processing method, computer equipment and readable storage medium
KR20200094608A (en) Method for detecting a face included in an image and a device therefor
CN112597984B (en) Image data processing method, image data processing device, computer equipment and storage medium
CN111523413A (en) Method and device for generating face image
CN114926766A (en) Identification method and device, equipment and computer readable storage medium
CN114820871A (en) Font generation method, model training method, device, equipment and medium
CN116994188A (en) Action recognition method and device, electronic equipment and storage medium
CN111325320A (en) Weak supervision machine learning optimization method, device, equipment and storage medium
CN113128526B (en) Image recognition method and device, electronic equipment and computer-readable storage medium
CN113190444B (en) Test method, test device and storage medium
CN111833115B (en) Operation identification method and device, storage medium and server
CN117422553A (en) Transaction processing method, device, equipment, medium and product of blockchain network
CN113033582B (en) Model training method, feature extraction method and device
CN116453226A (en) Human body posture recognition method and device based on artificial intelligence and related equipment
CN113240430A (en) Mobile payment verification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination