A privacy-protected federated learning method and device, electronic equipment and medium

By generating an intersection sample sequence and adding empty samples, the problem of information leakage in federated learning is solved, and sample data alignment is achieved without revealing the intersection sample identifiers, thus improving data security.

CN116432772BActive Publication Date: 2025-12-09TONGDUN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310308064.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2025-12-09
Estimated Expiration
2043-03-27

AI Technical Summary

Technical Problem

During the federated learning process, all participating parties are aware that the identification of overlapping samples can lead to information leakage and reduce data security.

Method used

By obtaining the intersection sample identifiers and location information, an intersection sample sequence is generated, and empty samples are added to it to form an expanded sample sequence. The expanded sample sequence is then used for model training to avoid leakage of intersection sample identifiers.

Benefits of technology

This enables sample data alignment without disclosing the identifiers of the intersection samples, improving data security during federated learning and preventing information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116432772B_ABST
    Figure CN116432772B_ABST
Patent Text Reader

Abstract

The application provides a privacy-protected federated learning method and device, electronic equipment and a computer readable storage medium. Intersection sample identifiers between a first sample sequence of a first participant and a second sample sequence of a second participant are obtained, as well as position information of the second sample corresponding to the intersection sample identifiers in the second sample sequence. The first sample corresponding to the intersection sample identifiers is arranged according to the position information to obtain an intersection sample sequence. An empty sample is added to the intersection sample sequence to obtain an expanded sample sequence. The first model of the first participant is trained based on a first model output result generated by a sample located at a target position in the expanded sample sequence. The sample data between the participants can be aligned in the case of concealing the intersection sample identifiers, so that the federated learning can be completed without informing the second participant of the intersection sample identifiers, thereby improving the information security in the federated learning process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of machine learning, and particularly relates to a privacy protection federated learning method and device, electronic equipment and a computer readable storage medium. BACKGROUND

[0002] With the rapid development of machine learning technology, the application of machine learning gradually penetrates into various fields. Federated learning is a kind of distributed machine learning technology, which allows multiple participants to collaboratively train a model while protecting data privacy.

[0003] In the related art, when federated learning is performed, the intersection of the sample data held by all participants is calculated first, and the intersection sample identifier is sent to each participant. Each participant processes the sample data held by itself according to the intersection sample identifier to generate an aligned sample data set, and all participants perform federated learning according to the aligned sample data set.

[0004] However, since all participants know the intersection sample identifier, they also know the similarity between the samples held by themselves and other participants, which can easily cause information leakage and reduce the data security of each participant in the federated learning process. SUMMARY

[0005] Embodiments of the present application provide a privacy protection federated learning method, device, electronic equipment and computer readable storage medium to solve the problem of reduced data security of each participant in the federated learning process in the related art.

[0006] In a first aspect, the embodiments of the present application provide a privacy protection federated learning method applied to a first participant, and the method comprises:

[0007] obtaining intersection sample identifiers between a first sample sequence of the first participant and a second sample sequence of a second participant, and position information of the second sample corresponding to the intersection sample identifiers in the second sample sequence;

[0008] arranging the first sample corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence;

[0009] adding empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample having the same sample identifier as the first sample in the second sample sequence;

[0010] training the first model of the first participant based on the first model output result generated by the sample at the target position in the extended sample sequence and the second model output result generated by the second sample at the target position in the second sample sequence obtained from the second participant, to obtain a first target model.

[0011] Optionally, the adding of the null sample in the intersection sample sequence to obtain the extended sample sequence comprises:

[0012] determining a complement sample identifier set of the intersection sample identifier in the second sample sequence;

[0013] generating a null sample corresponding to each complement sample identifier in the complement sample identifier set;

[0014] inserting the null sample corresponding to the complement sample identifier into the intersection sample sequence according to the order of the complement sample identifier in the second sample sequence to obtain the extended sample sequence.

[0015] Optionally, the method further comprises:

[0016] obtaining a first sample parameter from the sample at the target position in the extended sample sequence;

[0017] determining the first model output result based on the first sample parameter and a first model parameter of the first model.

[0018] Optionally, the method further comprises:

[0019] synchronizing the target position to the second participant, so that the second participant obtains a second sample parameter from the second sample at the target position in the second sample sequence, determines a second model output result based on the second sample parameter and a second model parameter of the second model, and sends the second model output result to the first participant.

[0020] Optionally, the training the first model of the first participant based on the first model output result generated by the sample at the target position in the extended sample sequence and the second model output result generated by the second sample at the target position in the second sample sequence obtained from the second participant, to obtain a first target model, comprises:

[0021] determining a prediction value based on the first model output result and the second model output result;

[0022] obtaining a sample label from the sample at the target position in the extended sample sequence;

[0023] The model loss value is determined based on the predicted value and the sample label;

[0024] The first model is trained based on the model loss value to obtain the first target model.

[0025] Optionally, the method includes:

[0026] If the sample at the target position in the expanded sample sequence is an empty sample, the model loss value is adjusted to a preset value.

[0027] Optionally, the method further includes:

[0028] Obtain the target public key from the intermediary;

[0029] The model loss value is homomorphically encrypted based on the target public key to obtain the ciphertext loss value;

[0030] The ciphertext loss value is sent to the second participant, enabling the second participant to generate a ciphertext blinding gradient based on the ciphertext loss value, the ciphertext random matrix, and the second model parameters of the second model. The ciphertext blinding gradient is then sent to the intermediary for decryption to obtain the blinding gradient. Based on the original random matrix corresponding to the ciphertext random matrix and the blinding gradient, a plaintext gradient is generated. The second model is then trained based on the plaintext gradient to obtain the second target model. The ciphertext random matrix is ​​obtained by the second participant encrypting the original random matrix using the target public key.

[0031] Secondly, embodiments of this application provide a privacy-preserving federated learning method.

[0032] Applied to a second participant, the method includes:

[0033] The first participant sends the second sample identifiers of each second sample in the second sample sequence of the second participant, along with their corresponding positional order, to the first participant. This allows the first participant to determine the positional information of the second sample corresponding to the intersection sample identifier in the second sample sequence based on the correspondence. The first samples corresponding to the intersection sample identifiers are then arranged according to the positional information to obtain an intersection sample sequence. Empty samples are added to the intersection sample sequence to obtain an expanded sample sequence. The samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identifier as the first sample in the second sample sequence.

[0034] The second model of the second participant is trained based on a second model output result generated based on a second sample located at a target position in the second sample sequence and a first model output result generated by the first participant based on a sample located at the target position in the augmented sample sequence, to obtain a second target model.

[0035] Optionally, the training of the second model of the second participant based on the second model output result generated based on the second sample located at the target position in the second sample sequence and the first model output result generated by the first participant based on the sample located at the target position in the augmented sample sequence, to obtain the second target model, comprises:

[0036] obtaining a target public key from the intermediate party;

[0037] obtaining, from the first participant, a ciphertext loss value homomorphically encrypted based on the target public key on a model loss value; wherein the model loss value is determined based on a prediction value determined by the first participant based on the first model output result and the second model output result, and a sample label obtained from the sample located at the target position in the augmented sample sequence;

[0038] generating a ciphertext blinding gradient according to the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model; wherein the ciphertext random matrix is obtained by the second participant by encrypting an original random matrix based on the target public key;

