Multi-user-side cooperative security k-means clustering method under privacy protection

By adopting homomorphic encryption and secret sharing technology methods in K-mean clustering of multi-user-side collaboration, the problems of data privacy protection and computing efficiency are solved, and efficient and secure data clustering is achieved in multi-user-side collaboration.

CN119474943APending Publication Date: 2025-02-18HAINAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411482509.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing K-mean clustering method is difficult to effectively protect data privacy in multi-user-side collaboration, and the computing overhead is large, affecting the availability of data.

Method used

A multi-user-end collaborative secure k-means clustering method is adopted to ensure data privacy through initialization process, encryption process and iterative process, and to ensure data privacy through homomorphic encryption and secret sharing technology, reducing the number of noise additions to protect data availability.

Benefits of technology

On the premise of ensuring data privacy, k-means clustering with multi-user-side collaboration is realized to ensure data availability and efficient computing, and is suitable for collaborative data processing scenarios that require privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474943A_ABST
    Figure CN119474943A_ABST
Patent Text Reader

Abstract

The invention relates to the field of information security, in particular to a multi-user-side cooperative security k-means clustering method under privacy protection, a system applied by the method comprises at least one user side, a first server and a second server, the user side is in communication connection with the first server, the second server is in communication connection with the first server, and the first server is in communication connection with the second server. The method comprises an initialization process, an encryption process and an iteration process. According to the method, the privacy security of the user side data is guaranteed by using the homomorphic encryption and secret sharing technology, the server obtains the random value, and the secret sharing technology is used for avoiding inferring the private data and effectively avoiding inferring the private data, and noise is only added once in each iteration, so that the availability of the data is properly protected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security, and in particular to a multi-user collaborative security k-means clustering method under privacy protection. Background Art

[0002] Data mining is widely used in many fields such as social networks, web services, business, medicine, weather forecasting, etc. By analyzing the hidden information in the data set through algorithms, data mining can provide useful and predictive information to the data owner. In the field of data mining, K-means clustering is a popular technique for organizing data into groups. Usually, the user end needs to cooperate on the K-means clustering project. In the process of data collection and analysis, data mining usually involves processing a large amount of private information, such as personal details, purchase records, and medical information of the user end. If confidential information is leaked, it may cause significant harm to individuals and have a negative impact on the entire society. Therefore, privacy protection must be given priority in data mining. A key research topic is how to perform clustering while protecting privacy. The K-means clustering algorithm is widely used in various fields such as data mining, machine learning, and information retrieval. The algorithm divides the data set into k unique clusters, where the data in the same cluster are very close to each other, which means that they are most similar to each other. However, the calculation process of K-means clustering involves processing a large amount of sensitive information. Therefore, in order to prevent data privacy leakage, it is of great significance to study and develop K-means clustering algorithms with privacy protection measures.

[0003] In addition, with the rapid advancement of information technology, the amount of data is increasing. For service providers, data collection and analysis are essential to improve service quality and gain advantages in a highly competitive market. However, the current K-means clustering method often requires multi-client collaboration, that is, the required data is distributed among multiple clients and may suffer from privacy leakage. Differential privacy computing is not suitable for multi-client k-means clustering. When each client adds noise to the cluster center, the noise is too large, the data availability is very low, and the clustering results are meaningless. Another commonly used method is that the client encrypts all data and then shares the decryption key with the server. However, this method not only has high computational overhead, but also cannot guarantee that the server will not leak data. In addition, if all data is encrypted using homomorphic encryption, homomorphic encryption does not support ciphertext partitioning and ciphertext comparison algorithms, and other measures need to be adopted to solve such problems, but the calculation will also be more complicated. Therefore, the issues to be considered in data clustering are not only the privacy and security of data, but also its availability.

[0004] In order to prevent data privacy leakage, it is of great significance to study and develop the k-means clustering algorithm with privacy protection measures. Summary of the invention

[0005] 1. To solve the above problems, the present invention provides a multi-client collaborative secure k-means clustering method for privacy protection. The system to which the method is applied includes at least one client, a first server, and a second server. The client is communicatively connected to the first server, and the second server is communicatively connected to the first server. The method includes an initialization process, an encryption process, and an iteration process:

[0006] Initialization process: This process realizes inputting a data set into the system, and the system randomly selects k data points as clustering centers;

[0007] Encryption process: This process realizes that each client encrypts its own data and sends the encrypted data to the first server;

