Vertical federated learning method, device, electronic device and readable storage medium

By initializing the cluster centers of all parties in vertical federated learning and utilizing semi-homomorphic encryption and differential privacy technologies, the problem of insufficient data security in vertical federated learning is solved, secure training without the participation of third-party servers is achieved, and the security and privacy of samples are improved.

CN116384503BActive Publication Date: 2025-09-26BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211734573.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-09-26
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing vertical federated learning methods rely on trusted third-party servers, resulting in low data security and insufficient security of training samples.

Method used

All parties involved in vertical federated learning initialize the cluster centers respectively, obtain the distance between sample cluster centers through K-means clustering, and use semi-homomorphic encryption algorithm to encrypt the distance information for interaction. In combination with differential privacy technology, noise is added to the calculation results to ensure the security of the calculation results and realize vertical federated learning without the participation of third-party servers.

Benefits of technology

Without the involvement of a third-party server, the security of samples during the training process is improved, the privacy and security of data interaction are ensured, and the effective implementation of vertical federated learning is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116384503B_ABST
    Figure CN116384503B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, apparatus, electronic device, and readable storage medium for vertical federated learning. In this method, multiple participants each initialize a cluster center and obtain the distance from a sample to the cluster center through a K-means clustering. The multiple participants use a semi-homomorphic encryption algorithm to encrypt and interact with the distance information, so that the multiple participants calculate the cluster center for the next round of K-means clustering for the other participants based on the ciphertext. When the calculation result is published to another participant, differential privacy technology is used to add noise that satisfies differential privacy to the calculation result to ensure the security of the published calculation result. Through continuous iteration, each participant can obtain the target cluster center for K-means clustering. The present disclosure can realize two-party vertical federated learning K-means training without the participation of a third-party server, and improves the security of samples through semi-homomorphic encryption and differential privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of federated learning, and in particular to a method, apparatus, electronic device, and readable storage medium for vertical federated learning. Background Art

[0002] Federated learning is one of the most popular machine learning technologies. It solves the problem of how to jointly train a global model on virtually "aggregated" data when multiple participants are involved, while protecting the data security of each participant. Federated learning can be further categorized into horizontal federation, vertical federation, and federated migration. In vertical federation, the data sets owned by multiple participants overlap, but the features are complementary. This makes it suitable for scenarios where multiple features serve the same business label. Therefore, vertical federated learning has extremely wide applications.

[0003] Currently, vertical federated learning typically uses a trusted third-party server to collect data from all participants, iterate and update the global model, and then distribute the finalized global model parameters to all participants. This approach to federated learning results in lower security for training samples. Summary of the Invention

[0004] In order to solve the above technical problems, the present disclosure provides a vertical federated learning method, device, electronic device and readable storage medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a vertical federated learning method, including:

[0006] Perform K-means clustering based on the first feature of the sample and the initialized cluster center to obtain a first distance, perform semi-homomorphic encryption on the first distance to obtain a first ciphertext distance, and send the first ciphertext distance to other participants in the vertical federated learning;

[0007] Receive a second ciphertext distance fed back by the other participant; the second ciphertext distance is obtained by the other participant performing semi-homomorphic encryption on the second distance and the first ciphertext distance; the second distance is obtained by the other participant performing K-means clustering based on the second feature of the sample owned by the other participant;

[0008] Determining the category of the sample according to the second ciphertext distance, and sending the category of the sample to the other participants, so that the other participants calculate the cluster center of the next round of K-means clustering based on the category of the sample;

[0009] Receiving first ciphertext indication information sent by the other participant; the first ciphertext indication information is ciphertext information obtained by the other participant performing differential privacy processing on the information of the calculated cluster center;

[0010] The cluster center indicated by the first ciphertext indication information is used as the cluster center and K-means clustering is performed, and iterative training is performed until the iteration requirements are met to obtain the target cluster center corresponding to the K-means clustering.

[0011] In a second aspect, the embodiments of the present disclosure provide a vertical federated learning method, including:

[0012] Receive a first ciphertext distance sent by another participant, where the first ciphertext distance is obtained by the other participant performing K-means clustering based on the first feature of the sample and the first cluster center and performing semi-homomorphic encryption on the first distance calculated by the clustering;

[0013] Performing K-means clustering based on the second feature of the sample and the second cluster center to obtain a second distance, performing semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain a second ciphertext distance, and sending the second ciphertext distance to the other participants, so that the other participants determine the category of the sample based on the second ciphertext distance;

[0014] Receive the category of the sample sent by the other participant, and calculate the cluster center of the other participant for the next round of K-means clustering according to the category of the sample;

[0015] Perform differential privacy processing on the information of the calculated cluster center to obtain first ciphertext indication information, and send the first ciphertext indication information to the other participants, so that the other participants update the cluster center based on the first ciphertext indication information to perform the next round of K-means clustering.

[0016] In a third aspect, an embodiment of the present disclosure provides a vertical federated learning apparatus, including:

[0017] A processing module, configured to perform K-means clustering based on the first feature of the sample and the initialized cluster center to obtain a first distance; perform semi-homomorphic encryption on the first distance to obtain a first ciphertext distance, and send the first ciphertext distance to other participants in the vertical federated learning;

[0018] a receiving module, configured to receive a second ciphertext distance fed back by the other participant; the second ciphertext distance being obtained by the other participant performing semi-homomorphic encryption on the second distance and the first ciphertext distance; the second distance being obtained by the other participant performing K-means clustering based on a second feature of the sample owned by the other participant; and determining a category of the sample based on the second ciphertext distance;

[0019] A sending module, configured to send the category of the sample to the other participants, so that the other participants calculate the cluster center of the next round of K-means clustering based on the category of the sample;

[0020] The receiving module is further configured to receive first ciphertext indication information sent by the other participants; the first ciphertext indication information is ciphertext information obtained by the other participants performing differential privacy processing on the information of the calculated cluster centers;

[0021] The processing module is used to use the cluster center indicated by the first ciphertext indication information as the cluster center and perform K-means clustering, iterative training until the iteration requirements are met, and obtain the target cluster center corresponding to the K-means clustering.

[0022] In a fourth aspect, an embodiment of the present disclosure provides a vertical federated learning device, including:

[0023] A receiving module, configured to receive a first ciphertext distance sent by another participant, where the first ciphertext distance is obtained by the other participant performing K-means clustering based on the first feature of the sample and the first cluster center and performing semi-homomorphic encryption on the first distance calculated by the clustering;

[0024] a processing module, configured to perform K-means clustering based on the second feature and the second cluster center of the sample to obtain a second distance, and perform semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain a second ciphertext distance;

[0025] a sending module, configured to send the second ciphertext distance to the other participants, so that the other participants determine the category of the sample based on the second ciphertext distance;

[0026] The receiving module is further configured to receive the category of the sample sent by the other participant, and calculate the cluster center for the other participant to perform the next round of K-means clustering according to the category of the sample;

[0027] The processing module is further configured to perform differential privacy processing on the calculated cluster center information to obtain first ciphertext indication information;

[0028] The sending module is further used to send the first ciphertext indication information to the other participants, so that the other participants update the cluster center based on the first ciphertext indication information to perform the next round of K-means clustering.

[0029] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising: a memory and a processor; the memory is configured to store computer program instructions;