[0039] sending the ciphertext blinding gradient to the intermediate party for decryption processing to obtain a blinding gradient;

[0040] generating a plaintext gradient based on the original random matrix corresponding to the ciphertext random matrix and the blinding gradient, and training the second model based on the plaintext gradient to obtain a second target model.

[0041] In a third aspect, an embodiment of the present application provides a privacy-protected federated learning device, applied to a first participant, and the device comprises:

[0042] an obtaining module, configured to obtain an intersection sample identifier between a first sample sequence of a first participant and a second sample sequence of a second participant, and position information of a second sample corresponding to the intersection sample identifier in the second sample sequence;

[0043] an intersection sample sequence module, configured to arrange the first sample corresponding to the intersection sample identifier according to the position information to obtain an intersection sample sequence;

[0044] The expansion sample sequence module is configured to add empty samples to the intersection sample sequence to obtain an expansion sample sequence; wherein the samples in the expansion sample sequence have one-to-one correspondence with the second samples in the second sample sequence, and the position of a first sample in the expansion sample sequence is the same as the position of a second sample having the same sample identifier in the second sample sequence.

[0045] The model training module is configured to train the first model of the first participant based on a first model output result generated by a sample at a target position in the expansion sample sequence and a second model output result generated by a second sample at the target position in the second sample sequence and obtained from the second participant, to obtain a first target model.

[0046] Optionally, the expansion sample sequence module comprises:

[0047] The complement sample identifier set sub-module is configured to determine a complement sample identifier set of the intersection sample identifier in the second sample sequence.

[0048] The empty sample sub-module is configured to generate an empty sample corresponding to each complement sample identifier in the complement sample identifier set.

[0049] The expansion sample sequence sub-module is configured to insert the empty sample corresponding to the complement sample identifier into the intersection sample sequence according to the order of the complement sample identifier in the second sample sequence to obtain the expansion sample sequence.

[0050] Optionally, the apparatus further comprises:

[0051] The first sample parameter module is configured to obtain a first sample parameter from a sample at a target position in the expansion sample sequence.

[0052] The first model output result module is configured to determine the first model output result based on the first sample parameter and a first model parameter of the first model.

[0053] Optionally, the apparatus further comprises:

[0054] The target position synchronization module is configured to synchronize the target position to the second participant, so that the second participant obtains a second sample parameter from a second sample at the target position in the second sample sequence, determines a second model output result based on the second sample parameter and a second model parameter of the second model, and sends the second model output result to the first participant.

[0055] Optionally, the model training module comprises:

[0056] a prediction value submodule configured to determine a prediction value based on the first model output result and the second model output result;

[0057] a sample label submodule configured to obtain a sample label from a sample at a target position in the augmented sample sequence;

[0058] a model loss value submodule configured to determine a model loss value based on the prediction value and the sample label;

[0059] a model training submodule configured to train the first model based on the model loss value to obtain a first target model.

[0060] Optionally, the apparatus further includes:

[0061] a loss value adjustment module configured to, in a case where the sample at the target position in the augmented sample sequence is a null sample, adjust the model loss value to a preset value.

[0062] Optionally, the apparatus further includes:

[0063] a public key obtaining module configured to obtain a target public key from an intermediate party;

[0064] an encryption module configured to homomorphically encrypt the model loss value based on the target public key to obtain a ciphertext loss value;

[0065] a ciphertext loss value sending module configured to send the ciphertext loss value to the second participant, so that the second participant generates a ciphertext blinded gradient based on the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model, sends the ciphertext blinded gradient to the intermediate party for decryption processing to obtain a blinded gradient, generates a plaintext gradient based on an original random matrix corresponding to the ciphertext random matrix and the blinded gradient, trains the second model based on the plaintext gradient to obtain a second target model; wherein the ciphertext random matrix is obtained by the second participant by encrypting an original random matrix based on the target public key.

[0066] In a fourth aspect, an embodiment of the present application provides a privacy-protected federated learning apparatus applied to a second participant, and the apparatus includes:

[0067] The identity sending module is configured to send, to the first participant, a correspondence relationship between second sample identities of each second sample in the second sample sequence of the second participant and positions, so that the first participant determines position information of a second sample corresponding to the intersection sample identity in the second sample sequence according to the correspondence relationship, arranges first samples corresponding to the intersection sample identity according to the position information, obtains an intersection sample sequence, and adds empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence relationship with the second samples in the second sample sequence, and a position of a first sample in the expanded sample sequence is the same as a position of a second sample having the same sample identity as the first sample in the second sample sequence.

[0068] The training module is configured to train the second model of the second participant based on a second model output result generated by a second sample located at a target position in the second sample sequence and a first model output result generated by a sample located at the target position in the expanded sample sequence according to the first participant, to obtain a second target model.

[0069] Optionally, the training module comprises:

[0070] The public key submodule is configured to obtain a target public key from the intermediate party.

[0071] The encryption submodule is configured to obtain, from the first participant, a ciphertext loss value obtained by homomorphically encrypting a model loss value based on the target public key; wherein the model loss value is determined based on a prediction value determined by the first participant according to the first model output result and the second model output result and a sample label obtained from a sample at a target position in the expanded sample sequence.

[0072] The ciphertext obfuscated gradient generation submodule is configured to generate a ciphertext obfuscated gradient according to the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model.

[0073] The ciphertext obfuscated gradient decryption submodule is configured to send the ciphertext obfuscated gradient to the intermediate party for decryption processing to obtain an obfuscated gradient.

[0074] The training submodule is configured to generate a plaintext gradient based on an original random matrix corresponding to the ciphertext random matrix and the obfuscated gradient, and train the second model based on the plaintext gradient to obtain a second target model.

[0075] In a fifth aspect, the embodiments of the present application further provide an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the privacy-preserving federated learning method.

[0076] In a sixth aspect, the embodiments of the present application further provide a computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the privacy-preserving federated learning method.

[0077] In the embodiments of the present application, the following steps are included: obtaining intersection sample identifiers between a first sample sequence of a first participant and a second sample sequence of a second participant, and position information of the second sample corresponding to the intersection sample identifiers in the second sample sequence; arranging the first sample corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence; adding empty samples in the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence; and training the first model of the first participant based on the first model output result generated by the sample at the target position in the expanded sample sequence and the second model output result generated by the second sample at the target position in the second sample sequence obtained from the second participant to obtain a first target model. In the federated learning process of the present application, the sample data between the participants can be aligned without revealing the intersection sample identifiers, so that the federated learning can be completed without informing the second participant of the intersection sample identifiers, thereby avoiding the information leakage of the first participant and improving the data security in the federated learning process.

[0078] The above description is only a summary of the technical solutions of the present application. In order to enable the technical means of the present application to be more clearly understood, and to be implemented according to the content of the description, and in order to enable the above and other purposes, features and advantages of the present application to be more apparent and easy to understand, the following detailed description of the specific embodiments of the present application is provided. BRIEF DESCRIPTION OF DRAWINGS

[0079] Various other advantages and benefits will become apparent to those of ordinary skill in the art, upon reading the following detailed description of the preferred embodiments. The accompanying drawings are intended to further aid the full and complete understanding of the preferred embodiments. Throughout the drawings, like reference numerals are used to designate like parts throughout the specification and claims. In the drawings:

[0080] Figure 1 is a step flow chart of a privacy-preserving federated learning method provided by the embodiments of the present application;

[0081] Figure 2 is a step flow chart of another privacy-protected federated learning method provided by an embodiment of the present application;

[0082] Figure 3 is a step flow chart of still another privacy-protected federated learning method provided by an embodiment of the present application;

[0083] Figure 4 is a step flow chart of yet another privacy-protected federated learning method provided by an embodiment of the present application;

[0084] Figure 5 is a structure diagram of a privacy-protected federated learning device provided by an embodiment of the present application;

[0085] Figure 6 is a structure diagram of another privacy-protected federated learning device provided by an embodiment of the present application;

[0086] Figure 7 is a structure diagram of a federated learning system provided by an embodiment of the present application;

[0087] Figure 8 is a logic block diagram of an electronic device according to an embodiment of the present application;

[0088] Figure 9 is a logic block diagram of an electronic device according to another embodiment of the present application. DETAILED DESCRIPTION

[0089] Exemplary embodiments of the present application will be described in greater detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it is understood that the present application can be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thoroughly and completely understood, and will fully convey the scope of the application to those skilled in the art.

[0090] Figure 1 is a step flow chart of a privacy-protected federated learning method provided by an embodiment of the present application, as shown in Figure 1 the method comprises:

[0091] Step 101, obtaining intersection sample identifiers between a first sample sequence of a first participant and a second sample sequence of a second participant, and position information of the second sample corresponding to the intersection sample identifiers in the second sample sequence.

[0092] In an embodiment of the present application, the first participant is a guider (GUSET), and the second participant is a host (HOST). The first participant holds the first sample sequence, and the second participant holds the second sample sequence.

[0093] In the embodiments of the present application, the first participant can obtain the intersection sample identifiers between the first sample sequence of the first participant and the second sample sequence of the second participant through private set intersection (PSI). The private set intersection (PSI) is a method for calculating the intersection of two sets while protecting privacy. The private set intersection method that can be used includes but is not limited to hash method, encryption protocol method (such as Oblivious Transfer), and the like, which are not limited in the embodiments of the present application.

[0094] For example, the first sample sequence held by the first participant is shown in Table 1 as follows:

[0095]

[0096]

[0097] Table 1

[0098] The second sample sequence held by the second participant is shown in Table 2 as follows:

[0099] Sample identification Sample parameter (salary) Sample parameter (performance) 1 6000 3000 2 7000 2000 11 8000 3000 4 6000 4000 12 9000 2000 6 5000 2000 13 6000 4000 10 7000 3000

[0100] Table 2

[0101] After the private set intersection is performed on the above first sample sequence and second sample sequence, it can be determined that the intersection sample identifiers include 1, 2, 4, 6, and 10.

[0102] In the embodiments of the present application, the position information of the intersection sample identifiers in the second sample sequence can also be determined. Specifically, the first participant can determine the correspondence between the second sample identifiers of each second sample and the position order in the second sample sequence of the second participant, and then determine the position information of each intersection sample identifier in the second sample sequence according to the correspondence. The position information is used to represent the order of the second sample corresponding to the intersection sample identifier in the second sample sequence.

[0103] For example, the position information of the intersection sample identifiers in the second sample sequence in the above example can be shown in Table 3 as follows:

[0104] Intersection sample identification Location information 1 1 2 2 4 4 6 6 10 8

[0105] Table 3

[0106] In step 102, the first sample corresponding to the intersection sample identifier is arranged according to the position information, and an intersection sample sequence is obtained.

[0107] In the embodiments of the present application, after the intersection sample identifiers are obtained, the first samples corresponding to the intersection sample identifiers can be obtained from the first sample sequence, and the intersection sample sequence can be generated by using the first samples, thereby completing the alignment operation of the first sample sequence and the second sample sequence.

[0108] For example, based on the intersection sample identifiers shown in Table 3, the corresponding first samples are extracted from the first sample sequence shown in Table 1, and the intersection sample sequence shown in Table 4 can be obtained.

[0109] Intersection sample identification Label Sample parameter (age) Sample parameter (gender) 1 0 32 0 2 0 29 1 4 1 45 1 6 1 45 0 10 1 26 1

[0110] Table 4

[0111] In step 103, an empty sample is added to the intersection sample sequence to obtain an extended sample sequence. The samples in the extended sample sequence have a one-to-one correspondence with the second samples in the second sample sequence. The position of the first sample in the extended sample sequence is the same as the position of the second sample having the same sample identifier in the second sample sequence.

[0112] In the embodiments of the present application, the intersection sample sequence can be completed to have the same number of samples as the second sample sequence by adding empty samples to the intersection sample sequence to obtain an extended sample sequence. The samples in the extended sample sequence have a one-to-one correspondence with the second samples in the second sample sequence. In the process of adding the empty samples, the position of the first sample in the extended sample sequence is kept the same as the position of the second sample having the same sample identifier in the second sample sequence. The data contents in the empty samples can be NULL or 0, which is not limited in the embodiments of the present application.

[0113] For example, after the empty samples are added to the intersection sample sequence shown in Table 4, the extended sample sequence shown in Table 5 can be obtained.

[0114] Sample identification Label Sample parameter (age) Sample parameter (gender) 1 0 32 0 2 0 29 1 0 0 0 0 4 1 45 1 0 0 0 0 6 1 45 0 0 0 0 0 10 1 26 1

[0115] Table 5

[0116] As shown in Table 5, the sample with sample identifier 0 is a null sample, the number of samples contained in the expanded sample sequence is the same as the number of samples contained in the second sample sequence shown in Table 2, and is 8, and the position of each first sample (sample with a sample identifier other than 0) in the expanded sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence (for example, the first sample with sample identifier 6 is located at position 6 in the expanded sample sequence, and the second sample with sample identifier 6 is also located at position 6 in the second sample sequence).

[0117] In the embodiments of the present application, in order to improve the data security of the federated learning process, the intersection sample identifier is not disclosed to the second participant, and only the first participant knows the intersection sample identifier. In this case, in order to perform the subsequent federated learning process, the intersection sample sequence can be expanded by adding null samples to the intersection sample sequence to obtain an expanded sample sequence, so that the position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence, and the order in the respective sequence remains the same. Therefore, in the subsequent federated learning process, even if the intersection sample identifier is not disclosed to the second participant, the first participant and the second participant can still use the intersection samples to train the model by using a fixed sample training order. Moreover, since the samples expanded by the first participant are null samples, and these null samples are not aligned in the sequence, in the subsequent training process, this part of data will not contribute to the model loss value, so the federated learning process is still performed on the aligned samples, which can ensure the correctness of the results.

[0118] In step 104, the first model of the first participant is trained based on the first model output result generated by the sample at the target position in the expanded sample sequence and the second model output result generated by the second sample at the target position in the second sample sequence obtained from the second participant, to obtain a first target model.

[0119] After obtaining the expanded sample sequence, the first participant and the second participant can start training their respective models. The first participant can train the first model of the first participant based on the first model output result generated by the sample at the target position in the expanded sample sequence and the second model output result generated by the second sample at the target position in the second sample sequence obtained from the second participant, to obtain a first target model.