[0008] Iteration process: This process realizes iterative calculation of clustering centers. In each calculation process, each client calculates the Euclidean distance from each of its own data points to each clustering center, and assigns the data point to the clustering center with the minimum distance, thereby generating an indicator vector, and sending the indicator vector and the encrypted data to the first server. The first server and the second server execute a secret sharing security algorithm to obtain new clustering centers. The new clustering centers are shared with the clients after introducing noise. The clients calculate the distance between the newly received clustering centers and the clustering centers obtained in the previous iteration; if the distance is greater than the threshold, re-clustering assignment and iteration are performed; if the distance is less than the threshold, the iteration is terminated and the final clustering centers are obtained.

[0009] Further, in the initialization process, assuming that there are m clients participating in k-means clustering and m < k, then each client randomly selects data points, and each of clients selects an additional data point; if m > k, then k clients are randomly selected, and each client selects a data point as the initial clustering center.

[0010] Further, in the encryption process, each user encrypts its own data using the public key of the second server.

[0011] Further, the indicator vector is an integer vector with several components. The dimension of the integer vector is the same as the number of clustering centers, and the distribution of the elements therein indicates the number of the clustering center to which the corresponding data point belongs.

[0012] Further, in the iteration process, the first server and the second server execute a secret sharing security algorithm to obtain new clustering centers, which specifically includes the following steps:

[0013] Step 1.1: The first server determines according to the indicator vector e = (0,…,1,…,0) T, encrypted using the homomorphic encryption algorithm to obtain sum i,,j is the total value of data, num i,,j The first server generates a random value as well as Calculation using homomorphic encryption algorithm Calculation results is sent to a second server; wherein, pk 2 is the second server public key;

[0014] Step 1.2: The second server uses the private key to decrypt and get and

[0015] Step 1.3: The first server generates random values ​​a, b, g, h and retains the secret share a 1 ,b 1 ,g 1 ,h 1 , the secret share a 2 ,b 2 ,g 2 ,h 2 Sent to the second server; where a=a 1 +a 2 ; b=b 1 +b 2 ; g = g 1 +g 2 ; h=h 1 +h 2 ;

[0016] Step 1.4: The first server and the second server execute the secret sharing secure multiplication algorithm to obtain a*sum i,j , b*sum i,j , g*num i,,j , h*num i,,j ;

[0017] Step 1.5: First server calculation Get new cluster centers

[0018] Furthermore, in step 1.4, during the process of the first server and the second server executing the secret sharing secure multiplication algorithm, the Beaver triple {α, β, γ} is used as the pre-shared secret information, and secret sharing is performed between the first server and the second server, where α and β are secret values ​​randomly selected by the first server, γ = α·β, and the first server has a share {α 1,β 1 ,γ 1}, the second server has share {α 2 ,β 2 ,γ 2}, where α = α 1 +α 2 , β=β 1 +β 2 , γ=γ 1 +γ 2 .

[0019] Furthermore, in step 1.5, the Laplace mechanism is used to introduce noise into the cluster center. The added noise is Where i∈{1,…,T}, T is the number of iterations, and ε is the privacy budget.

[0020] Furthermore, in step 1.5, the calculation formula for the first server to calculate the distance between the newly received cluster center and the cluster center of the previous iteration is: C i,j represents the value of the jth cluster center in the i-th iteration, C i-1,j Represents the value of the jth cluster center in the i-1th iteration.

[0021] Furthermore, in the encryption process, each client uses the second server public key to encrypt its own data.

[0022] Technical effects of the present invention:

[0023] The present invention utilizes homomorphic encryption and secret sharing technology to protect the privacy security of user-side data, the server obtains random values, and secret sharing technology to avoid inferring private data, effectively avoids inferring private data, and only adds noise once in each iteration, thereby appropriately protecting the availability of data. The present invention not only protects the privacy of input data and output results, but also protects the privacy of intermediate data in the calculation stage. Through the present invention, multi-user collaborative k-means clustering can be realized under the premise of protecting data privacy, while ensuring data availability and computational efficiency, and is suitable for collaborative data processing scenarios that require privacy protection. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is a system model diagram used in the present invention. DETAILED DESCRIPTION

[0025] The method of the present invention is applied to Figure 1 The system shown in the figure comprises at least one user terminal (U1...UM), a first server (S1), and a second server (S2). The user terminal is connected to the first server for communication, and the second server is connected to the first server for communication