[0030] The processor is configured to execute the computer program instructions so that the electronic device implements the vertical federated learning method as described in the first aspect or the second aspect.

[0031] In a sixth aspect, an embodiment of the present disclosure provides a readable storage medium, comprising: computer program instructions, which, when executed by at least one processor of an electronic device, enable the electronic device to implement the vertical federated learning method as described in the first aspect or the second aspect.

[0032] In a seventh aspect, an embodiment of the present disclosure provides a computer program product. When a computer executes the computer program product, the computer implements the vertical federated learning method as described in the first aspect or the second aspect.

[0033] The disclosed embodiments provide a method, apparatus, electronic device, and readable storage medium for vertical federated learning. In this method, each participant in the vertical federated learning initializes a cluster center respectively, and obtains the distance of the sample cluster center through a K-means clustering; each participant encrypts and interacts with the distance information using a semi-homomorphic encryption algorithm, and each participant calculates the cluster center of the next round of K-means clustering for the other participants based on the ciphertext; thereafter, before publishing the calculation result to another participant, differential privacy technology is used to add noise that satisfies differential privacy to the calculation result to ensure the security of the published calculation result. By continuously iterating until the iteration requirements are met, each participant can obtain the target cluster center for K-means clustering. The disclosed method can realize vertical federated learning K-means training without the participation of a third-party server, and improves the security of samples during the training process through semi-homomorphic encryption and differential privacy. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0035] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0036] Figure 1 An overall framework diagram of the vertical federated learning method provided in one embodiment of the present disclosure;

[0037] Figure 2 A schematic diagram of data distribution provided in one embodiment of the present disclosure;

[0038] Figure 3 A flowchart of a vertical federated learning method provided in one embodiment of the present disclosure;

[0039] Figure 4 A flowchart of a vertical federated learning method provided in another embodiment of the present disclosure;

[0040] Figure 5 A schematic diagram of the structure of a vertical federated learning device provided in one embodiment of the present disclosure;

[0041] Figure 6 A schematic diagram of the structure of a vertical federated learning device provided in one embodiment of the present disclosure;

[0042] Figure 7 A schematic structural diagram of an electronic device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION

[0043] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.

[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0045] In vertical federated learning scenarios, multiple participants have access to the same samples but different characteristics. The K-means algorithm is a basic unsupervised learning algorithm. By training a batch of unlabeled sample data, it can classify samples into different categories based on the randomness between samples. Therefore, the K-means algorithm is often used in scenarios where classification is required.

[0046] Currently, the K-means training method based on vertical federated learning is usually implemented based on a trusted third-party server and includes the following steps:

[0047] Step a: The third-party server first initializes multiple cluster centers.

[0048] Step b: The third-party server sends these cluster centers to the corresponding participants respectively. For example, if participant 1 has feature x1 of the sample, the third-party server sends the cluster center of feature x1 to participant 1; if participant 2 has feature x2 of the sample, the third-party server sends the cluster center of feature x2 to participant 2, and so on.

[0049] Step c: Each participant calculates the category to which the sample belongs based on its own sample features, and calculates a new cluster center based on the local learning rate, and sends the new cluster center to the third-party server.

[0050] Step d: The third-party server calculates the new cluster center again based on the global learning rate and the new cluster center sent by each participant. If the convergence condition is not met, steps b to d are repeated until the convergence condition is met.

[0051] With this approach, a third-party server is required to collect data from all participants, resulting in lower data security.

[0052] Based on this, the embodiments of the present disclosure provide a method, device, electronic device and readable storage medium for vertical federated learning, wherein each participant in the vertical federated learning initializes the cluster center respectively, and obtains the distance of the sample cluster center through a K-means clustering; each participant uses a semi-homomorphic encryption algorithm to encrypt and interact with the distance information, and each participant calculates the cluster center of the next round of K-means clustering for other participants based on the ciphertext; thereafter, before publishing the calculation result to another participant, differential privacy technology is used to add noise that satisfies differential privacy to the calculation result to ensure the security of the published calculation result, and through continuous iteration until the iteration requirements are met, each participant can obtain the target cluster center for K-means clustering. The present disclosure can realize vertical federated learning K-means training without the participation of a third-party server, and improves the security of samples during the training process through semi-homomorphic encryption and differential privacy.

[0053] In addition, in order to further improve the security of sample identification, the identification of samples of multiple participants is jointly encrypted through a commutative encryption algorithm, thereby blinding the correspondence between the identification of the encrypted sample and the original identification of the sample. Due to the use of commutative encryption, it is possible to ensure that the two participants obtain the same encrypted identification after multiple encryption of the same identification (the encrypted identification can also be called a blinded identification).

[0054] Exemplarily, the vertical federated learning method of the present disclosure can be executed by an electronic device. The electronic device can be a server, a server cluster, a service platform, a personal computer, etc. The present disclosure does not impose any restrictions on the specific type of electronic device.

[0055] To make the vertical federated learning method provided by the present disclosure clearer, semi-homomorphic encryption, differential privacy, and commutative encryption are first introduced here.

[0056] 1. Semi-homomorphic encryption

[0057] For any participant, such as participant G, they have homomorphic keys pk, sk, encryption function E, and decryption function D. For any data x, y, they satisfy the following properties:

[0058] a. Homomorphic addition: as well as

[0059] b. Homomorphic multiplication:

[0060] 2. Differential Privacy

[0061] For any data x, given the privacy budget ε and sensitivity s, differentially private data that meets the privacy budget can be obtained.

[0062] It can be expressed by the formula:

[0063] 3. Exchangeable Encryption

[0064] Among them, commutative encryption satisfies the properties that the encryption order is commutative and the decryption order is commutative. Assume that the participant G has the key z G , participant H has the key z H , the encryption function is F, and the decryption function is F -1 , the properties of commutative encryption and decryption order can be expressed by the following formula:

[0065] a. The encryption order can be exchanged:

[0066] in, Indicates the use of key z G encryption, Indicates the use of key z H encryption.

[0067] b. The decryption order can be exchanged:

[0068] The vertical federated learning method provided by the present disclosure will be introduced in detail below through some embodiments combined with drawings and scenarios.

[0069] Figure 1 This is an overall framework diagram of vertical federated learning provided in one embodiment of the present disclosure. Figure 2 This is a diagram of data distribution. Figure 1 as well as Figure 2 In the illustrated embodiment, two participants (Participant 1 and Participant 2) are taken as an example.

[0070] Figure 2 This is a diagram showing the distribution of sample data in Participant 1 and Participant 2. First, refer to Figure 2 As shown, participant 1 has multiple first characteristic values ​​of sample data, participant 2 has multiple second characteristic values ​​of sample data, the characteristic data respectively possessed by participant 1 and participant 2 are different, and participant 1 and participant 2 have the same sample identifier.

[0071] In the present disclosure, samples are generally structured data, which may be, but are not limited to, image data, voice data, text data, and other types of data.

[0072] Please continue reading Figure 1 The framework shown, combined with Figure 2 As shown in the data distribution, the vertical federated learning process can include: data preprocessing stage, training stage and prediction stage.

[0073] Among them, in the data preprocessing stage, Participant 1 and Participant 2 semi-homomorphically encrypt the characteristic values ​​of their respective sample data and then send them to each other, and exchangeably encrypt the identifiers of their respective samples and send them to each other, so that Participant 1 and Participant 2 respectively obtain the encrypted identifiers of the samples.

