A secure homomorphic k-means clustering method based on paillier cryptosystem
By optimizing the Paillier encryption algorithm's secure homomorphic k-means clustering method, and utilizing additive homomorphism and security protocols, the problems of insufficient computational efficiency and communication overhead in existing technologies are solved, achieving efficient and secure data clustering suitable for large-scale sensitive data analysis.
Patent Information
- Application Number
- CN202411445153.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-10-16
AI Technical Summary
Existing clustering algorithms based on homomorphic encryption have shortcomings in terms of computational efficiency and communication overhead. Especially when dealing with sensitive data, frequent encryption and decryption operations increase the computational burden and communication costs, and also pose security risks.
A secure homomorphic k-means clustering method was designed using the Paillier encryption algorithm. By optimizing the data preprocessing, iterative update, and result decryption process, and by utilizing the additive homomorphic property of the Paillier encryption algorithm, combined with secure distance calculation, cluster assignment, and cluster center update protocol, the method ensures that the data is always kept in an encrypted state, thereby reducing the amount of data exchange and computational burden.
It improves computational efficiency, reduces communication overhead, and enhances security, making it suitable for privacy-preserving data analysis in large-scale data environments, especially in the fields of healthcare and finance.
Smart Images

Figure CN119441921B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data mining and privacy protection, and particularly relates to a secure homomorphic k-means clustering method based on Paillier cryptosystem. BACKGROUND
[0002] With the rapid development of information technology and the Internet, the amount of data is growing explosively. Especially in sensitive areas such as healthcare and finance, the collection and analysis of data bring great value to the industry. However, these data often contain a large amount of personal privacy information, and how to effectively analyze the data while protecting the privacy of the data has become an important research topic. Data clustering is an important technology in data mining, and is widely used in pattern recognition, image processing, market analysis and other fields. Among them, the k-means clustering algorithm, due to its simplicity and efficiency, has become one of the most popular clustering algorithms. However, the traditional k-means algorithm has significant privacy risks when dealing with sensitive data, because it needs to directly access and process the original data. In the healthcare field, patients' health data, medical records and other information are highly sensitive data; in the financial field, customers' transaction records, credit information and other information also involve personal privacy. Once these data are leaked in the clustering process, it will cause serious invasion of personal privacy and may lead to legal and ethical problems.
[0003] To solve this problem, researchers have proposed secure clustering algorithms based on encryption technology. Among them, homomorphic encryption technology is of great concern because it allows specific computational operations on encrypted data. Paillier encryption algorithm is a famous homomorphic encryption algorithm with additive homomorphism, that is, it can perform addition and multiplication operations on encrypted data without decryption. Therefore, the Paillier encryption algorithm provides an effective solution for privacy-preserving data clustering. Existing clustering algorithms based on homomorphic encryption mainly focus on how to use homomorphic encryption technology to perform distance calculation, data assignment and cluster center update and other key steps. However, these methods still have certain room for improvement in terms of computational efficiency and communication overhead. For example, some schemes require frequent encryption and decryption operations, increasing the computational burden; some schemes require a large amount of data exchange with other participants when updating the cluster center, increasing the communication cost. Therefore, how to improve the computational efficiency of the clustering algorithm and reduce the communication overhead while ensuring data privacy is a problem that needs to be solved. SUMMARY
[0004] The application improves a secure homomorphic k-means clustering method based on a Paillier cryptographic system, and the system to which the method is applied comprises a cloud server, a computing service provider and a plurality of user terminals, each of the user terminals is registered on the cloud server and is in communication connection with the cloud server, and the cloud server is in communication connection with the computing service provider; the method comprises the following processes:
[0005] Data preprocessing process: the user terminal uses a Paillier encryption algorithm to encrypt each data point in an original data set to obtain encrypted data, and sends the encrypted data to the cloud server;
[0006] Secure K-means clustering process: the cloud server randomly generates R initial cluster centers, encrypts the initial cluster centers using a Paillier encryption algorithm to obtain encrypted initial cluster centers; R is the number of initial cluster centers;
[0007] Iterative updating process: the cloud server and the computing service provider interact, and in the case of not decrypting the data, the encrypted squared Euclidean distance of each encrypted data to the encrypted cluster center is iteratively calculated; and according to the calculation result, the data points are assigned to the cluster closest to them, and the encrypted cluster center on the cloud server is updated, and convergence checking is performed, if the stopping condition is met, the iteration is ended, otherwise the iteration is continued;
[0008] Result decryption process: the encrypted cluster center obtained after the iteration updating process is decrypted to obtain the original cluster center, and the encrypted cluster index is decrypted to obtain the original cluster index.
[0009] Further, in the iterative updating process, it is assumed that x i is the original data, the encrypted data is E(x i ), c j is the initial cluster center, the encrypted cluster center is E(c j ), j is the cluster center number, i is the data number, k is the dimension number, d is the dimension number, x ik is the kth dimension of the original data x i , k is greater than or equal to 1 and less than or equal to d, E() is an encryption function, c jk is the kth dimension of the cluster center c j , and in the case of not decrypting the data, the method for calculating the encrypted squared Euclidean distance of the encrypted data E(x i ) to the encrypted cluster center E(c j ) is as follows:
[0010] Step 3.1.1: The cloud server calculates the encrypted difference between each dimension of the encrypted data and the same dimension of the cluster center;
[0011] For dimension k, calculate the encryption difference: E(Δ) = E(x) ik )·E(c jk ) N-1 N is a parameter initially set for the Paillier operation;
[0012] Step 3.1.2: The cloud server and the computing service provider jointly calculate the squared difference of encryption for each dimension, using the formula E(Δ). 2 ) = RSM(E(Δ),E(Δ));
[0013] Step 3.1.3: The cloud server calculates the encrypted squared Euclidean distance between each dimension of the encrypted data and each encrypted cluster center. The obtained encrypted squared Euclidean distance values are then combined into an encrypted squared Euclidean distance set. E(x i ) and encrypted clustering center E(c j The formula for calculating the encrypted squared Euclidean distance is: This represents the squared difference of encryption in the k-th dimension; For data point x i and cluster center c j The square Euclidean distance between them;
[0014] Step 3.1.4: Return the set of encrypted squared Euclidean distances
[0015] Furthermore, in the iterative update process, data points are assigned to the nearest cluster based on the calculation results, specifically as follows:
[0016] Step 3.2.1: The cloud server initializes the distance value set U using the returned encrypted squared Euclidean distance set.
[0017] Step 3.2.2: The cloud server will store the elements in the distance value set U. The groups are divided into s pairs, each pair being of the form of When R is an odd number When R is even Find the smaller ciphertext value in each pair of elements;
[0018] Step 3.2.3: The service provider updates the elements in the distance value set U with the smaller ciphertext value obtained after the previous grouping. Then update R to s, group within the updated set U, and find the smaller ciphertext value in each pair of elements again;
[0019] Step 3.2.4: Repeat step 3.2.3 until R = 1, the iteration is completed, at this time there will be only one minimum ciphertext value in the distance value set U Obtain its index E(λ i );
[0020] Step 3.2.5: The cloud server assigns data points
[0021] Initialize an empty encrypted cluster set
[0022] For each data point x i : According to the encrypted index E(λ i ), the encrypted data point E(x i ) is assigned to the nearest encrypted cluster, and the assignment result is
[0023] Step 3.2.6: Return the encrypted cluster assignment set
[0024] Further, in the iteration process, updating the encrypted cluster center on the cloud server is specifically:
[0025] Step 3.3.1: For the cluster center C j , the user end initializes the accumulator to zero, and initializes the counter |C j | to zero;
[0026] Step 3.3.2: The cloud server performs the following operations for each encrypted data E(x i ): Determine whether the encrypted data E(x i ) belongs to the encrypted cluster center E(c j ), if it belongs, set the encrypted indication parameter E(b ij ) = 1, add E(x i ) to the accumulator , and update the encrypted counter E(|Cj | ); otherwise, set the indication parameter E(b ij ) = 0;
[0027] Step 3.3.3: The cloud server and the computing service provider update the accumulator using the module inverse for the cluster center C j : to calculate the encrypted average value, the calculation formula is:
[0028]
[0029] Step 3.3.4: Return the updated encrypted cluster center set
[0030] Further, in step 3.3.2, if the encrypted data E(x i ) belongs to the encrypted cluster center E(c j ), E(x i ) is added to the accumulator The specific calculation method is as follows: The specific calculation method of the updated encrypted counter |C j | is as follows:
[0031] Further, the result decryption process is to decrypt the encrypted cluster center E(c j ) to obtain the original cluster center c j , and decrypt the encrypted cluster index E(λ i ) to obtain the original cluster index λ i .
[0032] Further, the result analysis process is also included, in which, based on the decrypted cluster center and cluster index, the final clustering result is obtained at the user end.
[0033] The technical effects of the present application are as follows:
[0034] 1. In terms of computational efficiency, the present application improves the computational efficiency. Existing homomorphic encryption clustering algorithms have heavy computational burden and low efficiency when dealing with large-scale data. The present application optimizes the application of the Paillier encryption algorithm, especially in the distance calculation and cluster center updating process, thereby improving the computational efficiency and reducing the processing time. This improvement is particularly important for data analysis in a big data environment, making the algorithm more suitable for actual application requirements.
[0035] 2. In terms of communication overhead, some existing homomorphic encryption clustering algorithms require frequent data exchange during clustering allocation and center updating, which increases the communication cost. The present application designs an efficient secure clustering allocation (SCA) protocol and a secure cluster center update (SUCC) protocol, thereby reducing the amount of data exchange and reducing the communication overhead, thereby improving the practical application value of the protocol.
[0036] 3. In terms of security, frequent encryption and decryption operations in the prior art not only increase the computational burden, but also may cause security risks. The present application reduces these operations, thereby reducing the potential security risks and enhancing the overall security of the system.
[0037] In conclusion, the application provides an efficient and safe solution for data analysis in sensitive fields such as healthcare and finance, and has wide application potential, can be applied to other privacy-protected data mining scenarios such as social network analysis and marketing, provides a practical privacy-protected data clustering solution, and promotes the development of privacy-protected data mining technology. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 Model diagram of the system applied to the method of the application.
[0039] Figure 2 Flowchart of the method of the application. DETAILED DESCRIPTION
[0040] The inventive concept of the application is that the application designs a complete set of secure computing distance (SCD), secure clustering assignment (SCA) and secure clustering center update (SUCC) protocols using the additive homomorphism property of the Paillier encryption algorithm, always maintains the encrypted state of the data during the entire clustering calculation process, and ensures the confidentiality of the data. At the same time, by optimizing the encryption calculation and communication process, the efficiency of the clustering calculation is improved, and the communication overhead is reduced.
[0041] The following basic encryption primitives will be used in the application:
[0042] (1) Improved secure multiplication protocol (RSM)
[0043] The RSM protocol enables both parties (user end and computing service provider) to perform secure multiplication calculation while protecting the privacy of the original data. By introducing random numbers and partial decryption techniques in the multiplication operation, the RSM protocol realizes the calculation of the product without revealing the actual value of the multiplication. The core idea of this protocol is to use encryption and decryption operations to enable the computing service provider to obtain the encrypted product without knowing the actual value of the multiplication.
[0044] (2) Secure maximum and minimum sorting (SMMS) protocol
[0045] The SMMS protocol allows multiple parties to sort their data and determine the maximum and minimum values while ensuring the privacy of the original data. In the SMMS protocol, participants exchange encrypted sorting results and determine the maximum and minimum values using partial decryption techniques, thereby realizing privacy-protected sorting operations.
[0046] (3) Secure division protocol (SDIV)
[0047] The SDIV protocol enables both parties of communication to perform a secure division calculation, ensuring the privacy of data during the calculation process without revealing the actual values of the divisor and the dividend. By introducing random numbers and encryption technology, the SDIV protocol allows the calculation service provider to calculate the quotient in ciphertext form without obtaining the actual values of the original data.
[0048] (4) Secure Equality Test (SEQ) Protocol
[0049] The SEQ protocol can output ciphertext f and determine whether two ciphertexts are equal.
[0050] The above four basic encryption primitives are prior art, which can be found in "Theory and Application of Secure Computation" (People's Posts and Telecommunications Press).
[0051] The design goal of the present application is to develop a secure homomorphic k-means clustering protocol based on Paillier homomorphic encryption technology to achieve privacy protection and efficient clustering of sensitive data. Through the whole process of encrypted data processing, the confidentiality of data during the clustering process is ensured to prevent privacy leakage. By utilizing the additive homomorphic property of the Paillier encryption algorithm, the distance calculation and cluster center update of encrypted data are optimized, improving the computational efficiency, especially suitable for large-scale data environments.
[0052] The scheme proposes a secure K-means clustering method and three secure protocols. It consists of data preprocessing, encrypting each data point, initializing the cluster center with encrypted values, iteratively updating the cluster and its center while maintaining encryption, and finally calculating the clustering result. This method can perform clustering analysis while protecting sensitive information. The system to which this method is applied includes several user terminals, a cloud server, and a calculation service provider.
[0053] The system framework is shown in Figure 1 The functions of each part of the system are described as follows:
[0054] 1. User terminal
[0055] The user terminal first encrypts personal data using a public key, and then uploads the encrypted data to the cloud server for storage. The user terminal can also request the cloud server to calculate the outsourced data in a secret state.
[0056] 2. Cloud server (CS)
[0057] The cloud server is responsible for storing and managing the outsourced data of all registered parties (i.e., user terminals). In addition, the CS can store all intermediate and final ciphertext results, and can perform specific calculations on encrypted data.
[0058] 3. Calculation service provider (CSP)
[0059] A computing service provider provides online computing services for user end. In addition, the CSP can partially solve the ciphertext sent by the CS to perform specific calculations, and then re-encrypt the results.
[0060] The k-means clustering method based on the above system is described below. As shown in Figure 2 , the method includes a data preprocessing process, a secure K-means clustering process, an iterative updating process, and a result decryption process.
[0061] I. Data preprocessing process
[0062] The user end uses the Paillier encryption algorithm to encrypt each data point x i in the original data set to obtain encrypted data E(x i ) and send the ciphertext to the cloud server.
[0063] II. Secure K-means clustering process
[0064] The cloud server randomly generates R initial cluster centers, encrypts the initial cluster centers c j using the Paillier encryption algorithm to obtain encrypted cluster centers E(c j ). R is the number of cluster centers, and is a random number. The cluster center category is set by the user end according to the requirements of the computing task. The value of j is greater than or equal to 1 and less than or equal to R.
[0065] III. Iterative updating process
[0066] Steps 3.1-3.4 are repeated in this process until the stopping condition is met (e.g., the maximum number of iterations is reached or the calculated cluster center does not change from the previous calculated cluster center or the error is small enough to be ignored).
[0067] Step 3.1: The cloud server end and the computing service provider interact to execute the secure computing distance (SCD) protocol to calculate the encrypted distance of each encrypted data to the encrypted cluster center
[0068] The secure computing distance (SCD) protocol is introduced below.
[0069] This protocol ensures that the squared Euclidean distance between data points and cluster centers is calculated securely without decrypting the data, thereby protecting the privacy of data points and cluster centers.
[0070] The input and output of this protocol are as follows:
[0071] Input: encrypted data x i , obtain E(x i ), the encrypted cluster center
[0072] Output: Encrypted squared Euclidean distance
[0073] j is the cluster center number, i is the data number, k is the dimension number, d is the total number of dimensions, k is greater than or equal to 1 and less than or equal to d; x ik is the kth dimension of data x i , E(*) is an encryption function, c jk is the kth dimension of cluster center c j , is the squared Euclidean distance between data point x i and cluster center c j .
[0074] Step 3.1 is described in detail below. It includes the following steps
[0075] Step 3.1.1: Calculate the encrypted difference between each dimension of the encrypted data and the same dimension of the cluster center by the cloud server;
[0076] Let k be the dimension number, k be greater than or equal to 1 and less than or equal to d. For dimension k, calculate the encrypted difference: E(Δ) = E(x ik )·E(c jk ) N-1 N is a parameter set initially by Paillier operation, which is a random value;
[0077] Here, the homomorphic subtraction feature of the Paillier encryption system is used to achieve subtraction by multiplying the inverse of E(c jk ) modulo N.
[0078] Step 3.1.2: The cloud server and the computing service provider jointly calculate the encrypted squared difference of each dimension (k from 1 to d), and the calculation formula is as follows:
[0079] E(Δ 2 ) = RSM(E(Δ), E(Δ))
[0080] RSM (re-encrypted square mechanism) is a method for securely calculating the square of the encrypted difference in the prior art, involving interaction between CS and CSP to avoid leaking plaintext.
[0081] Step 3.1.3: The cloud server calculates the encrypted squared Euclidean distance between each dimension of the encrypted data E(x i ) and each cluster center, and the calculation formula is:
[0082]
[0083] Here, the homomorphic addition property of the Paillier encryption system is utilized to achieve addition by multiplying the product of the squared differences of each dimension.
[0084] The resulting set of encrypted squared Euclidean distance values forms the encrypted squared Euclidean distance set
[0085] Step 3.1.4: Return the encrypted squared Euclidean distance set
[0086] The Secure Computation of Distance (SCD) protocol ensures data privacy during the computation. Both the coordinates of the data points and the cluster centers participate in the computation in an encrypted form, and the final distance result is also encrypted, so that any participant cannot know the specific distance value without decryption. This process utilizes the properties of the Paillier homomorphic encryption system, such as homomorphic addition and homomorphic subtraction, to securely perform the computation.
[0087] Step 3.2: Secure Cluster Assignment. The cloud server and the computing service provider interact to execute the secure cluster assignment protocol, assigning each data point to the nearest cluster based on the obtained encrypted distances.
[0088] This step executes the Secure Cluster Assignment (SCA) protocol. The protocol is described in detail below.
[0089] The purpose of this protocol is to securely assign data points to clusters in the K-means algorithm using the Paillier encryption system. The input of this algorithm is the encrypted squared distance of data points to cluster centers, and the output is the encrypted cluster assignment result.
[0090] The protocol input and output are as follows:
[0091] Input: Encrypted squared Euclidean distance set where is the encrypted value of the squared distance of the data point to all R cluster centers.
[0092] Output: Encrypted cluster assignment set where is the encrypted cluster assignment result.
[0093] Parameter meaning explanation:
[0094] Data point x i to each cluster center c j Encrypted cluster center squared distance
[0095] This protocol is executed by the cloud server CS and the computing service provider (CSP), and the execution steps are as follows:
[0096] Step 3.2.1: Cloud server performs initialization: Initialize the set i.e. the set of all encrypted squared Euclidean distances.
[0097] Step 3.2.2: Iterative process: Grouping, the cloud server groups elements in the distance set U into s pairs, each pair is of the form When R is odd When R is even
[0098] Step 3.2.3: The service provider computes the updated set of distance values in U as the smaller ciphertext value from the previous grouping, and updates R to s, groups in the updated set U, and continues running the SMMS protocol to find the smaller ciphertext value in each pair;
[0099] Step 3.2.4: Repeat step 3.2.3 until R = 1, the iteration is complete, at this time the distance value set U will only be left with one encrypted minimum distance W(d ij ) min , get its index E(λ i );
[0100] Step 3.2.5: Cloud server performs encrypted clustering
[0101] Initialize an empty encrypted clustering set:
[0102] For each data point x i : Assign the encrypted data E(x i ) to the corresponding encrypted cluster according to the encrypted index E(λ i ) and get the assignment result
[0103] Step 3.2.6: Return the result
[0104] Return the encrypted clustering assignment set which contains the encrypted cluster to which each data point is assigned.
[0105] This protocol assigns each encrypted data to the closest encrypted cluster center by step-by-step comparison of encrypted squared Euclidean distances and selection of the minimum value. The entire process ensures the privacy and security of data during computation. Encryption calculations are performed using the characteristics of the Paillier homomorphic encryption system, ensuring that the encrypted state of the data cannot be leaked.
[0106] Step 3.3: Update cluster centers: Update the encrypted cluster centers on the cloud server using the secure update cluster center protocol (SUCC).
[0107] SUCC (Secure Update Cluster Centers) protocol:
[0108] The goal of this protocol is to update encrypted cluster centers. By processing the encrypted value of each data point, a new encrypted cluster center is computed and data privacy is guaranteed. SUUC protocol
[0109] Input and output
[0110] Input: encrypted data set N is the number of data, encrypted cluster center set
[0111] Output: updated encrypted cluster center set
[0112] Step 3.3.1: User side initializes accumulator, counter;
[0113] For cluster center C j , initialize encrypted accumulator to zero, initialize counter |C j | to zero.
[0114] Step 3.3.2: The cloud server performs the following operations:
[0115] For each encrypted data E(x i ): Determine whether the encrypted data E(x i ) belongs to E(c j ), if E(x i ) belongs to E(c j ), set E(b ij ) = 1; otherwise, set E(b ij ) = 0, if the encrypted data E(x i ) belongs to E(c j ), add E(x i ) to the accumulator and update the encrypted counter E(|C j |): The update method is:
[0116] E(b ij ) is an encrypted indication parameter that shows whether the encrypted data E(x i ) belongs to E(c j ).
[0117] Step 3.3.3: The following operations are jointly performed by the cloud server and the computing service provider:
[0118] For cluster center Cj Update the encrypted accumulator using the module inverse to calculate the encrypted average;
[0119]
[0120] Here, SDIV is a secure division operation that divides the encrypted counter E(|C) by 1. j |) is used as a divisor to update the encrypted accumulator. To calculate the average value of the encryption.
[0121] Step 3.3.4: Return Results
[0122] Return to the updated set of encrypted cluster centers
[0123] Step 3.4: Convergence Check: Check whether the cluster centers on the client or cloud server have converged. If the stopping condition is met, the iteration ends.
[0124] IV. Result Decryption Process
[0125] The encrypted cluster centers E(c) are decrypted using the Paillier decryption algorithm. j The original cluster centers c are obtained. j Decrypt the encrypted clustering index E(λ) i) Obtain the original clustering index λ i .
[0126] V. Results Analysis Process
[0127] Based on the decrypted cluster centers and cluster indexes, the final clustering results are obtained on the user's end for further analysis.
[0128] This application proposes a secure K-means clustering method based on Paillier homomorphic encryption, featuring significant innovations and unique characteristics. The innovations include: First, the scheme incorporates Paillier homomorphic encryption, ensuring data remains encrypted throughout the entire clustering process, effectively preventing data leakage. Second, through a modular design of three protocols (SCD, SCA, and SUCC), each responsible for distance calculation, cluster assignment, and center update respectively, each step is performed securely in an encrypted state. Furthermore, the scheme introduces a three-way collaboration mechanism involving the user client, cloud server, and computing service provider, optimizing resource utilization. Users do not need to operate online, enhancing data privacy protection. Finally, the Secure Multi-Party Least Choice (SMMS) protocol is used to find the nearest cluster centers without revealing specific distance values.
[0129] The features of the scheme mainly include the following aspects: cluster calculation without decryption, ensuring that intermediate results and final results are not exposed in plaintext state; secure update of encrypted cluster centers through homomorphic encryption addition and multiplication operations, ensuring data privacy; formal security proof covering each protocol, ensuring that the scheme is safe and reliable in theory; distributed computing suitable for large-scale data, utilizing the computing power of cloud servers and computing service providers to improve the efficiency of the K-means clustering algorithm. Finally, the scheme design takes into account the needs of practical application scenarios, providing specific operation steps and methods from data encryption, storage to computation, with high operability and practicality. These innovations and features make the scheme have wide application potential in the field of privacy-preserving data analysis.
Claims
1. A secure homomorphic k-means clustering method based on Paillier cryptosystem, characterized in that, The system to which the method is applied includes a cloud server, a computing service provider, and a plurality of user terminals, each of which is registered on and in communication connection with the cloud server, and the cloud server is in communication connection with the computing service provider; the method includes the following processes: A data preprocessing process: the user terminal encrypts each data point in an original data set using a Paillier encryption algorithm to obtain encrypted data, and sends the encrypted data to the cloud server; A secure K-means clustering process: the cloud server randomly generates R initial cluster centers, encrypts the initial cluster centers using the Paillier encryption algorithm to obtain encrypted initial cluster centers; R is the number of initial cluster centers; An iterative updating process: the cloud server and the computing service provider interact, and without decrypting the data, iteratively calculate the encrypted squared Euclidean distance of each encrypted data to the encrypted cluster center; and according to the calculation result, assign the data points to the cluster closest to them, update the encrypted cluster centers on the cloud server, and perform convergence checking; if the stopping condition is met, the iteration is ended, otherwise the iteration is continued; A result decryption process: decrypt the encrypted cluster centers obtained after the end of the iterative updating process to obtain the original cluster centers, and decrypt the encrypted cluster index to obtain the original cluster index; In the iterative updating process, assume x i is the original data, the encrypted data is E(x i ), c j is the initial cluster center, the encrypted cluster center is E(c j ), j is the cluster center number, i is the data number, k is the dimension number, d is the dimension number, x ik is the kth dimension of the original data x i , k is greater than or equal to 1 and less than or equal to d, E() is an encryption function, c jk is the kth dimension of the cluster center c j , without decrypting the data, the method for calculating the encrypted squared Euclidean distance from the encrypted data E(x i ) to the encrypted cluster center E(c j ) is specifically: Step 3.1.1: calculate, by the cloud server, the encrypted difference between each dimension of the encrypted data and the same dimension of the cluster center; For dimension k, calculate the encrypted difference: E(Δ) = E(x ik ) · E(c jk ) N-1 ; N is a parameter initially set for paillier operation Step 3.1.2: Cloud server and computing service provider jointly compute the square difference of each dimension encryption, the formula is E(Δ 2 ) = RSM(EΔ, E(Δ)); Step 3.1.3: The cloud server calculates the encrypted squared Euclidean distance between each dimension of the encrypted data and each encrypted cluster center, and the obtained encrypted squared Euclidean distance values form an encrypted squared Euclidean distance set E(x i ) and the encrypted cluster center E(c j ) is , which represents the encrypted squared difference of the kth dimension; is the squared Euclidean distance between the data point x i and the cluster center c j . Step 3.1.4: Return the set of encrypted squared Euclidean distances 2. The method of claim 1, wherein, In the iterative updating process, the data points are assigned to the cluster closest to them according to the calculation result, specifically: Step 3.2.1: The cloud server initializes the distance value set U with the returned encrypted square Euclidean distance set, Step 3.2.2: The cloud server groups the elements in the set U of distance values into s pairs, each pair being of the form R is odd R is even R is even Find the smaller ciphertext value in each pair of elements; Step 3.2.3: The service provider updates the elements in the set U of distance values to the smaller ciphertext values resulting from the last grouping, and updates R to s, groups in the updated set U, and again finds the smaller ciphertext value in each pair of elements. Step 3.2.4: Step 3.2.3 is executed in a loop until R = 1, the iteration is completed, at this time the distance value set U will only be left a minimum ciphertext value Obtain its index E(λ i ); Step 3.2.5: the cloud server assigns the data points; Initializing an empty encrypted cluster set For each data point x i : assign the encrypted data point E(x i ) to the nearest encrypted cluster according to the encrypted index E(λ i ), the result of the assignment is Step 3.2.6: return the encrypted cluster assignment set 3. The method of claim 2, wherein, In the iterative updating process, the encrypted cluster centers on the cloud server are updated, specifically: Step 3.3.1: For cluster center C j , the user initializes an accumulator to zero, initializes a counter |C j to zero; Step 3.3.2: The cloud server performs the following operations for each encrypted data E(x i ): judges whether the encrypted data E(x i ) belongs to the encrypted cluster center E(c j ) or not, if yes, sets the encrypted indication parameter E(b ij ) = 1, adds E(x i ) to the accumulator , and updates the encrypted counter E(|C j |); otherwise, sets the indication parameter E(b ij ) = 0. Step 3.3.3: Cloud server and computing service provider for cluster centers C j : Update the accumulator with the module inverses to compute the encrypted average, using the formula: Step 3.3.4: Return the updated set of encrypted cluster centers 4. The method of claim 3, wherein, Step 3.3.2: If the encrypted data E(x i ) belongs to the encrypted cluster center E(c j ), add E(x i ) to the accumulator The specific calculation method is: Update the encrypted counter |C j | The specific calculation method is:
5. The method of claim 3 or 4, wherein, The result decryption process is to decrypt the encrypted clustering center E(c j ) to obtain the original clustering center c j , and to decrypt the encrypted clustering index E(λ i ) to obtain the original clustering index λ i .
6. The method according to any one of claims 1 to 4, characterized in that, It also includes a result analysis process, in which, based on the decrypted cluster centers and cluster index, the final clustering result is obtained on the user terminal.
Citation Information
Patent Citations
K-means clustering method and system with privacy protection function
CN107145791A
Privacy information protection method based on K-means clustering
CN110233730A