[0120] Specifically, the first participant can obtain the first model output result corresponding to each sample in the augmented sample sequence through the first model owned by the first participant, and obtain the second model output result corresponding to each sample in the second sample sequence from the second participant (the second model output result is determined by the second participant through the second model owned by the second participant and the second sample in the second sample sequence). It should be noted that the first participant can determine the first model output result corresponding to each sample in the augmented sample sequence in a certain order, and the second participant can send the second model output result corresponding to each sample in the second sample sequence to the first participant in the same order. In this way, the first participant can determine the first model output result and the second model output result corresponding to the same target position in the sequence, and then use the first model output result and the second model output result corresponding to the same target position as the data required for one training to train the first model.

[0121] For example, if the first participant determines the first model output result corresponding to each sample in the augmented sample sequence according to the arrangement order of the samples, and the second participant also sends the second model output result corresponding to each sample in the second sample sequence to the first participant according to the arrangement order of the samples. In the case of the target position being 2 (2 samples in the sequence), the first model is trained once with the second model output result received by the first participant and the second model output result generated by the first participant. In this way, after traversing all positions in the sequence, the training of the first model is completed, and the first target model is obtained.

[0122] In summary, the privacy protection federated learning method provided in the embodiments of the present application includes: obtaining intersection sample identifiers between a first sample sequence of a first participant and a second sample sequence of a second participant, and position information of a second sample corresponding to the intersection sample identifiers in the second sample sequence; arranging the first samples corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence; adding empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence; and training the first model of the first participant based on a first model output result generated by a sample at a target position in the expanded sample sequence and a second model output result generated by a second sample at the target position in the second sample sequence obtained from the second participant to obtain a first target model. In the federated learning process of the present application, the sample data between the participants can be aligned without revealing the intersection sample identifiers, so that the federated learning can be completed without informing the second participant of the intersection sample identifiers, thereby avoiding information leakage of the first participant and improving the data security in the federated learning process.

[0123] Figure 2 is a step flowchart of another privacy protection federated learning method provided in the embodiments of the present application, as shown in Figure 2 the method includes:

[0124] Step 201: obtaining intersection sample identifiers between a first sample sequence of a first participant and a second sample sequence of a second participant, and position information of a second sample corresponding to the intersection sample identifiers in the second sample sequence.

[0125] This step can be referred to step 101, and the embodiments of the present application will not be described again.

[0126] Step 202: arranging the first samples corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence.

[0127] This step can be referred to step 101, and the embodiments of the present application will not be described again.

[0128] Step 203: adding empty samples to the intersection sample sequence to obtain an expanded sample sequence.

[0129] Optionally, in the embodiments of the present application, the intersection sample sequence can be expanded to obtain the expanded sample sequence through the following sub-steps 2031 to 2033.

[0130] Sub-step 2031, determining a complement sample identifier set of the intersection sample identifier in the second sample sequence.

[0131] The intersection is the common part of two or more sets. The intersection sample identifier refers to the identifier of the sample appearing in both the first sample sequence and the second sample sequence. For example, assuming there are two sample sequences A and B. The first sample sequence A has sample identifier 1 and sample identifier 2, and the second sample sequence B has sample identifier 1, sample identifier 2 and sample identifier 3. Then the intersection sample identifier includes sample identifier 1 and sample identifier 2. The complement is the set of all elements not contained in another set, so the complement sample identifier set refers to the set of identifiers of all samples not contained in the intersection sample identifier in the second sample sequence. Continuing the previous example, if the intersection sample identifier includes sample identifier 1 and sample identifier 2, then the complement sample identifier set of the intersection sample identifier in the second sample sequence B contains sample identifier 3.

[0132] For example, if the intersection sample identifier is all the sample identifiers in Table 3 above, and the second sample sequence is the sequence shown in Table 2 above, then the complement sample identifier set of the intersection sample identifier in the second sample sequence contains sample identifiers 11, 12 and 13.

[0133] Sub-step 2032, generating an empty sample corresponding to each complement sample identifier in the complement sample identifier set.

[0134] In order to make the empty sample not affect the subsequent actual training process, in the embodiment of the present application, at least the sample parameters in the empty sample can be set to NULL or 0 value.

[0135] For example, using the sample format shown in Table 1 above, an empty sample can be as shown in Table 6 below:

[0136] Sample identification Label Sample parameter (age) Sample parameter (gender) 11 0 0 0

[0137] Table 6

[0138] Sub-step 2033, inserting the empty sample corresponding to the complement sample identifier into the intersection sample sequence according to the order of the complement sample identifier in the second sample sequence, to obtain the expanded sample sequence.

[0139] In the embodiment of the present application, the first participant can obtain the order information of the complement sample identifier in the second sample sequence from the second participant, and insert the empty sample corresponding to the complement sample identifier into the intersection sample sequence according to the order information, to obtain the expanded sample sequence, so that the order of the empty sample corresponding to each complement sample identifier in the expanded sample sequence is the same as the order of the complement sample identifier in the second sample sequence.

[0140] In step 204, a first sample parameter is obtained from a sample at the target position in the extended sample sequence; and a first model output result is determined based on the first sample parameter and a first model parameter of the first model.

[0141] In the embodiments of the present application, the first model output result can be determined based on the first model parameter of the first model and the first sample parameter of the sample in the extended sample sequence.

[0142] Specifically, the first sample parameter can be obtained from the sample at the target position in the extended sample sequence. For example, in the extended sample sequence shown in Table 5, the first sample parameter, i.e., the age parameter 32 and the gender parameter 0, can be obtained from the sample at the second position. In the embodiments of the present application, the first model output result can be calculated by multiplying the first sample parameter and the first model parameter, or can be determined by other methods, which are not limited in the embodiments of the present application.

[0143] It should be noted that the target position can be selected in sequence or randomly from the sequence until all positions in the sequence are traversed.

[0144] In step 205, the target position is synchronized to the second participant.

[0145] In the embodiments of the present application, the first participant can also obtain the second model output result corresponding to the second sample at the target position in the second sample sequence from the second participant by sending the target position to the second participant. Specifically, the target position can be synchronized to the second participant, so that the second participant obtains the second sample parameter from the second sample at the target position in the second sample sequence, and determines the second model output result based on the second sample parameter and a second model parameter of a second model of the second participant, and sends the second model output result to the first participant.

[0146] In step 206, a prediction value is determined based on the first model output result and the second model output result.

[0147] After obtaining a group of first model output results and second model output results corresponding to a target position, a corresponding prediction value can be calculated, wherein the prediction value can be calculated by formula 1.

[0148] h = sigmoid(u + v) formula 1

[0149] wherein, h represents the predicted value, sigmoid is an activation function, u represents the first model output result, and v represents the second model output result. It should be noted that the skilled person can also select other activation functions according to actual needs, for example, a linear activation function (Rectified Linear Unit, ReLU), a hyperbolic tangent function (Hyperbolic Tangent, Tanh), and the like, and the embodiments of the present application are not specifically limited.

[0150] In step 207, a sample label is obtained from the sample at the target position in the augmented sample sequence; and a model loss value is determined based on the predicted value and the sample label.