[0074] During the training phase, participants 1 and 2 perform K-means clustering based on their respective samples, obtaining key distance information. This information is semi-homomorphically encrypted and sent to the other party. Participant 1 calculates new cluster centers for participant 2 in the ciphertext space, and participant 2 calculates new cluster centers for participant 1 in the ciphertext space. Afterward, participants 1 and 2 each perform differential privacy processing on their respective calculated new cluster centers and send them to each other for the next round of K-means clustering. Through continuous iterative training, participants 1 and 2 each achieve their final target cluster centers.

[0075] In the prediction phase, Participant 1 and Participant 2 each perform K-means clustering based on the different feature data of the objects to be clustered and the target cluster centers determined in the training phase to obtain distance information. They then exchange distance information through semi-homomorphic encryption, allowing one of the participants to determine the category of the objects to be clustered based on the distance information in the ciphertext space.

[0076] Next, through Figures 3 to 5 The embodiment shown in the figure introduces in detail the vertical federated learning method provided by the present disclosure. In the following embodiment, it is assumed that the two participants in the vertical federated learning are the first participant and the second participant.

[0077] Figure 3 A flowchart of a vertical federated learning method provided in one embodiment of the present disclosure.

[0078] Reference Figure 3 As shown, the method of this embodiment includes:

[0079] S301: The first participant initializes a first cluster center, and performs K-means clustering based on a first feature of the sample and the initialized cluster center to obtain a first distance.

[0080] This disclosure does not limit the method for initializing cluster centers. For example, the initialization method may be random initialization, where the first participant may randomly select multiple samples from the sample set as the initialized first cluster centers. The first participant may also initialize the first cluster centers using other existing K-means initialization methods.

[0081] The first feature may include multiple feature values, which may respectively reflect the feature information of the sample in multiple different dimensions. For example, the data format of a sample data x may be: <id,f1,f2,....,f n >, where id is the identifier of the sample data in the first participant, f1 to f n are multiple feature values ​​of the sample data x, and the first feature includes the multiple feature values.

[0082] As a possible implementation method, the first participant can use the Euclidean distance square calculation formula to calculate the first eigenvalue corresponding to the sample and the first eigenvalue of the sample corresponding to the first cluster center to obtain the distance square value, which is the first distance from the sample to the first cluster center.

[0083] Assume that the first participant initializes K first cluster centers. Through the above method, the first participant can obtain the following for each sample in the sample set: Among them, id is the identifier of the sample (original identifier).

[0084] S302: The second participant initializes a second cluster center, and performs K-means clustering based on the second feature of the sample and the initialized second cluster center to obtain a second distance.

[0085] This step is similar to step S301, and the detailed description of step S301 can be found here. It should be noted that after starting vertical federated learning, the first participant and the second participant can independently perform the above-mentioned process of initializing cluster centers and K-means clustering.

[0086] S303. The first participant performs semi-homomorphic encryption on the first distance to obtain a first ciphertext distance.

[0087] The first participant can initialize and obtain an encryption key for semi-homomorphic encryption, and perform semi-homomorphic encryption processing on the first distance corresponding to each sample in the sample set according to the encryption key to obtain the first ciphertext distance corresponding to each sample.

[0088] S304: The first participant sends the first ciphertext distance to the second participant. Correspondingly, the second participant receives the first ciphertext distance.

[0089] S305. The second participant performs semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain the second ciphertext distance, and sends the second ciphertext distance to the first participant.

[0090] As a possible implementation, the second participant can generate a random number and then perform additive homomorphic encryption on the random number, the second distance corresponding to the sample, and the first ciphertext distance corresponding to the sample to obtain the second ciphertext distance. It should be noted that all samples can use the same random number for additive homomorphic encryption. This ensures that the random number blinds the second distance, but does not affect the result of distance-based classification of the sample.

[0091] The second participant can fuse the first ciphertext distance, the second distance, and the random number through homomorphic addition. The first ciphertext distance is data in the ciphertext space, so the second participant is equivalent to completing the fusion of distance information in the ciphertext space. In addition, the second participant generates a random number for the sample, protecting the second distance from the first participant, thereby ensuring the security of the sample data related information in the second participant.

[0092] S306: The first participant determines the category of the sample according to the second ciphertext distance, and sends the category of the sample to the second participant.

[0093] After the second participant sends the second ciphertext distance to the first participant, the first participant can use the homomorphic decryption function and the private key to decrypt and obtain the ciphertext distance data corresponding to the sample, and then determine the category of the cluster center corresponding to the minimum value in the ciphertext distance data as the category of the sample, and synchronize the category of the sample to the second participant.

[0094] S307. The first participant calculates the cluster center for the second participant to perform the next round of K-means clustering based on the sample category, performs differential privacy processing on the information of the calculated cluster center, obtains the second ciphertext indication information, and sends it to the second participant.

[0095] Based on the K-means algorithm, a new cluster center can be calculated by taking the average value of the features of each sample belonging to the same category. Therefore, as a possible implementation method, the first participant can determine the cluster center of the category based on the average center of the ciphertext features corresponding to multiple samples of the same category in the ciphertext space according to the category of each sample. It should be noted that the ciphertext features of the samples used by the first participant to calculate the cluster center for the second participant are the second features of the samples that the second participant has semi-homomorphically encrypted in advance and sent to the second participant.

[0096] Afterwards, the first participant can calculate the average ciphertext feature value based on the ciphertext features of the samples pre-sent by the second participant as the sensitivity to differential privacy noise. Based on the user's preset privacy budget, the first participant performs differential privacy processing on the cluster centers to obtain the corresponding ciphertext indication information. This processing process can be understood as blurring the information of the actual cluster centers. After receiving the ciphertext indication information, the second participant can decrypt the ciphertext indication information using the private key used for semi-homomorphic decryption to obtain the actual cluster center information. Due to the differential privacy processing, the cluster center information recalculated by the first participant for the second participant cannot be easily obtained, thereby improving data security.

[0097] Among them, the second participant can semi-homomorphically encrypt the second feature of the sample it holds during the data preprocessing stage and send it to the first participant, so that the first participant has the ciphertext feature of the sample data; for example, the first participant can also calculate the ciphertext feature of the interactive sample at any time before the first participant calculates the distance center for the second participant.

[0098] It should be noted that the second party may use the same encryption key or different encryption keys to semi-homomorphically encrypt the second feature of the sample and the first distance in advance, and the first party and the second party may reach an agreement on this before training.

[0099] S308. The second participant calculates the cluster center of the first participant for the next round of K-means clustering based on the category of the sample, performs differential privacy processing on the information of the calculated cluster center, obtains the first ciphertext indication information, and sends it to the first participant.

[0100] As a possible implementation, the second party can determine the cluster center for each sample category in the ciphertext space based on the average center of the ciphertext features corresponding to multiple samples of the same category. It should be noted that the ciphertext features of the samples used by the second party to calculate the cluster centers for the first party are the first features of the samples that were pre-sent by the first party through semi-homomorphic encryption and sent to the second party. The second party can then calculate the average ciphertext feature based on the ciphertext features of the samples pre-sent by the first party as the sensitivity to differential privacy noise and, based on the user's preset privacy budget, perform differential privacy processing on the cluster center information to obtain the corresponding ciphertext indication information. This processing can be understood as the second party obfuscating the actual cluster center information. Upon receiving the ciphertext indication information, the first party can decrypt the ciphertext indication information using the private key used for semi-homomorphic decryption to obtain the actual cluster center information. Due to the differential privacy processing, the cluster center information recalculated by the second party for the first party cannot be easily obtained, thereby improving data security.