[0026] The clustering algorithm adopted in this invention is the k-means clustering algorithm. K-means clustering is used to analyze a data set by grouping the data set. The algorithm divides the data set into k clusters, with the goal of increasing the similarity within the cluster and reducing the similarity between clusters. The determination of the k value is mainly based on a combination of empirical methods and clustering result evaluation. The k value is preliminarily selected through experience, such as estimating the appropriate number of clusters based on the size of the data set, feature distribution, and specific application scenarios. On this basis, the clustering effect is further optimized and evaluated to ensure that the selected K value can take into account both the similarity within the cluster and the separation between clusters. The steps involved in the basic K-means clustering algorithm are as follows:

[0027] Step (1): Input the data set D = {x 1 ,…x i …,x n}. n is the total number of data in the data set, i is the data number;

[0028] Step (2): Randomly select k data points from the data set as the initial cluster centers, denoted as c j j is the cluster center number, which is greater than or equal to 1 and less than or equal to k;

[0029] Step (3): Calculate for each data point x i To cluster center c j The Euclidean distance z i,j =argmin j ||x i -c j || 2 , and then assign each point to the cluster with the shortest distance;

[0030] Step (4): Calculate the mean of the data points within each cluster and then update the cluster centers to reflect these new means;

[0031] Step (5): Repeat steps (3) and (4) until the change in cluster centers between consecutive iterations is below a specified threshold. If the change is below this threshold, the process terminates, otherwise it continues;

[0032] Step (6): Output the final cluster center.

[0033] This embodiment improves the above algorithm, which is described in more detail below.

[0034] The method of the present invention includes an initialization process, an encryption process, and an iteration process.

[0035] 1. Initialization process

[0036] In this process, a data set is input into the system, and the system randomly selects k data points as cluster centers.

[0037] If there are m clients (U1....Um) participating in k-means clustering, and if m < k, this means that if the number of clients is less than the number of cluster centers, then each client will randomly select a data point as a cluster center. The remaining cluster centers are formed by each client selecting an additional data point. If m > k, that is, the number of clients exceeds the number of cluster centers, then k clients are randomly selected, and each client selects a data point as the initial cluster center. The initial cluster centers are shared by all clients. Each cluster center has a number.

[0038] The client calculates the Euclidean distance between its own data points and each cluster center locally and assigns the data points to the cluster with the closest distance. In this process, the client only knows which cluster its own data points are assigned to, but does not know how the data of other clients are assigned and the specific data content. That is, each client can only see its own cluster and does not know the clusters of other clients.

[0039] II. Encryption Process

[0040] Each client uses the public key pk 2 publicly disclosed by the second server to encrypt its own data and packs all the encrypted ciphertext data points and sends them to the first server, while the client retains its own plaintext data.

[0041] III. Iterative Process

[0042] There are multiple iterative calculations in this process. In each iterative calculation process, each client calculates the Euclidean distance from each data point to each cluster center and assigns the data point to the cluster with the minimum distance, generates an indication vector accordingly, and sends the indication vector and the encrypted data to the first server. The first server and the second server execute the secret sharing security algorithm to obtain new cluster centers, and the new cluster centers are shared with the clients after introducing noise. The client calculates the distance between the newly received cluster center and the cluster center of the previous iteration; if the distance is greater than the threshold, the data points are reallocated and the iteration continues; if the distance is less than the threshold, the iteration is terminated and the final cluster centers are obtained.

[0043] More specifically, it can be divided into the following steps:

[0044] Step 1.1: The client generates an indication vector according to the cluster to which the data point belongs. The dimension of the integer vector is the same as the number of cluster centers, and the distribution of the elements in the indication vector indicates the number of the cluster center to which the corresponding data point belongs. In this embodiment, the indication vector is set e is an integer vector with k components, whose dimension should be the same as the number of cluster centers. Each component belongs to the integer set The position of element 1 indicates the number of the corresponding cluster center. Assume that the nearest cluster center to data point x is C 2 , then the indicator vector of data point x is e=(0,1,…,0) T , indicating that it belongs to the second cluster C 2 , that is. Among them, represents the k-dimensional vector space over the integer field. T represents the transpose of the vector. e=(0,…,1,…,0) T This means that e is a column vector (in transposed column vector form).