[0151] The sample label can also be obtained from the sample at the target position in the augmented sample sequence, and the model loss value can be determined based on the sample label and the predicted value corresponding to the target position. For example, in the augmented sample sequence shown in Table 5, the sample label corresponding to the 4th position is 1.

[0152] Specifically, the model loss value can be calculated using formula 2:

[0153] Δy = label - h formula 2

[0154] wherein, Δy represents the model loss value, label represents the label value of the sample label corresponding to the target position, and h represents the predicted value corresponding to the target position. It should be noted that formula 2 above indicates that the model loss value can be determined based on the difference between the sample label and the predicted value, and the difference can be calculated by various loss functions, such as mean squared error (Mean Squared Error, MSE), cross entropy (Cross Entropy, CE), mean absolute error (Mean Absolute Error, MAE), and hinge loss (Hinge Loss, HL), and the like, and the present application is not specifically limited.

[0155] Optionally, in the case where the sample at the target position in the augmented sample sequence is a null sample, the model loss value is adjusted to a preset value.

[0156] In some cases, even if the sample at the target position is a null sample, the corresponding model loss value can still be calculated, which can affect the model training effect. Therefore, in the embodiments of the present application, the model loss value can also be adjusted to a preset value in the case where the sample at the target position in the augmented sample sequence is a null sample, so as to further reduce the influence of the null sample in the augmented sample sequence on the model training accuracy and improve the model training effect.

[0157] Specifically, the preset value can include any value that does not affect the subsequent model training process, such as a 0 value, a null value, and the like, and embodiments of the present application are not limited specifically.

[0158] In step 208, the first model is trained based on the model loss value to obtain a first target model.

[0159] The first model can be iterated once through a model loss value, and the first model can be iterated multiple times through the calculation of the model loss value corresponding to each target position, until all positions in the expanded sample sequence are traversed, that is, the training of the first model is completed, and the first target model is obtained.

[0160] In step 209, the target public key is obtained from the intermediate party, and the model loss value is homomorphically encrypted based on the target public key to obtain a ciphertext loss value.

[0161] In order to enable the second participant to train the second model based on the above-mentioned model loss value, and not to expose the real model loss value to the second model, the model loss value can be first encrypted through the target public key to obtain the ciphertext loss value. The first participant can obtain the target public key from the intermediate party, the intermediate party can generate a target public key and a target private key pair, and send the target public key to the first participant and the second participant, and keep the private key.

[0162] Specifically, the first participant can homomorphically encrypt the model loss value through the target public key to obtain the ciphertext loss value. The homomorphic encryption is an encryption method that allows specific calculations to be performed on encrypted data without decrypting the data. The operation on the encrypted data is still encrypted data.

[0163] In step 210, the ciphertext loss value is sent to the second participant.

[0164] In embodiments of the present application, the first participant can send the ciphertext loss value to the second participant, so that the second participant generates a ciphertext blinding gradient based on the ciphertext loss value, second model parameters of the second model, and a ciphertext random matrix, sends the ciphertext blinding gradient to the intermediate party for decryption processing to obtain a blinding gradient, generates a plaintext gradient based on the original random matrix corresponding to the ciphertext random matrix and the blinding gradient, and trains the second model based on the plaintext gradient to obtain a second target model.

[0165] The first participant can send the ciphertext loss value to the second participant to ensure the security of the loss value in the transmission process. After receiving the ciphertext loss value, the second participant can calculate the ciphertext blinding gradient based on the ciphertext loss value. Specifically, the ciphertext blinding gradient can be calculated using formula 3:

[0166] [grad_B+R] = [Ay] * X_B + [R] Formula 3

[0167] Wherein, [grad_B+R] represents the ciphertext blind gradient, [Ay] represents the ciphertext loss value, X_B represents the sample parameter value of the second sample located at the target position corresponding to the ciphertext loss value [Ay] in the second sample sequence, and [R] represents the ciphertext random matrix obtained by homomorphic encryption of a random matrix by the target public key.

[0168] The ciphertext blind gradient can be sent to the intermediate party by the second participant, and the ciphertext blind gradient is decrypted by the intermediate party using the private key corresponding to the target public key to obtain the blind gradient, and then the blind gradient is sent to the second participant by the intermediate party. Since the ciphertext blind gradient is not only encrypted by the target public key, but also blinded by the random matrix, it is equivalent to double encryption, so that after the intermediate party decrypts the ciphertext blind gradient, the blind gradient obtained is still in the blind state, ensuring the security of the real gradient during the transmission of the blind gradient.

[0169] After receiving the blind gradient, the second participant subtracts the blind gradient from the above random matrix to obtain the plaintext gradient, and then trains the second model through the plaintext gradient to obtain the second target model.

[0170] In summary, another privacy protection federated learning method provided by the embodiments of the present application includes: obtaining the intersection sample identifier between the first sample sequence of the first participant and the second sample sequence of the second participant, and the position information of the second sample corresponding to the intersection sample identifier in the second sample sequence; arranging the first sample corresponding to the intersection sample identifier according to the position information to obtain the intersection sample sequence; adding empty samples to the intersection sample sequence to obtain the expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence; based on the first model output result generated by the sample located at the target position in the expanded sample sequence and the second model output result generated by the second sample located at the target position in the second sample sequence obtained from the second participant, the first model of the first participant is trained to obtain the first target model. In the federated learning process of the present application, the sample data between the participants can be aligned without revealing the intersection sample identifier, so that the federated learning can be completed without informing the second participant of the intersection sample identifier, avoiding the leakage of information of the first participant and improving the information security in the federated learning process.

[0171] Figure 3is a step flowchart of still another privacy-protected federated learning method provided by the application, applied to a second participant, such as Figure 3 As shown in the figure, the method comprises:

[0172] Step 301: sending, to a first participant, a correspondence between second sample identifiers of respective second samples in a second sample sequence of the second participant and position orders.

[0173] So that the first participant determines, according to the correspondence, position information of a second sample corresponding to an intersection sample identifier in the second sample sequence, arranges first samples corresponding to the intersection sample identifiers according to the position information, obtains an intersection sample sequence, and adds empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and a position of a first sample in the expanded sample sequence is the same as a position of a second sample having the same sample identifier as the first sample in the second sample sequence.

[0174] Step 302: training a second model of the second participant based on a second model output result generated by a second sample located at a target position in the second sample sequence and a first model output result generated by a sample located at the target position in the expanded sample sequence by the first participant, to obtain a second target model.

[0175] Optionally, step 302 can comprise:

[0176] Sub-step 3021: obtaining a target public key from an intermediate party.

[0177] Sub-step 3022: obtaining, from the first participant, a ciphertext loss value obtained by homomorphically encrypting a model loss value based on the target public key; wherein the model loss value is determined based on a prediction value determined by the first participant according to the first model output result and the second model output result and a sample label obtained from a sample at the target position in the expanded sample sequence.

[0178] Sub-step 3023: generating a ciphertext blinded gradient according to the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model; wherein the ciphertext random matrix is obtained by encrypting an original random matrix by the second participant through the target public key.

[0179] Sub-step 3024: sending the ciphertext blinded gradient to the intermediate party for decryption processing to obtain a blinded gradient.

[0180] In substep 3025, a plaintext gradient is generated based on the original random matrix corresponding to the ciphertext random matrix and the blinded gradient, and the second model is trained based on the plaintext gradient to obtain a second target model.