[0101] Among them, the second participant can semi-homomorphically encrypt the second feature of the sample it holds during the data preprocessing stage and send it to the first participant, so that the first participant has the ciphertext feature of the sample data; for example, the first participant can also calculate the ciphertext feature of the interactive sample at any time before the first participant calculates the distance center for the second participant.

[0102] It should be noted that the first participant may use the same encryption key or different encryption keys to semi-homomorphically encrypt the first feature of the sample and the first distance in advance, and the first participant and the second participant may reach an agreement on this before training.

[0103] S309: The first participant uses the cluster center indicated by the received first ciphertext indication information as the cluster center and performs K-means clustering.

[0104] That is, the first participant uses the cluster center calculated by the second participant as the cluster center for the next round of K-means clustering and starts iterative training.

[0105] S310. The second participant uses the cluster center indicated by the received second ciphertext indication information as the cluster center and performs K-means clustering.

[0106] That is, the second participant uses the cluster center calculated by the first participant as the cluster center for the next round of K-means clustering and starts iterative training.

[0107] By repeatedly executing steps S301 to S310 until the iterative training requirements are met, the two participants complete the vertical federated learning and obtain the target cluster centers of their respective K-means clustering models.

[0108] In the method of this embodiment, the first participant encrypts the sample and the distance information obtained by clustering through semi-homomorphic encryption technology and sends it to the second participant. The second participant can perform K-means calculation in the semi-homomorphic ciphertext space to determine the cluster center of the next round of K-means clustering for the first participant. The characteristics of the sample of the first participant and the related data generated during the training process will not be obtained by the second participant. In a similar way, the characteristics of the sample held by the second participant and the related data generated during the training process will not be obtained by the first participant; and when the two participants send the cluster center of the next round of K-means clustering to the other participant, the information of the cluster center is differentially privately processed to ensure the security of the calculation results; through the above two aspects, vertical federated learning is realized without the participation of a third-party server, and the security of samples in the vertical federated learning scenario is effectively improved.

[0109] exist Figure 3 In the illustrated embodiment, when the second participant calculates the cluster center of the next round of K-means clustering for the first participant, in order to facilitate the second participant to identify and locate each sample and determine the correspondence between the sample and the received ciphertext distance information, the first participant needs to send the sample identifier to the second participant. A similar problem also exists when the first participant calculates the cluster center for the second participant. If the sample identifier is sent in plain text, the security of the sample identifier may be low. Therefore, in the vertical federated learning method provided by the present disclosure, the sample identifier is encrypted using commutative encryption technology to solve the problem of low sample identifier security in the vertical federated learning scenario.

[0110] Next, we will Figure 4 The illustrated embodiment provides a detailed introduction on how to implement vertical federated learning between a first party and a second party by combining commutative encryption, semi-homomorphic encryption, and differential privacy.

[0111] Figure 4 This is a flow chart of a vertical federated learning method provided by another embodiment of the present disclosure. Figure 4 As shown, the method of this embodiment includes:

[0112] S401: The first participant initializes a first cluster center, and performs K-means clustering based on a first feature of the sample and the initialized cluster center to obtain a first distance.

[0113] S402: The second participant initializes a second cluster center, and performs K-means clustering based on the second feature of the sample and the initialized second cluster center to obtain a second distance.

[0114] S403. The first participant performs semi-homomorphic encryption on the first distance to obtain a first ciphertext distance.

[0115] S404: The first participant sends a first ciphertext distance to the second participant, where the first ciphertext distance carries the original identifier of the sample. Correspondingly, the second participant receives the first ciphertext distance and the original identifier of the sample.

[0116] In this embodiment, steps S401 to S404 are respectively Figure 3 In the embodiment shown, steps S301 to S304 are similar, and reference may be made to the aforementioned Figure 3 A detailed description of the illustrated embodiment.

[0117] It should be noted that the original identifier of the sample carried by the first ciphertext distance in step S404 can be used as the basis for the second participant to identify and locate the second distance of the same sample with an associated relationship (details will be introduced later), and the first participant encrypts the first distance. Therefore, even if the original identifier of the sample data is not encrypted, the security of the sample-related information can still be guaranteed.

[0118] S405. The second participant performs semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain the second ciphertext distance, and performs exchangeable encryption on the original identifier of each sample to obtain the first encrypted identifier of the sample, and sends the second ciphertext distance and the first encrypted identifier of the sample to the first participant.

[0119] The second participant may generate an exchangeable encryption key during initialization, and then encrypt the original identifier of the sample using the exchangeable encryption key and an encryption function to obtain a first encrypted identifier of the sample.

[0120] S406. The first participant determines the category of the sample based on the second ciphertext distance, and exchangeably encrypts the first encrypted identifier of the sample to obtain a second encrypted identifier of the sample; and sends the category of the sample and the second encrypted identifier of the sample to the second participant.

[0121] Since commutative encryption has the properties of commutative encryption order and decryption order, after the first participant performs commutative encryption on the first encrypted identifier again to obtain the second encrypted identifier as the encryption identifier of the sample and sends it to the second participant, the second participant will search for samples with the same encryption identifier from the encrypted samples pre-synchronized with the first participant based on the second encryption identifier, and then perform K-means calculation on the ciphertext features of samples belonging to the same category to obtain the cluster center of the first participant's next round of K-means clustering.

[0122] S407. The first participant calculates the cluster center for the second participant to perform the next round of K-means clustering based on the sample category, performs differential privacy processing on the information of the calculated cluster center, obtains the second ciphertext indication information, and sends it to the second participant.

[0123] After the first participant obtains the second ciphertext feature of the sample sent by the second participant and the encrypted identifier of the sample in advance, the first participant uses the exchangeable encryption algorithm to encrypt the encrypted identifier of the sample again to obtain the second encrypted identifier. Therefore, for the first participant, there is a corresponding relationship between the second encrypted identifier and the second ciphertext feature. When the first participant calculates a new cluster center for the second participant, the second encrypted identifier can be used to find the matching second ciphertext feature, and then the ciphertext feature average of the second ciphertext features of samples belonging to the same category is calculated as the new cluster center.

[0124] S408. The second participant calculates the cluster center of the first participant for the next round of K-means clustering based on the category of the sample, performs differential privacy processing on the information of the calculated cluster center, obtains the first ciphertext indication information, and sends it to the first participant.

[0125] After the second participant obtains the first ciphertext feature of the sample sent by the first participant and the encrypted identifier of the sample in advance, the second participant uses the exchangeable encryption algorithm to encrypt the encrypted identifier of the sample again to obtain the second encrypted identifier. Therefore, for the second participant, there is a corresponding relationship between the second encrypted identifier and the first ciphertext feature. When the second participant calculates a new clustering center for the first participant, the second encrypted identifier can be used to find the matching first ciphertext feature, and then the average ciphertext feature of the first ciphertext features of samples belonging to the same category is calculated as the new clustering center.

[0126] S409: The first participant uses the cluster center indicated by the received first ciphertext indication information as the cluster center and performs K-means clustering.

