Privacy protection oriented data adaptive clustering method and system
By employing a privacy-preserving adaptive clustering method based on additive masking cancellation and distance-sensitive hashing, this method addresses the issues of high computational complexity, significant privacy leakage risk, and insufficient stability in high-dimensional data clustering. It achieves computation and privacy protection of low-dimensional distance structures, adapts to multi-density data distributions, stably distinguishes data groups, and identifies anomalies.
Patent Information
- Application Number
- CN202611582394.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-13
- Publication Date
- 2026-11-27
AI Technical Summary
In multi-party data collaborative analysis scenarios, high-dimensional data clustering faces problems such as high computational complexity, high risk of privacy leakage, and insufficient clustering stability. In particular, when high-dimensional vector data needs to be frequently updated and monitored in real time, it is difficult to meet the requirements of low latency and scalable deployment. At the same time, traditional methods are difficult to adapt to unknown cluster numbers and multi-density data distributions under complex data distributions.
A privacy-preserving adaptive clustering method for data is adopted, which combines additive mask cancellation and distance-sensitive hashing. The mask manager generates an additive mask and establishes a relationship with the data holder to generate a ciphertext vector. The clustering server and the mask manager perform distance-sensitive hash projection cancellation to construct a low-dimensional hash signature. Density-adaptive hierarchical clustering is then performed to identify noise points.
Without restoring the original data from the data holder, it reduces computational and communication overhead, adapts to multi-density data distributions, stably distinguishes data clusters, outputs structured evidence that can be used for anomaly detection and robust decision-making, and protects data privacy.
Smart Images