[0181] In summary, another privacy protection federated learning method provided by the embodiments of the present application includes: sending, to the first participant, a correspondence between second sample identifiers of each second sample in a second sample sequence of the second participant and position orders, so that the first participant determines position information of the second sample corresponding to the intersection sample identifier in the second sample sequence according to the correspondence, arranges the first sample corresponding to the intersection sample identifier according to the position information, obtains an intersection sample sequence, and adds empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence; and the second model of the second participant is trained based on a second model output result generated by the second sample located at a target position in the second sample sequence and a first model output result generated by the sample located at the target position in the expanded sample sequence of the first participant to obtain a second target model. In the federated learning process of the present application, the sample data between the participants can be aligned without revealing the intersection sample identifiers, so that the federated learning can be completed without informing the second participant of the intersection sample identifiers, avoiding information leakage of the first participant and improving the data security in the federated learning process.

[0182] Figure 4 is a step flowchart of another privacy protection federated learning method provided by the embodiments of the present application, applied to the second participant, applied to a federated learning system including a first participant, a second participant and an intermediate party, as shown in Figure 4 The method includes the following steps.

[0183] In step 401, the first participant obtains intersection sample identifiers between a first sample sequence of the first participant and a second sample sequence of the second participant.

[0184] In step 402, the second participant sends, to the first participant, a correspondence between second sample identifiers of each second sample in the second sample sequence of the second participant and position orders.

[0185] In step 403, the first participant arranges the first sample corresponding to the intersection sample identifier according to the position information to obtain an intersection sample sequence.

[0186] In step 404, the first participant adds empty samples to the intersection sample sequence to obtain an expanded sample sequence.

[0187] At step 405, the first participant trains the first model of the first participant based on the first model output result generated by the sample at the target position in the extended sample sequence and the second model output result generated by the second sample at the target position in the second sample sequence obtained from the second participant, to obtain a first target model.

[0188] At step 406, the intermediate party generates the target public key and a target private key corresponding to the target public key, and sends the target public key to the first participant and the second participant.

[0189] At step 407, the first participant homomorphically encrypts the model loss value based on the target public key to obtain a ciphertext loss value.

[0190] At step 408, the first participant sends the ciphertext loss value to the second participant.

[0191] At step 409, the second participant generates a ciphertext blinded gradient according to the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model; wherein the ciphertext random matrix is obtained by the second participant by encrypting an original random matrix based on the target public key.

[0192] At step 410, the second participant sends the ciphertext blinded gradient to the intermediate party for decryption processing to obtain a blinded gradient.

[0193] At step 411, the intermediate party receives the ciphertext blinded gradient sent by the second participant, and decrypts the ciphertext blinded gradient using the target private key, and sends the decrypted blinded gradient to the second participant.

[0194] At step 412, the second participant generates a plaintext gradient based on the original random matrix corresponding to the ciphertext random matrix and the blinded gradient, and trains the second model based on the plaintext gradient to obtain a second target model.

[0195] In summary, in the federated learning process of the present application, the sample data between the participants can be aligned without revealing the intersection sample identifier, so that the federated learning can be completed without informing the second participant of the intersection sample identifier, thereby avoiding information leakage of the first participant and improving the information security in the federated learning process.

[0196] Corresponding to the method provided by the above-mentioned privacy protection federated learning method embodiment of the present application, see Figure 5The application also provides a privacy-protected federated learning device structure diagram, which is applied to a first participant and includes the following modules.

[0197] The acquisition module 501 is configured to acquire intersection sample identifiers between a first sample sequence of the first participant and a second sample sequence of a second participant, and position information of corresponding second samples of the intersection sample identifiers in the second sample sequence.

[0198] The intersection sample sequence module 502 is configured to arrange the first samples corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence.

[0199] The expanded sample sequence module 503 is configured to add empty samples to the intersection sample sequence to obtain an expanded sample sequence. The samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence. The position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence.

[0200] The model training module 504 is configured to train a first model of the first participant based on a first model output result generated by a sample at a target position in the expanded sample sequence and a second model output result generated by a second sample at the target position in the second sample sequence obtained from the second participant, to obtain a first target model.

[0201] Optionally, the expanded sample sequence module includes the following modules.

[0202] The complement sample identifier set sub-module is configured to determine a complement sample identifier set of the intersection sample identifiers in the second sample sequence.

[0203] The empty sample sub-module is configured to generate an empty sample corresponding to each complement sample identifier in the complement sample identifier set.

[0204] The expanded sample sequence sub-module is configured to insert the empty sample corresponding to the complement sample identifier into the intersection sample sequence according to the order of the complement sample identifier in the second sample sequence to obtain the expanded sample sequence.

[0205] Optionally, the device further includes the following modules.

[0206] The first sample parameter module is configured to acquire a first sample parameter from the sample at the target position in the expanded sample sequence.

[0207] The first model output result module is configured to determine the first model output result based on the first sample parameter and a first model parameter of the first model.

[0208] Optionally, the apparatus further comprises:

[0209] a target position synchronization module, configured to synchronize the target position to the second participant, so that the second participant obtains a second sample parameter from a second sample at the target position in the second sample sequence, determines a second model output result based on the second sample parameter and a second model parameter of the second model, and sends the second model output result to the first participant.

[0210] Optionally, the model training module comprises:

[0211] a predicted value sub-module, configured to determine a predicted value based on the first model output result and the second model output result;

[0212] a sample label sub-module, configured to obtain a sample label from a sample at the target position in the augmented sample sequence;

[0213] a model loss value sub-module, configured to determine a model loss value based on the predicted value and the sample label;

[0214] a model training sub-module, configured to train the first model based on the model loss value to obtain a first target model.

[0215] Optionally, the apparatus further comprises:

[0216] a loss value adjustment module, configured to adjust the model loss value to a preset value in a case where the sample at the target position in the augmented sample sequence is a null sample.

[0217] Optionally, the apparatus further comprises:

[0218] a public key obtaining module, configured to obtain a target public key from an intermediate party;

[0219] an encryption module, configured to homomorphically encrypt the model loss value based on the target public key to obtain a ciphertext loss value;

[0220] a ciphertext loss value sending module, configured to send the ciphertext loss value to the second participant, so that the second participant generates a ciphertext blinded gradient based on the ciphertext loss value, a ciphertext random matrix and a second model parameter of the second model, sends the ciphertext blinded gradient to the intermediate party for decryption processing to obtain a blinded gradient, generates a plaintext gradient based on an original random matrix corresponding to the ciphertext random matrix and the blinded gradient, and trains the second model based on the plaintext gradient to obtain a second target model.

[0221] In summary, the privacy protection federated learning device provided by the embodiments of the present application comprises: an acquisition module configured to acquire intersection sample identifiers between a first sample sequence of a first participant and a second sample sequence of a second participant, and position information of a second sample corresponding to the intersection sample identifiers in the second sample sequence; an intersection sample sequence module configured to arrange the first samples corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence; an expanded sample sequence module configured to add empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample having the same sample identifier in the second sample sequence; and a model training module configured to train the first model of the first participant based on a first model output result generated by a sample at a target position in the expanded sample sequence and a second model output result generated by a second sample at the target position in the second sample sequence and acquired from the second participant, to obtain a first target model. In the federated learning process of the present application, the sample data between the participants can be aligned without revealing the intersection sample identifiers, so that the federated learning can be completed without informing the second participant of the intersection sample identifiers, thereby avoiding information leakage of the first participant and improving the data security in the federated learning process.