[0045] The first server calculates the value of the indicator vector e=(0,…,1,…,0) according to the instruction vector e=(0,…,1,…,0). T , after using the homomorphic encryption algorithm to calculate the encryption calculation, we get Since the data value received by the first server from the client is the second server public key pk 2 Encrypted, and It can be obtained using the homomorphic encryption algorithm. The first server generates a random variable and in The first server also uses the public key pk 2 The random variables generated and Encrypt and then use the homomorphic encryption algorithm to calculate and and send them to the second server, where

[0046] Step 1.2: The second server uses its own private key to receive and Decrypt it and get and

[0047] Step 1.3: The first server generates random values ​​a, b, g, h and retains the random secret share value a 1 ,b 1 ,g 1 ,h 1 , and set the other secret share value a 2 ,b 2 ,g 2 ,h 2 Send to the second server; a=a 1 +a2 ; b=b 1 +b 2 ; g = g 1 +g 2 ; h=h 1 +h 2 .

[0048] Step 1.4: The first server and the second server execute the secret sharing secure multiplication algorithm to obtain a*sum i,j , b*sum i,j , g*num i,j , h*num i,j .

[0049] The first server and the second server use secret sharing secure multiplication to calculate and obtain the new That is, the new cluster center. The present invention uses the Beaver triple {α, β, γ}, which is pre-shared secret information. Among them, α and β are secret values ​​randomly selected by the first server, and γ = α·β. The introduction of the pre-shared random value ternary allows participants to perform multiplication operations without revealing their secret shared information. The triple reduces the risk of directly sharing private data and increases the security that the shared secret information cannot be inferred. Based on the Beaver triple {α, β, γ}, γ = α·β, the Beaver triple is pre-shared secret information, which is secretly shared between the first server and the second server. Therefore, the first server has a share {α 1 ,β 1 ,γ 1}, the second server has share {α 2 ,β 2 ,γ 2}. Among them, α=α 1 +α 2 , β=β 1 +β 2 , γ=γ 1 +γ 2 .by For example, a is a random value selected by the first server, sum i,j It represents the sum of the values ​​of the jth cluster in the i-th iteration. i,j Secretly shared between the first server and the second server. Where a = a 1 +a 2 , The first server has share a 1 and The second server has share a 2 and The first server calculates 1 =a 1 -α1 , The second server calculates e 2 =a 2 -α 1 , Among them, e 1 ,e 2 ,f 1 ,f 2 is the intermediate value of the calculation, e=e 1 +e 2 , f=f 1 +f 2 The first server and the second server exchange 1 、e 2 、f 1 、f i , we can calculate e = e 1 +e 2 =a 1 -α 1 +a 2 -α 1 =a-α,f= The first server calculates z 1 =α 1 f+γ 1 +e·β 1 , the second server calculates z 2 =α 2 f+γ 2 +e·β 2 +e·f. Therefore z=z 1 +z 2 =a*sum i,,j Since they are both random numbers, we can get b*sum by this method. i,j ,g*num i,j ,h*num i,j .

[0050] Step 1.5: First server calculation and Get new cluster centers And add noise.

