Associative learning method, device, electronic device, and storage medium
Through collaborative learning training methods, the server receives and processes gradient information from each client, determines the client to which the tag samples belong, and sends target gradient information, solving the sample discarding problem caused by the inability to directly transmit data, and improving the accuracy of model training.
Patent Information
- Application Number
- JP2023560084
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-04-09
- Filing Date
- 2022-04-02
- Publication Date
- 2025-05-08
- Estimated Expiration
- 2042-04-02
AI Technical Summary
During the training of machine learning models, data is stored distributed from multiple platforms and cannot be directly transmitted, resulting in sample data of the same tag being discarded on other platforms, affecting the accuracy of model training.
The collaborative learning training method is adopted to receive the gradient information of each client through the server, calculate the target gradient information, and determine the client to which each tag sample belongs, and send the target gradient information to the corresponding client to realize the fusion and update of the gradient information.
It effectively avoids the discarding of samples of the same tag, realizes gradient information fusion and updates of multiple clients, and improves the accuracy of machine learning model training.
Smart Images

Figure 0007673229000004 
Figure 0007673229000005 
Figure 0007673229000006
Abstract
Description
Cross-references to related applications
[0001] This application is filed based on a Chinese patent application bearing application number 202110382357.0 and filing date April 9, 2021, and claims priority to the Chinese patent application, the entire contents of which are incorporated by reference into this application. [Technical field]
[0002] The present application relates to the field of data counting analysis, and in particular to an associative learning method, device, electronic device and storage medium. [Background technology]
[0003] In the process of training a machine learning model, the sample label data can be used to calculate numerical values such as gradient calculation, node splitting gain, etc. In the related technology, the data of a local machine learning algorithm is distributed across multiple platforms, and data transmission between platforms cannot be realized. Therefore, when multiple platforms hold data of any one label, a designated platform holds the sample data of the label, and the sample data of other platforms holding the label is limited to be discarded. Therefore, the discard rate of sample data is high. As a result, when some sample labels are mislabeled, effective correction cannot be achieved using sample data of other platforms holding the same label, which has a certain impact on the accuracy of model training. Summary of the Invention
[0004] The present application aims to solve one of the technical problems in the related art to some extent.
[0005] To that end, a first aspect of the present application provides a method for associative learning and training.
[0006] A second aspect of the present application further provides an associative learning training method.
[0007] A third aspect of the present application provides an associative learning and training device.
[0008] A fourth aspect of the present application further provides an associative learning and training device.
[0009] A fifth aspect of the present application provides an electronic device.
[0010] A sixth aspect of the present application provides a computer-readable storage medium.
[0011] A seventh aspect of the present application is a computer program M provide.
[0012] A first aspect of the present application provides a federated learning training method performed by a server, the method including: receiving gradient information of each client's own labeled sample sent from the client; obtaining target gradient information belonging to the same labeled sample based on the gradient information sent from the client; determining a client to which each labeled sample belongs; and sending the target gradient information corresponding to the labeled sample to the client to which the labeled sample belongs.
[0013] In addition, the associative learning and training method provided by the first aspect of the present application may further have the following additional technical features.
[0014] According to one embodiment of the present application, the step of determining a client to which each of the labeled samples belongs includes the step of: for any one of the labeled samples, querying a mapping relationship between the labeled sample and a client based on first identification information of the any one of the labeled samples, and obtaining a client matching the first identification information of the any one of the labeled samples.
[0015] According to one embodiment of the present application, the federated learning training method further includes a step of receiving first identification information of labeled samples sent from each client end before training begins, and a step of obtaining first identification information belonging to labeled samples of the same client, and establishing a mapping relationship between second identification information of the client and the first identification information.
[0016] According to one embodiment of the present application, the step of obtaining target gradient information belonging to the same-labeled sample based on the gradient information transmitted from each of the clients includes the steps of obtaining weights of clients associated with the same-labeled sample, and obtaining the target gradient information by weighting and averaging the gradient information transmitted from the clients associated with the same-labeled sample based on the weights of associated clients and the number of occurrences of the same-labeled sample.
[0017] According to one embodiment of the present application, the federated learning training method further includes a step of counting the occurrence number of each labeled sample after receiving first identification information of the labeled samples sent from each client end before the start of training.
[0018] According to an embodiment of the present application, the federated learning and training method further includes a step of requiring encryption of data transmission with the client.
[0019] A second aspect of the present application further provides a federated learning training method executed by a client, the method including: sending gradient information of its own labeled samples to a server every time training is completed; receiving target gradient information of each labeled sample belonging to itself sent from the server; updating model parameters of a local learning model based on the target gradient information, and performing next training until training is completed, thereby obtaining a target federated learning model.
[0020] The associative learning and training method provided by the second aspect of the present application may further have the following additional technical features.
[0021] According to an embodiment of the present application, the federated learning training method further includes a step of sending first identification information of its labeled samples to the server before training begins.
[0022] According to an embodiment of the present application, the federated learning training method further includes a step of requiring data transmission with the server to be encrypted.
[0023] A third aspect of the present application provides a federated learning training device, comprising: a first receiving module for receiving gradient information of its own labeled sample transmitted from each client; a calculation module for obtaining target gradient information belonging to the same labeled sample based on the gradient information transmitted from each client; an identification module for determining a client to which each labeled sample belongs; and a first transmitting module for transmitting the target gradient information corresponding to the labeled sample to the client to which the labeled sample belongs.
[0024] The associative learning and training device provided by the third aspect of the present application may further have the following additional technical features.
[0025] According to one embodiment of the present application, the identification module includes a mapping unit for, for any one of the labeled samples, querying a mapping relationship between the labeled sample and a client based on first identification information of the any one of the labeled samples, and obtaining a client matching the first identification information of the any one of the labeled samples.
[0026] According to one embodiment of the present application, the first receiving module further receives first identification information of labeled samples sent from each client end before training begins, obtains first identification information belonging to labeled samples of the same client, and establishes a mapping relationship between the second identification information of the client and the first identification information.
[0027] According to one embodiment of the present application, the calculation module includes: a weight obtaining unit for obtaining weights of clients associated with the same-labeled samples; and a calculation unit for weighting-averaging the gradient information sent from the clients associated with the same-labeled samples based on the weights of the associated clients and the occurrence counts of the same-labeled samples to obtain the target gradient information.
[0028] According to one embodiment of the present application, the federated learning training device further includes a counting module for counting the occurrence number of each labeled sample after receiving first identification information of the labeled samples sent from each client end before the start of training.
[0029] According to an embodiment of the present application, the federated learning and training device further comprises a first encryption module which needs to encrypt data transmission with the client.
[0030] A fourth aspect of the present application further provides an associative learning training device, comprising: a second sending module for sending gradient information of its own labeled sample to a server every time training is completed; a second receiving module for receiving target gradient information of each labeled sample belonging to itself sent from the server; and an update module for updating model parameters of a local learning model based on the target gradient information, performing next training until training is completed, and obtaining a target associative learning model.
[0031] The associative learning and training device provided by the fourth aspect of the present application may further have the following additional technical features.
[0032] According to an embodiment of the present application, the second sending module further sends first identification information of its labeled samples to the server before training begins.
[0033] According to an embodiment of the present application, the federated learning and training device further includes a second encryption module, which needs to encrypt data transmission with the server.
[0034] A fifth aspect of the present application provides an electronic device comprising at least one processor and a memory communicatively connected to the at least one processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor such that the at least one processor can perform the associative learning training method provided by any one of the first and second aspects above.
[0035] A sixth aspect of the present application provides a computer-readable storage medium, the computer instructions causing the computer to perform the associative learning training method provided in any one of the first and second aspects.
[0036] A seventh aspect of the present application is a computer program M The computer program, when executed by a processor, realises the associative learning and training method provided by any one of the first and second aspects above. Effect of the Invention
[0037] In the federated learning training method provided by the present application, the server obtains the gradient information of the labeled samples sent by the clients, calculates it according to the set rules, obtains the target gradient information corresponding to the same labeled sample, and after identifying and determining the client corresponding to the labeled sample, sends the corresponding target gradient information to the client to which the labeled sample belongs. In the present application, the gradient information of the labeled samples of the related multiple clients is all taken as the sample basic data for federated learning training, and the same labeled samples existing in multiple clients are not discarded, and further, the fusion calculation and update of the gradient information of the same labeled samples of multiple clients realizes effective correction of the variation in model training, and thus improves the accuracy of model training.
[0038] It should be understood that the contents described in this application are not intended to identify key or important features of the embodiments of this application, nor are they intended to limit the scope of this application. Other features of this application will become more readily apparent from the description. [Brief description of the drawings]
[0039] The above and / or additional aspects and advantages of the present application will become apparent and will be more easily understood from the following detailed description of the embodiments taken in conjunction with the drawings. [Figure 1] 1 is a flowchart of a method for training associative learning according to an embodiment of the present application. [Diagram 2] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Diagram 3] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Figure 4] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Diagram 5] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Figure 6] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Figure 7] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Figure 8] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Figure 9] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Figure 10] 4 is a flowchart of an associative learning training method in another embodiment of the present application. [Figure 11] 1 is a structural schematic diagram of an associative learning and training device according to an embodiment of the present application; [Figure 12] FIG. 2 is a structural schematic diagram of an associative learning and training device according to another embodiment of the present application; [Figure 13] FIG. 2 is a structural schematic diagram of an associative learning and training device according to another embodiment of the present application; [Figure 14] FIG. 2 is a structural schematic diagram of an associative learning and training device according to another embodiment of the present application; [Figure 15] FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0040] Hereinafter, the embodiments of the present application will be described in detail, and examples of the embodiments are illustrated in the drawings, in which the same or similar reference numerals represent the same or similar elements throughout, or elements having the same or similar functions. The embodiments described below with reference to the drawings are illustrative and are for the purpose of explaining the present application, and should not be understood as limitations on the present application.
[0041] Hereinafter, an associative learning training method, an apparatus, an electronic device, and a storage medium according to embodiments of the present application will be described with reference to the drawings.
[0042] FIG. 1 is a flowchart of a method for associative learning and training according to an embodiment of the present application. The method is executed by a server. As shown in FIG. 1, the method includes steps S101 to S104.
[0043] S101, receive gradient information of the labeled samples sent from each client.
[0044] The federated learning method targets machine learning algorithms where samples are distributed across multiple clients and sample data cannot be transmitted locally; in implementation, the federated learning training can involve multiple clients, with each client having its own local sample data.
[0045] It should be noted that the local sample data of the client may be labeled sample data or unlabeled sample data.
[0046] Sample data of the same object can exist in multiple clients, and the sample data of the same object existing in different clients can be the same or different. For example, assuming that object X has two different kinds of sample data, namely static information and dynamic information, static information samples such as its name and age can exist in client A, and static information samples such as its name and age can exist in client B, and dynamic information such as its online shopping records and search records can exist in client C, and dynamic information such as its online shopping records and search records can exist in client B. It is understood that sample data of the same object can be randomly distributed to different clients.
[0047] In the related art, the process of federated learning training can calculate data such as gradient information, classification gain, etc. of samples through a designated client. In the scene of vertical and / or horizontal federated learning training, when identically labeled samples exist in multiple clients, only the labeled samples of the designated client remain during training, and the identically labeled samples exist in other undesignated clients are all discarded without participating in training, resulting in a high sample discard rate. In addition, the model training effect of the labeled samples of the designated client cannot be corrected by training on the labeled samples of other undesignated clients, resulting in inaccurate model training results.
[0048] In some embodiments of the present application, the client can send gradient information of the acquired labeled samples to the server, and the server can receive the gradient information of the labeled samples sent from each client. Here, the gradient information is used to adjust the federated learning model for the next training. In some embodiments, the gradient information is the first-order gradient g generated when calculating the loss function of the model. i and the quadratic gradient h i Includes.
[0049] S102, based on the gradient information sent from each client, obtain target gradient information belonging to the same labeled sample.
[0050] After obtaining the gradient information of the labeled samples sent from the clients, the server determines the clients associated with the same labeled samples based on the obtained gradient information, and determines one or more gradient information corresponding to the same labeled samples, where the number of gradient information is determined by the number of clients associated with the same labeled samples, and when the number of clients associated with the same labeled samples is greater than 1, the number of gradient information corresponding to the same labeled samples is correspondingly greater than 1, and when the number of clients associated with the same labeled samples is 1, the number of gradient information corresponding to the same labeled samples is 1.
[0051] In an embodiment of the present application, after obtaining one or more gradient information corresponding to the same labeled sample, the server performs a fusion calculation on the obtained multiple gradient information, and obtains target gradient information belonging to the same labeled sample.
[0052] Here, the fusion calculation method may be addition and averaging, weighting processing, or the like.
[0053] For example, for the same labeled sample X, it is set that the clients related to the current federated learning training include clients A to N, in which the same labeled sample X exists in M clients, and each of the M clients transmits gradient information of its local labeled sample X to a server. The server receives multiple gradient information of the same labeled sample X transmitted from the M clients, and performs fusion calculation based on the acquired multiple gradient information to obtain target gradient information corresponding to the same labeled sample X.
[0054] In some embodiments, multiple gradient information of the same labeled sample X sent from M clients can be summed to obtain an average value, or weighted based on weight values corresponding to the M clients associated with the multiple gradient information of the same labeled sample X to obtain target gradient information.
[0055] S103, determine the client to which each labeled sample belongs.
[0056] The client sends the gradient information of the labeled sample to the server, and after the server obtains the target gradient information of the labeled sample, it can identify and determine the client to which the labeled sample belongs from the source that sends the target gradient information.
[0057] In some embodiments, the client to which the labeled sample belongs can be identified based on the network address of the client, and different clients have different network addresses. Before the start of model training, the client can send its network address information and corresponding client information to the server, and the server builds a mapping relationship based on the obtained network address information and corresponding client information. During model training, the server transmits the network address used based on the gradient information of the labeled sample, queries the mapping relationship, and thus determines the client to which each labeled sample belongs.
[0058] In some embodiments, before the start of model training, the client can set its identification information by itself, and the identifier of each client is unique and non-overlapping. During model training, when the client sends the gradient information of the labeled sample, it sends its set identifier to the server at the same time, and the server identifies the client identification information contained in the information sent by the client, queries the mapping relationship based on the obtained identifier, and further determines the client to which the labeled sample belongs.
[0059] S104, sending target gradient information corresponding to the labeled sample to the client to which the labeled sample belongs.
[0060] In an embodiment of the present application, after the server determines the client to which the labeled sample belongs, it can send the target gradient information of the acquired labeled sample to the corresponding client.
[0061] After determining which client each labeled sample belongs to, the server can send target gradient information corresponding to the acquired labeled samples to the corresponding client.
[0062] In the federated learning training method provided by the present application, the server obtains gradient information of the labeled samples sent by the clients, obtains target gradient information corresponding to the same labeled samples, and after identifying the clients corresponding to the labeled samples, sends the corresponding target gradient information to the clients to which the labeled samples belong. In the present application, the gradient information of the labeled samples of the related multiple clients is all taken as the sample basic data for federated learning training, and the same labeled samples existing in multiple clients are not discarded, and further, the gradient information of the same labeled samples of multiple clients is fused and calculated and updated to realize effective correction of the variation in model training, and thus improve the accuracy of model training.
[0063] The determination of the client to which the labeled sample provided in the above embodiment belongs can be further understood in conjunction with FIG. 2, which is a flowchart of a federated learning training method in another embodiment of the present application, in which the method is performed by a server. As shown in FIG. 2, for any one labeled sample, the method includes S201 of querying a mapping relationship between the labeled sample and a client based on the first identification information of the one labeled sample, and obtaining a client that matches the first identification information of the one labeled sample.
[0064] When the client sends a labeled sample to the server, the labeled sample may carry multiple identification information, including information that can uniquely and non-duplicately identify the corresponding labeled sample, which may be referred to as first identification information.
[0065] The first identification information of the labeled sample is in a mapping relationship with the client to which it belongs, and the mapping relationship can be stored in a configuration location on the server before model training begins.
[0066] In an embodiment of the present application, after the server obtains the first identification information of the labeled sample, it uses the first identification information as a query condition to query the mapping relationship stored in a preset location to obtain clients that match the first identification information of the labeled sample.
[0067] Here, the same labeled sample may exist in one or more clients, and the first identification information of the same labeled sample may correspond to one or more clients.
[0068] For example, the first identification information of any one of the labeled samples A is set to N, and in the mapping relationship pre-stored in the server, the clients corresponding to the first identification information N are M, client S, and client Q. After the server obtains the labeled sample A, it can identify the first identification information N carried by it, and use the first identification information N as a query condition to query the mapping relationship pre-stored in the set location, and then determine that the clients to which the labeled sample A belongs are M, client S, and client Q.
[0069] The federated learning training method provided by the present application limits the method of obtaining the client to which the labeled sample belongs, so that the server can accurately obtain the client to which the labeled sample belongs through the first identification information, thereby ensuring the accuracy of subsequent information transmission, and thus ensuring the accuracy of model training.
[0070] The mapping relationship between the first identifier and the client provided by the above embodiment can be further understood in conjunction with FIG. 3, which is a flowchart of a federated learning training method in another embodiment of the present application, in which the method is executed by a server. As shown in FIG. 3, the method includes steps S301 to S302.
[0071] S301, receiving first identification information of labeled samples sent from each client end before the start of training.
[0072] Before model training begins, the client needs to send a first identification information of the local labeled sample to the server. The server can receive the first identification information of the labeled sample sent from the client. The first identification information can characterize the corresponding labeled sample.
[0073] In addition, the setting of the first identification information of the locally labeled samples of all clients involved in the federated learning training follows a unified rule.
[0074] S302, obtaining first identification information belonging to the labeled samples of the same client, and establishing a mapping relationship between the second identification information and the first identification information of the client.
[0075] In an embodiment of the present application, a client can use unique and non-duplicate information among its attribute information as second identification information, and the second identification information can characterize the client, and before the start of model training, the client registers the corresponding second identification information on the server side by itself.
[0076] In addition, the setting of the second identification information of all clients related to the federated learning training follows unified rules.
[0077] After receiving the corresponding first identification information sent by the client, the server establishes a mapping relationship between the labeled sample first identification information and the second identification information of the client based on the first identification information and the corresponding second identification information.
[0078] Here, the first identification information of the labeled sample may correspond to only the second identification information of any one of the clients, or may correspond to the second identification information of multiple clients.
[0079] For example, if the first identification information of a labeled sample is α, and the clients that register with the server that the first identification information of the local labeled sample includes α are β, γ, and θ, the second identification information that can establish a mapping relationship with the first identification information α includes β, γ, and θ.
[0080] As another example, if the first identification information of a labeled sample is N and the only client that registers with the server that the first identification information of the local labeled sample includes N, then the only second identification information that can establish a mapping relationship with the first identification information N is M.
[0081] Based on the above example, the mapping relationship table that the server can construct is shown in Table 1. [Table 1]
[0082] The federated learning training method provided by the present application limits the construction process of the mapping relationship between the client's second identification information and the first identification information of the labeled samples, and ensures the accuracy of the mapping relationship, thereby accurately transmitting subsequent information and thus ensuring the accuracy of model training.
[0083] The acquisition of target gradient information provided by the above embodiment can be further understood in conjunction with FIG. 4, which is a flowchart of an associative learning training method in another embodiment of the present application, in which the method is executed by a server. As shown in FIG. 4, the method includes steps S401 to S402.
[0084] S401, obtain weights of clients associated with the same labeled sample.
[0085] Before the start of model training, the server can pre-set weights of clients associated with the federated learning training, where the weight values can be set based on relevant factors such as the role identities of the affiliated clients in the federated learning training, the attributes of the affiliated clients, and the appearance of outliers in data preprocessing.
[0086] For example, if the availability of labeled samples collected by a client is high, a high weight value can be set for that client, so that the client's local labeled samples are fully utilized during model training.
[0087] As another example, if a client is a user of a target model generated by federated training learning, a high weight value can be set for that client, so that the final generated model will be more suitable for that client.
[0088] As another example, the same weight values can be set for clients involved in federated learning training, so that every labeled sample in each involved client is effectively utilized.
[0089] In the embodiment of the present application, before the start of model training, the user stores the weight values of the clients related to the federated learning training set by the user in the server. During the federated learning training, the server identifies the clients related to the same labeled sample based on the gradient information of the labeled sample sent from the acquired client, and queries the pre-stored weight value settings to obtain the weights of the clients related to the same labeled sample.
[0090] S402, weighting average the gradient information sent from the clients associated with the same labeled sample based on the weights of the associated clients and the occurrence frequency of the same labeled sample to obtain target gradient information.
[0091] In the embodiment of the present application, after obtaining the labeled samples sent by the clients, the server counts the occurrences of the same labeled samples, and performs fusion calculation on all gradient information of the same labeled samples according to the counted occurrences and the obtained weights of the related clients to obtain target gradient information, where the fusion calculation may be weighting and averaging.
[0092] For example, the gradient information of the same labeled sample sent by the client to the server is the first-order gradient g i and the number of occurrences counted is n i and the associated client weight is w i,j Then, the server calculates the corresponding target gradient information g i (j) can be obtained, and the formula is as follows:
number
[0093] As another example, the gradient information for the same labeled sample sent by the client to the server is the quadratic gradient h i and the number of occurrences counted is ni and the associated client weight is w i,j Then, the server calculates the corresponding target gradient information h i (j) can be obtained, and the formula is as follows:
number
[0094] The federated learning training method provided by the present application limits the calculation method of target gradient information of identically labeled samples, and ensures the accuracy of the target gradient information, so that the client's gradient information is accurately updated in each round of training, and thus ensures the accuracy of model training.
[0095] The process of counting the occurrence number of the same labeled sample provided by the above embodiment can be further understood with reference to FIG. 5, which is a flowchart of a federated learning training method of another embodiment of the present application, in which the method is performed by a server. As shown in FIG. 5, the method includes S501, which counts the occurrence number of each labeled sample after receiving first identification information of the labeled sample sent from each client end before the start of training.
[0096] In an embodiment of the present application, the server can obtain the first identification information of the labeled samples sent by the client, and can count the occurrence number of each labeled sample according to the obtained first identification information of the labeled samples, and set a recording format. The server stores the data in the form of a table according to the set recording format.
[0097] For example, the format for recording the number of occurrences of labeled samples is configurable.<ID_i, n_i> Here, ID_i represents the first identification information corresponding to a certain labeled sample, and n_i represents the number of occurrences of the first identification information corresponding to the labeled sample. As shown in FIG. 6, there are currently three clients, Client A, Client B, and Client C, and it can be seen from the situation of the labeled samples present in the three clients that the first identification information ID1 appears twice.<ID_1,2> and the first identification information ID2 appears a total of one time,<ID_2,1> The first identification information ID3 appears a total of three times,<ID_3,3> and the first identification information ID4 appears once in total,<ID_4,1> Based on the recorded number of occurrences of the first identification information, the number of occurrences of the corresponding labeled sample can be determined.
[0098] The associative learning training method provided by the present application indicates a process of counting the occurrence number of labeled samples, and provides an accurate and effective count number for the subsequent calculation of target gradient information, thereby ensuring the accuracy of model training.
[0099] FIG. 7 is a flowchart of a federated learning training method in another embodiment of the present application, in which the method is performed by a server. As shown in FIG. 7, the method includes S701, which requires encrypting data transmission with a client.
[0100] To ensure the security and confidentiality of the model training sample data, data transmission between the server and the client needs to be encrypted.
[0101] In some embodiments, a normal encryption method can be used. Before model training begins, the server can generate a pair of keys including a public key and a private key, and send the public key to each client, and when the client sends related information such as gradient information of labeled samples and first identification information, the client first encrypts the information using the public key and then sends it to the server, and the server uses the private key to decrypt the encrypted information after receiving it, and then calculates the target gradient information.
[0102] This encryption method can ensure confidentiality of data between each client.
[0103] In some embodiments, a homomorphic encryption method may be used. Before starting model training, each client determines a pair of homomorphic encryption public and private keys, and sends the public key to the server. When each client sends related information such as gradient information of labeled samples and first identification information, the client encrypts the information using the public key, and after obtaining the encrypted information, the server performs ciphertext calculation using the public key to obtain encrypted target gradient information, which is then transmitted to each corresponding client. After obtaining the encrypted target gradient information, the client decrypts the information using the private key, and updates the gradient information in the client based on the decrypted target gradient information.
[0104] The encryption method can achieve data confidentiality between the client and the server.
[0105] The federated learning training method provided by this application provides different data encryption methods based on model training, which improves the confidentiality of data transmission during the model training process and ensures data security.
[0106] In order to realize the federated learning training method provided by the above embodiments, the present application further provides a federated learning training method, where Figure 8 is a flowchart of a federated learning training method of another embodiment of the present application, where the execution body of the method is a client, and as shown in Figure 8, the method may include steps S801 to S803.
[0107] S801: After each training session, the gradient information of the labeled samples is sent to the server.
[0108] In the embodiment of the present application, after each training, the client needs to send the gradient information of the locally labeled samples generated during the training to the server.
[0109] Furthermore, after obtaining gradient information corresponding to the local labeled samples sent from the clients, the server identifies the clients to which the identical labeled samples belong, determines weights of the associated clients, counts the occurrences of the identical labeled samples, and further calculates and generates target gradient information corresponding to the identical labeled samples according to the gradient information corresponding to the labeled samples sent from the obtained clients, and returns it to the clients.
[0110] S802, receive target gradient information of each labeled sample belonging to itself sent from the server.
[0111] In an embodiment of the present application, the server sends target gradient information corresponding to the labeled samples to the client, and the client can receive the target gradient information corresponding to its local labeled samples, where each labeled sample has corresponding target gradient information.
[0112] S803, update the model parameters of the local learning model according to the target gradient information, and perform next training until the training is completed to obtain a target association learning model.
[0113] In the embodiment of the present application, the client can obtain the target gradient information corresponding to the labeled samples sent by the server, and complete the update of the model parameters of the local learning model according to the target gradient information. After the update of the model parameters of the local learning model is completed, the next federated learning training is continued until the termination condition of the federated learning training is met, and when the termination condition of the federated learning training is met, further training is stopped, and the federated learning model generated by the current training is the final target federated learning model.
[0114] In some embodiments, the end condition of the associative learning training may be the number of trainings. Before the model training starts, the number of associative learning trainings can be preset, and each time the associative learning training is completed, whether the number of times of the associative learning training has reached the preset number of trainings is identified to determine whether the associative learning training has reached the end condition.
[0115] In some embodiments, the associative learning training termination condition may be the effect of the associative learning model. Before the model training begins, an expected effect parameter of the associative learning model can be set, and each time the associative learning training is completed, whether the effect parameter of the associative learning model output by the current associative learning training reaches the preset effect parameter is identified to determine whether the associative learning training reaches the termination condition.
[0116] In the federated learning training method provided by the present application, the client sends gradient information of labeled samples to the server, receives target gradient information corresponding to the labeled samples returned by the server, and completes the update of the model parameters of its local learning model according to the obtained target gradient information until the training is completed, which is the initial parameter of the next round of training, and further generates a target federated learning model. In the present application, the client sends the labeled sample gradient information to the server, which provides sample data basis for each training round during model training, and ensures that model training is effectively realized.
[0117] FIG. 9 is a flowchart of a federated learning training method in another embodiment of the present application, in which the method is performed by a client. As shown in FIG. 9, the method includes S901, before the start of training, sending first identification information of its own labeled samples to a server.
[0118] In the embodiment of the present application, in order to ensure that the server can accurately identify the client corresponding to the labeled sample, before the start of model training, the client needs to send the first identification information of its local labeled sample to the server, so that the server can pre-establish and complete the mapping relationship between the first identification information and the second identification information of the client.
[0119] The associative learning training method provided by the present application limits the transmission time of the first identification information, so that the first identification information and the second identification information can complete the establishment of a mapping relationship before the start of model training, and ensure the smooth execution of subsequent model training.
[0120] In one implementation, data transmission between the client and the server must be encrypted.
[0121] In order to ensure the data security of the client, the data transmitted between the client and the server must be encrypted. For the specific encryption method, please refer to the above detailed description, and the detailed description will be omitted here.
[0122] The federated learning training method provided by the present application provides different data encryption methods based on model training, thereby improving the confidentiality of data transmission and ensuring data security during the model training process.
[0123] To better understand the associative learning training method provided by the above embodiment, as shown in FIG. 10, FIG. 10 is a flowchart of an associative learning training method of another embodiment of the present application, and the method includes steps S1001 to S1009.
[0124] S1001, before the start of model training, a client transmits first identification information of a locally labeled sample and second identification information of the client.
[0125] S1002: The server counts the number of occurrences of the same labeled sample based on the first identification information, and establishes a mapping relationship between the first identification information and the second identification information.
[0126] S1003, the client obtains gradient information of the locally labeled samples.
[0127] S1004, the client sends gradient information of the labeled samples to the server.
[0128] S1005, the server obtains the weights of the clients associated with the same labeled sample.
[0129] S1006, the server calculates and obtains target gradient information based on the weights of the clients associated with the same labeled sample, the number of occurrences, and the gradient information of the local labeled sample sent by the clients.
[0130] S1007, the server identifies the client to which the labeled sample belongs.
[0131] S1008, the server sends the target gradient information to the client.
[0132] S1009, the client updates the local learning model parameters based on the target gradient information sent from the server, and uses the updated parameters as initial parameters for the next associative learning training, continuing until the training is terminated, to generate a target associative learning model.
[0133] In an embodiment of the present application, before the start of model training, the client sends the first identification information of the labeled sample and the second identification information of the client to the server, and the server builds a mapping relationship between the first identification information and the second identification information based on the acquired first identification information and second identification information, and counts the occurrence number of the same labeled sample based on the first identification information. The client calculates and sends the gradient information of the local labeled sample to the server, and the server obtains the weight of the client related to the same labeled sample based on the gradient information of the labeled sample sent from the acquired client, and further calculates and obtains the target gradient information corresponding to the labeled sample based on the gradient information of the same labeled sample acquired, the weight of the related client, and the occurrence number of the corresponding labeled sample, identifies the belonging client corresponding to the labeled sample, and sends the target gradient information to the corresponding client. The client realizes an update to the parameters of the local learning model based on the target gradient information sent from the acquired server, and uses the updated model parameters as the initial parameters of the next federated learning training, and continues until the training is completed to generate a target federated learning model.
[0134] All information transmitted between the server and the client is encrypted.
[0135] In this application, the gradient information of the labeled samples of multiple related clients is all used as the sample base data for federated learning training, and the same labeled samples existing in multiple clients are not discarded, and the gradient information of the same labeled samples of multiple clients is fused and updated to effectively correct the variation in model training, and thus improve the accuracy of model training. Furthermore, the information transmission process between the server and the client is encrypted to ensure the confidentiality of data.
[0136] Corresponding to the associative learning and training method provided by some of the above examples, one embodiment of the present application further provides a associative learning and training device, and since the associative learning and training device provided by the embodiments of the present application corresponds to the associative learning and training method provided by some of the above examples, the embodiments of the above associative learning and training method are also applied to the associative learning and training device provided by the embodiments of the present application, so detailed explanations are omitted in the following embodiments.
[0137] In order to realize the federated learning training method provided by the above embodiment, the present application provides a federated learning training apparatus, and FIG. 11 is a structural schematic diagram of the federated learning training apparatus of one embodiment of the present application, where the apparatus is disposed in a server. As shown in FIG. 11, the federated learning training apparatus 100 includes a first receiving module 11, a calculation module 12, an identification module 13, and a first sending module 14, where the first receiving module 11 receives gradient information of its own labeled samples sent by each client, the calculation module 12 obtains target gradient information belonging to the same labeled sample based on the gradient information sent by each client, the identification module 13 determines the client to which each labeled sample belongs, and the first sending module 14 sends the target gradient information corresponding to the labeled sample to the client to which the labeled sample belongs.
[0138] In the federated learning training device provided by the present application, the server obtains the gradient information of the labeled samples sent by the clients, calculates according to the set rules, obtains the target gradient information corresponding to the same labeled sample, identifies and determines the client corresponding to the labeled sample, and then sends the corresponding target gradient information to the client to which the labeled sample belongs. In the present application, the gradient information of the labeled samples of the related multiple clients is all taken as the sample basic data for federated learning training, and the same labeled samples existing in multiple clients are not discarded, and further, the gradient information of the same labeled samples of multiple clients is fused and calculated and updated to realize effective correction of the variation in model training, and thus improve the accuracy of model training.
[0139] Figure 12 is a structural schematic diagram of a federated learning and training device of another embodiment of the present application, where the device is disposed in a server. As shown in Figure 12, the federated learning and training device 200 includes a first receiving module 21, a calculation module 22, an identification module 23, a first transmitting module 24, a counting module 25, and a first encryption module 26.
[0140] It should be noted that the first receiving module 11, the calculation module 12, the identification module 13, and the first transmitting module 14 have the same structures and functions as the first receiving module 21, the calculation module 22, the identification module 23, and the first transmitting module 24.
[0141] In an embodiment of the present application, the identification module 23 includes a mapping unit 231 for querying, for any one of the labeled samples, a mapping relationship between the labeled sample and a client based on the first identification information of the one of the labeled samples, and obtaining a client matching the first identification information of the one of the labeled samples.
[0142] In an embodiment of the present application, the first receiving module 21 further receives first identification information of the labeled samples sent from each client end before the start of training, obtains the first identification information belonging to the labeled samples of the same client, and establishes a mapping relationship between the second identification information of the client and the first identification information.
[0143] In an embodiment of the present application, the calculation module 22 includes: a weight obtaining unit 221 for obtaining weights of clients associated with the same-labeled samples; and a calculation unit 222 for obtaining target gradient information by weighting-averaging the gradient information sent from the clients associated with the same-labeled samples based on the weights of the associated clients and the occurrence counts of the same-labeled samples.
[0144] In an embodiment of the present application, the federated learning training device 200 further includes a counting module 25, in which the counting module 25 counts the occurrence number of each labeled sample after receiving first identification information of the labeled samples sent from each client end before the start of training.
[0145] In the embodiment of the present application, the federated learning and training device 200 further comprises a first encryption module 26, where the first encryption module 26 needs to encrypt data transmission with the client.
[0146] In the federated learning training device provided by the present application, the server establishes a mapping relationship between the first identification information sent by the client and the second identification information of the client, and counts the occurrence frequency of the corresponding labeled sample. Based on the gradient information of the local labeled sample sent by the client, the server obtains the weight of the client associated with the labeled sample, and further, based on the gradient information of the labeled sample, the occurrence frequency, and the client weight, the server calculates and obtains the corresponding target gradient information and sends it to the affiliated client corresponding to the identified labeled sample. In the present application, the gradient information of the labeled samples of the associated multiple clients is all taken as the sample basic data for federated learning training, and the same labeled samples existing in multiple clients are not discarded, and further, the gradient information of the same labeled samples of the multiple clients is fused and calculated and updated to realize effective correction of the variance of the model training, and thus improve the accuracy of the model training. Furthermore, the transmission of encrypted information between the server and the client realizes data confidentiality.
[0147] In order to realize the federated learning training method provided by the above embodiments, the present application further provides a federated learning training device, and FIG. 13 is a structural schematic diagram of a federated learning training device of another embodiment of the present application, where the device is disposed in a client. As shown in FIG. 13, the federated learning training device 300 includes a second sending module 31, a second receiving module 32, and an updating module 33, where the second sending module 31 sends gradient information of its own labeled samples to the server every time training is completed, the second receiving module 32 receives target gradient information of each labeled sample belonging to itself sent from the server, and the updating module 33 updates the model parameters of the local learning model based on the target gradient information, and performs the next training until the training is completed to obtain the target associative learning model.
[0148] The associative learning training device provided by the present application is such that the client sends the gradient information of labeled samples to the server, and receives the target gradient information returned by the server, and completes the update of the model parameters of the local learning model according to the obtained target gradient information until the training is completed, and uses it as the initial parameters for the next training, thereby generating a target associative learning model. In the present application, the client sends the labeled sample gradient information to the server, which provides the sample data basis for each training of the model, and ensures the effective realization of the model training.
[0149] Figure 14 is a structural schematic diagram of a federated learning and training device of another embodiment of the present application, where the device is located in a client. As shown in Figure 14, the federated learning and training device 400 includes a second transmitting module 41, a second receiving module 42, an updating module 43, and a second encryption module 44.
[0150] The second transmitting module 31, the second receiving module 32, and the update module 33, and the second transmitting module 41, the second receiving module 42, and the update module 43 have the same structures and functions.
[0151] In an embodiment of the present application, the second sending module 41 further sends the first identification information of its labeled samples to the server before the start of training.
[0152] In the embodiment of the present application, the associative learning and training device 400 further comprises a second encryption module 44, where the second encryption module 44 needs to encrypt data transmission with the server.
[0153] In the federated learning training device provided by the present application, before the start of model training, the client sends the first identification information of the labeled sample and the second identification information of the client to the server, and after the start of model training, the client calculates and sends the gradient information of the local labeled sample to the server. Furthermore, based on the target gradient information corresponding to the label sample calculated and returned by the server obtained, the update of the local learning model parameters is completed, and the updated parameters are used as the initial parameters of the next round of training, and the training is continued until the end to generate a target federated learning model. In the present application, the gradient information of the labeled samples of the related multiple clients is all used as the sample basic data of the federated learning training, and the same labeled samples existing in multiple clients are not discarded, and the fusion calculation and update of the gradient information of the same labeled samples of multiple clients realizes effective correction of the variation of the model training, and thus improves the accuracy of the model training. Furthermore, based on the encrypted information transmission between the server and the client, data confidentiality is realized.
[0154] In order to achieve the above embodiment, the present application relates to an electronic device and Computer-readable storage medium Body More to offer. According to an embodiment of the present disclosure, the present disclosure further provides a computer program, which, when executed by a processor, realizes the federated learning method provided by the present disclosure.
[0155] 15 is an exemplary block diagram of an example electronic device 1500 that can be used to practice embodiments of the present application. The electronic device is intended to represent various types of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device can also represent various types of mobile devices, such as personal digital assistants, mobile phones, smartphones, wearable devices, and other similar computing devices. The components illustrated herein, their connections and relationships, and their functions are merely examples and are not intended to limit the description herein and / or the implementation of the present application as claimed.
[0156] As shown in FIG. 15, the device 1500 includes a memory 151, a processor 152, and a computer program stored in the memory 151 and executable in the processor 152, which, when executing the program instructions, realizes the associative learning training method provided by the above embodiment.
[0157] The electronic device provided by the embodiment of the present application executes the computer program stored in the memory 151 through the processor 152, and before the start of model training, the client sends the first identification information of the labeled sample and the second identification information of the client to the server. The server establishes a mapping relationship between the first identification information and the second identification information of the client sent from the client, and counts the occurrence number of the corresponding labeled sample. The client calculates the gradient information of the local labeled sample and sends it to the server. The server obtains the weight of the client related to the labeled sample based on the gradient information of the local labeled sample sent from the client, and further, the server calculates and obtains the corresponding target gradient information based on the gradient information of the labeled sample, the occurrence number, and the client weight, and sends it to the affiliated client corresponding to the identified labeled sample, and the client completes the update of the local learning model parameters based on the obtained target gradient information, and continues until the training is completed, thereby generating a target association learning model. In this application, the gradient information of the labeled samples of multiple related clients is all used as the sample base data for federated learning training, and the same labeled samples existing in multiple clients are not discarded, and the gradient information of the same labeled samples of multiple clients is fused and updated to effectively correct the variation in model training, and thus improve the accuracy of model training. Furthermore, the confidentiality of data is realized based on the encrypted information transmission between the server and the client.
[0158] A computer-readable storage medium is provided according to an embodiment of the present application, which stores a computer program, and when the program is executed by the processor 152, realizes the associative learning training method provided according to the above embodiment.
[0159] A computer-readable storage medium according to an embodiment of the present application stores a computer program and is executed by a processor, and executes the computer program stored in the memory 151 through the processor 152, and before the start of model training, the client sends the first identification information of the labeled sample and the second identification information of the client to the server. The server establishes a mapping relationship between the first identification information and the second identification information of the client sent from the client, and counts the occurrence number of the corresponding labeled sample. The client calculates the gradient information of the local labeled sample and sends it to the server. The server obtains the weight of the client related to the labeled sample based on the gradient information of the local labeled sample sent from the client, and further, the server calculates and obtains the corresponding target gradient information based on the gradient information of the labeled sample, the occurrence number, and the client weight, and sends it to the affiliated client corresponding to the identified labeled sample, and the client completes the update of the local learning model parameters based on the obtained target gradient information, and continues until the training is completed, thereby generating a target association learning model. In this application, the gradient information of the labeled samples of multiple related clients is all used as the sample base data for federated learning training, and the same labeled samples existing in multiple clients are not discarded, and the gradient information of the same labeled samples of multiple clients is fused and updated to effectively correct the variation in model training, and thus improve the accuracy of model training. Furthermore, the confidentiality of data is realized based on the encrypted information transmission between the server and the client.
[0160] Various embodiments of the systems and techniques described herein above may be implemented in digital electronic circuitry systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include being embodied in one or more computer programs that may be executed and / or interpreted in a programmable system having at least one programmable processor, which may be an application specific or general purpose programmable processor, and that may receive data and instructions from and transmit data and instructions to a storage system, at least one input device, and at least one output device.
[0161] The program codes for implementing the methods of the present application can be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, a special purpose computer, or other programmable data processing device such that, when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine, partially on a remote machine, or entirely on a remote machine or server.
[0162] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in combination with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the above contents. More specific examples of machine-readable storage media include one or more line-based electrical connections, portable computer disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above contents.
[0163] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user, and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other types of devices can provide interaction with a user, for example, the feedback provided to the user can be any form of sensing feedback (e.g., visual feedback, auditory feedback, or haptic feedback) and can receive input from the user in any form (including acoustic, speech, or tactile input).
[0164] The systems and techniques described herein may be implemented in a computing system with a back-end component (e.g., a data server), or a computing system with a middleware component (e.g., an application server), or a computing system with a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system with any combination of such back-end, middleware, and front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0165] The computer system may include a client and a server. The client and the server are generally remote from each other and usually interact with each other via a communication network. The relationship between the client and the server is generated by a computer program that runs on a corresponding computer and has a client-server relationship with each other. The service side may be a cloud server, also called a cloud computing server or cloud host, which is a host product in a cloud computing service system and solves the problems of the difficulty of management and weak business scalability that exist in the traditional physical host and VPS service (abbreviated as "Virtual Private Server", or "VPS"). The server may be a server of a distributed system or a server incorporating a blockchain.
[0166] In the present specification, the description of a reference term such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" refers to the inclusion of a specific feature, structure, material, or characteristic described in connection with the embodiment or example in at least one embodiment or example of the present application. In the present specification, an exemplary description of the above term does not necessarily refer to the same embodiment or example. In addition, the specific features, structures, materials, or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples. In addition, if not mutually inconsistent, a person skilled in the art may combine or combine different embodiments or examples described herein and features of different embodiments or examples.
[0167] Additionally, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying a relative importance or number of the indicated technical features. Thus, a feature qualified by "first" or "second" may explicitly or implicitly include at least one of the feature. In the description of this application, unless specifically limited, "plurality" means at least two, e.g., two, three, etc.
[0168] Any process or method description within a flowchart or otherwise described herein can be understood as representing one or more modules, snippets, or portions for implementing executable instruction code of customized logical functions or process steps, and the scope of the preferred embodiments of the present application includes other implementations, which may not follow the order shown or discussed herein, including performing functions essentially simultaneously or in reverse order, depending on the functionality involved, as should be understood by one of ordinary skill in the art.
[0169] The logic and / or steps depicted within the flow charts or otherwise described herein may be considered, for example, as an ordered list of executable instructions for implementing logical functions, and may in particular be implemented within any computer-readable medium and provided to or used in conjunction with an instruction execution system, device or apparatus (e.g., a computer-based system, a system with a processor, or a system that receives and executes instructions from an instruction execution system, device or apparatus). As used herein, a "computer-readable medium" may be any device that can contain, store, communicate, propagate, or transmit a program and provide the program to or be used in conjunction with an instruction execution system, device or apparatus. More specific examples (non-exhaustive list) of computer-readable media include electrical connections having one or more wires (electronic devices), portable computer disk cartridges (magnetic devices), random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), fiber optic devices, and portable compact disk read-only memories (CD-ROMs). The computer readable medium may also be paper or other suitable medium on which the program can be printed, for example optically scanned, compiled and interpreted, or processed in any other suitable manner when necessary, to obtain the program in electronic form, which is then stored in a computer memory.
[0170] Each part of the present application may be realized by hardware, software, firmware, or a combination thereof. In the above embodiment, a plurality of steps or methods may be realized by software or firmware stored in a memory and executed by an appropriate instruction execution system. For example, when realized by hardware, as in the other embodiment, it may be realized by any one or a combination of known techniques in the art, such as a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0171] As can be understood by those skilled in the art, the realization of all or part of the steps included in the above embodiment method can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it includes one or a combination of the steps of the method embodiment.
[0172] In addition, each functional unit in each embodiment of the present application can be integrated into one processing module, and each unit may exist physically alone, or two or more units may be integrated into one module. The integrated module may be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0173] The above mentioned storage medium may be a read-only memory, a magnetic disk, an optical disk, etc. Although the above shows and describes the embodiments of the present application, the above embodiments are merely illustrative and should not be understood as limiting the present application, and those skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present application.
[0174] It should be understood that the above various types of flows can be used to rearrange, add, or remove steps. For example, the steps described in this application can be performed in parallel or in a different order, and are not limited thereto, as long as the desired results of the technical solution disclosed in this application can be achieved.
[0175] The above specific embodiments do not limit the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, partial combinations and substitutions are possible according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A federated learning training method executed by a server, comprising: receiving gradient information of each client's labeled samples; obtaining target gradient information belonging to the same labeled sample based on the gradient information sent from each client; determining to which client each labeled sample belongs; sending target gradient information corresponding to the labeled sample to a client to which the labeled sample belongs; An associative learning and training method including:
2. determining to which client each of the labeled samples belongs, 2. The method for training as claimed in claim 1, further comprising: for any one of the labeled samples, querying a mapping relationship between the labeled sample and a client based on first identification information of the one of the labeled samples, and obtaining a client that matches the first identification information of the one of the labeled samples.
3. receiving first identification information of the labeled samples sent from each client end before the start of training; Obtaining a first identification information belonging to a labeled sample of a same client, and establishing a mapping relationship between a second identification information of the client and the first identification information; 2. The method of claim 1, further comprising:
4. A step of obtaining target gradient information belonging to the same labeled sample based on the gradient information transmitted from each of the clients, obtaining weights of clients associated with the same labeled samples; weighting and averaging the gradient information sent from clients associated with the same-labeled samples based on the weights of the associated clients and the number of occurrences of the same-labeled samples to obtain the target gradient information; 2. The method of claim 1, further comprising:
5. The federated learning training method of claim 1 , further comprising: counting the occurrence number of each labeled sample after receiving first identification information of the labeled sample sent from each client end before the start of training.
6. The federated learning training method as described in claim 1, comprising a step of encrypting data transmission between the server and the client.
7. A client-executed associative learning and training method, comprising: Each time training is completed, the server transmits gradient information of its own labeled sample to the server, so that the server obtains weights of clients related to the same labeled sample, and obtains the target gradient information by weighting and averaging the gradient information transmitted from the clients related to the same labeled sample based on the weights of the related clients and the number of occurrences of the same labeled sample; receiving target gradient information for each labeled sample belonging to said server; updating model parameters of the local learning model according to the target gradient information, and performing next training until the training is completed to obtain a target association learning model; An associative learning and training method including:
8. The method for training as claimed in claim 7 , further comprising the step of transmitting first identification information of the labeled samples of the trainee to the server before the start of training.
9. 8. The method of claim 7, further comprising the step of encrypting data transmission between said server and said client.
10. A first receiving module for receiving gradient information of its own labeled samples sent from each client; A calculation module for obtaining target gradient information belonging to the same labeled sample according to the gradient information sent from each client; an identification module for determining to which client each labeled sample belongs; a first sending module for sending target gradient information corresponding to the labeled samples to a client to which the labeled samples belong; An associative learning and training device comprising:
11. a second transmission module for transmitting gradient information of its own labeled sample to a server every time training is completed, so that the server obtains weights of clients related to the same labeled sample, and weight-averaging the gradient information transmitted from the clients related to the same labeled sample based on the weights of the related clients and the occurrence frequency of the same labeled sample to obtain the target gradient information; A second receiving module for receiving target gradient information of each labeled sample belonging to the second receiving module sent from the server; an update module for updating model parameters of a local learning model according to the target gradient information, and performing next training until the training is completed to obtain a target association learning model; An associative learning and training device comprising:
12. At least one processor; a memory communicatively coupled to the at least one processor; Equipped with An electronic device, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor such that the at least one processor can perform the method of any one of claims 1 to 6 and claims 7 to 9.
13. A non-transitory computer readable storage medium having computer instructions stored thereon, the computer instructions causing a computer to perform the method of any one of claims 1 to 6 and claims 7 to 9.
14. A computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6 and claims 7 to 9.
Citation Information
Patent Citations
Federation learning method and device, computer equipment and medium
CN112257876A
Distributed deep learning system
JP2019144642A
Machine learning system and method, integration server, information processing device, program, and inference model generation method
WO2021059607A1