Semi-supervised horizontal federated learning optimization method, device and storage medium

By combining self-supervised and supervised training in horizontal federated learning, and using unlabeled and labeled samples, the problem of lack of labeled data on the client is solved, effective training and high-quality output of the model are achieved, and it adapts to the needs of actual scenarios.

CN111291897BActive Publication Date: 2024-10-11WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010084917.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-10
Publication Date
2024-10-11
Estimated Expiration
2040-02-10

AI Technical Summary

Technical Problem

Existing horizontal federated learning methods usually require a large amount of labeled data to train the model. However, in actual scenarios, clients often only have a small amount of or unlabeled data, making it difficult to obtain high-quality models using existing training modes.

Method used

A horizontal federated learning optimization method based on semi-supervision is adopted. Through the alternating method of local self-supervised training on the client and supervised training on the server, a combination of unlabeled samples and labeled samples is used to update the model parameters to ensure that the model can perform well in the absence of labeled data. Effective training can still be achieved under any circumstances.

Benefits of technology

In the absence of labeled data, it achieves effective training of the model, improves the utilization rate of unlabeled samples, avoids deviations in self-supervised training results, saves labor costs, and adapts to real-life scenarios lacking labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111291897B_ABST
    Figure CN111291897B_ABST
Patent Text Reader

Abstract

The present invention discloses a semi-supervised horizontal federated learning optimization method, device and storage medium, the method comprising: receiving global model parameters of this unlabeled global model update sent by a server; performing self-supervised training on a local model to be trained according to the global model parameters and training samples, updating the encoder parameters and decoder parameters in the model to be trained to obtain local model parameters; sending the local model parameters to the server, so that the server can perform supervised training on the model to be trained according to the local model parameters sent by each client, obtain the global model parameters of a new unlabeled global model update and send them to each client; loop until the preset conditions are met and stop training to obtain the target model. The present invention realizes that horizontal federated learning can be performed when the client has only a small amount of labeled data or even no labeled data at all, thereby adapting to the real scene of lack of labeled data and saving labor costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a semi-supervised horizontal federated learning optimization method, device and storage medium. Background Art

[0002] With the development of artificial intelligence, people have proposed the concept of "federated learning" to solve the problem of data silos, so that both parties in the federation can train models to obtain model parameters without providing their own data, and avoid data privacy leakage. Horizontal federated learning, also known as feature-aligned federated learning, is to extract the data with the same client data features but different users for joint machine learning when the data features of each client overlap a lot (that is, the data features are aligned) and the users overlap less.

[0003] Current horizontal federated learning usually assumes that the client has a large amount of labeled data in order to ensure that the model can be trained using the horizontal federated learning training mode. However, the actual situation is usually that the client has a small amount of or even no labeled data. In fact, it is difficult to require the client to label the data, so it is difficult to use the existing horizontal federated learning training mode to obtain a high-quality model. Summary of the invention

[0004] The main purpose of the present invention is to provide a semi-supervised horizontal federated learning optimization method, device and storage medium, aiming to solve the problem that horizontal federated learning cannot be used to train models when there is a small amount of labeled data in the existing clients or even some clients have no labeled data.

[0005] To achieve the above object, the present invention provides a semi-supervised horizontal federated learning optimization method, which is applied to a client participating in horizontal federated learning, wherein the local training samples of the client include unlabeled samples, and the client is connected to a server participating in horizontal federated learning in communication, and the method comprises:

[0006] Receive the global model parameters for this label-free global model update sent by the server;

[0007] Performing self-supervisory training on the 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;

[0008] Send the local model parameters to the server, so that the server can perform supervised training on the to-be-trained model according to the local model parameters sent by each client, obtain the global model parameters of a new unlabeled global model update and send them to each client;

[0009] The training is stopped in the loop until the preset conditions are met to obtain the target model.

[0010] Optionally, the step of performing self-supervisory training on the local model to be trained according to the global model parameters and the training samples, and updating the encoder parameters and decoder parameters in the model to be trained to obtain the local model parameters comprises:

[0011] After the local model to be trained is updated using the global model parameters, the training sample is input into the model to be trained, and the encoder and decoder in the model to be trained are called in sequence to process the training sample to obtain decoded data;

[0012] Calculating a self-supervised loss function based on the training sample and the decoded data;

[0013] The encoder parameters and the decoder parameters in the model to be trained are updated according to the self-supervised loss function to obtain local model parameters.

[0014] Optionally, the target model is used to identify the type of heart disease of the patient, and after the step of looping until a preset condition is met and stopping training to obtain the target model, the step further includes:

[0015] The electrocardiogram data of the target patient is input into the target model, and the encoder and the predictor in the target model are called in sequence to process the electrocardiogram data to obtain the heart disease type recognition result of the target patient.

[0016] To achieve the above object, the present invention also provides a semi-supervised horizontal federated learning optimization method, which is applied to a server participating in horizontal federated learning, the server is connected to each client participating in horizontal federated learning, and the local training samples of each client include unlabeled samples. The method includes:

[0017] Send the first global model parameters of this unlabeled global model update to each client, so that each client can perform self-supervised training on its own local model to be trained according to the first global model parameters and the training samples, update the encoder parameters and decoder parameters in its own local model to be trained, obtain the first local model parameters and return them;

[0018] Receive the first local model parameters returned by each client, and perform supervised training on the to-be-trained model according to the first local model parameters to obtain the first global model parameters for a new label-free global model update and send them to each client;

[0019] The training is stopped in the loop until the preset conditions are met to obtain the target model.

[0020] Optionally, 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 parameters, obtaining the first global model parameters for a new unlabeled global model update and issuing them to each client includes:

[0021] The first local model parameters are fused, and the fused model parameters obtained by fusion are used as the second global model parameters for a new labeled global model update;

[0022] Send the second global model parameters to each client having a labeled sample, so that each client uses the labeled sample to perform supervised training on its own local model to be trained, updates the encoder parameters and predictor parameters in its own local model to be trained, obtains the second local model parameters and returns them;

[0023] The second local model parameters returned by each client are received, and each of the second local model parameters is fused, and the fusion result is sent to each client as the first global model parameter of a new label-free global model update.

[0024] Optionally, when the server has labeled samples and a model to be trained with the same structure as the local model to be trained of each client, the step of performing supervised training on the model to be trained according to the first local model parameters, obtaining the first global model parameters for a new unlabeled global model update and sending them to each client includes:

[0025] fusing the first local model parameters to obtain fused model parameters;

[0026] After updating the server's model to be trained based on the fusion model parameters, the server's model to be trained is supervised trained using the labeled samples, the encoder parameters and predictor parameters in the server's model to be trained are updated, and the first global model parameters for a new global model update are obtained and sent to each client.

[0027] Optionally, the step of using the labeled samples to perform supervised training on the server-side model to be trained, and updating encoder parameters and predictor parameters in the server-side model to be trained includes:

[0028] Input the labeled sample into the model to be trained on the server, and sequentially call the encoder and the predictor in the model to be trained on the server to process the labeled sample to obtain a predicted label;

[0029] Calculate a supervised loss function based on the predicted label and the true label corresponding to the labeled sample;

[0030] The encoder parameters and predictor parameters in the server-side model to be trained are updated according to the supervised loss function.

[0031] Optionally, the step of fusing the first local model parameters to obtain fused model parameters includes:

[0032] A weighted average is performed on the first local model parameters to obtain a fusion model parameter.

[0033] To achieve the above-mentioned objectives, the present invention also provides a semi-supervised horizontal federated learning optimization device, which comprises: a memory, a processor, and a semi-supervised horizontal federated learning optimization program stored in the memory and executable on the processor, wherein the semi-supervised horizontal federated learning optimization program implements the steps of the semi-supervised horizontal federated learning optimization method as described above when executed by the processor.

[0034] In addition, to achieve the above-mentioned objectives, the present invention also proposes a computer-readable storage medium, on which a semi-supervised horizontal federated learning optimization program is stored. When the semi-supervised horizontal federated learning optimization program is executed by a processor, the steps of the semi-supervised horizontal federated learning optimization method as described above are implemented.

[0035] In the present invention, the client receives the global model parameters sent by the server, performs self-supervised training on the local model to be trained based on the global model parameter update and the training samples, updates the encoder parameters and decoder parameters of the model to be trained, and obtains the local model parameters, so that the client can also participate in horizontal federated learning when there is no labeled data, and gives full play to the role of unlabeled samples; the client sends the local model parameters to the server, so that the server can perform supervised training on the model to be trained according to the local model parameters sent by each client, obtain the global model parameters of the new unlabeled global model update and send them to each client; it is achieved by interspersing supervised training in the self-supervised training of the client, providing guidance direction for the self-supervised training of the client, and avoiding deviations in the self-supervised training results of the client; it enables self-supervised training to utilize the features of labeled samples learned by supervised training, and also enables supervised training to utilize the features of a large number of unlabeled samples learned by self-supervised training, so that when only some clients have a small number of labeled samples, horizontal federated learning can be performed, and a model that meets performance requirements can be trained, so as to adapt to the real scene of lack of labeled data and save labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;

[0037] Figure 2 It is a flowchart of the first embodiment of the semi-supervised horizontal federated learning optimization method of the present invention;

[0038] Figure 3 A schematic diagram of a training sample distribution involved in an embodiment of the present invention;

[0039] Figure 4 A schematic diagram of a training sample distribution involved in an embodiment of the present invention;

[0040] Figure 5 A schematic diagram of a training sample distribution involved in an embodiment of the present invention;

[0041] Figure 6 A schematic diagram of a self-supervised training process involved in an embodiment of the present invention;

[0042] Figure 7 A schematic diagram of a supervised training process involved in an embodiment of the present invention.

[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0045] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0046] It should be noted that the semi-supervised horizontal federated learning optimization device in the embodiment of the present invention can be a smart phone, a personal computer, a server and other devices, and no specific limitation is made here.

[0047] like Figure 1 As shown, the semi-supervised horizontal federated learning optimization device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and 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 and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0048] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the semi-supervised horizontal federated learning optimization device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0049] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a semi-supervised horizontal federated learning optimization program.

[0050] when Figure 1 When the device shown in is a client participating in horizontal federated learning, the user interface 1003 is mainly used to communicate data with the user end; the network interface 1004 is mainly used to establish a communication connection with the server participating in horizontal federated learning; and the processor 1001 can be used to call the semi-supervised horizontal federated learning optimization program stored in the memory 1005, and perform the following operations:

[0051] Receive the global model parameters for this label-free global model update sent by the server;

[0052] Performing self-supervisory training on the 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;

[0053] Send the local model parameters to the server, so that the server can perform supervised training on the to-be-trained model according to the local model parameters sent by each client, obtain the global model parameters of a new unlabeled global model update and send them to each client;

[0054] The training is stopped in the loop until the preset conditions are met to obtain the target model.

[0055] Furthermore, the step of performing self-supervisory training on the local model to be trained according to the global model parameters and the training samples, and updating the encoder parameters and decoder parameters in the model to be trained to obtain the local model parameters includes:

[0056] After the local model to be trained is updated using the global model parameters, the training sample is input into the model to be trained, and the encoder and decoder in the model to be trained are called in sequence to process the training sample to obtain decoded data;

[0057] Calculating a self-supervised loss function based on the training sample and the decoded data;

[0058] The encoder parameters and the decoder parameters in the model to be trained are updated according to the self-supervised loss function to obtain local model parameters.

[0059] Furthermore, the target model is used to identify the type of heart disease of the patient, and after the step of looping until the preset condition is met and stopping the training to obtain the target model, the method further includes:

[0060] The electrocardiogram data of the target patient is input into the target model, and the encoder and the predictor in the target model are called in sequence to process the electrocardiogram data to obtain the heart disease type recognition result of the target patient.

[0061] when Figure 1 When the device shown in is a server participating in horizontal federated learning, the user interface 1003 is mainly used to communicate data with the user end; the network interface 1004 is mainly used to establish a communication connection with the client participating in horizontal federated learning; and the processor 1001 can be used to call the semi-supervised horizontal federated learning optimization program stored in the memory 1005, and perform the following operations:

[0062] Send the first global model parameters of this unlabeled global model update to each client, so that each client can perform self-supervised training on its own local model to be trained according to the first global model parameters and the training samples, update the encoder parameters and decoder parameters in its own local model to be trained, obtain the first local model parameters and return them;

[0063] Receive the first local model parameters returned by each client, and perform supervised training on the to-be-trained model according to the first local model parameters to obtain the first global model parameters for a new label-free global model update and send them to each client;

[0064] The training is stopped in the loop until the preset conditions are met to obtain the target model.

[0065] Further, 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 parameters, obtaining the first global model parameters for a new unlabeled global model update and sending them to each client includes:

[0066] The first local model parameters are fused, and the fused model parameters obtained by fusion are used as the second global model parameters for a new labeled global model update;

[0067] Send the second global model parameters to each client having a labeled sample, so that each client uses the labeled sample to perform supervised training on its own local model to be trained, updates the encoder parameters and predictor parameters in its own local model to be trained, obtains the second local model parameters and returns them;

[0068] The second local model parameters returned by each client are received, and each of the second local model parameters is fused, and the fusion result is sent to each client as the first global model parameter of a new label-free global model update.

[0069] Furthermore, when the server has labeled samples and a model to be trained with the same structure as the local model to be trained of each client, the step of performing supervised training on the model to be trained according to the first local model parameters, obtaining the first global model parameters for a new unlabeled global model update and sending them to each client includes:

[0070] fusing the first local model parameters to obtain fused model parameters;

[0071] After updating the server's model to be trained based on the fusion model parameters, the server's model to be trained is supervised trained using the labeled samples, the encoder parameters and predictor parameters in the server's model to be trained are updated, and the first global model parameters for a new global model update are obtained and sent to each client.

[0072] Furthermore, the step of using the labeled samples to perform supervised training on the server-side model to be trained and updating the encoder parameters and predictor parameters in the server-side model to be trained includes:

[0073] Input the labeled sample into the model to be trained on the server, and sequentially call the encoder and the predictor in the model to be trained on the server to process the labeled sample to obtain a predicted label;

[0074] Calculate a supervised loss function based on the predicted label and the true label corresponding to the labeled sample;

[0075] The encoder parameters and predictor parameters in the server-side model to be trained are updated according to the supervised loss function.

[0076] Furthermore, it is characterized in that the step of fusing the first local model parameters to obtain fused model parameters comprises:

[0077] A weighted average is performed on the first local model parameters to obtain a fusion model parameter.

[0078] Based on the above structure, various embodiments of a semi-supervised horizontal federated learning optimization method are proposed.

[0079] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the semi-supervised horizontal federated learning optimization method of the present invention.

[0080] An embodiment of the present invention provides an embodiment of a semi-supervised horizontal federated learning optimization method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown here.

[0081] The first embodiment of the semi-supervised horizontal federated learning optimization method of the present invention is applied to a client participating in horizontal federated learning, the local training samples of the client include unlabeled samples, the client is connected to the server participating in horizontal federated learning, and the server and client involved in the embodiment of the present invention can be devices such as smart phones, personal computers and servers. In this embodiment, the semi-supervised horizontal federated learning optimization method includes:

[0082] Step S10, receiving the global model parameters of the current tag-free global model update sent by the server;

[0083] In this embodiment, the server and each client can establish a communication connection in advance through handshake and identity authentication, and determine the model to be trained in this federated learning, such as a neural network model. The server can send the determined model to be trained to each client, so that each client has a model to be trained with the same structure locally, and the server can also have a model to be trained with the same structure locally. Figure 3 , 4 As shown in Figure 5, there are three possible sample situations in real scenes; Figure 3 In the example, each client locally has training samples for training the model to be trained. The training samples are all unlabeled samples, and the server has a small number of labeled samples. Figure 4 In the example, 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 has no training samples; Figure 5In the training sample, each client's local training samples include unlabeled samples, some clients' training samples include a small number of labeled samples, and the server also has a small number of labeled samples. It should be noted that unlabeled samples and labeled samples are collectively referred to as training samples. An unlabeled sample includes a piece of data, and a labeled sample includes a piece of data and the label corresponding to the data. The number of unlabeled samples can be much larger than the number of labeled samples, in order to save manpower and material resources for manual labeling. Different training samples can be used depending on the specific training task. For example, if the training task is to use a neural network model to detect faces in images, the training sample is an image, and the labeled sample also includes a label indicating whether there is a face in the image. For another example, if the training task is to use a decision tree model to predict user purchase intentions, the training sample is user data, and the labeled sample also includes the user's purchase intention label.

[0084] Based on the above Figure 3 , 4 In the training sample distribution scenario shown in and 5, a semi-supervised horizontal federated learning optimization method is proposed in an embodiment of the present invention.

[0085] Specifically, in horizontal federated learning, the server and the client cooperate with each other to perform multiple global model updates on the model to be trained, and finally obtain a target model that meets the quality requirements. Model update refers to updating the model parameters of the model to be trained. For example, when the model to be trained is a neural network model, the model parameters are the connection weights between neurons. After multiple global model updates, the final model parameters are determined, thereby determining the target model. It should be noted that the process of the server and the client jointly updating the model to be trained is called global model update. The situation in which the client uses labeled samples for training in the global model update is called labeled global model update, and the situation in which the client uses unlabeled samples for training in the global model update is called unlabeled global model update, for the purpose of distinction.

[0086] In an unlabeled global model update, the client receives the global model parameters of this unlabeled global model update from the server. It should be noted that if it is the first global model update, the server can use random model parameters to initialize the server's model to be trained, or use the model parameters set by the developer based on experience to initialize the server's model to be trained. Subsequently, the server can directly send the initialized model parameters of the model to be trained as the global model parameters of this unlabeled global model update, or use different schemes to obtain the global model parameters of this unlabeled global model update according to the different distributions of labeled samples.

[0087] Specifically, when the distribution of labeled samples is Figure 3As shown in , the server can use labeled samples to perform supervised training on the initialized model to be trained. After one or more rounds of iterations, the model parameters of the model to be trained are updated and the updated model parameters are used as the global model parameters for this unlabeled global model update. Figure 4 As shown in , the server can work with the client with labeled samples to perform one or more labeled global model updates, and use the updated model parameters as the global model parameters for this unlabeled global model update. Figure 5 As shown, the server can first use local labeled samples for supervised training, and then work with the client that has labeled samples to perform one or more labeled global model updates, and then use the updated model parameters as the global model parameters for this unlabeled global model update.

[0088] At the beginning of federated learning, the server first performs supervised training on the model to be trained, which provides an initial direction for subsequent self-supervised training on each client and shortens the training time. That is, the model to be trained obtained after supervised training has learned some characteristics of labeled samples, so that the prediction results of the client's self-supervised training process are relatively accurate, thereby shortening the number of updates to the unlabeled global model and reducing training time, while also improving the quality and performance of the trained target model.

[0089] Step S20, performing self-supervised training on the local model to be trained according to the global model parameters and the training samples, and updating the encoder parameters and decoder parameters in the model to be trained to obtain local model parameters;