[0051] Since the iterated cluster center needs to be sent to the user end for sharing, the present invention uses the Laplace mechanism to introduce noise into the cluster center to protect the output result. The user end determines whether the distance between the newly received cluster center and the cluster center of the previous iteration is less than the threshold value. If it is greater than the threshold Then reallocate and iterate, if it is less than the threshold Then the iteration is terminated and the optimal cluster center is obtained. For the i-th iteration, the allocated privacy budget is The cumulative privacy budget for T iterations is Where i∈{1,…,T}. Adding random noise to the cluster center is: T is the number of iterations, ε is the privacy budget; the Laplace mechanism ensures differential privacy by adding Laplace noise to the query results. The probability density function of the Laplace distribution is as follows: Where b is the scale parameter. For the input data set D n →R d (D n Represents a dataset of size n, where n is the number of records in the dataset. d Represents a d-dimensional real number space. Each piece of data can be represented as a d-dimensional vector, where each element is a real number. n →R d This means mapping a set of n data into a d-dimensional real space. In simple terms, the input data set has n data points, each of which corresponds to a d-dimensional vector, that is, each data has d features. 1 Sensitivity is defined as follows: Δf = max||f(D 1 )-f(D 2 )|| 1 , where ||·|| 1 Represents the sum of the absolute values ​​of all elements in the vector. Set the noise scale parameter of the Laplace mechanism b: D 1 and D 2 Represents two different data sets and is usually used to calculate the difference in the output of a query function f on two different data sets. They are often used in privacy computing to compare the results of applying functions to similar but different data sets to ensure privacy protection. ∈ is a privacy budget parameter, which indicates the degree of privacy leakage in differential privacy. Smaller ∈ values ​​mean stronger privacy protection, but may also lead to reduced accuracy of the results.

[0052] Client-side computing If the value is greater than the threshold Then re-assign the clusters and iterate. If the value is less than the threshold Then the iteration is terminated and the optimal cluster center is obtained. i,j represents the value of the cluster center of the jth cluster in the i-th iteration, C i-1,j Represents the value of the cluster center of the jth cluster in the i-1th iteration. is a predetermined value.

Claims

1. A multi-user collaborative secure k-means clustering method for privacy protection, characterized in that: The system used by the method includes at least one client and a first server and a second server. The client is connected to the first server for communication, and the second server is connected to the first server for communication. The method includes an initialization process, an encryption process, and an iteration process: Initialization process: This process implements inputting a data set into the system, and the system randomly selects k data points as cluster centers; Encryption process: This process enables each user to encrypt their own data; Iterative process: This process implements iterative calculation of cluster centers. During each calculation process, each user terminal calculates the Euclidean distance from each of its own data points to each cluster center, and assigns the data point to the cluster with the minimum distance. Based on this, an indicator vector is generated, and the indicator vector and encrypted data are sent to the first server. The first server and the second server execute the secret sharing security algorithm to obtain a new cluster center. The new cluster center is shared with the user terminal after introducing noise. The user terminal calculates the distance between the newly received cluster center and the cluster center obtained in the previous iteration; if the distance is greater than the threshold, the cluster assignment is re-performed and the next iteration is executed; If the distance is less than the threshold, the iteration is terminated and the final cluster center is obtained.

2. The method according to claim 1, characterized in that In the initialization process, assume that there are m client devices participating in k-means clustering and m < k. Then each client device randomly selects data points, and each of the m client devices selects an additional data point; if m > k, then k client devices are randomly selected, and each client device selects a data point as the initial clustering center.

3. The method according to claim 1, characterized in that In the encryption process, each user uses the public key of the second server to encrypt his or her own data.

4. The method according to claim 1, characterized in that The indicator vector is an integer vector having several components, the dimension of the integer vector is consistent with the number of cluster centers, and the distribution of elements therein indicates the cluster center number corresponding to the corresponding data point.

5. The method according to any one of claims 1 to 4, characterized in that: In the iterative process, the first server and the second server execute the secret sharing security algorithm to obtain a new cluster center, which specifically includes the following steps: Step 1.1: The first server obtains the indication vector by encrypting it using the homomorphic encryption algorithm The first server generates a random value as well as Calculation using homomorphic encryption algorithm Calculation results is sent to a second server; wherein, pk2 is the second server public key; Step 1.2: The second server uses the private key to decrypt and get and Step 1.3: The first server generates random values ​​a, b, g, h, retains secret shares a1, b1, g1, h1, and sends secret shares a2, b2, g2, h2 to the second server; where a = a1 + a2; b = b1 + b2; g = g1 + g2; h = h1 + h2; Step 1.4: The first server and the second server execute the secret sharing secure multiplication algorithm to obtain a*sum i,j , b*sum i,j , g*num i,j , h*num i,j ; Step 1.5: First server calculation Get new cluster centers 6. The method according to claim 5, characterized in that In step 1.4, during the process of the first server and the second server executing the secret sharing secure multiplication algorithm, the Beaver triplet {α, β, γ} is used as the pre-shared secret information and is secretly shared between the first server and the second server, where α and β are secret values ​​randomly selected by the first server, γ = α·β, the first server has shares {α1, β1, γ1}, and the second server has shares {α2, β2, γ2}, where α = α1+α2, β = β1+β2, and γ = γ1+γ2.

7. The method according to claim 6, characterized in that In step 1.5, the Laplace mechanism is used to introduce noise into the cluster center. The added noise is Where i∈{1,…,T}, T is the number of iterations, and ε is the privacy budget.

8. The method according to claim 7, characterized in that In step 1.5, the first server calculates the distance between the newly received cluster center and the cluster center of the previous iteration using the following formula: C i,j represents the value of the jth cluster center in the i-th iteration, C i-1,j Represents the value of the jth cluster center in the i-1th iteration.

9. The method according to claim 1, characterized in that In the encryption process, each client uses the second server public key to encrypt its own data.