[0127] S410: The second participant uses the cluster center indicated by the received second ciphertext indication information as the cluster center and performs K-means clustering.

[0128] In this embodiment, steps S407 and S410 are respectively Figure 3 The example steps S307 and S310 are similar, and can be referred to the aforementioned Figure 3 For the sake of brevity, the detailed description of the illustrated embodiment will not be repeated here.

[0129] In the method of this embodiment, the identification of the sample is encrypted through exchangeable encryption, which can blind the correspondence between the encrypted identification of the sample and the original identification of the sample, thereby ensuring the security of the sample identification. The first participant and the second participant obtain the same encrypted identification after jointly encrypting the identification of the sample, which can ensure that each participant can accurately identify and locate relevant data based on the same encrypted identification, thereby avoiding errors in the training process.

[0130] In a specific embodiment, assume that there are two participants, Guest (hereinafter referred to as G) and Host (hereinafter referred to as H), where G has the following data: <id,f1,f2,....,f n1 >, the data form of H is: <id,f1′,f2′,....,f n2 ′〉, that is, each sample contains an id and multiple feature values.

[0131] It should be noted that in the vertical federated learning scenario, the original identity of the same sample in G and the original identity in H are the same, which also provides a basis for the subsequent use of exchangeable encryption technology by the two to jointly encrypt the sample identity, thereby protecting the original identity of the sample.

[0132] The following is an exemplary description in three stages.

[0133] 1. Data preprocessing stage

[0134] The following steps may be included:

[0135] Step 1: G and H each randomly generate their own exchangeable encryption key z G 、z H , and the homomorphic key (pk G ,sk G )、(pk H ,sk H ).

[0136] Step 2: For each sample in the sample set, G and H use their respective exchangeable encryption keys z G 、z H Encrypt the sample ID using its own homomorphic key pk G 、pk H Encrypt each feature value of the sample separately.

[0137] G obtains the encrypted data as:

[0138] The encrypted data obtained by H is:

[0139] Step 3. G will encrypt the data Send to H; H will encrypt the data Send to G.

[0140] Step 4: G and H use the exchangeable encryption key z again G 、z H Encrypt the id in the encrypted data obtained in step 3 and record Among them, bid is equivalent to the target encryption identifier described above.

[0141] G obtains the encrypted data as:

[0142] The encrypted data obtained by H is:

[0143] Step 5: G and H calculate the average value of each encrypted feature based on the encrypted feature value of each sample.

[0144] G gets

[0145] H gets

[0146] 2. Prediction Stage

[0147] Step 6. G and H initialize their own K cluster centers respectively. The cluster centers initialized by G are C1, C2, ..., C K , H obtains the initialized cluster centers C′1, C′2, ..., C′ K .

[0148] The initialization method can be implemented by random initialization or other K-means initialization schemes.

[0149] Step 7, G and H calculate the square of the distance from each sample to each cluster center respectively, and G obtains 〈id,d1 for each sample 2 ,d2 2 ,....,d K 2 >, H is obtained for each sample

[0150] The calculation formula of Euclidean distance squared can be used: d i 2 =∑ j (f j -Ci,j ) 2 , where d i 2 Represents the square of the distance from the sample to the cluster center i, C i,j represents the j-th eigenvalue of cluster center i, f j Represents the j-th eigenvalue of the sample.

[0151] Step 8. G uses the key pk G Encrypt the square of the distance from the sample to each cluster center and get And send it to H.

[0152] It should be noted that G encrypts the square of the distance of each sample and sends it to H.

[0153] Step 9. H generates a random number r for each sample, and then adds the square of the distance sent by G in step 8 and the distance obtained by H in step 2 to the value of the random number r. And the random number are added together, and H uses the exchangeable encryption key z to encrypt the original id of the sample H Encrypt. H obtains the second ciphertext distance after fusion for each sample:

[0154]

[0155] H sends the obtained fused second ciphertext distance to G.

[0156] Step 10: For the second ciphertext distance corresponding to each received sample, G uses the exchangeable encryption key pair Encrypt again to obtain the bid corresponding to the sample (i.e., the second encryption identifier); G uses the private key sk in the semi-homomorphic key pair G The second ciphertext distance is decrypted to obtain ciphertext distance data (also called blinded distance value).

[0157] That is, G gets:

[0158] G calculates the index corresponding to the minimum distance value through the argmin() function based on the obtained ciphertext distance data, thereby obtaining the category to which each sample belongs, which is expressed by the formula:

[0159]

[0160] G sends the result to H.

[0161] In step 11, G and H respectively calculate the center point of each category in the ciphertext space (the cluster center of the next round of K-means clustering) for each other based on the category corresponding to each bid and the data obtained in step 4 of the data preprocessing stage.

[0162] Specifically, for M samples bid1, bid2, ..., bid belonging to category w M , H can calculate the new encrypted cluster center for G through the following formula:

[0163]

[0164] in, Represents the new encrypted cluster center, and the subscript of f represents the sequence number of the sample and the sequence number of the sample's eigenvalue.

[0165] Similarly, G can calculate the new encrypted cluster center for H using the following formula:

[0166]

[0167] In step 12, G and H use the average value of each ciphertext feature calculated in step 5 of the data preprocessing phase as the sensitivity s of the differential privacy noise, and calculate the fuzzy cluster center based on the pre-set privacy budget ε.

[0168] G is calculated using the formula:

[0169] H is calculated using the formula:

[0170] and are the fuzzy cluster centers calculated for G and H respectively.

[0171] G and H send the fuzzy cluster centers calculated for each other as ciphertext indication information to each other.

[0172] Step 13, G and H use their respective private keys sk G ,sk H Decrypted ciphertext indicates the fuzzy cluster center contained in the information and For each eigenvalue in , we get a new cluster center and

[0173] Step 14: Repeat steps 7 to 13 until the iterative training requirement is met (such as the number of iterations preset by the user), and G and H obtain their respective target cluster centers.

[0174] 3. Prediction Stage

[0175] Step a1: For the object to be clustered x (i.e., the object whose category needs to be predicted), G obtains the id of the object to be clustered and multiple feature values, expressed as: <id x,f1,f2,....,f n1 >H obtains the id of the object to be clustered and multiple eigenvalues, expressed as: <id x ,f1′,f2′,....,f n2 ′>.

[0176] In step a2, G and H respectively calculate the square of the distance between the object to be clustered x and the respective target cluster center using the Euclidean distance square calculation formula shown in step 7 above, and G obtains the distance: <id x ,d1 2 ,d2 2 ,....,d K 2 >, H gets the distance: That is, G and H cluster x respectively to obtain the third distance and the fourth distance.

[0177] Step a3, each third distance obtained by G encryption, the third ciphertext distance is obtained And send the third ciphertext distance to H.

[0178] Step a4, H is the id of the object to be clustered x Generate a random number r x , and the third ciphertext distance, the fourth distance and the random number r x The fourth ciphertext distance is calculated by homomorphic addition encryption, where the fourth ciphertext distance is expressed by the following formula:

[0179]

[0180] Then send the fourth ciphertext distance to G.

[0181] Step a5: G decrypts the fourth ciphertext distance in step a4 and obtains And using the minimum distance value, use the argmin() function to calculate the category index and determine the category to which the object to be clustered belongs. G can also send the category information of the object to be clustered to H.