[0090] After obtaining the global model parameters, the client performs self-supervised training on the local model to be trained based on the global model parameters and training samples, and updates the encoder parameters and decoder parameters in the model to be trained to obtain the local model parameters. The model to be trained may include at least three parts: an encoder, a decoder, and a predictor. The output of the encoder is connected to the input of the decoder and the predictor respectively; the encoder is used to extract the features of the input data, which is equivalent to encoding the input data; the decoder is used to decode the results of the encoder encoding, aiming to restore the input data; the predictor is used to output the prediction results of the model based on the features extracted by the encoder; in the stage of training the model, the encoder parameters, decoder parameters, and predictor parameters need to be updated, and in the stage of using the model, the encoder and predictor are used to complete the prediction task.

[0091] If the training samples include labeled samples, the client can remove the labels from the labeled samples and convert them into unlabeled samples, and treat all training samples as unlabeled samples to perform self-supervised training on the training model.

[0092] The local model parameters are relative to the global model parameters. Each client uses local training samples to update the parameters of the local model to be trained. At the beginning of local training, the model parameters of each client are consistent. After the training, the model parameters of the model to be trained of each client will be different. That is, the local model parameters obtained by each client will be different. This difference comes from the fact that each client has training samples from different users.

[0093] Further, step S20 includes:

[0094] Step S201, after the local model to be trained is updated with the global model parameters, the training sample is input into the model to be trained, and the encoder and decoder in the model to be trained are called in sequence to process the training sample to obtain decoded data;

[0095] Step S202, calculating a self-supervised loss function according to the training sample and the decoded data;

[0096] Step S203: updating the encoder parameters and decoder parameters in the model to be trained according to the self-supervised loss function to obtain local model parameters.

[0097] The client uses the global model parameters to update the local model to be trained. The global model parameters may include encoder parameters, decoder parameters, and predictor parameters. Figure 6 As shown, after updating the model parameters of the local model to be trained, the client inputs the training sample into the model to be trained to obtain the predicted label, and sequentially calls the encoder and decoder in the model to be trained to process the training sample to obtain the decoded data. Specifically, the encoder in the model to be trained extracts the features in the training sample, and the decoder restores the features extracted by the encoder to obtain the decoded data. The client calculates the self-supervised loss function based on the decoded data and the training sample, calculates the gradients corresponding to the encoder parameters and the decoder parameters respectively according to the self-supervised loss function, and updates the encoder parameters and the decoder parameters respectively according to the gradients. After one or more rounds of updates, the client uses the model parameters of the model to be trained that are finally updated as the local model parameters. Among them, the calculation method of the self-supervised loss function can adopt the conventional loss function calculation method, and the difference from the supervised loss function is that the self-supervised loss function mainly represents the error between the training sample and the decoded data.

[0098] It should be noted that the local model parameters may include encoder parameters, predictor parameters, and decoder parameters, among which the predictor parameters are still the predictor parameters in the global model parameters sent by the server, that is, the predictor parameters are not updated during the update of the unlabeled global model. Under ideal conditions, the decoded data restored by the decoder is close to or even identical to the input training samples. The self-supervised loss function represents the error between the decoded data and the training samples. The purpose of self-supervised training is to continuously adjust the decoder parameters and encoder parameters so that the value of the self-supervised loss function continues to decrease, thereby improving the feature extraction accuracy of the encoder and decoder.

[0099] Step S30, sending the local model parameters to the server, so that the server can perform supervised training on the to-be-trained model according to the local model parameters sent by each client, obtain the global model parameters of a new unlabeled global model update and send them to each client;

[0100] The client sends the local model parameters to the server. The server receives the local model parameters sent by each client, performs supervised training based on the local model parameters sent by each client, obtains the global model parameters of the new unlabeled global model update, and sends them to each client.

[0101] Specifically, depending on the distribution of labeled samples, the server may perform different supervised training processes on the training model.

[0102] When the distribution of labeled samples is Figure 3 As shown, the server can first fuse the local model parameters to obtain the fused model parameters; the server uses the fused model parameters to update the server's model to be trained; after the update, the server uses the local labeled samples of the server to perform supervised training on the server's model to be trained, and after one or more rounds of training, the encoder parameters and predictor parameters of the server's model to be trained are updated, and the updated model parameters of the model to be trained are used as the global model parameters for a new unlabeled global model update.

[0103] When the distribution of labeled samples is Figure 4As shown, the server can first fuse the local model parameters to obtain the fused model parameters; send the fused model parameters as the global model parameters of a new labeled global model update to each client with labeled samples; after each client uses the received global model parameters to update the local model to be trained, it uses the local labeled samples to perform supervised training on the model to be trained, updates the encoder parameters and prediction period parameters of the model to be trained, uses the updated model parameters of the model to be trained as the local model parameters, and sends the local model parameters to the server; the server receives the local model parameters sent by each client with labeled samples, fuses them, and uses the fusion results as the global model parameters of a new unlabeled global model update; the server sends the global model parameters of the new unlabeled global model update to each client to enter a new unlabeled global model update.

[0104] When the distribution of labeled samples is Figure 5 As shown, the server can first fuse the parameters of each local model to obtain the fused model parameters; the server uses the fused model parameters to update the server's model to be trained; after the update, the server uses the local labeled samples of the server to supervise the model to be trained on the server, and after one or more rounds of training, the encoder parameters and predictor parameters of the server's model to be trained are updated, and the updated model parameters of the model to be trained are used as the global model parameters of a new labeled global model update, and sent to each client; after each client uses the received global model parameters to update the local model to be trained, it uses the local labeled samples to supervise the model to be trained, updates the encoder parameters and predictor parameters of the model to be trained, and uses the updated model parameters of the model to be trained as the local model parameters, and sends the local model parameters to the server; the server receives the local model parameters sent by each client with labeled samples, fuses them, and uses the fusion results as the global model parameters of a new unlabeled global model update; the server sends the global model parameters of the new unlabeled global model update to each client to enter a new unlabeled global model update.

[0105] After each client uses local unlabeled samples to update the unlabeled model, the server performs supervised training on the model to be trained to adjust the results of the unlabeled model update of each client. This allows labeled samples to provide guidance on model prediction or classification effects throughout the entire federated learning process, thereby avoiding deviations in the results of training using unlabeled samples by the client, shortening the model training time, and improving the performance of the target model obtained through training. The most important thing is to give full play to the role of unlabeled samples while avoiding deviations in model performance.