[0222] Corresponding to the method provided by another privacy protection federated learning method embodiment of the present application described above, referring to Figure 6 The present application also provides another privacy protection federated learning device structure diagram, which is applied to a second participant, and the device comprises:

[0223] An identifier sending module 61 is configured to send the correspondence between the second sample identifiers of each second sample in the second sample sequence of the second participant and the position order to the first participant, so that the first participant determines the position information of the second sample corresponding to the intersection sample identifiers in the second sample sequence according to the correspondence, arranges the first samples corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence, and adds empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample having the same sample identifier in the second sample sequence;

[0224] The training module 62 is configured to train the second model of the second participant based on a second model output result generated by the second sample located at a target position in the second sample sequence and a first model output result generated by the first participant according to the sample located at the target position in the extended sample sequence, to obtain a second target model.

[0225] Optionally, the training module comprises:

[0226] The public key submodule is configured to obtain a target public key from the intermediate party.

[0227] The encryption submodule is configured to obtain a ciphertext loss value from the first participant, the ciphertext loss value being homomorphically encrypted based on the target public key, wherein the model loss value is determined based on a prediction value determined by the first participant according to the first model output result and the second model output result and a sample label obtained from the sample located at the target position in the extended sample sequence.

[0228] The ciphertext blinding gradient generation submodule is configured to generate a ciphertext blinding gradient according to the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model.

[0229] The ciphertext blinding gradient decryption submodule is configured to send the ciphertext blinding gradient to the intermediate party for decryption processing to obtain a blinding gradient.

[0230] The training submodule is configured to generate a plaintext gradient based on an original random matrix corresponding to the ciphertext random matrix and the blinding gradient, and train the second model based on the plaintext gradient to obtain a second target model.

[0231] In summary, the privacy protection federated learning device provided by the embodiment of the present application comprises: an identification sending module 61, configured to send, to a first participant, a correspondence relationship between a second sample identification of each second sample in a second sample sequence of a second participant and a position order, so that the first participant determines position information of the second sample corresponding to the intersection sample identification in the second sample sequence according to the correspondence relationship, arranges the first sample corresponding to the intersection sample identification according to the position information, obtains an intersection sample sequence, and adds an empty sample to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence relationship with the second samples in the second sample sequence, and the position of the first sample in the expanded sample sequence is the same as the position of the second sample with the same sample identification in the second sample sequence; and a training module, configured to train the second model of the second participant based on a second model output result generated by the second sample located at a target position in the second sample sequence and a first model output result generated by the sample located at the target position in the expanded sample sequence according to the first participant, to obtain a second target model. In the federated learning process of the present application, the sample data between the participants can be aligned without revealing the intersection sample identification, so that the federated learning can be completed without informing the second participant of the intersection sample identification, the information leakage of the first participant is avoided, and the information security in the federated learning process is improved.

[0232] Corresponding to the method provided by the above-mentioned another privacy protection federated learning method embodiment of the present application, referring to Figure 7 , the present application also provides a federated learning system structure diagram, as Figure 7 shown, the system comprises:

[0233] The first participant 701, the second participant 702 and the intermediate party 703 in the above-mentioned embodiment.

[0234] In summary, the federated learning system provided by the embodiment of the present application can align the sample data between the participants without revealing the intersection sample identification, so that the federated learning can be completed without informing the second participant of the intersection sample identification, the information leakage of the first participant is avoided, and the information security in the federated learning process is improved.

[0235] Figure 8 The logic block diagram of the electronic device 600 of one embodiment of the present application. For example, the electronic device 600 can be a mobile phone, a computer, a digital broadcast terminal, a message transmission device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0236] Referring to Figure 8The electronic device 600 can include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0237] The processing component 602 usually controls overall operations of the electronic device 600, such as operations associated with displaying, making phone calls, data communications, camera operations, and recording operations. The processing component 602 can include one or more processors 620 to execute instructions to complete all or part of steps of the methods described above. In addition, the processing component 602 can include one or more modules to facilitate

[0238] The memory 604 is used to store various types of data to support operations of the electronic device 600. Examples of these data include instructions for any application or method operating on the electronic device 600, contact data, phonebook data, messages, pictures, videos, and the like. The memory 604 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0239] The power component 606 provides power to various components of the electronic device 600. The power component 606 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 600.

[0240] The multimedia component 608 includes a screen to provide an output interface between the electronic device 600 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide and gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0241] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC) to receive an external audio signal when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 also includes a speaker to output audio signals.

[0242] The I / O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0243] The sensor component 614 includes one or more sensors to provide various state assessments for the electronic device 600. For example, the sensor component 614 can detect an open / closed state of the electronic device 600, relative positioning of components, such as a display and a keypad of the electronic device 600, a change in position of the electronic device 600 or a component of the electronic device 600, presence or absence of user contact with the electronic device 600, an orientation or acceleration / deceleration of the electronic device 600, and a temperature change of the electronic device 600. The sensor component 614 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 614 can further include a light sensor, such as a CMOS or CCD image sensor, for use in an imaging application. In some embodiments, the sensor component 614 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0244] Communication component 616 facilitates wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0245] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement a privacy-preserving federated learning method provided in the embodiments of this application.

[0246] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of an electronic device 600 to perform the above-described method. For example, the non-transitory storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0247] Figure 9 This is a logical block diagram of an electronic device 700 according to one embodiment of this application. For example, the electronic device 700 may be provided as a server. (See also...) Figure 9 The electronic device 700 includes a processing component 722, which further includes one or more processors, and memory resources represented by memory 732 for storing instructions, such as application programs, that can be executed by the processing component 722. The application programs stored in memory 732 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 722 is configured to execute instructions to perform a privacy-preserving federated learning method provided in embodiments of this application.

[0248] The electronic device 700 can also include a power supply component 726 configured to perform power management for the electronic device 700, a wired or wireless network interface 750 configured to connect the electronic device 700 to a network, and an input / output (I / O) interface 758. The electronic device 700 can operate based on an operating system stored in the memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0249] The embodiments of the present application further provide a computer program product, comprising a computer program, wherein the computer program is executed by a processor to implement the privacy-preserving federated learning method.

[0250] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.

[0251] It is to be understood that the application is not limited to the precise details of design and construction that have been described and exemplified above and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the claims that follow.

Claims