[0182] In this embodiment, G and H complete vertical federated learning without relying on any trusted third-party servers, achieving effective unsupervised learning. A combination of commutative encryption, semi-homomorphic encryption, and differential privacy protects data security during the preprocessing, training, and prediction phases. Furthermore, the data preprocessing phase includes encryption of sample feature values ​​and calculation of ciphertext feature averages, effectively reducing online overhead for all participants and improving the efficiency of vertical federated learning.

[0183] Figure 5 A schematic diagram of the structure of a vertical federated learning device provided in one embodiment of the present disclosure.

[0184] See also Figure 5 As shown, the apparatus 500 of this embodiment includes:

[0185] Processing module 501 is used to perform K-means clustering based on the first feature of the sample and the initialized cluster center to obtain a first distance; semi-homomorphic encryption is performed on the first distance to obtain a first ciphertext distance, and the first ciphertext distance is sent to other participants participating in vertical federated learning.

[0186] The receiving module 502 is used to receive the second ciphertext distance fed back by the other participants; the second ciphertext distance is obtained by the other participants performing semi-homomorphic encryption on the second distance and the first ciphertext distance; the second distance is obtained by the other participants performing K-means clustering based on the second feature of the sample they own; and determining the category of the sample according to the second ciphertext distance.

[0187] The sending module 503 is configured to send the category of the sample to the other participants, so that the other participants calculate the cluster center of the next round of K-means clustering based on the category of the sample.

[0188] The receiving module 502 is further used to receive the first ciphertext indication information sent by the other participants; the first ciphertext indication information is the ciphertext information obtained by the other participants performing differential privacy processing on the information of the calculated cluster center.

[0189] The processing module 501 is configured to use the cluster center indicated by the first ciphertext indication information as the cluster center and perform K-means clustering, iteratively train until the iteration requirements are met, and obtain the target cluster center corresponding to the K-means clustering.

[0190] In some embodiments, the processing module 501 is specifically used to perform semi-homomorphic decryption on the second ciphertext distance to obtain ciphertext distance data corresponding to each of the samples; wherein the ciphertext distance data is the result of the fusion of the first distance, the second distance and a random number; and, for each of the samples, determine that the category of the cluster center corresponding to the minimum value in the ciphertext distance data is the category of the sample.

[0191] In some embodiments, the processing module 501 is also used to calculate the cluster center for the next round of K-means clustering by the other participants based on the category of each of the samples and the ciphertext features of the samples held by the other participants; and perform differential privacy processing on the information of the cluster center to obtain second ciphertext indication information.

[0192] The sending module 503 is further configured to send the second ciphertext indication information to the other participants, so that the other participants update the cluster centers based on the second ciphertext indication information to perform the next round of K-means clustering.

[0193] In some embodiments, the processing module 501 is specifically used to calculate the average value of the ciphertext features based on the pre-obtained ciphertext features of the samples held by the other participants, and determine that the average value of the ciphertext features is the noise processed by differential privacy; the ciphertext features of the samples held by the other participants are obtained by semi-homomorphic encryption of the second features of the samples; based on the noise processed by differential privacy and the preset differential privacy budget, the information of the cluster center is differentially privately processed to obtain the second ciphertext indication information.

[0194] In some embodiments, the processing module 501 is further used to perform semi-homomorphic encryption on the first feature of the sample to obtain a corresponding ciphertext feature; the sending module 503 is further used to send the calculated ciphertext feature to the other participant, so that the second participant uses the received ciphertext feature of the sample to calculate the cluster center and perform differential privacy processing on the information of the cluster center.

[0195] In some embodiments, the second ciphertext data carries the first encrypted identifier of the sample, and the first encrypted identifier is obtained by the other participant performing exchangeable encryption on the original identifier of the sample; the processing module 501 is also used to perform exchangeable encryption processing on the first encrypted identifier to obtain a second encrypted identifier; the sending module 503 is specifically used to package the second encrypted identifier as the identifier of the sample with the category of the sample and send it to the other participant.

[0196] In some embodiments, the processing module 501 is further used to perform K-means clustering based on the first feature of the object to be clustered and the target cluster center to obtain a third distance; and perform semi-homomorphic encryption on the third distance to obtain a third ciphertext distance.

[0197] The sending module 503 is further configured to send the third ciphertext distance to the other participants.

[0198] The receiving module 502 is further configured to obtain a fourth ciphertext distance fed back by the other participants, where the fourth ciphertext distance data is obtained by the other participants performing semi-homomorphic encryption on the fourth distance and the third ciphertext distance.

[0199] The processing module 501 is further configured to perform semi-homomorphic decryption on the fourth ciphertext distance, and determine the category of the object to be clustered based on the minimum value in the ciphertext distance data obtained by decryption, where the category of the object to be clustered is the category of the target cluster center corresponding to the minimum distance value.

[0200] The vertical federated learning device provided in this embodiment can be used to implement the technical solution executed by the first participant in any of the aforementioned method embodiments. Its implementation principles and technical effects are similar. Please refer to the detailed description of the aforementioned method embodiments. For the sake of brevity, they will not be repeated here.

[0201] Figure 6 This is a schematic diagram of the structure of a federated learning device provided in one embodiment of the present disclosure. Figure 6 As shown, the apparatus 600 provided in this embodiment includes:

[0202] Receiving module 601 is used to receive the first ciphertext distance sent by other participants, where the first ciphertext distance is obtained by the other participants performing K-means clustering based on the first feature of the sample and the first cluster center and performing semi-homomorphic encryption on the first distance calculated by the clustering.

[0203] The processing module 602 is configured to perform K-means clustering based on the second feature of the sample and the second cluster center to obtain a second distance, and perform semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain a second ciphertext distance.

[0204] A sending module 603 is configured to send the second ciphertext distance to the other participants, so that the other participants determine the category of the sample based on the second ciphertext distance;

[0205] The receiving module 601 is further configured to receive the categories of the samples sent by the other participants, and calculate the cluster centers for the next round of K-means clustering by the other participants based on the categories of the samples.

[0206] The processing module 602 is further configured to perform differential privacy processing on the calculated cluster center information to obtain first ciphertext indication information.

[0207] The sending module 603 is further configured to send the first ciphertext indication information to the other participants, so that the other participants update the cluster centers based on the first ciphertext indication information to perform the next round of K-means clustering.

[0208] In some embodiments, the processing module 602 is specifically configured to generate a random number; and obtain the second ciphertext distance by performing additive homomorphic encryption on the second distance, the first ciphertext distance, and the random number using semi-homomorphic addition.

[0209] In some embodiments, the receiving module 601 is also used to receive second ciphertext indication information sent by the other participants; the second ciphertext indication information is the cluster center calculated by the other participants based on the category of the sample and the ciphertext information obtained by differential privacy processing of the cluster center information.

[0210] The processing module 602 is further configured to perform K-means clustering using the cluster center indicated by the second ciphertext indication information as the cluster center, perform iterative training until the iteration requirements are met, and obtain the target cluster center corresponding to the K-means clustering.

[0211] In some embodiments, the processing module 602 is specifically used to calculate the average value of the ciphertext features based on the pre-obtained ciphertext features of the samples held by the other participants, and determine that the average value of the ciphertext features is the noise processed by differential privacy; the ciphertext features of the samples held by the other participants are obtained by the other participants performing semi-homomorphic encryption on the first features of the samples; based on the noise processed by differential privacy and the preset differential privacy budget, the information of the cluster center is differentially privately processed to obtain the first ciphertext indication information.