[0106] Step S40, loop until the preset conditions are met and stop training to obtain the target model.

[0107] The above steps are repeated until the client stops training when it detects that the preset conditions are met, and obtains the target model. The preset conditions can be set in advance as needed, such as detecting that the local model to be trained on the client converges, or detecting that the number of cycles reaches a preset number, or detecting that the training time reaches a preset time, or receiving a stop training instruction sent by the server. The server can also send a global model parameter and a stop training instruction to the client when it detects that the model to be trained on the server converges. After receiving the stop training instruction and the global model parameter, the client uses the global model parameter to update the local model to be trained, and then stops training. The client uses the model to be trained with the final model parameters as the target model, and can use the target model to complete the prediction or classification task later.

[0108] It should be noted that the server can work with clients that have labeled samples to perform multiple labeled global model updates, and then work with each client to perform multiple unlabeled global model updates. That is, it is not necessarily necessary to update the labeled global model at least once and then update the unlabeled global model at least once, and this process is repeated until the training is stopped.

[0109] In this embodiment, the client receives the global model parameters sent by the server, performs self-supervised training on the local model to be trained based on the global model parameter update and the training samples, updates the encoder parameters and decoder parameters of the model to be trained, and obtains the local model parameters, so that the client can also participate in horizontal federated learning when there is no labeled data, giving full play to the role of unlabeled samples and improving the utilization rate of unlabeled samples; the client sends the local model parameters to the server, so that the server can perform supervised training on the model to be trained according to the local model parameters sent by each client, obtain the global model parameters of the new unlabeled global model update and send them to each client; it is realized that by interspersing supervised training in the self-supervised training of the client, a guiding direction is provided for the self-supervised training of the client, and deviations in the self-supervised training results of the client are avoided; the self-supervised training can utilize the features of the labeled samples learned by the supervised training, and the supervised training can utilize the features of a large number of unlabeled samples learned by the self-supervised training, so that when only some clients have a small number of labeled samples, horizontal federated learning can be performed, and a model that meets the performance requirements can be trained, so as to adapt to the real scene of lack of labeled data and save labor costs.

[0110] Furthermore, in medical scenarios, it is necessary to identify the type of heart disease of a patient based on the patient's electrocardiogram, so a recognition model can be trained to identify the electrocardiogram. However, doctors rarely have time to label data, and non-doctors do not know how to label. Therefore, there is a lack of labeled samples, which leads to poor recognition effect of the trained recognition model, and unlabeled data cannot be used. To solve this problem, in this embodiment, the target model can be used to identify the type of heart disease of the patient, and after step S40, it also includes:

[0111] Step S50, inputting the electrocardiogram data of the target patient into the target model, calling the encoder and the predictor in the target model in sequence to process the electrocardiogram data, and obtaining the heart disease type recognition result of the target patient.

[0112] The target model can be used to identify the type of heart disease of the patient. The input of the target model can be the electrocardiogram data of the patient, and the output can be the result of the identification of the type of heart disease of the patient. The client can be the equipment of multiple hospitals, each of which has the electrocardiogram data of multiple patients locally, and the server is a third-party server independent of multiple hospitals. The server and each client train the model to be trained according to the process of federated learning in the above embodiment to obtain the type of heart disease finally used to identify the patient. Each hospital can use the trained target model to identify the type of heart disease of the target patient. Specifically, the client inputs the electrocardiogram data of the target patient into the target model, and sequentially calls the encoder and predictor in the target model to process the electrocardiogram data to obtain the result of the identification of the type of heart disease of the target patient. Since the server and the client use self-supervised training and supervised training in alternating ways during the joint training process, so that in the training process, some clients have a small number of labeled samples or the server has a small number of labeled samples, plus a large number of unlabeled samples, a target model with good recognition effect can be trained, thereby reducing the training cost of the heart disease type recognition model, being more adaptable to the real scene of lack of labeled data, and improving the utilization rate of unlabeled data.

[0113] Furthermore, the target model can also be used to predict the credit risk of the user. The input of the target model can be the characteristic data of the user, and the output can be the risk score of the user. The client can be the equipment of multiple banks, each of which has sample data of multiple users locally, and the server is a third-party server independent of multiple banks. The server and each client train the model to be trained according to the process of federated learning in the above embodiment to obtain the target model finally used for credit risk prediction. Each bank can use the trained target model to predict the credit risk of the target user. Specifically, the client inputs the characteristic data of the target user into the target model, and sequentially calls the encoder and predictor in the target model to process the characteristic data to obtain the risk score of the target user. Since the server and the client use self-supervised training and supervised training in alternating ways during the joint training process, so that in the training process, some clients have a small number of labeled samples or the server has a small number of labeled samples, plus a large number of unlabeled samples, a target model with high risk prediction effect can be trained, thereby reducing the training cost of the credit risk prediction model and being more adaptable to the real scene of lack of labeled data.

[0114] It should be noted that the target model can also be used in application scenarios other than credit risk estimation, such as performance level prediction, paper value evaluation, etc., which is not limited in the embodiments of the present invention.

[0115] Further, based on the above first and second embodiments, a third embodiment of the semi-supervised horizontal federated learning optimization method of the present invention is proposed. In this embodiment, the semi-supervised horizontal federated learning optimization method is applied to a server participating in horizontal federated learning, and the server is connected to the client participating in horizontal federated learning. The local training samples of each client include unlabeled samples. The server and client involved in the embodiment of the present invention can be devices such as smart phones, personal computers and servers. In this embodiment, the semi-supervised horizontal federated learning optimization method includes the following steps:

[0116] Step A10, sending the first global model parameters of this unlabeled global model update to each client, so that each client can perform self-supervised training on its own local model to be trained according to the first global model parameters and the training samples, update the encoder parameters and decoder parameters in its own local model to be trained, obtain the first local model parameters and return them;