Figure CN123179018A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of privacy computing, encrypted data analysis, similarity search, and data clustering. Specifically, it relates to a privacy-preserving adaptive data clustering method and system. More specifically, it relates to a privacy-preserving adaptive data clustering method and system based on additive mask cancellation and distance-sensitive hashing, which is particularly suitable for application scenarios where data objects can be represented as high-dimensional vectors, the original data should not be exposed, but similarity analysis, anomaly identification, or group division is still required. Background Technology
[0002] In multi-party data collaborative analysis scenarios, data objects are typically represented as high-dimensional vectors, and similarity analysis, group segmentation, or anomaly identification need to be performed without exposing the original data content. For example, in federated learning scenarios, model update vectors uploaded by different clients can reflect their local data distribution and training status, and the server needs to identify similar update groups, abnormal updates, or potential poisoning behaviors; in medical data analysis scenarios, patient feature vectors, image embedding vectors, or medical records held by different hospitals or institutions may contain sensitive health information, and it is necessary to discover similar case groups or abnormal samples without disclosing patient privacy; in financial risk control scenarios, transaction behavior vectors, account profile vectors, or risk feature vectors may contain user identity, consumption habits, and business risk information, requiring clustering of similar transaction patterns or abnormal account behaviors; in IoT and industrial internet scenarios, device status vectors, sensor time-series feature vectors, or network traffic feature vectors can be used to identify device groups, abnormal operating states, or signs of network attacks; in user profiling and recommendation system scenarios, user interest vectors, interaction behavior vectors, or content embedding vectors can be used for similar user discovery and group segmentation, but these vectors may also reveal personal preferences or behavioral habits. Therefore, all of the above scenarios require a method that can support distance-aware clustering while protecting the original data vector.
[0003] First, high-dimensional data clustering faces significant computational complexity. Traditional clustering methods typically require calculating pairwise Euclidean distance, cosine distance, or other similarity metrics between data objects. When the number of data objects is large and the vector dimension is high, pairwise distance calculations incur significant time and storage overhead. If distance calculations are further performed in a encrypted domain or protected computing environment, even higher cryptographic and communication overheads will be introduced. Especially in scenarios requiring frequent updates to clustering results, such as multi-round model training, real-time risk control, or continuous device monitoring, high-dimensional accurate distance calculations struggle to meet the requirements for low latency and scalable deployment.
[0004] Second, direct access to plaintext data by clustering servers poses a privacy risk. In existing clustering processes, servers typically need to obtain the complete original vectors to calculate the distance matrix and perform clustering. However, these original vectors may contain user behavior, device status, business characteristics, model updates, or other sensitive information. If the clustering server is attacked, misconfigured, or colludes with other parties, the original data vectors may be recovered, inferred, or analyzed, leading to privacy breaches. While privacy protection technologies such as homomorphic encryption and secure multi-party computation can reduce the risk of plaintext exposure, the nonlinear computation and interaction overhead in high-dimensional vector distance calculation and clustering processes remain high, making it difficult to balance privacy protection and clustering efficiency.
[0005] Third, clustering stability is insufficient under complex data distributions. Real-world high-dimensional data often exhibits uneven density, skewed category distribution, non-independent and identically distributed (NID) clusters, or benign outliers. Traditional methods like K-Means typically require a pre-defined number of clusters K, making them ill-suited for unknown cluster numbers and multi-density data distributions. Density-based clustering methods like DBSCAN rely on fixed neighborhood radii, easily misclassifying sparse but normal data groups as noise in data with significant density differences. Hierarchical clustering methods are susceptible to distance concentration and noise points in high-dimensional data, potentially leading to unstable merging processes and difficulty in achieving clear convergent cluster structures under complex distributions. Especially in cases of NID data or outliers disguised as benign outliers, a single distance threshold, a pre-defined number of clusters, or ordinary hierarchical merging rules can all result in unstable clustering results.
[0006] Therefore, how to provide a low-leakage distance structure sufficient to support clustering for the clustering server without exposing the original high-dimensional data vector, and reduce the computational overhead of high-dimensional distance, while adapting to data distributions with uneven density, non-independent and identically distributed characteristics, and mixed abnormal objects, is a problem that existing privacy-preserving clustering technologies still need to solve. Summary of the Invention
[0007] To address the shortcomings of existing technologies, the purpose of this invention is to provide a privacy-preserving adaptive data clustering method and system.
[0008] According to the present invention, a privacy-preserving adaptive data clustering method includes: Step S1: The mask manager generates public parameters and establishes additive mask generation relationships with multiple data holders respectively; Step S2: Each data holder encodes the local data vector to be clustered to obtain an encoded data vector, and uses an additive mask generated according to the additive mask generation relationship to hide the encoded data vector, thereby obtaining a ciphertext vector and sending it to the clustering server; Step S3: The clustering server and the mask management party execute the distance-sensitive hashing (LSH) projection cancellation protocol. The clustering server performs low-dimensional random projection on the ciphertext vector, and the mask management party provides the corresponding mask projection scalar. The clustering server generates a low-dimensional hash signature for each data vector by canceling the ciphertext projection value with the mask projection scalar. Step S4: The clustering server constructs a distance proxy matrix between data objects based on the differences between the low-dimensional hash signatures; Step S5: The clustering server performs density-adaptive hierarchical clustering based on the distance proxy matrix to obtain one or more data clusters and identify noise points.
[0009] Preferably, the public parameters in step S1 include: data vector dimension, task public label, additive mask generation parameters, and distance-sensitive hash projection parameters; The additive mask generation relationship includes at least one of the following: a key homomorphic pseudo-random function, a one-time random vector, or other additively reconstructible masking mechanism.
[0010] Preferably, step S2 includes: Step S2.1: Each data holder encodes the data vector to be clustered using at least one of fixed-point coding, quantization coding, integer coding, finite field coding, or identity mapping to obtain the encoded data vector; Step S2.2: Each data holder generates a task-related additive mask corresponding to the task public label based on the task public label and the additive mask generation relationship; Step S2.3: Each data holder adds the encoded data vector and the task-related additive mask in the modulus space to form the ciphertext vector, and sends the ciphertext vector to the clustering server, so that the clustering server cannot directly recover the data vector to be clustered, thereby achieving privacy protection of the data.
[0011] Preferably, step S3 includes: Step S3.1: The clustering server synchronizes the distance-sensitive hash projection parameters with the mask management party; the clustering server calculates the inner product of the ciphertext vector and each of the distance-sensitive hash projection vectors to obtain the ciphertext projection value; Step S3.2: The mask manager calculates the mask projection value of the corresponding additive mask on each distance-sensitive hash projection vector according to the additive mask generation relationship, and only returns the mask projection value to the clustering server; Step S3.3: The clustering server performs a centering subtraction between the ciphertext projection value and the mask projection value to obtain the low-dimensional projection of the encoded data vector in each projection direction, and generates the low-dimensional hash signature based on the low-dimensional projection, thereby realizing the calculation of the low-dimensional projection of the original data vector in the ciphertext state.
[0012] Preferably, step S4 includes: the clustering server maps the normalized Hamming difference between the low-dimensional hash signatures of any two data objects to Euclidean distance surrogate values according to the hash bucket width, and normalizes them by the number of distance-sensitive hash projections, and the distance surrogate matrix is formed by the Euclidean distance surrogate values.
[0013] Preferably, step S5 includes: Step S5.1: The clustering server generates a candidate neighborhood radius set according to the distance distribution between data object pairs in the distance proxy matrix D and the candidate quantile set P. ;in, It is a quantile function. Distance proxy matrix D The Middle i The data object and the first j Distance proxy value between data objects; For the candidate quantile set P The first in One candidate quantile; Step S5.2: The clustering server performs multiple rounds of DBSCAN clustering on the unassigned data objects in the order of increasing neighborhood radius in the candidate neighborhood radius set. In each round of DBSCAN, the neighborhood relationship between objects is determined based on the distance proxy matrix D, and the clusters that meet the minimum cluster size threshold are added to the initial cluster set. Step S5.3: Calculate the representative points of the medoid for the initial cluster. And perform hierarchical merging based on the distance between representative points, where the two clusters V a and V b The merge distance between them is ; Choose a function for the minimum value of the independent variable. For data objects u With data objects v Distance proxy value between V , and Represents a data cluster; Cluster V The medoid represents a point; Step S5.4: Record the merging distance sequence during the hierarchical merging process, and determine the adaptive splitting point based on the maximum jump between adjacent merging distances. ;in, Choose a function for the maximum value of the independent variable, subscript To merge the position indices in the distance sequence; For the first level merging process The merge distance for +1 merge. For the first The merge distance of the next merge; Step S5.5: Obtain the final cluster set based on the adaptive splitting points, and mark data objects that are not stably assigned to any cluster or are significantly deviated from other clusters as noise points or suspected outliers.
[0014] According to a medical data processing method provided by the present invention, the following steps are performed based on the above-described privacy-oriented adaptive clustering method: Step T1: Receive adaptive clustering instructions for the data; Step T2: Each data holder acquires medical data, which includes at least one of patient feature vectors, medical image embedding vectors, or medical record representation vectors; Step T3: For the acquired medical data, adaptive clustering is performed using the privacy-preserving adaptive clustering method to obtain clustering results, which include one or more data clusters and noise points; Step T4: Based on the clustering results, perform case grouping analysis and abnormal case identification operations to obtain case grouping results and a list of suspected abnormal cases; The case grouping results include similar case groups corresponding to each data cluster and the statistical characteristics of the group. The statistical characteristics of the group only include the cluster size, the object identifier within the cluster, and the cluster representative point identifier, and do not include the original medical data vector of any data object. The list of suspected abnormal cases consists of data objects marked as noise points or significantly deviating from other clusters, and is used to trigger case review.
[0015] According to the present invention, a privacy-preserving adaptive data clustering system includes: Module M1: The mask manager generates public parameters and establishes additive mask generation relationships with multiple data holders respectively; Module M2: Each data holder encodes the local data vector to be clustered to obtain an encoded data vector, and hides the encoded data vector using an additive mask generated according to the additive mask generation relationship to obtain a ciphertext vector and send it to the clustering server; Module M3: The clustering server and the mask manager execute a distance-sensitive hashing (LSH) projection cancellation protocol. The clustering server performs a low-dimensional random projection on the ciphertext vector, and the mask manager provides the corresponding mask projection scalar. The clustering server generates a low-dimensional hash signature for each data vector by canceling the ciphertext projection value with the mask projection scalar. Module M4: The clustering server constructs a distance proxy matrix between data objects based on the differences between the low-dimensional hash signatures; Module M5: The clustering server performs density-adaptive hierarchical clustering based on the distance proxy matrix to obtain one or more data clusters and identify noise points.
[0016] Preferably, the public parameters in module M1 include: data vector dimension, task public label, additive mask generation parameters, and distance-sensitive hash projection parameters; The additive mask generation relationship includes at least one of the following: key homomorphic pseudo-random function, one-time random vector, or other additively reconstructable masking mechanism; The module M2 includes: Module M2.1: Each data holder encodes the data vector to be clustered using at least one of fixed-point encoding, quantization encoding, integer encoding, finite field encoding, or identity mapping to obtain the encoded data vector; Module M2.2: Each data holder generates a task-related additive mask corresponding to the task public label based on the task public label and the additive mask generation relationship; Module M2.3: Each data holder adds the encoded data vector and the task-related additive mask in the modulus space to form the ciphertext vector, and sends the ciphertext vector to the clustering server, so that the clustering server cannot directly recover the data vector to be clustered, thereby achieving privacy protection of the data.
[0017] Preferably, the module M3 includes: Module M3.1: The clustering server synchronizes distance-sensitive hash projection parameters with the mask management party; the clustering server calculates the inner product of the ciphertext vector and each distance-sensitive hash projection vector to obtain the ciphertext projection value; Module M3.2: The mask manager calculates the mask projection value of the corresponding additive mask on each distance-sensitive hash projection vector according to the additive mask generation relationship, and only returns the mask projection value to the clustering server; Module M3.3: The clustering server performs a centered subtraction between the ciphertext projection value and the mask projection value to obtain the low-dimensional projection of the encoded data vector in each projection direction, and generates the low-dimensional hash signature based on the low-dimensional projection, thereby realizing the calculation of the low-dimensional projection of the original data vector in the ciphertext state; The module M4 includes: the clustering server maps the normalized Hamming difference between the low-dimensional hash signatures of any two data objects to Euclidean distance surrogate values according to the hash bucket width, and normalizes them by the number of distance-sensitive hash projections, and the distance surrogate matrix is formed by the Euclidean distance surrogate values.
[0018] Preferably, the module M5 includes: Module M5.1: The clustering server generates a candidate neighborhood radius set according to the distance distribution between data object pairs in the distance proxy matrix D and the candidate quantile set P. ;in, It is a quantile function. Distance proxy matrix D The Middle i The data object and the first j Distance proxy value between data objects; The first quantile in the candidate quantile set P One candidate quantile; Module M5.2: The clustering server performs multiple rounds of DBSCAN clustering on unassigned data objects in the order of increasing neighborhood radius in the candidate neighborhood radius set. In each round of DBSCAN, the neighborhood relationship between objects is determined based on the distance proxy matrix D, and clusters that meet the minimum cluster size threshold are added to the initial cluster set. Module M5.3: Calculate the representative points of the medoid for the initial cluster. And perform hierarchical merging based on the distance between representative points, where the two clusters V a and V b The merge distance between them is ; Choose a function for the minimum value of the independent variable. For data objects u With data objects v Distance proxy value between V , and Represents a data cluster; The medoid denotes the point representing cluster V; Module M5.4: Records the merge distance sequence during the hierarchical merging process and determines the adaptive split point based on the maximum jump between adjacent merge distances. ;in, Choose a function for the maximum value of the independent variable, subscript To merge the position indices in the distance sequence; For the first level merging process The merge distance for +1 merge. For the first The merge distance of the next merge; Module M5.5: Obtains the final cluster set based on the adaptive splitting points, and marks data objects that are not stably assigned to any cluster or that are significantly deviated from other clusters as noise points or suspected outliers.
[0019] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention obtains a low-dimensional distance structure that can be used for clustering without the clustering server recovering the original data vector of any data holder, thus balancing the needs of data privacy protection and similarity analysis. 2. This invention utilizes the linear property of distance-sensitive hash projection to transform the nonlinear distance calculation in the high-dimensional ciphertext domain into the calculation of low-dimensional projection scalar cancellation and hash signature difference, thereby reducing computational and communication overhead and making it suitable for high-dimensional vector data or large-scale data object scenarios. 3. The present invention adopts an adaptive density hierarchical clustering method, which does not require a pre-defined number of clusters, nor does it rely on a single fixed neighborhood radius. It can more stably distinguish different data groups when there are multiple density data distributions, outlier data objects and abnormal data objects coexist. 4. The data clusters, noise points, and suspected anomaly clusters output by this invention can serve as a structured basis for subsequent anomaly detection, robust decision-making, risk identification, or security analysis, thereby reducing the need for direct inspection of individual plaintext data objects. 5. This invention can reduce the overhead of high-dimensional nonlinear computation in the encrypted domain and achieve distance-aware clustering while protecting the privacy of the original data. Attached Figure Description
[0020] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 Flowchart of an adaptive clustering method for privacy-preserving data.
[0021] Figure 2 This is an interactive graph for calculating the data distance matrix based on distance-sensitive hash projection cancellation.
[0022] Figure 3This is a flowchart of the iDBHC hierarchical adaptive clustering algorithm.
[0023] Figure 4 This is a partial screenshot of the improved density hierarchical clustering algorithm. Detailed Implementation
[0024] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0025] Example 1 The purpose of this invention is to address the problem in high-dimensional vector data analysis scenarios where the original data vectors should not be exposed, while the clustering server needs to obtain the distance structure to perform similarity analysis and clustering. To address the issues of high computational and communication overhead in high-dimensional encrypted distance calculations in existing privacy-preserving schemes, and the susceptibility of traditional clustering algorithms to misjudgments when multi-density data objects and anomalous objects are mixed, this invention proposes a privacy-preserving adaptive clustering method and system based on additive mask cancellation and distance-sensitive hashing.
[0026] The privacy-preserving adaptive clustering method for data based on additive mask cancellation and distance-sensitive hashing includes: Step 101: The mask manager, data manager, and data holders simultaneously disclose parameters. The mask manager establishes additive mask generation relationships with multiple data holders respectively. The disclosed parameters include at least the modulus q and p, the data vector dimension d, the number of distance-sensitive hash projections K, the hash bucket width w, the task public label τ, and the distance-sensitive hash projection parameters. The clustering server obtains the disclosed parameters and the set of data object identifiers, but does not obtain the original data vector or mask generation key of the data holders. For the i-th data holder, the mask manager and its corresponding task-related additive mask m... i Located in d-dimensional modulo space:
[0027] Where, m i Let p represent the additive mask corresponding to the i-th data holder, p represent the modulus, and d represent the dimension of the data vector. Let p be a d-dimensional integer vector space. Step 102: Each data holder stores the clustering data vector locally. Perform encoding to obtain the encoded data vector. Generate task-related additive masks based on the task's public label τ and the additive mask generation relationship. The encoded data vector will then be used. Task-related additive mask They are added together in the modulo space to form the ciphertext vector. It is then sent to the clustering server, so that the clustering server receives the vector representation hidden by the mask, as follows:
[0028]
[0029]
[0030] Where Encode(·) represents the encoding function, and MaskGen(·) represents the additive mask generation function. τ Indicates the task is public. This represents the ciphertext vector corresponding to the i-th data object.
[0031] Step 103: Perform projection calculation. The clustering server and the mask management unit synchronize projection vectors, and then perform ciphertext and mask projection calculations respectively. That is, calculate the ciphertext / mask projection value for each ciphertext / mask vector and the projection vector of the kth fixed point. Perform mask projection cancellation. After obtaining the mask projection value from the mask management unit, the clustering server performs centering cancellation on the ciphertext projection value and the mask projection value to obtain the low-dimensional data projection. Perform Hamming distance calculation for the data projection. The clustering server generates distance-sensitive hash signatures by combining random bias and hash bucket width, and constructs a distance proxy matrix D based on the Hamming difference between any two distance-sensitive hash signatures, as follows:
[0032]
[0033]
[0034]
[0035]
[0036] in, This is the projection vector of the k-th fixed point; The ciphertext projection value of the data of the i-th data holder in the k-th projection direction; The mask projection value of the data of the i-th data holder in the k-th projection direction; Let be the low-dimensional projection value of the data of the i-th data holder in the k-th projection direction; This means mapping elements in the modulo p space to a centralized integer range. This represents the hash value of the i-th data object in the k-th projection direction. For the random offset in the k-th projection direction; The width of the hash bucket; This represents the distance proxy value between the i-th data object and the j-th data object. This represents the Hamming difference between two hash signatures; For the number of distance-sensitive hash projections, For the distance-sensitive hash signature of the j-th data object; For the distance-sensitive hash signature of the i-th data object; Step 104: The clustering server generates an adaptive neighborhood radius set, extracts the distance distribution of data object pairs based on the distance proxy matrix D, and generates a candidate neighborhood radius set E according to the candidate quantile set P; it executes DBSCAN multiple times, performing multiple rounds of DBSCAN clustering on unassigned data objects in ascending order of candidate neighborhood radii, prioritizing the extraction of high-density and structurally stable data clusters, and marking the remaining objects as single-point clusters, noise candidates, or objects to be merged; it performs medoid hierarchical merging, calculates the medoid representative point for the obtained initial cluster V, and performs hierarchical merging based on the distance between the representative points of different clusters; it performs adaptive splitting and anomaly marking, records the merging distance sequence during the hierarchical merging process, determines the adaptive splitting point based on the maximum jump between adjacent merging distances, obtains the final cluster set, and marks data objects that fail to stably belong to any cluster or whose distance deviates significantly from other clusters as noise points or suspected anomalies, as detailed below:
[0037]
[0038]
[0039] Record the merge distance sequence during the hierarchical merging process, and determine the adaptive split point based on the maximum jump between adjacent merge distances. ; in, Indicates the candidate quantile. V , and Let V represent a data cluster, and med(V) represent the medoid representative point of cluster V. This represents the distance between representative points of two clusters. This represents the adaptive split point.
[0040] It should be noted that the number of projections K, bucket width w, quantile set P, encoding rules, and clustering splitting criteria can all be adjusted according to data dimension, data scale, privacy requirements, and clustering granularity. The encoding can be fixed-point encoding, quantization encoding, integer encoding, finite field encoding, or identity mapping. When the additive mask generation mechanism has rounding errors, quantization errors, or approximately homomorphic errors, the encoding can include scaling processing to ensure that the errors are located in the least significant bits and eliminated during subsequent rounding or decoding. The additive mask generation mechanism includes masking mechanisms based on key homomorphic pseudo-random functions with rounding learning, one-time random vectors, or other additively reconstructible masking mechanisms.
[0041] The present invention also provides a privacy-preserving adaptive clustering system for data based on additive mask cancellation and distance-sensitive hashing. The privacy-preserving adaptive clustering system for data based on additive mask cancellation and distance-sensitive hashing can be implemented by executing the process steps of the privacy-preserving adaptive clustering method for data based on additive mask cancellation and distance-sensitive hashing. That is, those skilled in the art can understand the privacy-preserving adaptive clustering method for data based on additive mask cancellation and distance-sensitive hashing as a preferred embodiment of the privacy-preserving adaptive clustering system for data based on additive mask cancellation and distance-sensitive hashing.
[0042] Example 2 Example 2 is a preferred example of Example 1. According to a medical data processing method provided by the present invention, the following steps are performed based on the above-described privacy-oriented adaptive clustering method: Step T1: Receive adaptive clustering instructions for the data; Step T2: Each data holder acquires medical data, which includes at least one of patient feature vectors, medical image embedding vectors, or medical record representation vectors; Step T3: For the acquired medical data, adaptive clustering is performed using the privacy-preserving adaptive clustering method to obtain clustering results, which include one or more data clusters and noise points; Step T4: Based on the clustering results, perform case grouping analysis and abnormal case identification operations to obtain case grouping results and a list of suspected abnormal cases; The case grouping results include similar case groups corresponding to each data cluster and the statistical characteristics of the group. The statistical characteristics of the group only include the cluster size, the object identifier within the cluster, and the cluster representative point identifier, and do not include the original medical data vector of any data object. The list of suspected abnormal cases consists of data objects marked as noise points or significantly deviating from other clusters, and is used to trigger case review.
[0043] Example 3 Example 3 is a preferred example of Example 1. The invention will be further described in detail below with reference to the accompanying drawings and examples of model update clustering in federated learning training rounds. It should be understood that the federated learning examples are only for illustrating the technical solutions of the invention. The invention can also be applied to scenarios requiring privacy-preserving clustering, such as medical data analysis, financial risk control, IoT anomaly detection, and cross-institutional vector similarity analysis. In the federated learning examples, the data vector to be clustered is the client model update vector; in the medical examples, the data vector to be clustered is patient features or image embeddings; in the financial examples, the data vector to be clustered is transaction behavior features; in the IoT examples, the data vector to be clustered is device status or network traffic features. The above applications do not change the core privacy-preserving distance estimation and clustering process of the invention.
[0044] like Figure 1 As shown, this embodiment involves a data holder (in this embodiment, the federated learning client holding local model update data), a clustering server (in this embodiment, the federated learning aggregation server), and a mask manager. The federated learning client, as the data holder, obtains the model update vector through local training and wishes to hide the vector's content. The aggregation server, as the clustering server, receives the ciphertext vector and is responsible for performing LSH signature generation, distance proxy matrix construction, and iDBHC adaptive clustering. The mask manager stores the mask generation relationship corresponding to the client and returns the mask projection scalar within the protocol's allowed range. The clustering server and the mask manager do not collude, and the clustering server does not possess the client's mask generation key.
[0045] In this federated learning scenario, some clients may be Byzantine clients, capable of controlling local data, the training process, and uploaded model updates. They may employ poisoning attacks such as label flipping and Gaussian noise, or operate a group of malicious clients to launch a Sybil attack. Meanwhile, benign clients may naturally form multiple update groups with varying densities under non-independent, identically distributed data conditions. The goal of this embodiment is to obtain a distance structure sufficient to support density-adaptive clustering without exposing the plaintext of individual client model updates, thereby preserving benign heterogeneous groups and isolating anomalous updates.
[0046] Step 201: The mask manager generates the modulus q and p, the data vector dimension d, the number of projections K, the bucket width w, and the task public label τ, and establishes an additive mask generation relationship with each data holder. The additive mask generation mechanism can be a key-homomorphic pseudorandom function, a one-time random vector, or other additively reconstructable masking mechanism; in this embodiment, MaskGen is preferably implemented using a key-homomorphic pseudorandom function (KHPRF) based on learning with rounding (LWR).
[0047] Specifically, the mask manager establishes a static key for the i-th data holder. The static key resides in an n-dimensional vector space modulo q, and the correspondence between the data holder identifier and the static key is maintained in secure storage; the clustering server only obtains the public parameters and data object identifiers, and does not obtain... .
[0048]
[0049] in, Let be an n-dimensional vector space over the ring of integers modulo q; For the publicly disclosed task label τ, the mask manager and the corresponding data holder generate a publicly disclosed task-related matrix based on the publicly disclosed pseudo-random expansion function. The matrix is located in a d×n dimensional matrix space modulo q:
[0050] in, It is a pseudo-random expansion function. It is a d×n dimensional matrix space in the modulo q space; Define a deterministic rounding mapping from a space modulo q to a space modulo p. Then, the task-related additive mask based on LWR can be expressed as:
[0051] Where q is greater than p, This means that the product vector modulo q is rounded proportionally to the space modulo p. ;because Derived from the publicly available task label τ, the masks obtained from different tasks or different training rounds are independent of each other; because The data is not disclosed to the clustering server, and the clustering server cannot generate or offset the mask of a single data holder from the disclosed parameters.
[0052] Step 202: The data holder completes data encoding, task-related additive mask generation, and ciphertext vector formation locally, so that the clustering server only receives the vector hidden by the mask. Specifically, step 202 includes: In step 2021, the client encodes the real-valued model update vector obtained from the local training in this round into an integer vector in the modulus space to support subsequent additive masking operations and fixed-point projection calculations. In this embodiment, fixed-point encoding is used to map the real-valued vector to the non-negative integer domain, and the encoding precision can be set according to the model dimension and precision requirements.
[0053]
[0054] In one implementation of fixed-point encoding, let prec represent the fixed-point precision. Let Δ represent the bias used to shift the real-valued coordinates to the non-negative interval, and let Δ represent an optional scaling factor. The Encode function can then be implemented as follows:
[0055] When no additional amplification of the encoding interval is required, Δ can be set to 1; when using an LWR mask and it is necessary to suppress the influence of rounding error on decoding, Δ can be set to be greater than the upper bound of LWR rounding error, so that the error is limited to the least significant bit.
[0056] In this embodiment of the federated learning secure aggregation scenario, 16-bit fixed-point precision and offset can be used. Scaling factor and message module As a set of optional parameters, the above values are only for example parameters and can be adjusted according to the data range, model dimension and allowable quantization error during actual deployment.
[0057] In step 2022, the client generates an additive mask bound to the current training round based on the mask generation relationship established with the mask manager and the public label τ of the current task. The public labels for different training rounds are different, making the mask round-dependent and avoiding cross-round reuse. In the implementation using LWR-KHPRF, MaskGen is jointly implemented by the public label derivation matrix, the client's static key, and a deterministic rounding mapping.
[0058]
[0059] The mask generation based on LWR-KHPRF also exhibits an approximately additive homomorphic property. For any two data holders i and j, the sum of their masks differs from the mask generated by the synthesized key only by a bounded rounding error e:
[0060]
[0061] Where γ is the upper bound of LWR rounding error. This property allows the mask manager to generate aggregate masks or projection masks based on the set of data objects when needed, without exposing a single static key to the clustering server; in the LSH signature generation step of this embodiment, the mask manager only returns the projection scalar of the mask in the public projection direction.
[0062] In step 2023, the client adds the encoded model update vector to the task-related additive mask in the modular space to obtain a ciphertext vector, which is then uploaded to the clustering server. Because the ciphertext vector contains an additive mask of the same dimension as the model update, the clustering server cannot directly recover the client's model update from a single ciphertext vector.
[0063]
[0064] Step 203: Perform distance-sensitive hash projection cancellation and construct the distance proxy matrix; as follows Figure 2 As shown, the clustering server and the mask manager perform lightweight projection cancellation around the same set of distance-sensitive hash projection vectors. Instead of calculating the exact Euclidean distance in the ciphertext field, the clustering server sequentially performs ciphertext projection, mask projection cancellation, and data projection Hamming distance calculation to approximate the distance relationship between client model updates.
[0065] Specifically, step 203 includes: In step 2031, the clustering server calculates the inner product of the ciphertext vector uploaded by each client and the projection vector of each fixed point to obtain the ciphertext projection value. The mask manager calculates the mask projection value of the corresponding additive mask in each projection direction based on the client identifier, the task public label τ, and the same projection vector, and returns only the projection scalar, not the mask vector itself. This process involves only linear projection and modular arithmetic, making it suitable for batch execution in high-dimensional model updates.
[0066]
[0067]
[0068] In step 2032, the clustering server requests the mask projection value from the mask manager, subtracts the ciphertext projection value from the mask projection value, and maps it to a centered integer range to obtain the low-dimensional projection proxy of the encoding model update in the corresponding projection direction. This step utilizes the commutative property of additive masks and linear projections to make the distance structure visible at the projection level, while the original high-dimensional update remains invisible.
[0069]
[0070] Step 2033: The clustering server combines the low-dimensional projection proxy with random bias and hash bucket width to obtain the distance-sensitive hash signature of each client model update in K projection directions; then, it calculates the distance proxy value based on the Hamming difference between any two client LSH signatures, forming the distance proxy matrix D. The bucket width w is used to adjust the collision probability and distance resolution, and the number of projections K is used to control the balance between signature stability and computational overhead.
[0071]
[0072]
[0073] Step 204, as follows Figure 4 and Figure 3 As shown, the clustering server performs adaptive neighborhood radius generation, multiple DBSCAN operations, medoid hierarchical merging, and adaptive segmentation based on the distance proxy matrix D to obtain stable client update clusters, noise points, and suspected outlier clusters. This step is used to handle the situation in federated learning where non-independent, identically distributed benign clients may form multiple natural clusters, while attacking clients may form dense anomalous clusters or disguise themselves as benign outliers.
[0074] Specifically, step 204 includes: Step 2041: After initializing the relevant variables, the clustering server extracts the distance proxy values of all client update pairs from the distance proxy matrix D, and then sorts them according to the candidate quantile set. Calculate multiple candidate neighborhood radii to obtain a candidate radius set E. The candidate radii are sorted in ascending order to cover client update groups of different densities.
[0075] In step 2042, the clustering server initializes the unassigned client set with all clients and performs DBSCAN on the unassigned clients sequentially according to the candidate radius from smallest to largest. In each round, the distance proxy matrix D is used to determine neighborhood relationships, thus prioritizing the extraction of clients with higher density and more stable structures to update clusters. For each cluster obtained from DBSCAN, if its size is not less than the minimum cluster size threshold MinPts, it is added to the initial cluster set and removed from the unassigned client set; clients that fail to form stable clusters are retained in larger candidate radii for further clustering attempts. After the candidate radius traversal is complete, clients that are still unassigned are marked as single-point clusters, noisy candidates, or objects to be merged, to reduce the probability of benign sparse clients being misjudged as abnormal.
[0076] Step 2043: The clustering server calculates a medoid representative point for each initial cluster and uses the medoid distance between clusters as the basis for hierarchical merging. Clusters are iteratively merged from smallest to largest distance, and the merged distance sequence is recorded. Compared to merging methods that rely on boundary points, using medoid representative points can reduce the impact of attacking clients connecting benign and anomalous clusters through bridging samples.
[0077]
[0078]
[0079] Step 2044: Perform adaptive splitting and anomaly labeling. The clustering server determines the adaptive splitting point based on the maximum transition position in the merged distance sequence to obtain the final cluster set; for client updates that are too small, significantly deviate from other clusters, or cannot be stably clustered under multiple rounds of candidate radii, they are marked as noise points or suspected anomalies.
[0080] In a set of exemplary experiments, to illustrate that the distance proxy matrix and iDBHC adaptive clustering described in this invention can maintain good clustering discrimination ability when heterogeneous data and abnormal updates coexist, non-independent identically distributed (Non-IID) data with a 30% proportion of malicious data holders were tested, where α represents the Dirichlet distribution parameter used to divide the Non-IID data, and the clustering effect data are shown in Table 1.
[0081] Table 1. Experimental data related to iDBHC clustering effect.
[0082] As shown in Table 1, under different Non-IID levels of MNIST and CIFAR-10, as well as ALIE, IPM, and Min-Max attack conditions, the average cluster purity remained between 0.949 and 1.000, indicating that the adaptive clustering can effectively distinguish between benign heterogeneous groups and anomalous groups.
[0083] To illustrate the computational efficiency of this invention in high-dimensional vector scenarios, the client-side computation time and server-side computation time of this method under different model dimensions are shown in Table 2.
[0084] Table 2 Comparison of computational efficiency under different model dimensions Model Dimension Client calculation time / ms Server-side calculation time / ms 20000 0.29 42.43 40000 1.41 190.39 60000 1.23 201.89 80000 1.95 213.26 100000 1.01 326.05 120000 1.88 243.96 As shown in Table 2, when the model dimension is 100,000, the client-side computation time of this method is approximately 1.01 ms, and the server-side computation time is approximately 326.05 ms. Compared with methods that require higher ciphertext computation overhead, this method reduces the nonlinear computation in the high-dimensional ciphertext domain by using low-dimensional LSH signatures and distance proxy matrices.
[0085] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0086] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A privacy-preserving adaptive data clustering method, characterized in that, include: Step S1: The mask manager generates public parameters and establishes additive mask generation relationships with multiple data holders respectively; Step S2: Each data holder encodes the local data vector to be clustered to obtain an encoded data vector, and uses an additive mask generated according to the additive mask generation relationship to hide the encoded data vector, thereby obtaining a ciphertext vector and sending it to the clustering server; Step S3: The clustering server and the mask management party execute a distance-sensitive hash projection cancellation protocol. The clustering server performs a low-dimensional random projection on the ciphertext vector, and the mask management party provides the corresponding mask projection scalar. The clustering server generates a low-dimensional hash signature for each data vector by canceling the ciphertext projection value with the mask projection scalar. Step S4: The clustering server constructs a distance proxy matrix between data objects based on the differences between the low-dimensional hash signatures; Step S5: The clustering server performs density-adaptive hierarchical clustering based on the distance proxy matrix to obtain one or more data clusters and identify noise points.
2. The privacy-preserving adaptive clustering method for data as described in claim 1, characterized in that, The public parameters in step S1 include: data vector dimension, task public label, additive mask generation parameters, and distance-sensitive hash projection parameters. The additive mask generation relationship includes at least one of the following: a key homomorphic pseudo-random function, a one-time random vector, or other additively reconstructible masking mechanism.
3. The privacy-preserving adaptive clustering method for data as described in claim 1, characterized in that, Step S2 includes: Step S2.1: Each data holder encodes the data vector to be clustered using at least one of fixed-point coding, quantization coding, integer coding, finite field coding, or identity mapping to obtain the encoded data vector; Step S2.2: Each data holder generates a task-related additive mask corresponding to the task public label based on the task public label and the additive mask generation relationship; Step S2.3: Each data holder adds the encoded data vector and the task-related additive mask in the modulus space to form the ciphertext vector, and sends the ciphertext vector to the clustering server, so that the clustering server cannot directly recover the data vector to be clustered, thereby achieving privacy protection of the data.
4. The privacy-preserving adaptive clustering method for data as described in claim 1, characterized in that, Step S3 includes: Step S3.1: The clustering server synchronizes the distance-sensitive hash projection parameters with the mask management party; the clustering server calculates the inner product of the ciphertext vector and each of the distance-sensitive hash projection vectors to obtain the ciphertext projection value; Step S3.2: The mask manager calculates the mask projection value of the corresponding additive mask on each distance-sensitive hash projection vector according to the additive mask generation relationship, and only returns the mask projection value to the clustering server; Step S3.3: The clustering server performs a centering subtraction between the ciphertext projection value and the mask projection value to obtain the low-dimensional projection of the encoded data vector in each projection direction, and generates the low-dimensional hash signature based on the low-dimensional projection, thereby realizing the calculation of the low-dimensional projection of the original data vector in the ciphertext state.
5. The privacy-preserving adaptive clustering method for data according to claim 4, characterized in that, Step S4 includes: the clustering server maps the normalized Hamming difference between the low-dimensional hash signatures of any two data objects to Euclidean distance surrogate values according to the hash bucket width, and normalizes them by the number of distance-sensitive hash projections, and the distance surrogate matrix is formed by the Euclidean distance surrogate values.
6. The privacy-preserving adaptive clustering method for data as described in claim 1, characterized in that, Step S5 includes: Step S5.1: The clustering server generates a candidate neighborhood radius set according to the distance distribution between data object pairs in the distance proxy matrix D and the candidate quantile set P. ;in, It is a quantile function. This represents the distance proxy value between the i-th data object and the j-th data object in the distance proxy matrix D; The first quantile in the candidate quantile set P One candidate quantile; Step S5.2: The clustering server performs multiple rounds of DBSCAN clustering on the unassigned data objects in the order of increasing neighborhood radius in the candidate neighborhood radius set. In each round of DBSCAN, the neighborhood relationship between objects is determined based on the distance proxy matrix D, and the clusters that meet the minimum cluster size threshold are added to the initial cluster set. Step S5.3: Calculate the representative points of the medoid for the initial cluster. And perform hierarchical merging based on the distance between representative points, where two clusters V a and V b The merge distance between them is ; Choose a function for the minimum value of the independent variable. For data objects u With data objects v Distance proxy value between V , and Represents a data cluster; The medoid denotes the point representing cluster V; Step S5.4: Record the merging distance sequence during the hierarchical merging process, and determine the adaptive splitting point based on the maximum jump between adjacent merging distances. ;in, Choose a function for the maximum value of the independent variable, subscript To merge the position indices in the distance sequence; For the first level merging process The merge distance for +1 merge. For the first The merge distance of the next merge; Step S5.5: Obtain the final cluster set based on the adaptive splitting points, and mark data objects that are not stably assigned to any cluster or are significantly deviated from other clusters as noise points or suspected outliers.
7. A medical data processing method, characterized in that, Based on the privacy-preserving adaptive data clustering method according to any one of claims 1 to 6, the following steps are performed: Step T1: Receive adaptive clustering instructions for the data; Step T2: Each data holder acquires medical data, which includes at least one of patient feature vectors, medical image embedding vectors, or medical record representation vectors; Step T3: For the acquired medical data, adaptive clustering is performed using the privacy-preserving adaptive clustering method to obtain clustering results, which include one or more data clusters and noise points; Step T4: Based on the clustering results, perform case grouping analysis and abnormal case identification operations to obtain case grouping results and a list of suspected abnormal cases; The case grouping results include similar case groups corresponding to each data cluster and the statistical characteristics of the group. The statistical characteristics of the group only include the cluster size, the object identifier within the cluster, and the cluster representative point identifier, and do not include the original medical data vector of any data object. The list of suspected abnormal cases consists of data objects marked as noise points or significantly deviating from other clusters, and is used to trigger case review.
8. A privacy-preserving adaptive data clustering system, characterized in that, include: Module M1: The mask manager generates public parameters and establishes additive mask generation relationships with multiple data holders respectively; Module M2: Each data holder encodes the local data vector to be clustered to obtain an encoded data vector, and hides the encoded data vector using an additive mask generated according to the additive mask generation relationship to obtain a ciphertext vector and send it to the clustering server; Module M3: The clustering server and the mask management party execute a distance-sensitive hash projection cancellation protocol. The clustering server performs a low-dimensional random projection on the ciphertext vector, and the mask management party provides the corresponding mask projection scalar. The clustering server generates a low-dimensional hash signature for each data vector by canceling the ciphertext projection value with the mask projection scalar. Module M4: The clustering server constructs a distance proxy matrix between data objects based on the differences between the low-dimensional hash signatures; Module M5: The clustering server performs density-adaptive hierarchical clustering based on the distance proxy matrix to obtain one or more data clusters and identify noise points.
9. The privacy-preserving adaptive data clustering system according to claim 8, characterized in that, The public parameters in module M1 include: data vector dimension, task public label, additive mask generation parameters, and distance-sensitive hash projection parameters; The additive mask generation relationship includes at least one of the following: key homomorphic pseudo-random function, one-time random vector, or other additively reconstructable masking mechanism; The module M2 includes: Module M2.1: Each data holder encodes the data vector to be clustered using at least one of fixed-point encoding, quantization encoding, integer encoding, finite field encoding, or identity mapping to obtain the encoded data vector; Module M2.2: Each data holder generates a task-related additive mask corresponding to the task public label based on the task public label and the additive mask generation relationship; Module M2.3: Each data holder adds the encoded data vector and the task-related additive mask in the modulus space to form the ciphertext vector, and sends the ciphertext vector to the clustering server, so that the clustering server cannot directly recover the data vector to be clustered, thereby achieving privacy protection of the data; The module M3 includes: Module M3.1: The clustering server synchronizes distance-sensitive hash projection parameters with the mask management party; the clustering server calculates the inner product of the ciphertext vector and each distance-sensitive hash projection vector to obtain the ciphertext projection value; Module M3.2: The mask manager calculates the mask projection value of the corresponding additive mask on each distance-sensitive hash projection vector according to the additive mask generation relationship, and only returns the mask projection value to the clustering server; Module M3.3: The clustering server performs a centered subtraction between the ciphertext projection value and the mask projection value to obtain the low-dimensional projection of the encoded data vector in each projection direction, and generates the low-dimensional hash signature based on the low-dimensional projection, thereby realizing the calculation of the low-dimensional projection of the original data vector in the ciphertext state; The module M4 includes: the clustering server maps the normalized Hamming difference between the low-dimensional hash signatures of any two data objects to Euclidean distance surrogate values according to the hash bucket width, and normalizes them by the number of distance-sensitive hash projections, and the distance surrogate matrix is formed by the Euclidean distance surrogate values.
10. The privacy-preserving adaptive data clustering system according to claim 7, characterized in that, The module M5 includes: Module M5.1: The clustering server generates a candidate neighborhood radius set according to the distance distribution between data object pairs in the distance proxy matrix D and the candidate quantile set P. ;in, It is a quantile function. Distance proxy matrix D The Middle i The data object and the first j Distance proxy value between data objects; For the candidate quantile set P The first in One candidate quantile; Module M5.2: The clustering server performs multiple rounds of DBSCAN clustering on unassigned data objects in the order of increasing neighborhood radius in the candidate neighborhood radius set. In each round of DBSCAN, the neighborhood relationship between objects is determined based on the distance proxy matrix D, and clusters that meet the minimum cluster size threshold are added to the initial cluster set. Module M5.3: Calculate the representative points of the medoid for the initial cluster. And perform hierarchical merging based on the distance between representative points, where two clusters V a and V b The merge distance between them is ; Choose a function for the minimum value of the independent variable. For data objects u With data objects v Distance proxy value between V , and Represents a data cluster; The medoid denotes the point representing cluster V; Module M5.4: Records the merge distance sequence during the hierarchical merging process and determines the adaptive split point based on the maximum jump between adjacent merge distances. ;in, Choose a function for the maximum value of the independent variable, subscript To merge the position indices in the distance sequence; For the first level merging process The merge distance for +1 merge. For the first The merge distance of the next merge; Module M5.5: Obtains the final cluster set based on the adaptive splitting points, and marks data objects that are not stably assigned to any cluster or that are significantly deviated from other clusters as noise points or suspected outliers.