[0212] In some embodiments, the processing module 602 is further used to exchangeably encrypt the original identifier of the sample to obtain a first encrypted identifier of the sample; the sending module 603 is specifically used to package the first encrypted identifier as the identifier of the sample and the second ciphertext distance and send it to other participants.

[0213] In some embodiments, the category of the sample sent by the other participant carries a second encrypted identifier of the sample, and the second encrypted identifier is obtained by the other participant performing exchangeable encryption processing on the first encrypted identifier.

[0214] In some embodiments, the receiving module 601 is also used to receive a third ciphertext distance sent by other participants; the third ciphertext distance is obtained by the other participants performing K-means clustering based on the first feature of the object to be clustered and the target cluster center determined by the other participants through vertical federated learning, and performing semi-homomorphic encryption on the third distance calculated by the clustering.

[0215] The processing module 602 is further configured to perform K-means clustering based on the second feature of the object to be clustered and the target cluster center to obtain a fourth distance; and perform semi-homomorphic encryption on the fourth distance and the third ciphertext distance to obtain a fourth ciphertext distance.

[0216] The sending module 603 is further configured to send the fourth ciphertext distance to the other participants, so that the other participants determine the categories of the objects to be clustered based on the fourth ciphertext distance.

[0217] The vertical federated learning device provided in this embodiment can be used to implement the technical solution executed by the second participant in any of the aforementioned method embodiments. Its implementation principles and technical effects are similar. Please refer to the detailed description of the aforementioned method embodiments. For the sake of brevity, they will not be repeated here.

[0218] Illustratively, an embodiment of the present disclosure further provides an electronic device.

[0219] Figure 7 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 7 As shown, the electronic device 700 provided in this embodiment includes: 700 includes: a memory 701 and a processor 702.

[0220] The memory 701 may be an independent physical unit, and may be connected to the processor 702 via a bus 703. The memory 701 and the processor 702 may also be integrated together and implemented through hardware.

[0221] The memory 701 is used to store program instructions, and the processor 702 calls the program instructions to execute the technical solution executed by the first participant or the second participant in any of the above method embodiments.

[0222] Optionally, when part or all of the methods of the above embodiments are implemented by software, the electronic device 700 may also include only the processor 702. The memory 701 for storing programs is located outside the electronic device 700, and the processor 702 is connected to the memory via circuits / wires to read and execute the programs stored in the memory.

[0223] The processor 702 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.

[0224] The processor 702 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0225] The memory 701 may include a volatile memory, such as a random-access memory (RAM); the memory may also include a non-volatile memory, such as a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory may also include a combination of the above types of memory.

[0226] The present disclosure also provides a readable storage medium, including: computer program instructions, which, when executed by at least one processor of an electronic device, enable the electronic device to implement the technical solution executed by the first participant or the second participant in any of the above method embodiments.

[0227] The present disclosure also provides a computer program product, which, when executed on a computer, enables the computer to implement the technical solution executed by the first participant or the second participant in any of the above method embodiments.

[0228] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0229] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.

Claims

1. A vertical federated learning method, characterized in that: include: Perform K-means clustering based on the first feature of the sample and the initialized cluster center to obtain a first distance, perform semi-homomorphic encryption on the first distance to obtain a first ciphertext distance, and send the first ciphertext distance to other participants in the vertical federated learning; Receive a second ciphertext distance fed back by the other participant; the second ciphertext distance is obtained by the other participant performing semi-homomorphic encryption on the second distance and the first ciphertext distance; the second distance is obtained by the other participant performing K-means clustering based on the second feature of the sample owned by the other participant; Determining the category of the sample based on the second ciphertext distance, and sending the category of the sample to the other participants, so that the other participants calculate the cluster centers of the next round of K-means clustering based on the category of the sample, wherein the ciphertext features of the sample used by the other participants when calculating the cluster centers are the first features of the sample that are semi-homomorphically encrypted in advance and sent to the other participants; Receive first ciphertext indication information sent by the other participant; the first ciphertext indication information is ciphertext information obtained by the other participant calculating the average ciphertext feature value based on the ciphertext feature of the sample, using the average ciphertext feature value as the sensitivity of differential privacy noise, and performing differential privacy processing on the calculated cluster center information according to the privacy budget preset by the user; The cluster center indicated by the first ciphertext indication information is used as the cluster center and K-means clustering is performed, and iterative training is performed until the iteration requirements are met to obtain the target cluster center corresponding to the K-means clustering.

2. The method according to claim 1, characterized in that The determining the category of the sample according to the second ciphertext distance includes: Performing semi-homomorphic decryption on the second ciphertext distance to obtain ciphertext distance data corresponding to each of the samples; wherein the ciphertext distance data is a result of integrating the first distance, the second distance, and a random number; For each of the samples, the category of the cluster center corresponding to the minimum value in the ciphertext distance data is determined as the category of the sample.

3. The method according to claim 1, characterized in that Also includes: Calculating the cluster centers for the next round of K-means clustering by the other participants based on the categories of the samples and the ciphertext features of the samples held by the other participants; Perform differential privacy processing on the information of the cluster center to obtain second ciphertext indication information, and send the second ciphertext indication information to the other participants, so that the other participants update the cluster center based on the second ciphertext indication information to perform the next round of K-means clustering.

4. The method according to claim 3, characterized in that The performing differential privacy processing on the information of the cluster center to obtain the second ciphertext indication information includes: Calculating an average ciphertext feature based on the pre-obtained ciphertext features of the samples held by the other participants, and determining that the average ciphertext feature is noise processed by differential privacy; the ciphertext features of the samples held by the other participants are obtained by semi-homomorphic encryption of the second features of the samples; The second ciphertext indication information is obtained by performing differential privacy processing on the information of the cluster center based on the noise of the differential privacy processing and the preset differential privacy budget.

5. The method according to claim 1, wherein Also includes: Semi-homomorphic encryption is performed on the first feature of the sample to obtain the corresponding ciphertext feature, and the calculated ciphertext feature is sent to the other participants, so that the other participants use the received ciphertext features of the sample to calculate the cluster center and perform differential privacy processing on the information of the cluster center.

6. The method according to claim 1, characterized in that The second ciphertext data carries a first encrypted identifier of the sample, where the first encrypted identifier is obtained by the other party performing exchangeable encryption on the original identifier of the sample; The method further comprises: Performing exchangeable encryption processing on the first encrypted identifier to obtain a second encrypted identifier; The sending of the sample category to the other participants includes: The second encrypted identifier is packaged as the identifier of the sample together with the category of the sample and sent to the other participants.

7. The method according to claim 1, characterized in that Also includes: Performing K-means clustering based on the first feature of the object to be clustered and the target cluster center to obtain a third distance; performing semi-homomorphic encryption on the third distance to obtain a third ciphertext distance, and sending the third ciphertext distance to the other participants; Obtaining a fourth ciphertext distance fed back by the other participant, where the fourth ciphertext distance data is obtained by the other participant performing semi-homomorphic encryption on the fourth distance and the third ciphertext distance; The fourth ciphertext distance is semi-homomorphically decrypted, and the category of the object to be clustered is determined according to the minimum value in the ciphertext distance data obtained by decryption, where the category of the object to be clustered is the category of the target cluster center corresponding to the minimum value.