[0117] In this embodiment, the server and each client can establish a communication connection in advance through handshake and identity authentication, and determine the model to be trained in this federated learning, such as a neural network model. The server can send the determined model to be trained to each client, so that each client has a model to be trained with the same structure locally, and the server can also have a model to be trained with the same structure locally. Figure 3 , 4 As shown in Figure 5, there are three possible sample situations in real scenes; Figure 3 In the example, each client locally has training samples for training the model to be trained. The training samples are all unlabeled samples, and the server has a small number of labeled samples. Figure 4 In the example, 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 has no training samples; Figure 5 In the training sample, each client's local training samples include unlabeled samples, some clients' training samples include a small number of labeled samples, and the server also has a small number of labeled samples. It should be noted that unlabeled samples and labeled samples are collectively referred to as training samples. An unlabeled sample includes a piece of data, and a labeled sample includes a piece of data and the label corresponding to the data. The number of unlabeled samples can be much larger than the number of labeled samples, in order to save manpower and material resources for manual labeling. Different training samples can be used depending on the specific training task. For example, if the training task is to use a neural network model to detect faces in images, the training sample is an image, and the labeled sample also includes a label indicating whether there is a face in the image. For another example, if the training task is to use a decision tree model to predict user purchase intentions, the training sample is user data, and the labeled sample also includes the user's purchase intention label.

[0118] Based on the above Figure 3 , 4 In the training sample distribution scenario shown in and 5, a semi-supervised horizontal federated learning optimization method is proposed in an embodiment of the present invention.

[0119] Specifically, in horizontal federated learning, the server and the client cooperate with each other to perform multiple global model updates on the model to be trained, and finally obtain a target model that meets the quality requirements. Model update refers to updating the model parameters of the model to be trained. For example, when the model to be trained is a neural network model, the model parameters are the connection weights between neurons. After multiple global model updates, the final model parameters are determined, thereby determining the target model. It should be noted that the process of the server and the client jointly updating the model to be trained is called global model update. The situation in which the client uses labeled samples for training in the global model update is called labeled global model update, and the situation in which the client uses unlabeled samples for training in the global model update is called unlabeled global model update. The concept in the unlabeled global model update is called "first", and the concept involved in the labeled global model update is called "second" to distinguish them.

[0120] In an unlabeled global model update, the client receives the first global model parameters of this unlabeled global model update from the server. It should be noted that if it is the first global model update, the server can use random model parameters to initialize the server's model to be trained, or use the model parameters set by the developer based on experience to initialize the server's model to be trained. Subsequently, the server can directly send the initialized model parameters of the model to be trained as the first global model parameters of this unlabeled global model update, or use different schemes to obtain the first global model parameters of this unlabeled global model update according to the different distributions of labeled samples.

[0121] Specifically, when the distribution of labeled samples is Figure 3 As shown in , the server can use labeled samples to perform supervised training on the initialized model to be trained. After one or more rounds of iterations, the model parameters of the model to be trained are updated and the updated model parameters are used as the first global model parameters of this unlabeled global model update. Figure 4 As shown in , the server can work with the client with labeled samples to perform one or more labeled global model updates, and use the updated model parameters as the first global model parameters for this unlabeled global model update. Figure 5 As shown, the server can first use local labeled samples for supervised training, and then work with the client that has labeled samples to perform one or more labeled global model updates, and then use the updated model parameters as the first global model parameters of this unlabeled global model update.

[0122] At the beginning of federated learning, the server first performs supervised training on the model to be trained, which provides an initial direction for subsequent self-supervised training on each client and shortens the training time. That is, the model to be trained obtained after supervised training has learned some characteristics of labeled samples, so that the prediction results of the client's self-supervised training process are relatively accurate, thereby shortening the number of updates to the unlabeled global model and reducing training time, while also improving the quality and performance of the trained target model.

[0123] After obtaining the first global model parameters, each client performs self-supervised training on the local model to be trained according to the first global model parameters and training samples, and updates the encoder parameters and decoder parameters in the model to be trained to obtain the first local model parameters. The model to be trained may include at least three parts: an encoder, a decoder, and a predictor. The output of the encoder is connected to the input of the decoder and the predictor respectively; the encoder is used to extract the features of the input data, which is equivalent to encoding the input data; the decoder is used to decode the result of the encoder encoding, aiming to restore the input data; the predictor is used to output the prediction results of the model based on the features extracted by the encoder; in the stage of training the model, the encoder parameters, the decoder parameters, and the predictor parameters need to be updated. In the stage of using the model, the encoder and the predictor are used to complete the prediction task.

[0124] If the training samples include labeled samples, the client can remove the labels from the labeled samples and convert them into unlabeled samples, and treat all training samples as unlabeled samples to perform self-supervised training on the training model.

[0125] Specifically, the client first uses the first global model parameters to update the local model to be trained. Among them, the first global model parameters may include encoder parameters, decoder parameters and predictor parameters. After updating the model parameters of the local model to be trained, the client inputs the training sample into the model to be trained to obtain the predicted label, and sequentially calls the encoder and decoder in the model to be trained to process the training sample to obtain the decoded data. Specifically, the encoder in the model to be trained extracts the features in the training sample, and the decoder restores the features extracted by the encoder to obtain the decoded data. The client calculates the self-supervised loss function based on the decoded data and the training sample, calculates the gradients corresponding to the encoder parameters and the decoder parameters respectively according to the self-supervised loss function, and updates the encoder parameters and the decoder parameters respectively according to the gradients. After one or more rounds of updates, the client uses the model parameters of the model to be trained that are finally updated as the first local model parameters. Among them, the calculation method of the self-supervised loss function can adopt the conventional loss function calculation method, and the difference from the supervised loss function is that the self-supervised loss function mainly represents the error between the training sample and the decoded data.

[0126] It should be noted that the first local model parameters may include encoder parameters, predictor parameters and decoder parameters, wherein the predictor parameters are still the predictor parameters in the first global model parameters sent by the server, that is, the predictor parameters are not updated during the update of the unlabeled global model. Under ideal conditions, the decoded data restored by the decoder is close to or even identical to the input training samples. The self-supervised loss function represents the error between the decoded data and the training samples. The purpose of self-supervised training is to continuously adjust the decoder parameters and encoder parameters so that the value of the self-supervised loss function continues to decrease, thereby improving the feature extraction accuracy of the encoder and decoder.

[0127] The local model parameters are relative to the global model parameters. Each client uses local training samples to update the parameters of the local model to be trained. At the beginning of local training, the model parameters of each client are consistent. After the training, the model parameters of the model to be trained of each client will be different. That is, the local model parameters obtained by each client will be different. This difference comes from the fact that each client has training samples from different users.

[0128] Step A20, receiving the first local model parameters returned by each client, and performing supervised training on the to-be-trained model according to the first local model parameters, obtaining the first global model parameters for a new unlabeled global model update and sending them to each client;

[0129] 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 for a new unlabeled global model update, and sends them to each client.

