Density peak-based data clustering method, device and medium
By combining the mixed density values of absolute density and relative density to identify cluster centers, and using the effective lower-level and k-level upper-level distributions to determine labels, the problem of difficult initial center selection and inaccurate allocation of remaining points in the DPC method is solved, thus realizing automated and accurate data clustering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU UNIV OF INFORMATION TECH
- Filing Date
- 2022-05-10
- Publication Date
- 2026-05-01
AI Technical Summary
Existing density peak-based clustering method DPC requires manual selection of initial cluster centers, which makes it difficult to handle datasets with uneven density. Furthermore, the remaining point allocation strategy can easily lead to a chain reaction, resulting in inaccurate clustering results.
Cluster centers are identified by combining absolute and relative density values, and labels for remaining points are determined using effective lower-level and k-level upper-level distributions. Clustering is performed using a combination of density and local structure methods.
It enables automated clustering without the need for manual setting of center points, improving clustering accuracy and efficiency when dealing with complex datasets, and adapting to data with uneven density and high dimensionality.
Smart Images

Figure CN115205566B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of cluster analysis technology, specifically, it relates to a data clustering method, device, and medium based on density peaks. Background Technology
[0002] Clustering analysis is an unsupervised learning machine learning method that assigns data to different sets based on their similarity, resulting in higher similarity among samples within the same set and lower similarity among samples in different sets; these sets are called clusters. Existing clustering methods can be divided into different categories based on different interpretations of similarity, typically distance-based methods and density-based methods. In 2014, Rodriguez and Laio proposed Clustering by Fast Search and Find of Density Peaks (DPC), a popular density-based clustering method. DPC is based on two assumptions: the first is that cluster centers are local density peaks, and the second is that non-cluster centers should be in the same cluster as their high-density nearest neighbors. Due to its simplicity and efficiency, DPC has been widely used in image processing, information security, big data, and other fields. For example, for an image set, it clusters similar images into one category. However, DPC has the following drawbacks: First, the selection of initial cluster centers is manual, which can be extremely difficult or even impossible in some cases. Secondly, considering only absolute density while ignoring relative density means the method cannot handle clusters with uneven density well. Finally, DPC's residual point allocation strategy will lead to a "chain reaction," meaning that when a high-density point is assigned to the wrong cluster, its lower-density neighbors are likely to be assigned to the same wrong cluster. Summary of the Invention
[0003] The purpose of this invention is to overcome the technical problems raised in the background art and propose a data clustering method, apparatus, and medium based on density peaks, starting from the inconsistency between assumptions and implementations and the inapplicability of assumptions. It utilizes direct subordinates to describe the relative density of each data point, designs a hybrid density value combining relative and absolute density to identify cluster centers, defines effective subordinates based on similarity reachability, performs primary allocation of non-center points, and combines the k-level upper-level distribution of different clusters to determine the labels of remaining points. This effectively groups data points of the same category in the dataset into one category, efficiently and accurately completing the classification of the dataset.
[0004] The specific technical solution of the present invention is as follows:
[0005] According to a first technical solution of the present invention, a data clustering method based on density peaks that combines mixed density and local structure is provided, the method comprising:
[0006] Obtain a dataset, which may be a text set or an image set. When the dataset is a text set, extract word features from the text set and use the word features as data points. When the dataset is an image set, use the images from the image set as data points and calculate the absolute density of each data point. Sort the data points by absolute density to obtain the high-density nearest neighbors of the data points and use the number of direct subordinates of the data points as the relative density value of the data points. Determine the mixed density cluster centers by combining the relative density with the absolute density. Gradually allocate the mixed density cluster centers using effective subordinate relationships using the following formula (9):
[0007]
[0008] Where, L(x) i ) represents data point x i The tag, Ll(x) j ) represents data point x j The direct subordinate set, DR(x) j ) represents data point x j The set of similar reachable points.
[0009] According to a second technical solution of the present invention, a data clustering device based on density peaks that combines mixed density and local structure is provided. The device includes a processor configured to: acquire a dataset, the dataset being a text set or an image set; when the dataset is a text set, extract word features from the text set and use the word features as data points; when the dataset is an image set, use the images from the image set as data points and calculate the absolute density of each data point; obtain the high-density nearest neighbors of the data points by sorting the absolute density of each data point, and use the number of direct subordinates of the data points as the relative density value of the data points; express the mixed density according to the relative density combined with the absolute density to determine the mixed density cluster centers; and gradually allocate the mixed density cluster centers using effective subordinate relationships through the following formula (9):
[0010]
[0011] Where, L(x) i ) represents data point x i The tag, Ll(x) j ) represents data point x j The direct subordinate set, DR(x) j ) represents data point x jThe set of similar reachable points.
[0012] According to a third technical solution of the present invention, a computer-readable storage medium is provided, on which computer-readable instructions are stored, which, when executed by a computer processor, cause the computer to perform the methods described in various embodiments of the present invention.
[0013] According to the data clustering method, apparatus, and medium based on density peaks of the present invention, when clustering a dataset, there is no need to manually set the center point. It can achieve automated clustering, assigning data points belonging to the same category in the dataset to the same cluster, thus efficiently and accurately completing data clustering. This effectively improves the processing efficiency and clustering accuracy when dealing with complex datasets such as cross-cutting, non-uniform density, and high-dimensional data. Attached Figure Description
[0014] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0015] Figure 1(a) shows the decision graph on the Jain dataset using the DPC method.
[0016] Figure 1(b) shows the clustering results of the DPC method on the Jain dataset.
[0017] Figure 2(a) shows the decision graph on the Pathbased dataset using the DPC method.
[0018] Figure 2(b) shows the clustering results of the DPC method on the Pathbased dataset.
[0019] Figure 3 (a)-(c) are the similarity definition and two-step assignment.
[0020] Figure 4(a) shows the decision graph of the new method on the Jain dataset.
[0021] Figure 4(b) shows the clustering process of the new method on the Jain dataset.
[0022] Figure 4(c) shows the clustering process of the new method on the Jain dataset.
[0023] Figure 4(d) shows the decision graph of the new method on the Pathbased dataset.
[0024] Figure 4(e) shows the clustering process of the new method on the Pathbased dataset.
[0025] Figure 4(f) shows the clustering process of the new method on the Pathbased dataset.
[0026] Figures 5(a)-(c) show the allocation process of the k-th level of the Twomons dataset.
[0027] Figures 6(a)-(x) are visualizations of the clustering results.
[0028] Figure 7 This is a flowchart of a data clustering method based on density peaks according to an embodiment of the present invention. Detailed Implementation
[0029] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0030] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0031] The invention will now be further described with reference to the accompanying drawings.
[0032] According to the existing DPC method, the DPC method represents the similarity of different data points based on the distance between them, following two main ideas: (1) the density of the cluster center is greater than that of its neighbors and the distance between it and sample points with higher density is relatively large; (2) non-centers are in the same cluster as their high-density nearest neighbors. Therefore, the DPC method determines the cluster center point based on the density ρ and distance δ of each data point, and then allocates the data of non-center points according to the remaining point allocation strategy. This method first calculates the local density of each data point. For a data point x i Local density ρ i From Gauss's kernel:
[0033]
[0034] Where, ρ i d represents the absolute density of each data point. ij =dist(x i ,x j ) represents the distance between two data points, usually Euclidean distance; d cThe cutoff distance is set by user input or by adjusting it according to the dataset distribution at a rate of 1%-2% (i.e., a data point distance less than d). c The average number of neighbors is approximately 1%-2% of the total number of points in the dataset.
[0035] Using local absolute density ρ i Point x i distance δ i Defined as:
[0036]
[0037] The δ value of the sample point with the highest density is the distance between that point and the data point farthest from it, while the δ value of the data point without the highest density is the distance between that point and its high-density nearest neighbor.
[0038] The DPC method assumes that cluster centers are local density peaks, which typically have high ρ values and are usually far from points with even higher density, indicating high δ values. In contrast to the smaller ρ and δ values of non-cluster centers, a minority of sample points have larger ρ and δ values; this difference is reflected and detected in the decision graph. Then, given the cluster centers, the remaining points are assigned to their high-density nearest neighbors in the same cluster to complete the clustering.
[0039] The DPC method is mainly based on two assumptions: (1) cluster centers are local density peaks, and (2) non-center points should be in the same cluster as their highest-density nearest neighbors. Research has revealed two problems with DPC.
[0040] First, there is an inconsistency between the initial assumption and the implementation. It is assumed that the center point is a local density peak, but the decision graph selects the center point based on a global concept. That is, relative to all data points, the data point with the largest density value is selected as the cluster center. However, within the local data domain where the center point is located, the point may be a local peak, and its density value relative to the entire dataset may not be large. This inconsistency makes it difficult for DPC to identify suitable cluster centers from the decision graph, even with manual identification, when faced with clusters of uneven density. As shown in Figure 1(a) of the decision graph for the Jain dataset, the center points are clearly selected as data points numbered 206 and 119, but the clustering result of DPC on the Jain dataset, as shown in Figure 1(b), shows a clear error.
[0041] Second, the second assumption is that non-centroids should be in the same cluster as their direct parent. However, not all data points are suitable for being assigned to the same cluster as their direct parent. For example, point D in Figure 2(b) has point E as its direct parent, but the two points are clearly not in the same cluster. This assumption only considers the relationship between a data point and its direct parent when assigning non-centroids, ignoring the local structure of the data. This makes DPC only applicable to convex datasets, and the one-step assignment strategy is prone to chain reactions. When facing complex data situations, even if the centroids are relatively correct, the remaining point assignment strategy will lead to incorrect results. As shown in the decision graph of the Pathbased dataset in Figure 2(a), the cluster center selection is relatively correct, but the clustering result is as shown in Figure 2(b).
[0042] To address the problems of the aforementioned DPC method, this invention proposes a density peak-based data clustering method that combines mixed density and local structure.
[0043] Figure 7 A flowchart illustrating a data clustering method based on density peaks according to an embodiment of the present invention is shown. Figure 7 As shown, the method begins in step S100, acquiring a dataset, which can be a text set or an image set. When the dataset is a text set, word features are extracted from the text set and used as data points. When the dataset is an image set, images from the image set are used as data points, and the absolute density of each data point is calculated. It should be noted that the dataset can also be a speech set or a video set. The speech set includes at least one speech data point, which is converted into text data, and word features are extracted from the text data, with the corresponding word features used as data points. The video set includes at least one video data point, which is decomposed frame by frame into individual image frames, with each image frame used as a data point. Therefore, this invention can cluster or classify data such as text, speech, images, and videos. For example, in an image set containing a large number of images, similar images can be clustered together based on automatically selected labels (the label selection method will be explained in detail in subsequent steps), achieving unsupervised automatic clustering.
[0044] In some embodiments, the absolute density of each data point is calculated using the following formula:
[0045]
[0046] Where, ρ i d represents the absolute density of each data point. c The cutoff distance is set by user input or by adjusting it according to the dataset distribution at a rate of 1%-2% (i.e., a data point distance less than d). cThe average number of neighbors is approximately 1%-2% of the total number of points in the dataset, sign(d ij -d c ) is an indicator function, if d ij -d c If ≤0, then sign(d) ij -d c ) = 1; otherwise sign(d ij -d c ) = 0. According to equation (5), x i density ρ i It is determined by distance x i Less than or equal to d c The point contribution is the only difference between equation (5) and equation (2). This change will avoid x i The density of a particle is affected by points that are too far away from it, which can improve performance to some extent.
[0047] In step S200, the hierarchical relationship (high-density nearest neighbor) of each data point is obtained by sorting the data points by their absolute density, and the number of subordinates of each data point is used as the relative density value of each data point.
[0048] Sort the data points by absolute density to obtain their high-density nearest neighbors. To simplify the description of the relationship between a data point and its high-density nearest neighbor, we first define the following concept: Given two data points x1 and x2, if x2 is the high-density nearest neighbor of x1 (i.e., δ), then... 12 =d 12 Then x1 is called the direct subordinate of x2, and x2 is called the direct superior of x1. This relationship is represented by x1→x2.
[0049] In step S300, several data points are selected from all data points as cluster centers based on their relative density and absolute density.
[0050] Using a Gaussian kernel to obtain the local absolute density of each point, however, using absolute density to identify cluster centers creates inconsistencies between local and global data, making it difficult to identify low-density cluster centers. To eliminate this inconsistency, a density value representing a global concept needs to be used to replace the original density measure. The relative density relationship is described using the number of direct subordinates of each point, providing a unified relative density measure for global data with different densities, and increasing the prominence of low absolute density peaks in the global data.
[0051] However, data points with high absolute density also tend to have a high number of direct neighbors, which can lead to a high relative density for these data points. This can cause data points with low absolute density but high relative density to be overlooked, affecting the accuracy of cluster center determination. Therefore, in addition to using direct neighbors to represent relative density relationships, we introduce absolute density values to further measure the density information of data points. This fully reveals the density relationship between sample points and the global data, eliminating the impact of large density differences between different clusters on the clustering results.
[0052] The density expression, combining relative and absolute density, is given by the following formula:
[0053]
[0054]
[0055] Where, when x i It is x j When it is a direct subordinate, ζ(x) i ,x j The value is 1 if the condition is not met, and 0 otherwise. r (i), ρ m (i) represent x respectively i The relative density and mixed density are given by the formula, and max() represents the maximum value function. The new formula does not require additional parameters and retains higher relative density values for points with low absolute density, reducing the likelihood of data points with both high absolute and relative density acting as cluster centers.
[0056] DPC uses decision graphs to identify data points with larger ρ and δ values as cluster centers, but this often requires human expert involvement, making the DPC clustering process cumbersome. Considering the characteristics of cluster centers, the following function is used to measure the probability of each point becoming a cluster center:
[0057]
[0058] Among them, S i ρ represents the probability that a data point is a cluster center. m `max()` represents the mixture density value, and `max()` represents the maximum value function. The c most likely points are selected as cluster centers from all data points. For example, Figures 4(a) and (d) show the correct cluster centers selected in the Jain and Pathbased datasets.
[0059] By defining hierarchical relationships, DPC assigns labels from the upper level to the lower level without considering the data distribution between them. This invention uses the local structure between the upper and lower levels to determine whether the lower level can be assigned a label, and defines the lower level that can be assigned a label as a valid lower level.
[0060] Therefore, in step S400, each data point is allocated according to the effective subordinate relationship of the cluster center and the k-level superior, until all non-cluster centers have been allocated.
[0061] Suppose there are two data points K and L, such as Figure 3 As shown in (b), the two data points are close to each other and contribute to each other's density values. However, defining similarity solely by distance easily overlooks the local structure of the data points, and the algorithm's robustness is poor due to the influence of random distribution, making it unable to adapt to complex data situations. If the two data points are not only close to each other but also have many overlapping data points contributing to each other's density values, then... Figure 3 (a) If the midpoints H and I are similar, then they have similar local structures and their data points are relatively closely arranged, ruling out the possibility of large gaps between them, thus concluding that they are similar. If data point x i and x j Having similarity and x j With x k If they also have similarities, then x i With x k They are similar. For example Figure 3 In (a), point H determines that point J is similar to point I. If the similarity is passed from the superior to the subordinate, then this point is a valid subordinate to which a label is assigned.
[0062] Cluster centers are local density peaks. Sub-clusters of a cluster have higher density values and greater influence than non-center sub-clusters, and are considered core data points of the entire cluster. Identifying effective sub-clusters starting from the center can reveal the main structure of the cluster, as defined below:
[0063] Definition 1 (Maximum number of cutoff points): The distance from the data point x in the data set. i The distance is less than the cutoff distance d c The number of data points is the cutoff point number. The maximum cutoff point number is denoted as MCD.
[0064] Definition 2 (Maximum Cut-Off Nearest Neighbor): For data point x i The nearest two MCD data points are the maximum truncation nearest neighbors, denoted as MCDNN(x). i ).
[0065] Definition 3 (Similarity): For data point x i and x j The distance between them is less than d c And MCDNN(x) i ) and MCDNN(x j The number of overlapping points between two points is greater than the MCD. That is, two points are defined as similar.
[0066] Definition 4 (Similarity Reachability): For x i Point, if x j If a point is a data point that can be reached through similarity, then there exists a path x1 = x2. i ,x2,…x n =x j Any point xk satisfies x k ∈MCDNN(x k+1 ), and number(MCDNN(x k )∩MCDNN(x k+1 ))≥MCD.
[0067] Definition 5 (Effective Subordinate): If the superior x i and subordinate x j If x is reachable from x based on similarity, then x j For x i The effective subordinate of. Denotes it as x. j ∈DR(x i The concept of effective subordinate allocation is represented as follows:
[0068]
[0069] Where, L(x) i ) represents x i The tag, Ll(x) i ) represents x i The direct subordinate set of DR(x) i x represents i Similarity reachable sets. Data points that are reachable due to similarity indicate that the two points are necessarily similar, and that there are relatively compactly arranged points within the cluster, located in the core region of the cluster. To further combine the characteristics of similarity and lower-level assignment, labels are assigned to the similarity reachable points of the cluster centers.
[0070] By assigning the cluster center labels to non-center points according to their effective subordinates, the cluster core data has been clustered, forming the main structure of the clusters. For unassigned boundary region data points, the distance from the point to different cluster trunks will be calculated, and the point will be preferentially assigned to the nearest cluster.
[0071] This method measures the similarity between boundary points and different clusters and combines this with the data distribution of cluster core points, thus it is effective for clustering data of various densities. Based on the similarity between boundary points and different clusters, it determines the cluster to which a point belongs. This prevents errors in higher-level assignments from affecting lower-level assignments, thereby breaking the chain reaction. However, to reduce computation time, the distance from the data point to be assigned to each cluster's k-level parent is used to represent the distance from that point to different clusters. For example... Figure 3In (c), points A and B can be correctly assigned when k=1. The specific definition of the upper level of k is given below.
[0072] Definition 6 (k-level upper level): For data point x i In the same cluster, the k nearest data points among the data points with higher density are sorted by distance and are the k upper layers.
[0073] This assignment strategy aims to assign labels to boundary points. The calculation for the sum of distances between a boundary point and all distances to its k-level parent is as follows:
[0074]
[0075] Where, x b It is an unassigned point, B c It is the set of the k-th level superiors of the c-th cluster, ||x b -x i || 2 x represents b and x i The Euclidean distance between them is SB(x) b B c ) represents x b The sum of distances to the k-th level parent clusters of different clusters. Then, the remaining points are assigned to the labels of the clusters with the smallest distances, as shown in the following formula:
[0076]
[0077] Here, C is the number of clusters, and the entire process continues until all unallocated data points have been allocated. Figure 5 shows the allocation of remaining points using this strategy, where point A is closer to the center of the green cluster. If the allocation method is followed according to the method of allocating points closer to the center, point A will be allocated incorrectly.
[0078] The time complexity of this invention is mainly in the following five aspects: (1) The time complexity of calculating the distance matrix is O(n 2 (2) Determine the direct superior of each point and calculate the distance value δ. The time complexity is O(n^2). 2 (3) Count the number of direct subordinates to represent the relative density O(n) and calculate the mixed density value O(n). (4) Obtain the maximum truncated nearest neighbor for each point, and determine the similarity based on the overlapping nearest neighbor situation. The time complexity is O(n). 2 (5) Calculate the sum of distances from the remaining points to the k-th level higher-level points in different clusters. Since the distance matrix has already been calculated, this step only requires selecting the k nearest high-density points for each cluster and summing their distances, resulting in a time complexity of O(n). In summary, the time complexity of the algorithm mentioned in this paper is O(n). 2 ).
[0079] During edge point assignment, the k-th level parent of each cluster is selected to represent the distance from that point to different clusters. A larger k value results in longer computation time but allows for consideration of more data distribution; the optimal clustering effect is achieved as the k value increases. For example, in Figure 5, point A is assigned a label based solely on the distance from that point to the level parent of different clusters. This point belongs to the right-hand cluster, and the result remains unchanged as k gradually increases.
[0080] For artificially synthesized datasets, the NMI value remains unchanged regardless of the parameter k, which ranges from 1 to 20. The UCI dataset achieves its optimal NMI value around k=8. The difference between the UCI and artificially synthesized datasets lies in the fact that the UCI dataset is a high-dimensional dataset with a complex data distribution; considering only a single data point cannot represent the entire cluster's data distribution. However, as k increases, the best clustering effect is reached around k=8. In general, for low-dimensional data, a k value of 5 or less is recommended, while for high-dimensional datasets, a k value between 5 and 10 yields the best clustering results. Overall, although the new method introduces the parameter k, its value is easily determined, and the parameter sensitivity is extremely low.
[0081] The following experiments will test the performance of the new method. Five popular methods—DPC, K-means, DBSCAN, Single-link, and DGB—will be used as comparative experimental groups. The experimental data will consist of 10 artificially synthesized datasets and 10 real-world datasets. Method metrics will be ARI, NMI, and F1. NMI and F1 range from 0 to 1.0, while ARI ranges from -1.0 to 1.0. For each of the three metrics, a higher value indicates better method performance. The source code for DPC and DGB is provided by the authors. Implementations of other clustering methods were collected from the MATLAB Toolbox or the MATLAB Central File Exchange.
[0082] Tables 1 and 2 list the details of the synthetic and real-world datasets required for the experiments, all sourced from the UCI Machine Learning Repository. These datasets contain complex data distributions, including irregular shapes, non-uniform densities, varying cluster sizes, and cluster overlap, posing specific challenges to various aspects of clustering methods. Therefore, these datasets are used to evaluate the performance of different aspects of clustering methods.
[0083] For the different parameters required by the method in the experiment, we set the number of clusters to the actual number of clusters. For other parameters, we tested a set of parameter values and took the best test result as the final result. The DPC method requires d... c The target value is between 1% and 2%, as suggested by the algorithm authors (i.e., a data point is less than d). cThe average number of neighbors is approximately 1%-2% of the total number of points in the dataset, but an optimal value cannot be obtained. Therefore, we use a value between 0% and 10% to select the best parameter value. Selecting cluster centers from the decision graph for DPC is also quite difficult. After multiple attempts, the most suitable cluster centers are selected, and the best value among the three indicators is taken as the final result. The MinPts parameter of DBSCAN is tested with a step size of 1 from 1 to 10, and Eps is calculated based on MinPts. k-means and Single-link only require setting the correct number of clusters. DGB has three input parameters: number of clusters nc, grid size ng, and cutoff factor cf, and the optimal value is selected after testing. Our proposed method d c The cluster settings are the same as the original DPC, and there is no need to select cluster centers through a decision graph. Cluster centers are automatically identified using a function.
[0084] Table 1. Information on artificial datasets
[0085]
[0086] Table 2 Real-word dataset information
[0087]
[0088] In this embodiment of the invention, we compare the clustering results of the new method with DPC, k-means, DBSCAN, Single-link, and DGB on 10 artificial datasets. The ARI, NMI, and F1 scores are shown in Table 4 below, and the parameters are shown in Table 3. The clustering results are also visualized. The key datasets will be described in detail below.
[0089] The Jain dataset contains two clusters with uneven density. DPC failed to determine the correct cluster centers and correctly assign remaining points, while the new method perfectly overcomes these two shortcomings, achieving a performance of 1.00 on all three metrics. DGB and DBSACN also achieved good clustering results, but performed poorly on the boundary regions of low-density clusters. k-means performed similarly to the original DPC, identifying the regions of high-density clusters near low-density clusters as low-density clusters, resulting in poor performance. Single-link failed to complete clustering, and the clustering results are shown in Figures 6(s)-(x).
[0090] R15 contains 15 clusters, with the outer clusters being farther apart and the inner clusters being closer together. D31 contains 31 clusters, with different clusters being closer together. The density is high at the center of each cluster, decreasing towards the edge. The cluster data distribution satisfies the DPC's residual point allocation strategy, assigning unassigned data points to their high-density nearest neighbors. The new method achieves state-of-the-art results on both datasets, indicating that it retains the advantages of the original DPC. DGB and DBSCAN fail to correctly assign data points at intersections between different clusters and identify boundary points as noise, resulting in overall performance inferior to DPC and the new method. k-means also fails to correctly assign boundary points. Single-link fails to cluster both datasets; the clustering results are shown in Figures 6(g)-(r).
[0091] The Pathbase dataset contains three clusters. The new method achieved the best results and significantly improved the performance compared to DPC. As analyzed earlier, the new method significantly improves the allocation of remaining points in DPC when the cluster centers are correctly selected. DPC and k-means methods fail to correctly allocate the portions where inner and outer clusters meet. While the DBSCAN method can correctly allocate inner clusters, its performance is poor because the density of outer ring clusters is lower than the Minpts standard value, leading to the outer ring clusters being identified as noise.
[0092] The A3 dataset contains 50 clusters, and the new method achieved the best performance. DPC cluster centers showed three incorrect cases. DGB and DBSCAN still performed poorly in handling cluster boundary points. The k-means method, due to biases in cluster center selection and the near-center principle in the assignment process, resulted in the merging of two clusters. The Single-link method merged clusters that were close together into one, thus performing poorly. The A3 clustering results are shown in Figures 6(a)-(f).
[0093] Table 3. Parameters of the six methods on the artificial set.
[0094]
[0095] Table 4. Performance of the six methods on artificial datasets.
[0096]
[0097]
[0098] This invention compares the performance of six methods on 10 real-world datasets. Table 2 shows the detailed information of the datasets. The testing criteria are ARI, NMI, and F1 score. The experimental results are shown in Table 6, with the best results highlighted in bold. Specific parameter settings are shown in Table 5.
[0099] As can be seen from the table, the new method achieves better performance than other methods in most cases. Specifically, the new method outperforms other methods in three criteria across four datasets: Iris, Waveform, Zoo, and Dermatology. Furthermore, it surpasses other methods in two metrics on the Libras Movement, Spambase, and Seeds datasets. For non-optimal metrics, the new method is at a suboptimal level or just below the suboptimal level.
[0100] The new method shows significant improvements over DPC on the Iris, Seeds, Waveform, Zoo, Dermatology, Liver-disorders, Libras Movement, Wine, and Spambase datasets. Specific improvements over DPC on datasets where the new method outperforms DPC in all three metrics (ARI, NMI, and F1) are as follows: Iris, 30%, 21%, 8%; Waveform, 53%, 34%, 7%; Zoo, 95%, 30%, 45%; Dermatology, 81%, 26%, 25%; Liver-disorders, 200%, 500%, 20%; Libras Movement, 172%, 48%, 33%; Wine, 67%, 44%, 14%; Spambase, 140%, 23%, 0.6%. For the Statlog(heart) dataset, the new method shows little difference from DPC in the three metrics, indicating that our improvements to DPC are effective. None of the methods achieved good results on the Spambase dataset, but the new method still achieved the best values in NMI and F1 compared to other methods, while the DGB method achieved the best value in ARI.
[0101] On the Wine dataset, the k-means method outperformed DPC and the new method, achieving the best NMI and F1 scores. Although the new method achieved the highest score in ARI, it was only 0.011 higher than the k-means method. On the Liver-disorders dataset, none of the methods achieved good results. The new method, DGB, and Single-link achieved the best scores in ARI, NMI, and F1, respectively, but the new method's NMI and F1 scores were only slightly lower than the best.
[0102] Experimental results show that the novel method proposed in this invention achieves better scores on at least 70% of real-world datasets, outperforming DPC, DGB, k-means, DBSCAN, and Single-link in most cases. Combined with the good performance of the novel method on synthetic datasets, this indicates that the new method significantly improves upon the original DPC method and outperforms DGB, k-means, DBSCAN, and Single-link, exhibiting better generalization performance. The new method identifies cluster centers based on relative density, enabling it to handle more complex density-varying data. While retaining the DPC pattern of cluster growth from high-density to low-density regions, it places greater emphasis on local data structure, making the new method suitable not only for datasets with Gaussian and uniform distributions but also demonstrating good performance on some complex datasets.
[0103] Table 5. Parameters of the six methods on the Real-word dataset.
[0104]
[0105]
[0106] Table 6. Performance of the six methods on the Real-word dataset
[0107]
[0108] In summary, this invention provides a data clustering method based on density peaks. This method uses mixed density to determine cluster centers, eliminating the inconsistency between the assumptions and implementation of the DPC method and avoiding manual selection of cluster centers. It redefines the similarity between data points based on local structure, thus adapting to complex data situations. Finally, it propagates the center points based on similarity, searches for effective data, and forms the backbone structure of clusters. The remaining points are then optimally assigned based on the distribution of backbone points from different clusters, isolating cascading reactions and completing boundary clustering. The time complexity and robustness of this method are discussed. Experimental results show that the new method not only outperforms DPC but also surpasses other popular methods in the prior art, demonstrating its effectiveness.
[0109] This invention also provides a density peak-based data clustering device that combines mixed density and local structure. The device includes a processor configured to: acquire the absolute density of each data point; sort the data points by their absolute density to obtain their high-density nearest neighbors, and use the number of direct subordinates of each data point to represent the relative density value; construct a mixed density based on the absolute density and relative density to determine the relative density cluster center; and gradually allocate the center points using effective subordinates and k-level superiors.
[0110] It should be noted that the processor described in the embodiments of the present invention can be a processing device that includes one or more general-purpose processing devices, such as a microprocessor, a central processing unit (CPU), a graphics processing unit (GPU), etc. More specifically, the processor can be a complex instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, a processor that runs other instruction sets, or a processor that runs a combination of instruction sets. The processor can also be one or more special-purpose processing devices, such as an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), a system-on-a-chip (SoC), etc.
[0111] In some embodiments, the processor is further configured to calculate the absolute density of each data point using the following formula (5):
[0112]
[0113] Where, ρ i d represents the absolute density of each data point. c The cutoff distance is set by user input or by adjusting it according to the dataset distribution at a rate of 1%-2% (i.e., a data point distance less than d). c The average number of neighbors is approximately 1%-2% of the total number of points in the dataset, sign(d ij -d c ) is an indicator function, if d ij -d c If ≤0, then sign(d) ij -d c ) = 1; otherwise sign(d ij -d c ) = 0.
[0114] In some embodiments, the processor is further configured to: calculate the distance δ for each data point. i The direct superior of each data point is obtained, and the number of direct subordinates of each data point is counted.
[0115] In some embodiments, the processor is further configured to: determine mixed density cluster centers based on a mixed density expression combining relative density and absolute density, including:
[0116] Mixed density cluster centers are determined using the following formulas (6) and (7):
[0117]
[0118]
[0119] Where, when x i It is x j When it is a direct subordinate, ζ(x) i ,x j The value is 1 if the condition is not met, and 0 otherwise. r (i), ρ m (i) represent x respectively i The relative density and mixed density are given by max(), which represents the maximum value function.
[0120] In some embodiments, the processor is further configured to measure the likelihood of each data point becoming a relative density cluster center using the following formula (8):
[0121]
[0122] Among them, S i This represents the probability that each data point will become a cluster center; and the c points with the highest probability are selected from all data points as cluster centers.
[0123] In some embodiments, the processor is further configured to assign a data point to the same cluster as its direct parent when the data point and its direct subordinate are similarly reachable.
[0124] In some embodiments, the processor is further configured to: progressively allocate the center point using effective hierarchical relationships via the following formula:
[0125]
[0126] Where, L(x) i ) represents data point x i The tag, Ll(x) j ) represents data point x j The direct subordinate set, DR(x) j ) represents data point x j The set that can be reached by similarity.
[0127] In some embodiments, the processor is further configured to: in the case of unassigned data points, calculate the average distance between the unassigned data points and different clusters, and assign them to the nearest cluster.
[0128] In some embodiments, the processor is further configured to represent the average distance between different clusters based on the distance of the unassigned data points to the k-level superiors of each cluster, wherein the k-level superiors are the k closest data points in the same cluster that are at a higher density than the data points in that cluster.
[0129] In some embodiments, the processor is further configured to calculate the sum of distances between the unassigned data points and all distances to the k-th layer upper level according to the following formula (10):
[0130]
[0131] Where, x b It is an unassigned data point, B C It is the set of the k-th level parent of the c-th cluster, ||x b -x i || 2 Represents data point x b and data point x i The Euclidean distance between them, SB(x) b B c ) represents x b The sum of distances to the k-th level parent of different clusters;
[0132] The unassigned data points are assigned according to the following formula (11):
[0133]
[0134] Where C is the number of known clusters.
[0135] The beneficial effects of the apparatus described in the various embodiments of the present invention are basically the same as those of the methods described in the corresponding embodiments, and will not be repeated here.
[0136] This invention also provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a computer's processor, cause the computer to perform the calculation methods described in various embodiments of this invention.
[0137] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A data clustering method based on density peaks, characterized in that, The method includes: Obtain a dataset, which may be a text set or an image set. When the dataset is a text set, extract word features from the text set and use the word features as data points. When the dataset is an image set, use the images from the image set as data points and calculate the absolute density of each data point. The hierarchical relationship of data points is obtained by sorting the absolute density of each data point, and the number of direct subordinates of each data point is used as the relative density of the data points. Based on the relative and absolute density of the data points, select a number of data points as cluster centers from all the data points; The data points are allocated based on the effective hierarchical relationships of the cluster centers and the k-level ancestor: The data points are progressively allocated using effective hierarchical relationships through the following formula: ; in, Data points that serve as cluster centers The tag, Representing data points The direct subordinate set, Representing data points The set of similar reachable points, in In the middle, data points and The distance between them is less than the cutoff distance. ,and and The number of overlapping point sets between them is greater than the MCD, that is, the number of data points and They are similar, data points Data points Data points that are reachable by similarity, in any point in satisfy ,and MCD represents the distance from the data point in the dataset. The distance is less than the cutoff distance Number of data points, MCDNN(x) i ) represents data point x i The maximum truncated nearest neighbor, where the maximum truncated nearest neighbor is the nearest neighbor at a distance x from the data point. i The most recent two MCD data points, MCDNN(x) represents i ) and MCDNN(x i+1 The number of overlapping point sets between ) is greater than that of MCD, i.e. Any point in the data is similar to its neighboring data points; In the case of unassigned data points, the average distance between the unassigned data points and different clusters is calculated, and the data points are assigned to the nearest cluster, where the cluster is a set of data points assigned to the corresponding labels based on the labels of the cluster centers. The absolute density of each data point is calculated using the following formula: ; in, Indicates absolute density. This represents the cutoff distance, when the distance between two data points is less than [a certain value]. Then it participates in density calculation, sign( ) is an indicator function, if If ≤0, then sign( ) = 1; otherwise sign( )=0; This represents the distance between two data points; The step of selecting a number of data points as cluster centers from all data points based on their relative and absolute densities includes: The absolute density and relative density of the data points are calculated using the following formulas: ; ; Among them, when yes When the direct subordinate, The value is 1 if it is not 1, otherwise the value is 0. , They represent The relative density and mixture density, MAX() represents the maximum value function, and S represents the dataset; The step of selecting a number of data points as cluster centers from all data points based on their relative and absolute densities includes: The likelihood of a data point becoming a cluster center is measured using the following formula: ; in, Indicates the probability that a data point is a cluster center. () represents the maximum value function. This represents the minimum distance between data point i and data points with a density greater than i. Select the c points with the highest probability as cluster centers.
2. The method according to claim 1, characterized in that, In the case of unassigned data points, the average distance between the unassigned data points and different clusters is calculated using the following method: The average distance between the unassigned data points and different clusters is obtained based on the distance from the unassigned data points to the k-level parent of each cluster, wherein the k-level parent is the k closest data points in the same cluster that have a higher relative density than the data points in the cluster.
3. The method according to claim 2, characterized in that, In the case of unassigned data points, the average distance between the unassigned data points and different clusters is calculated, and the data points are assigned to the nearest cluster. Specifically, this includes: The sum of distances between unassigned data points and all distances to the k-th level parent is calculated using the following formula: ; in, These are unassigned data points. It is the set of the k-th level parent of the c-th cluster. Representing data points and data points The Euclidean distance between them express The sum of distances to the k-th level parent of different clusters; The unassigned data points are assigned according to the following formula: ; Where C is the number of known clusters.
4. A data clustering device based on density peaks, characterized in that, The device includes a processor, the processor being configured to: Obtain a dataset, which may be a text set or an image set. When the dataset is a text set, extract word features from the text set and use the word features as data points. When the dataset is an image set, use the images from the image set as data points and calculate the absolute density of each data point. The high-density nearest neighbors of each data point are obtained by sorting the data points by absolute density, and the number of direct subordinates of each data point is used as the relative density value of the data points. Based on the relative and absolute density of the data points, select a number of data points as cluster centers from all the data points; The data points are allocated based on the effective hierarchical relationships of the cluster centers and the k-level ancestor: The data points are progressively allocated using effective hierarchical relationships through the following formula: ; in, Data points that serve as cluster centers The tag, Representing data points The direct subordinate set, Representing data points The set of similar reachable points, in In the middle, data points and The distance between them is less than the cutoff distance. ,and and The number of overlapping point sets between them is greater than the MCD, that is, the number of data points and They are similar, data points Data points Data points that are reachable by similarity, in any point in satisfy ,and MCD represents the distance from the data point in the dataset. The distance is less than the cutoff distance Number of data points, MCDNN(x) i ) represents data point x i The maximum truncated nearest neighbor, where the maximum truncated nearest neighbor is the nearest neighbor at a distance x from the data point. i The most recent two MCD data points, MCDNN(x) represents i ) and MCDNN(x i+1 The number of overlapping point sets between ) is greater than that of MCD, i.e. Any point in the data is similar to its neighboring data points; In the case of unassigned data points, the average distance between the unassigned data points and different clusters is calculated, and the data points are assigned to the nearest cluster, where the cluster is a set of data points assigned to the corresponding labels based on the labels of the cluster centers. The absolute density of each data point is calculated using the following formula: ; in, Indicates absolute density. This represents the cutoff distance, when the distance between two data points is less than [a certain value]. Then it participates in density calculation, sign( ) is an indicator function, if If ≤0, then sign( ) = 1; otherwise sign( )=0; This represents the distance between two data points; The step of selecting a number of data points as cluster centers from all data points based on their relative and absolute densities includes: The absolute density and relative density of the data points are calculated using the following formulas: ; ; Among them, when yes When the direct subordinate, The value is 1 if it is not 1, otherwise the value is 0. , They represent The relative density and mixture density, MAX() represents the maximum value function, and S represents the dataset; The step of selecting a number of data points as cluster centers from all data points based on their relative and absolute densities includes: The likelihood of a data point becoming a cluster center is measured using the following formula: ; in, MAX() represents the probability that a data point is a cluster center. This represents the minimum distance between data point i and data points with a density greater than i. Select the c points with the highest probability as cluster centers.
5. A computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by the computer's processor, cause the computer to perform the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Mixed attribute data clustering method based on density peak value
CN107103336A
Density peak-core fusion-based adaptive clustering method
CN109840558A