8. A vertical federated learning method, characterized in that: include: Receive a first ciphertext distance sent by another participant, where the first ciphertext distance is obtained by the other participant performing K-means clustering based on the first feature of the sample and the first cluster center and performing semi-homomorphic encryption on the first distance calculated by the clustering; Performing K-means clustering based on the second feature of the sample and the second cluster center to obtain a second distance, performing semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain a second ciphertext distance, and sending the second ciphertext distance to the other participants, so that the other participants determine the category of the sample based on the second ciphertext distance; Receive the category of the sample sent by the other participant, and calculate the cluster center for the other participant to perform the next round of K-means clustering based on the category of the sample, wherein the ciphertext feature of the sample used when calculating the cluster center for the other participant is obtained by semi-homomorphically encrypting the first feature of the sample in advance by the other participant; Perform differential privacy processing on the calculated cluster center information to obtain first ciphertext indication information, and send the first ciphertext indication information to the other participants, so that the other participants update the cluster center based on the first ciphertext indication information to perform the next round of K-means clustering; The performing differential privacy processing on the calculated cluster center information to obtain the first ciphertext indication information includes: Calculating an average ciphertext feature value based on the pre-obtained ciphertext features of the samples held by the other participants, and determining the average ciphertext feature value as noise processed by differential privacy; The first ciphertext indication information is obtained by performing differential privacy processing on the information of the cluster center based on the noise of the differential privacy processing and a preset differential privacy budget.

9. The method according to claim 8, characterized in that The performing semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain the second ciphertext distance includes: Generate random numbers; The second distance, the first ciphertext distance, and the random number are homomorphically encrypted by addition using semi-homomorphic addition to obtain the second ciphertext distance.

10. The method according to claim 8, characterized in that Also includes: Receiving second ciphertext indication information sent by the other party; The second ciphertext indication information is the cluster center calculated by the other participants based on the category of the sample and the ciphertext information obtained by performing differential privacy processing on the information of the cluster center; K-means clustering is performed using the cluster center indicated by the second ciphertext indication information as the cluster center, and iterative training is performed until the iteration requirements are met to obtain the target cluster center corresponding to the K-means clustering.

11. The method according to claim 8, characterized in that Also includes: Performing exchangeable encryption on the original identifier of the sample to obtain a first encrypted identifier of the sample; The sending the second ciphertext distance to the other party includes: The first encrypted identifier is packaged as an identifier of the sample together with the second ciphertext distance and sent to the other participants.

12. The method according to claim 11, characterized in that The category of the sample sent by the other participant carries a second encrypted identifier of the sample, where the second encrypted identifier is obtained by the other participant performing exchangeable encryption processing on the first encrypted identifier.

13. The method according to claim 8, characterized in that Also includes: Receiving a third ciphertext distance sent by the other participant; the third ciphertext distance is obtained by performing K-means clustering by the other participant based on the first feature of the object to be clustered and the target cluster center determined by the other participant through vertical federated learning, and performing semi-homomorphic encryption on the third distance calculated by the clustering; K-means clustering is performed based on the second feature of the object to be clustered and the target cluster center to obtain a fourth distance; semi-homomorphic encryption is performed on the fourth distance and the third ciphertext distance to obtain a fourth ciphertext distance, and the fourth ciphertext distance is sent to the other participants, so that the other participants determine the category of the object to be clustered based on the fourth ciphertext distance.

14. A vertical federated learning device, characterized in that: include: A processing module, configured to perform K-means clustering based on the first feature of the sample and the initialized cluster center to obtain a first distance; perform semi-homomorphic encryption on the first distance to obtain a first ciphertext distance, and send the first ciphertext distance to other participants in the vertical federated learning; a receiving module, configured to receive a second ciphertext distance fed back by the other participant; the second ciphertext distance is obtained by the other participant performing semi-homomorphic encryption on the second distance and the first ciphertext distance; the second distance is obtained by the other participant performing K-means clustering based on the second feature of the sample owned by the other participant; and, determining the category of the sample according to the second ciphertext distance; a sending module, configured to send the category of the sample to the other participants, so that the other participants calculate the cluster centers of the next round of K-means clustering based on the category of the sample, wherein the ciphertext features of the sample used by the other participants when calculating the cluster centers are the first features of the sample that are semi-homomorphically encrypted in advance and sent to the other participants; The receiving module is further configured to receive first ciphertext indication information sent by the other participant; the first ciphertext indication information is ciphertext information obtained by the other participant calculating an average ciphertext feature value based on the ciphertext features of the sample, using the average ciphertext feature value as the sensitivity to differential privacy noise, and performing differential privacy processing on the calculated cluster center information according to a privacy budget preset by the user; The processing module is used to use the cluster center indicated by the first ciphertext indication information as the cluster center and perform K-means clustering, iterative training until the iteration requirements are met, and obtain the target cluster center corresponding to the K-means clustering.

15. A vertical federated learning device, characterized in that: include: A receiving module, configured to receive a first ciphertext distance sent by another participant, where the first ciphertext distance is obtained by the other participant performing K-means clustering based on the first feature of the sample and the first cluster center and performing semi-homomorphic encryption on the first distance calculated by the clustering; a processing module, configured to perform K-means clustering based on the second feature and the second cluster center of the sample to obtain a second distance, and perform semi-homomorphic encryption on the second distance and the first ciphertext distance to obtain a second ciphertext distance; a sending module, configured to send the second ciphertext distance to the other participants, so that the other participants determine the category of the sample based on the second ciphertext distance; The receiving module is further configured to receive the category of the sample sent by the other participant, and calculate the cluster center for the other participant to perform the next round of K-means clustering based on the category of the sample, wherein the ciphertext feature of the sample used by the other participant when calculating the cluster center is obtained by semi-homomorphically encrypting the first feature of the sample in advance by the other participant; The processing module is further configured to perform differential privacy processing on the calculated cluster center information to obtain first ciphertext indication information; The sending module is further configured to send the first ciphertext indication information to the other participants, so that the other participants update the cluster centers based on the first ciphertext indication information to perform the next round of K-means clustering; The performing differential privacy processing on the calculated cluster center information to obtain the first ciphertext indication information includes: Calculating an average ciphertext feature value based on the pre-obtained ciphertext features of the samples held by the other participants, and determining the average ciphertext feature value as noise processed by differential privacy; The first ciphertext indication information is obtained by performing differential privacy processing on the information of the cluster center based on the noise of the differential privacy processing and a preset differential privacy budget.

16. An electronic device, characterized in that: include: memory and processor; The memory is configured to store computer program instructions; The processor is configured to execute the computer program instructions so that the electronic device implements the vertical federated learning method as described in any one of claims 1 to 7, or any one of claims 8 to 13.

17. A readable storage medium, characterized in that include: computer program instructions; The computer program instructions are executed by at least one processor of an electronic device, so that the electronic device implements the vertical federated learning method as described in any one of claims 1 to 7, or any one of claims 8 to 13.

18. A computer program product, characterized in that When a computer executes the computer program product, the computer implements the vertical federated learning method as described in any one of claims 1 to 7, or any one of claims 8 to 13.

Citation Information

Patent Citations

  • Clustering method and device, electronic equipment and storage medium

    CN114118180A

  • Decentralized federated clustering method and device, electronic equipment and storage medium

    CN114386071A