[0130] Specifically, depending on the distribution of labeled samples, the server can perform different supervised training on the training model. Figure 5As shown, the server can first fuse the first local model parameters to obtain the fused model parameters; the server uses the fused model parameters to update the server's model to be trained; after the update, the server uses the local labeled samples of the server to supervise the model to be trained on the server, and after one or more rounds of training, the encoder parameters and predictor parameters of the server's model to be trained are updated, and the updated model parameters of the model to be trained are used as the second global model parameters of the new labeled global model update, and sent to each client; after each client uses the received second global model parameters to update the local model to be trained, the local labeled samples are used to supervise the model to be trained, the encoder parameters and prediction period parameters of the model to be trained are updated, and the model parameters of the updated model to be trained are used as the second local model parameters, and the second local model parameters are sent to the server; the server receives the second local model parameters sent by each client with labeled samples, and fuses them, and uses the fusion result as the first global model parameter of the new unlabeled global model update; the server sends the first global model parameter of the new unlabeled global model update to each client to enter a new unlabeled global model update.

[0131] After each client uses local unlabeled samples to update the unlabeled model, the server performs supervised training on the model to be trained to adjust the results of the unlabeled model update of each client. This allows labeled samples to provide guidance on model prediction or classification effects throughout the entire federated learning process, thereby avoiding deviations in the results of training using unlabeled samples by the client, shortening the model training time, and improving the performance of the target model obtained through training. The most important thing is to give full play to the role of unlabeled samples while avoiding deviations in model performance.

[0132] Step A30, loop until the preset conditions are met and stop training to obtain the target model.

[0133] The above steps are repeated until the server detects that the preset conditions are met and stops training to obtain the target model. The preset conditions can be set in advance as needed, such as detecting that the model to be trained on the server has converged, or detecting that the number of cycles has reached a preset number, or detecting that the training time has reached a preset time. The server can also send a global model parameter to the client and a stop training instruction when it detects that the model to be trained has converged. After receiving the stop training instruction and the global model parameter, the client uses the global model parameter to update the local model to be trained and then stops training. The client uses the model to be trained with the final model parameters as the target model, and can use the target model to complete the prediction or classification task later.

[0134] It should be noted that the server can work with clients that have labeled samples to perform multiple labeled global model updates, and then work with each client to perform multiple unlabeled global model updates. That is, it is not necessarily necessary to update the labeled global model at least once and then update the unlabeled global model at least once, and this process is repeated until the training is stopped.

[0135] In this embodiment, the server sends global model parameters to each client. The client performs self-supervised training on the local model to be trained based on the global model parameter update and training samples, updates the encoder parameters and decoder parameters of the model to be trained, and obtains the local model parameters, so that the client can also participate in horizontal federated learning when there is no labeled data, giving full play to the role of unlabeled samples and improving the utilization rate of unlabeled samples; the server performs supervised training on the model to be trained according to the local model parameters sent by each client, obtains the global model parameters of the new unlabeled global model update and sends them to each client; by interspersing supervised training in the self-supervised training of the client, it is achieved to provide guidance for the self-supervised training of the client, and avoid deviations in the self-supervised training results of the client; the self-supervised training can utilize the features of the labeled samples learned by the supervised training, and the supervised training can utilize the features of a large number of unlabeled samples learned by the self-supervised training, so that when only some clients have a small number of labeled samples, horizontal federated learning can be performed, and a model that meets the performance requirements can be trained, thereby adapting to the real scene of lack of labeled data and saving labor costs.

[0136] Furthermore, when the training samples of some clients include labeled samples, the step A20 includes:

[0137] Step A201, fusing the first local model parameters, and using the fused model parameters obtained by fusion as the second global model parameters for a new labeled global model update;

[0138] Step A202, sending the second global model parameters to each client having a labeled sample, so that each client uses the labeled sample to perform supervised training on its own local model to be trained, updates the encoder parameters and predictor parameters in its own local model to be trained, obtains the second local model parameters and returns them;

[0139] Step A203, receiving the second local model parameters returned by each client, and fusing each of the second local model parameters, and sending the fusion result to each client as the first global model parameter for a new label-free global model update.

[0140] Specifically, when the training samples of some clients include labeled samples, that is, the distribution of labeled samples is as follows: Figure 4As shown, the server can first fuse the first local model parameters to obtain the fused model parameters; send the fused model parameters as the second global model parameters for a new labeled global model update to each client with labeled samples; after each client uses the received second global model parameters to update the local model to be trained, it uses the local labeled samples to perform supervised training on the model to be trained, updates the encoder parameters and prediction period parameters of the model to be trained, uses the updated model parameters of the model to be trained as the second local model parameters, and sends the second local model parameters to the server; the server receives the second local model parameters sent by each client with labeled samples, fuses them, and uses the fusion results as the first global model parameters for a new unlabeled global model update; the server sends the first global model parameters for the new unlabeled global model update to each client to enter a new unlabeled global model update.

[0141] Furthermore, when the server has labeled samples and a model to be trained having the same structure as the model to be trained locally on each client, step A20 includes:

[0142] Step A204, fusing the first local model parameters to obtain fused model parameters;

[0143] Step A205, after updating the server's model to be trained based on the fusion model parameters, the server's model to be trained is supervised trained using the labeled samples, the encoder parameters and predictor parameters in the server's model to be trained are updated, and the first global model parameters of a new global model update are obtained and sent to each client.

[0144] Specifically, when the server has labeled samples, that is, the distribution of labeled samples is as follows Figure 3 As shown, the server can first fuse the parameters of each first local model to obtain the fused model parameters; the server uses the fused model parameters to update the server's model to be trained; after the update, the server uses the local labeled samples of the server to perform supervised training on the server's model to be trained, and after one or more rounds of training, the encoder parameters and predictor parameters of the server's model to be trained are updated, and the updated model parameters of the model to be trained are used as the first global model parameters for a new unlabeled global model update. The server uses the local labeled samples of the server to perform supervised training on the server's model to be trained, and the process of updating the encoder parameters and predictor parameters of the server's model to be trained can be specifically as follows: Figure 7As shown, the server inputs the data of the labeled samples into the server's model to be trained, and sequentially calls the encoder and predictor in the server's model to be trained to process the labeled samples to obtain the predicted labels; the supervised loss function is calculated based on the predicted labels and the true labels corresponding to the labeled samples; the encoder parameters and predictor parameters in the server's model to be trained are updated according to the supervised loss function.