1. A privacy-preserving federated learning method, characterized in that, The method applied to a first participant comprises: obtaining intersection sample identifiers between a first sample sequence of the first participant and a second sample sequence of a second participant, and position information of corresponding second samples of the intersection sample identifiers in the second sample sequence; arranging the corresponding first samples of the intersection sample identifiers according to the position information to obtain an intersection sample sequence; adding empty samples to the intersection sample sequence to obtain an extended sample sequence; wherein the samples in the extended sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of the first sample in the extended sample sequence is the same as the position of the second sample with the same sample identifier in the second sample sequence; training a first model of the first participant based on a first model output result generated by a sample at a target position in the extended sample sequence and a second model output result generated by a second sample at the target position in the second sample sequence obtained from the second participant to obtain a first target model, comprising: determining a prediction value based on the first model output result and the second model output result; obtaining a sample label from the sample at the target position in the extended sample sequence; determining a model loss value based on the prediction value and the sample label; training the first model based on the model loss value to obtain the first target model; obtaining a target public key from an intermediate party; homomorphically encrypting the model loss value based on the target public key to obtain a ciphertext loss value; sending the ciphertext loss value to the second participant to enable the second participant to generate a ciphertext blinding gradient based on the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model, sending the ciphertext blinding gradient to the intermediate party for decryption processing to obtain a blinding gradient, generating a plaintext gradient based on an original random matrix corresponding to the ciphertext random matrix and the blinding gradient, and training the second model based on the plaintext gradient to obtain a second target model; wherein the ciphertext random matrix is obtained by encrypting the original random matrix by the second participant through the target public key.

2. The method of claim 1, wherein, The method further comprises: determining a set of complement sample identifiers of the intersection sample identifiers in the second sample sequence; generating empty samples corresponding to each complement sample identifier in the set of complement sample identifiers; inserting the empty samples corresponding to the complement sample identifiers into the intersection sample sequence according to the order of the complement sample identifiers in the second sample sequence to obtain the extended sample sequence.

3. The method of claim 1, wherein, The method further comprises: obtaining first sample parameters from the sample at the target position in the extended sample sequence; determining the first model output result based on the first sample parameters and first model parameters of the first model.

4. The method of claim 3, wherein, The method further comprises: synchronize the target position to the second participant, so that the second participant obtains a second sample parameter from a second sample located at the target position in the second sample sequence, determines a second model output result based on the second sample parameter and a second model parameter of the second model, and sends the second model output result to the first participant.

5. The method of claim 1, wherein, The method comprises: In the case that the sample at the target position in the extended sample sequence is a null sample, the model loss value is adjusted to a preset value.

6. A privacy-preserving federated learning method, characterized in that, The method is applied to the second participant, and the method comprises: sending, to the first participant, a correspondence between a second sample identifier of each second sample in a second sample sequence of the second participant and a position order, so that the first participant determines position information of a second sample corresponding to an intersection sample identifier in the second sample sequence according to the correspondence, arranges first samples corresponding to the intersection sample identifiers according to the position information, obtains an intersection sample sequence, and adds a null sample to the intersection sample sequence to obtain an extended sample sequence; wherein the samples in the extended sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and a position of a first sample in the extended sample sequence is the same as a position of a second sample having the same sample identifier as the first sample in the second sample sequence; training a second model of the second participant based on a second model output result generated based on a second sample located at a target position in the second sample sequence and a first model output result generated by the first participant based on a sample located at the target position in the extended sample sequence, to obtain a second target model, comprising: obtaining a target public key from an intermediate party; obtaining, from the first participant, a ciphertext loss value obtained by homomorphic encryption of a model loss value based on the target public key; wherein the model loss value is determined based on a prediction value determined by the first participant based on the first model output result and the second model output result and a sample label obtained from a sample at a target position in the extended sample sequence; generating a ciphertext blinded gradient based on the ciphertext loss value, a ciphertext random matrix and a second model parameter of the second model; wherein the ciphertext random matrix is obtained by encrypting an original random matrix by the second participant through the target public key; sending the ciphertext blinded gradient to the intermediate party for decryption processing to obtain a blinded gradient; generating a plaintext gradient based on the original random matrix corresponding to the ciphertext random matrix and the blinded gradient, and training the second model based on the plaintext gradient to obtain a second target model.

7. A privacy-preserving federated learning apparatus, comprising: The device is applied to the first participant, and the device comprises: an obtaining module configured to obtain intersection sample identifiers between a first sample sequence of the first participant and a second sample sequence of the second participant and position information of second samples corresponding to the intersection sample identifiers in the second sample sequence; an intersection sample sequence module configured to arrange first samples corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence; and an extended sample sequence module configured to add a null sample to the intersection sample sequence to obtain an extended sample sequence. The expansion sample sequence module is configured to add empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of a first sample in the expanded sample sequence is the same as the position of a second sample having the same sample identifier as the first sample in the second sample sequence; The model training module is configured to train the first model of the first participant based on a first model output result generated by a sample at a target position in the expanded sample sequence and a second model output result generated by a second sample at the target position in the second sample sequence obtained from the second participant, to obtain a first target model, including: determining a predicted value based on the first model output result and the second model output result; obtaining a sample label from the sample at the target position in the expanded sample sequence; determining a model loss value based on the predicted value and the sample label; training the first model based on the model loss value to obtain the first target model; obtaining a target public key from the intermediate party; homomorphically encrypting the model loss value based on the target public key to obtain a ciphertext loss value; sending the ciphertext loss value to the second participant, so that the second participant generates a ciphertext obfuscated gradient based on the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model, sends the ciphertext obfuscated gradient to the intermediate party for decryption processing to obtain an obfuscated gradient, generates a plaintext gradient based on an original random matrix corresponding to the ciphertext random matrix and the obfuscated gradient, and trains the second model based on the plaintext gradient to obtain a second target model; wherein the ciphertext random matrix is obtained by encrypting an original random matrix by the second participant through the target public key.

8. A privacy-preserving federated learning apparatus, comprising: The device applied to the second participant includes: The identifier sending module is configured to send, to the first participant, a correspondence between second sample identifiers of each second sample in the second sample sequence of the second participant and position order, so that the first participant determines position information of a second sample corresponding to an intersection sample identifier in the second sample sequence based on the correspondence, arranges first samples corresponding to the intersection sample identifiers according to the position information to obtain an intersection sample sequence, and adds empty samples to the intersection sample sequence to obtain an expanded sample sequence; wherein the samples in the expanded sample sequence have a one-to-one correspondence with the second samples in the second sample sequence, and the position of a first sample in the expanded sample sequence is the same as the position of a second sample having the same sample identifier as the first sample in the second sample sequence. The model training module is configured to train the second model of the second participant based on a second model output result generated by a second sample located at a target position in the second sample sequence and a first model output result generated by the first participant based on a sample located at the target position in the augmented sample sequence, to obtain a second target model, including: Obtaining a target public key from the intermediate party; Obtaining a ciphertext loss value from the first participant, which is homomorphically encrypted by the target public key based on a model loss value determined by the first participant based on a prediction value determined by the first participant based on the first model output result and the second model output result and a sample label obtained from a sample located at a target position in the augmented sample sequence; Generating a ciphertext blinding gradient based on the ciphertext loss value, a ciphertext random matrix and second model parameters of the second model, wherein the ciphertext random matrix is obtained by encrypting an original random matrix by the target public key by the second participant; Sending the ciphertext blinding gradient to the intermediate party for decryption processing to obtain a blinding gradient; Generating a plaintext gradient based on the original random matrix corresponding to the ciphertext random matrix and the blinding gradient, and training the second model based on the plaintext gradient to obtain a second target model.

9. An electronic device, comprising: including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, When the instructions in the computer readable storage medium are executed by the processor of the electronic device, the electronic device can perform the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Safety intersection solving and federated learning model training method and system, equipment and medium

    CN115392480A

  • Federated learning method and system, and computer device and storage medium

    WO2021139467A1