[0145] Furthermore, the process of the server fusing the local model parameters (first local model parameters or second local model parameters) sent by each client may be a weighted average of the local model parameters, and the weight value corresponding to each client may be set in advance according to specific needs. For example, it may be set according to the data volume proportion of the training samples of each client. The larger the data volume proportion, the greater the weight.

[0146] In addition, an embodiment of the present invention also proposes a computer-readable storage medium, on which a semi-supervised horizontal federated learning optimization program is stored. When the semi-supervised horizontal federated learning optimization program is executed by a processor, the steps of the semi-supervised horizontal federated learning optimization method described below are implemented.

[0147] The various embodiments of the semi-supervised horizontal federated learning optimization device and computer-readable storage medium of the present invention can all refer to the various embodiments of the semi-supervised horizontal federated learning optimization method of the present invention, which will not be repeated here.

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

[0149] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0151] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A semi-supervised horizontal federated learning optimization method, characterized in that: Applied to clients participating in horizontal federated learning, each client is a device deployed in multiple hospitals, the local training samples of the client include unlabeled samples, the unlabeled samples include electrocardiogram data, the client is connected to the server participating in horizontal federated learning, and the method includes: Receive the global model parameters for this label-free global model update sent by the server; Performing self-supervisory training on the local model to be trained according to the global model parameters and the electrocardiogram data as the training sample, and updating the encoder parameters and decoder parameters in the model to be trained to obtain local model parameters; The local model parameters are sent to the server, so that the server can perform supervised training on the training model based on the local model parameters sent by each client and the labeled electrocardiogram data in some clients and / or the labeled electrocardiogram data in the server, obtain the global model parameters of a new unlabeled global model update and send them to each client; The training is stopped in a loop until a preset condition is met to obtain a target model, wherein the target model is used to identify the type of heart disease of the patient.

2. The semi-supervised horizontal federated learning optimization method according to claim 1, characterized in that: The step of performing self-supervisory training on the local model to be trained according to the global model parameters and the training samples, and updating the encoder parameters and decoder parameters in the model to be trained to obtain the local model parameters comprises: After the local model to be trained is updated using the global model parameters, the training sample is input into the model to be trained, and the encoder and decoder in the model to be trained are called in sequence to process the training sample to obtain decoded data; Calculating a self-supervised loss function based on the training sample and the decoded data; The encoder parameters and the decoder parameters in the model to be trained are updated according to the self-supervised loss function to obtain local model parameters.

3. The semi-supervised horizontal federated learning optimization method according to any one of claims 1 and 2, characterized in that: The target model is used to identify the type of heart disease of the patient. After the step of looping until the preset condition is met and stopping the training to obtain the target model, the step further includes: The electrocardiogram data of the target patient is input into the target model, and the encoder and the predictor in the target model are called in sequence to process the electrocardiogram data to obtain the heart disease type recognition result of the target patient.

4. A semi-supervised horizontal federated learning optimization method, characterized in that: The method is applied to a server participating in horizontal federated learning, the server is connected to each client participating in horizontal federated learning, each client is a device deployed in multiple hospitals, and the local training samples of each client include unlabeled samples, and the unlabeled samples include electrocardiogram data. The method includes: Sending the first global model parameters of this unlabeled global model update to each client, so that each client can perform self-supervised training on its own local model to be trained according to the first global model parameters and the electrocardiogram data as the training sample, update the encoder parameters and decoder parameters in its own local model to be trained, obtain the first local model parameters and return them; Receive the first local model parameters returned by each client, and perform supervised training on the to-be-trained model based on the first local model parameters and the labeled electrocardiogram data in some clients and / or the labeled electrocardiogram data in the server, obtain the first global model parameters for a new unlabeled global model update, and send them to each client; The training is stopped in a loop until a preset condition is met to obtain a target model, wherein the target model is used to identify the type of heart disease of the patient.

5. The semi-supervised horizontal federated learning optimization method according to claim 4, characterized in that: 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 parameters, obtaining the first global model parameters for a new unlabeled global model update and issuing them to each client includes: The first local model parameters are fused, and the fused model parameters obtained by fusion are used as the second global model parameters for a new labeled global model update; Send the second global model parameters to each client having a labeled sample, so that each client uses the labeled sample to perform supervised training on its own local model to be trained, updates the encoder parameters and predictor parameters in its own local model to be trained, obtains the second local model parameters and returns them; The second local model parameters returned by each client are received, and each of the second local model parameters is fused, and the fusion result is sent to each client as the first global model parameter of a new label-free global model update.

6. The semi-supervised horizontal federated learning optimization method according to claim 4, characterized in that: When the server has labeled samples and a model to be trained with the same structure as the local model to be trained of each client, the step of performing supervised training on the model to be trained according to the first local model parameters, obtaining the first global model parameters for a new unlabeled global model update and sending them to each client includes: fusing the first local model parameters to obtain fused model parameters; After updating the server's model to be trained based on the fusion model parameters, the server's model to be trained is supervised trained using the labeled samples, the encoder parameters and predictor parameters in the server's model to be trained are updated, and the first global model parameters for a new global model update are obtained and sent to each client.

7. The semi-supervised horizontal federated learning optimization method according to claim 6, characterized in that: The step of using the labeled samples to perform supervised training on the server-side model to be trained and updating the encoder parameters and predictor parameters in the server-side model to be trained comprises: Input the labeled sample into the model to be trained on the server, and sequentially call the encoder and the predictor in the model to be trained on the server to process the labeled sample to obtain a predicted label; Calculate a supervised loss function based on the predicted label and the true label corresponding to the labeled sample; The encoder parameters and predictor parameters in the server-side model to be trained are updated according to the supervised loss function.

8. The semi-supervised horizontal federated learning optimization method according to any one of claims 5 to 7, characterized in that: The step of fusing the first local model parameters to obtain fused model parameters includes: A weighted average is performed on the first local model parameters to obtain a fusion model parameter.

9. A semi-supervised horizontal federated learning optimization device, characterized in that: The semi-supervised horizontal federated learning optimization device includes: a memory, a processor, and a semi-supervised horizontal federated learning optimization program stored in the memory and executable on the processor. When the semi-supervised horizontal federated learning optimization program is executed by the processor, the steps of the semi-supervised horizontal federated learning optimization method as described in any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a semi-supervised horizontal federated learning optimization program, which, when executed by a processor, implements the steps of the semi-supervised horizontal federated learning optimization method as described in any one of claims 1 to 8.