A clustering method, apparatus, device, and storage medium
By identifying the center data under different data densities and dynamically adjusting the clustering parameters, the clustering error problem of DBSCAN when the data density is uneven is solved, and more accurate clustering results are achieved.
Patent Information
- Application Number
- CN202210271198.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In existing technologies, DBSCAN clustering analysis requires setting a uniform cluster radius and minimum number of points when the data density is uneven, which leads to large clustering errors, especially in high-dimensional data where it is difficult to select the neighborhood radius.
By determining the distribution density information of the data to be clustered, identifying the center data and clustering parameters under each distribution density, dynamically adjusting the clustering radius and minimum number of points, and performing clustering according to different clustering parameters matched with the density.
It achieves more accurate clustering results under uneven data density, reduces clustering errors, and improves clustering accuracy, especially in high-dimensional data.
Smart Images

Figure CN114742134B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a clustering method, apparatus, device and storage medium. Background Technology
[0002] In related technologies, when using Density-Based Spatial Clustering of Applications with Noise (DBSCAN) for cluster analysis, it is necessary to set uniform cluster radius and minimum number of points. DBSCAN clustering can cause significant errors when the data density in the dataset is uneven. Summary of the Invention
[0003] In view of this, embodiments of this application provide a clustering method, apparatus, device, and storage medium.
[0004] In a first aspect, embodiments of this application provide a clustering method, the method comprising:
[0005] Determine the distribution density information of the data to be clustered;
[0006] Based on the distribution density information of the data to be clustered, determine the center data and clustering parameters of the data under each of at least two distribution densities of the data to be clustered;
[0007] Based on the center data and clustering parameters of the data at each distribution density, the data to be clustered is clustered to obtain the clustering results.
[0008] Secondly, embodiments of this application provide a clustering apparatus, comprising:
[0009] The first determining module is used to determine the distribution density information of the data to be clustered.
[0010] The second determining module is used to determine the center data and clustering parameters of the data under each of at least two distribution densities of the data to be clustered, based on the distribution density information of the data to be clustered.
[0011] The first processing module is used to cluster the data to be clustered based on the center data and clustering parameters of the data under each distribution density, and obtain the clustering result.
[0012] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, and a communication bus;
[0013] The communication bus is used to realize the communication connection between the processor and the memory;
[0014] The processor is used to execute the program in the memory to implement the above-described clustering method.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the electronic device control methods described in the embodiments of this application.
[0016] In this embodiment, firstly, the distribution density information of the data to be clustered is determined; secondly, based on the distribution density information of the data to be clustered, the center data and clustering parameters of the data under each of at least two distribution densities are determined; thus, suitable clustering parameters can be matched for each distribution density; finally, based on the center data and clustering parameters of the data under each distribution density, the data to be clustered is clustered to obtain clustering results; thus, different clustering parameters can be matched for different distribution densities, thereby obtaining more accurate clustering results. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0018] Figure 2 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0019] Figure 3 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0020] Figure 4 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0021] Figure 5 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0022] Figure 6 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0023] Figure 7 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0024] Figure 8 A flowchart illustrating a clustering method provided in an embodiment of this application;
[0025] Figure 9 The clustering effect diagrams provided in the embodiments of this application are for illustrating the related technologies.
[0026] Figure 10AA flowchart illustrating the implementation process of a DBSCAN-based visual clustering analysis method provided in this application embodiment;
[0027] Figure 10B A flowchart illustrating the implementation process of a DBSCAN-based visual clustering analysis method provided in this application embodiment;
[0028] Figure 11 This is a schematic diagram of the structure of a clustering device provided in an embodiment of this application;
[0029] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0031] Figure 1 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes:
[0032] Step S101: Determine the distribution density information of the data to be clustered.
[0033] In some embodiments, distribution density information refers to the distribution density of the data to be clustered in a coordinate system. When the data to be clustered is uniformly distributed, the distribution density information includes one distribution density; when the data to be clustered is non-uniformly distributed, the distribution density information includes multiple distribution densities.
[0034] In some embodiments, taking the plotting of two-dimensional data on a two-dimensional coordinate system as an example, the distribution density of the data to be clustered can be determined through the following process: First, based on the coordinates of the data points, the coordinates of all data points are represented as an N×2 matrix, where N is the number of data points, the N rows of the N×2 matrix correspond to N data points, and the first column of the two columns corresponds to the x-coordinate, and the second column corresponds to the y-coordinate; Second, the two-dimensional distribution of all data points is statistically analyzed using a histogram, that is, the number of data points in each histogram grid is counted. The histogram defaults to a 10×10 grid, which can be adjusted according to actual needs; Finally, the data points in each grid are divided by the total number of points to obtain the density of data points in each grid. Furthermore, adjacent grids with the same data point density can be connected to form the same grid.
[0035] Step S102: Based on the distribution density information of the data to be clustered, determine the center data and clustering parameters of the data under each of the at least two distribution densities of the data to be clustered.
[0036] In some embodiments, the central data is data in which the number of data points within the neighborhood radius is greater than or equal to the minimum number of points; where data points can be understood as points formed by plotting the data to be clustered on a coordinate system after dimensionality reduction processing; the minimum number of points measures the density of data points within the neighborhood radius; generally, when the number of data points within the neighborhood radius is greater than the minimum number of points, it is considered dense.
[0037] In some embodiments, the clustering parameters can be the neighborhood radius and minimum number of points mentioned above.
[0038] In some embodiments, each data point can be encoded according to the acquisition order of the data to be clustered. In each distribution density, the data points are scanned sequentially, and the data points whose number of neighborhood points in the first scan is greater than or equal to the minimum number of points are determined as the center data.
[0039] In some embodiments, the neighborhood radius is determined based on the distribution density. Generally, a lower distribution density indicates a sparser distribution of data points, thus allowing for a larger neighborhood radius; a higher distribution density indicates a denser distribution of data points, thus allowing for a smaller neighborhood radius. This way, even with uneven data point distribution, a suitable neighborhood radius can be matched to each distribution density, resulting in more accurate clustering results.
[0040] In some embodiments, the minimum number of points can be determined empirically; generally, the minimum number of points is 3 or 4.
[0041] Step S103: Based on the center data and clustering parameters of the data under each distribution density, cluster the data to be clustered to obtain the clustering results.
[0042] In some embodiments, the clustering result is all the clusters into which the data to be clustered is divided; wherein each cluster includes data at the corresponding distribution density.
[0043] In some embodiments, clustering can be performed on the data to be clustered based on the center data and clustering parameters of the data at each distribution density.
[0044] In this embodiment, firstly, the distribution density information of the data to be clustered is determined; secondly, based on the distribution density information of the data to be clustered, the center data and clustering parameters of the data under each of at least two distribution densities are determined; thus, suitable clustering parameters can be matched for each distribution density; finally, based on the center data and clustering parameters of the data under each distribution density, the data to be clustered is clustered to obtain clustering results; thus, different clustering parameters can be matched for different distribution densities, thereby obtaining more accurate clustering results.
[0045] In some embodiments, the clustering parameters include: cluster radius and scatter point number threshold; Figure 2 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 2 As shown, step S102 includes:
[0046] Step S201: Based on the distribution density of the data to be clustered, determine the cluster radius of the data under each distribution density in different distribution densities.
[0047] In some embodiments, the scatter point number threshold is the minimum number of points mentioned above; the cluster radius is the neighborhood radius mentioned above; the determination of the center data and the clustering parameters is sequential; generally, the clustering parameters are determined first, and then the center data is determined based on the clustering parameters; in one possible implementation, since the scatter point number threshold in the clustering parameters is determined empirically, the clustering radius in the clustering parameters is mainly determined first, and then the center data is determined based on the clustering radius and the scatter point number threshold.
[0048] In some embodiments, the cluster radius is determined based on the distribution density. One possible implementation involves the following process: First, for each data class, historical clustering results are obtained; second, the historical clustering is visualized; third, the visualized historical clustering results are adjusted to obtain accurate historical clustering results; finally, based on the accurate historical clustering results, a correspondence between distribution density and cluster radius is established. Here, a correspondence between distribution density and cluster radius can be established, or a correspondence between a distribution density interval and cluster radius can be established. When establishing the correspondence between a distribution density interval and cluster radius, the average cluster radius corresponding to all distribution densities within that interval can be used as the cluster radius of that distribution density interval.
[0049] Step S202: Based on the cluster radius and the scatter point number threshold, determine the center data of the data at each distribution density.
[0050] In some embodiments, data that meet the thresholds for cluster radius and number of scattered points under each distribution density are identified as center data; for example, the preset condition can be to identify data whose number of data points within the cluster radius is greater than or equal to the maximum number of scattered points as center data.
[0051] In this embodiment, firstly, based on the distribution density of the data to be clustered, the cluster radius of the data under each distribution density is determined; secondly, based on the cluster radius and the scatter point number threshold, the center data of the data under each distribution density is determined; thus, different clustering parameters can be matched for different densities, thereby achieving accurate clustering of the data to be clustered even when the data distribution is uneven.
[0052] In some embodiments, data can be filtered according to certain rules, and the first data that meets the conditions can be determined as the central data; Figure 3 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 3 As shown, step S202 includes:
[0053] Step S301: Take one data point from the data at each of the aforementioned distribution densities to obtain the first data.
[0054] In some embodiments, the data to be clustered can be data carrying an order, which can be determined during the data acquisition stage; in one possible implementation, the order of the data can be determined according to the order of data acquisition, and the data can be taken in that order; of course, data can also be taken based on a certain rule, as long as the data is not taken repeatedly.
[0055] Step S302: If the number of data points included within the cluster radius of the first data is greater than the scatter point number threshold, the first data is determined as the center data of the data under the distribution density.
[0056] In this embodiment of the application, firstly, data is sequentially taken from the data at each distribution density to obtain first data; secondly, if the number of data included within the cluster radius of the first data is greater than the number of scatter points threshold, the first data is determined as the center data of the data at the distribution density; thus, the center data of the data at each distribution density can be determined.
[0057] Figure 4 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 4 As shown, step S102 includes:
[0058] Step S401: Obtain mapping information that represents the correspondence between different distribution densities and clustering parameters.
[0059] In some embodiments, since the threshold for the number of scatter points can be determined empirically and is not specific but universal, the mapping information can be the correspondence between different distribution densities and the cluster radius in the clustering parameters. Of course, for the sake of more convenient data acquisition, mapping information on the correspondence between different distribution densities and the cluster radius and the threshold for the number of scatter points can also be established.
[0060] In some embodiments, a correspondence between distribution density and clustering parameters can be established. In one possible implementation, this can be achieved through the following process: First, obtain multiple sets of sample data to be clustered; second, use spatial clustering to cluster each set of sample data to be clustered, obtaining multiple clustering results; third, visualize the multiple clustering results; next, adjust the multiple clustering results based on the visualization, so that different distribution densities in each clustering result correspond to different clustering radii, obtaining multiple adjusted clustering results; finally, based on the multiple adjusted clustering results, establish mapping information between different distribution densities and clustering parameters.
[0061] Step S402: Based on the mapping information, determine the clustering parameters that match each density according to each density in the distribution density information.
[0062] In some embodiments, step S402 involves finding the clustering parameter corresponding to each density in the mapping information based on each density in the distribution density information.
[0063] In this embodiment, firstly, mapping information representing the correspondence between different distribution densities and clustering parameters is obtained; secondly, based on the mapping information, the clustering parameter matching each density is determined according to each density in the distribution density information; thus, the clustering parameter corresponding to each of at least two distribution densities of the data to be clustered can be determined.
[0064] Figure 5 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 5 As shown, step S103 includes:
[0065] Step S501: Based on the cluster radius and scatter point number threshold of the data under each distribution density, determine the density connection data of the center data under each distribution density.
[0066] In some embodiments, understanding density-connected data requires introducing two concepts: density-directly-reachable data and density-reachable data. Density-directly-reachable data is explained as follows: Assuming data point P is the central data point, and data point Q is within the cluster radius of data point P, then data point P is density-directly reachable from data point Q; that is, data point Q is density-directly reachable data of data point P. Density-reachable data is explained as follows: Assuming data point P is the central data point, and data point P is density-directly reachable from data point Q, and data point Q is density-directly reachable from data point M, then data point P is density-reachable from data point M; that is, data point M is density-reachable data of data point P. Density-connected data is explained as follows: Assuming data point P is the central data point, and data point P is density-reachable from data point M and data point O, then data point M and data point O are density-connected; that is, data point M and data point O are density-connected data of data point P. Thus, step S501 can determine the density-connected data of the central data point under each distribution density.
[0067] Step S502: Divide the density concatenation data of the center data under each distribution density into a cluster to obtain the clustering result.
[0068] In some embodiments, the density-connected data belong to the same cluster. For example, data point M and data point O both belong to the cluster where data point P is located. Step S502 involves dividing the data to be clustered according to the principle that the density-connected data belong to the same cluster where the central data is located. This allows the density-connected data of the central data under each distribution density to be divided into one cluster, thus obtaining the clustering result.
[0069] In this embodiment, firstly, based on the cluster radius and scatter point number threshold of the data under each distribution density, the density connection data of the central data under each distribution density is determined; secondly, the density connection data of the central data under each distribution density is divided into a cluster to obtain the clustering result; thus, the density connection data of the central data under each distribution density can be divided into the same cluster to obtain the clustering result.
[0070] Figure 6 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 6 As shown, the method also includes:
[0071] Step S601: When the second data is density-connected data of the center data under multiple distribution densities, the second data is divided into the clusters where the center data of the density corresponding to the smallest cluster radius is located.
[0072] In some embodiments, if the second data is density-connected data of center data under multiple distribution densities, the cluster radii of the multiple distribution densities are compared, and the second data is assigned to the cluster containing the center data with the smaller cluster radius. This resolves the data partitioning conflict by assigning each data point to the cluster containing the nearest center data.
[0073] Figure 7 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 7 As shown, after step S102, the following steps are included:
[0074] Step S701: Adjust the center data and clustering parameters of the data at each distribution density based on the visualized scatter plot.
[0075] In some embodiments, step S701 may involve manually adjusting the visualized scatter plot on the visualization interface, mainly by manually adjusting the center data and clustering parameters of the data at each distribution density based on experience.
[0076] Step S702: Based on the center data and clustering parameters of the data under each adjusted distribution density, cluster the data to be clustered to obtain the clustering result.
[0077] In some embodiments, manually adjusting the center data and clustering parameters of the data at each distribution density based on experience before clustering can make the clustering process faster and more accurate.
[0078] In this embodiment, firstly, the center data and clustering parameters of the data at each distribution density are adjusted based on a visualized scatter plot; secondly, based on the adjusted center data and clustering parameters of the data at each distribution density, the data to be clustered is clustered to obtain the clustering result; thus, clustering can be performed faster and more accurately.
[0079] Figure 8 This is a schematic diagram illustrating the implementation process of a clustering method provided in an embodiment of this application, as shown below. Figure 8 As shown, the steps preceding step S101 include:
[0080] Step S801: Obtain the data to be processed.
[0081] In some embodiments, the data to be processed can be any raw data that needs to be clustered, such as image data, audio data, business data from various industries, etc., without limitation.
[0082] Step S802: Extract features from the data to be processed to obtain data features.
[0083] In some embodiments, the purpose of step S802 is to convert the data to be processed into data that can be processed by a machine. Therefore, when the data to be processed is image data, audio data, etc., feature extraction is required. When the data to be processed is business data of various industries, feature extraction is performed according to the specific form of the data. Generally, when the data of various industries is in numerical form, feature extraction is not required. When the data of various industries is in a form other than numerical form such as symbols, feature extraction is required.
[0084] In some embodiments, when the data to be processed is feature data in an image or audio feature data, the data to be processed can be obtained through feature extraction; when the data to be processed is business data from various industries, the data to be processed can be obtained through databases or other means.
[0085] Step S803: Preprocess the data features to obtain processed data features.
[0086] In some embodiments, in order to obtain data features that can be recognized by machines, it is necessary to preprocess the data features. Here, preprocessing may include: numericalization, standardization, normalization, dimensionality reduction, etc.
[0087] Step S804: Determine the data to be clustered based on the degree of dispersion of the processed data features.
[0088] In some embodiments, step S804 can be understood as feature selection, which is to filter data features. This is because some data features are relatively dense and do not need to be clustered, while some data features are relatively dispersed and can be clustered. In one possible implementation, feature selection can be performed based on the variance of the data features. For example, if the variance of the data features is greater than a preset threshold, it indicates that the data features are relatively discrete and can be clustered; if the variance of the data features is less than a preset threshold, it indicates that the data features are relatively dense and do not need to be clustered.
[0089] Step S805: Visualize the data to be clustered to obtain a visualized scatter plot of the data to be clustered.
[0090] In some embodiments, after steps S803 and S804, low-dimensional data to be clustered, such as two-dimensional or three-dimensional data, can be obtained. Therefore, a visual scatter plot of the data to be clustered can be obtained by plotting the data to be clustered in a coordinate system.
[0091] Optionally, after step S805, determining the distribution density information of the data to be clustered in step S101 can be specifically performed as follows: determining the distribution density information of the data to be clustered based on the visualized scatter plot.
[0092] In some embodiments, the distribution density of the data to be clustered, i.e. the density of the data point distribution in the visualized scatter plot, is executed in the same way as step S101, and will not be described in detail here.
[0093] In this embodiment, firstly, data to be processed is acquired; secondly, features are extracted from the data to be processed to obtain data features; thirdly, the data features are preprocessed to obtain processed data features; next, based on the dispersion of the processed data features, the data to be clustered is determined; then, the data to be clustered is visualized to obtain a visualized scatter plot of the data to be clustered; finally, based on the visualized scatter plot, the distribution density of the data to be clustered is determined; thus, regardless of the form of the data to be processed, machine-recognizable data to be clustered can be determined, and the distribution density of the data to be clustered can be obtained.
[0094] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario, using the DBSCAN-based visualization clustering method as an example to illustrate the above clustering method.
[0095] In related technologies, when using DBSCAN for cluster analysis, it is necessary to set uniform neighborhood radius and minimum number of points. When the data density in the dataset is uneven, DBSCAN can introduce errors, such as... Figure 9 As shown, when the neighborhood radius is set to a large value, the resulting clusters are A, B, C, and D, while when the neighborhood radius is set to a small value, the resulting clusters are a, b, c, and d, and other data points are identified as noise. Moreover, when the data dimension is large, it is difficult to select the neighborhood radius.
[0096] Based on this Figure 10A A schematic diagram illustrating the implementation process of a DBSCAN-based visual clustering analysis method provided in this application embodiment is shown below. Figure 10A As shown, the method includes:
[0097] Step S1001: Preprocess the data to be processed to obtain the data to be clustered.
[0098] In some embodiments, dimensionality reduction can be performed using algorithms such as Uniform Manifold Approximation and Projection (UMAP) to reduce high-dimensional data to two or three dimensions.
[0099] Step S1002: Draw a scatter plot based on the data to be clustered.
[0100] Step S1003: Based on the distribution density of the scatter plot, determine the center point and neighborhood radius for each distribution density.
[0101] Step S1004: Manually adjust the center point and neighborhood radius based on experience.
[0102] In some embodiments, the center point corresponds to the aforementioned center data; the neighborhood radius corresponds to the aforementioned clustering radius.
[0103] Step S1005: Determine the density of connected points for each center point based on the neighborhood radius and the minimum number of points.
[0104] In some embodiments, the minimum number of points corresponds to the above-mentioned scatter point number threshold; density-connected points correspond to the above-mentioned density-connected data.
[0105] Step S1006: Assign density-connected points of each center point to the same cluster to obtain the clustering result.
[0106] Figure 10B A schematic diagram illustrating the implementation process of a DBSCAN-based visual clustering analysis method provided in this application embodiment is shown below. Figure 10B As shown, the method includes:
[0107] Step S1007: Based on each center point, obtain the set of center points.
[0108] Step S1008: Determine whether the set of center points is empty.
[0109] If the set of center points is empty, the entire process ends; if the set of center points is not empty, proceed to step S1009.
[0110] Step S1009: Select any center point P.
[0111] Step S1010: Find the set D of density-connected points of the center point P.
[0112] Step S1011: Determine whether the set D of density-connected points is empty.
[0113] If the density-connected point set D is empty, proceed to step S1009; if the density-connected point set D is not empty, proceed to step S1012.
[0114] Step S1012: Randomly select a density-connected point a.
[0115] Step S1013: Determine whether density-connected point a belongs to a cluster of a certain central point.
[0116] If density connection point a does not belong to a cluster of a certain central point, proceed to step S1014; if density connection point a belongs to a cluster of a certain central point, proceed to step S1015.
[0117] Step S1014: Assign density-connected point a to the cluster where the center point P is located.
[0118] Step S1015: Compare the neighborhood radius of the original center point with the neighborhood radius of the center point P.
[0119] If the neighborhood radius of the original assigned center point is greater than the neighborhood radius of the center point P, return to step S1014; if the neighborhood radius of the original assigned center point is less than the neighborhood radius of the center point P, proceed to step 1016.
[0120] Step S1016: Keep the density-connected point a in the same cluster as the original center point.
[0121] Figure 11 This is a schematic diagram of the structure of a clustering device 1100 provided in an embodiment of this application, as shown below. Figure 11 As shown, the device includes:
[0122] The first determining module 1101 is used to determine the distribution density information of the data to be clustered;
[0123] The second determining module 1102 is used to determine the center data and clustering parameters of the data under each of at least two distribution densities of the data to be clustered, based on the distribution density information of the data to be clustered.
[0124] The first processing module 1103 is used to cluster the data to be clustered based on the center data and clustering parameters of the data under each distribution density, and obtain the clustering result.
[0125] In some embodiments, the second determining module 1102 includes:
[0126] The first determining submodule is used to determine the clustering radius of the data under each distribution density based on the distribution density of the data to be clustered;
[0127] The second determining submodule determines the center data of the data at each distribution density based on the cluster radius and the scatter point number threshold.
[0128] In some embodiments, the second determining submodule includes:
[0129] The first processing submodule is used to sequentially extract data from the data at each of the distribution densities to obtain the first data.
[0130] The third determining submodule is used to determine the first data as the center data of the data under the distribution density if the number of data included within the cluster radius of the first data is greater than the number of scatter points threshold.
[0131] In some embodiments, the second determining module 1102 includes:
[0132] The first acquisition submodule is used to acquire mapping information that represents the correspondence between different distribution densities and clustering parameters;
[0133] The fourth determining submodule is used to determine the clustering parameters that match each density based on the mapping information and each density in the distribution density information.
[0134] In some embodiments, the first processing module 1103 includes:
[0135] The fifth determining submodule is used to determine the density connection data of the center data under each distribution density based on the cluster radius and the threshold of the number of scattered points of the data under each distribution density;
[0136] The second processing submodule is used to divide the density connection data of the center data under each distribution density into a cluster to obtain the clustering result.
[0137] In some embodiments, the clustering device 1100 further includes:
[0138] The second processing module is used to divide the second data into clusters containing the center data at the density corresponding to the smallest clustering radius when the second data is density-connected data of center data under multiple distribution densities.
[0139] In some embodiments, the clustering device 1100 further includes:
[0140] The first adjustment module is used to adjust the center data and clustering parameters of the data under each distribution density based on a visualized scatter plot;
[0141] The third processing module is used to cluster the data to be clustered based on the center data and clustering parameters of the data under each adjusted distribution density, and to obtain the clustering result.
[0142] In some embodiments, the clustering device 1100 further includes:
[0143] The first acquisition module is used to acquire data to be processed.
[0144] The fourth processing module is used to extract features from the data to be processed to obtain data features;
[0145] The fifth processing module is used to preprocess the data features to obtain processed data features;
[0146] The third determining module is used to determine the data to be clustered based on the degree of dispersion of the processed data features;
[0147] The sixth processing module is used to visualize the data to be clustered, and obtain a visualized scatter plot of the data to be clustered.
[0148] The fourth determining module is used to determine the distribution density of the data to be clustered based on the visualized scatter plot.
[0149] This application provides an electronic device. Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 12 As shown, the electronic device 1200 includes: a processor 1201, a memory 1202, and a communication bus 1203;
[0150] The communication bus 1203 is used to realize the communication connection between the processor 1201 and the memory 1202;
[0151] The processor 1201 is used to execute the program in the memory 1202 to implement the above-mentioned clustering method.
[0152] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the above-described electronic device control methods.
[0153] It should be noted that the aforementioned computer-readable storage media can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; it can also be various processors that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0154] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0155] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0157] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0158] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0159] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0160] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A clustering method, the method comprising: Determine the distribution density information of the data to be clustered; The data to be clustered includes at least one of the following: image data, audio data; Based on the distribution density information of the data to be clustered, determine the center data and clustering parameters of the data under each of at least two distribution densities of the data to be clustered; the clustering parameters include the cluster radius and a threshold for the number of scatter points; Based on the center data and clustering parameters of the data under each distribution density, the data to be clustered is clustered to obtain the clustering results; The step of determining the center data and clustering parameters of the data at at least two distribution densities of the data to be clustered, based on the distribution density information of the data to be clustered, includes: Obtain the historical clustering results for each data category; Visualize the historical clustering results; The visualized historical clustering results are adjusted to obtain accurate historical clustering results; Based on the accurate historical clustering results, establish the correspondence between distribution density and cluster radius; Based on the correspondence, the clustering radius of the data under each distribution density is determined in the different distribution densities of the data to be clustered.
2. The method according to claim 1, wherein determining the center data and clustering parameters of the data at each of at least two distribution densities of the data to be clustered based on the distribution density information of the data to be clustered further comprises: Based on the cluster radius and the scatter point number threshold, the center data of the data at each distribution density is determined.
3. The method according to claim 2, wherein determining the center data of the data at each distribution density based on the cluster radius and the scatter point number threshold comprises: Take one data point from the data at each of the aforementioned distribution densities to obtain the first data; If the number of data points included within the cluster radius of the first data is greater than the threshold for the number of scatter points, the first data is determined as the center data of the data under the distribution density.
4. The method according to claim 1, wherein determining the clustering parameters of the data at each of at least two distribution densities of the data to be clustered based on the distribution density information of the data to be clustered further comprises: Obtain mapping information that represents the correspondence between different distribution densities and clustering parameters; Based on the mapping information, the clustering parameters that match each density are determined according to each density in the distribution density information.
5. The method according to claim 1, wherein clustering the data to be clustered based on the center data and clustering parameters of the data at each distribution density to obtain clustering results includes: Based on the clustering radius and scatter point number threshold of the data under each distribution density, the density connection data of the center data under each distribution density is determined; The density-connected data of the center data under each distribution density are divided into a cluster to obtain the clustering result.
6. The method according to claim 5, further comprising: In the case where the second data consists of density-connected data of the center data under multiple distribution densities, the second data is divided into the clusters containing the center data of the density corresponding to the smallest cluster radius.
7. The method according to claim 1, wherein, based on the distribution density information of the data to be clustered, the center data and clustering parameters of the data at each of at least two distribution densities of the data to be clustered are determined, the method further comprises: The center data and clustering parameters of the data under each distribution density are adjusted based on the visualized scatter plot; Correspondingly, the step of clustering the data to be clustered based on the center data and clustering parameters of the data at each distribution density to obtain the clustering results includes: Based on the center data and clustering parameters of the data under each adjusted distribution density, the data to be clustered is clustered to obtain the clustering results.
8. The method according to claim 1, further comprising: Obtain the data to be processed; Feature extraction is performed on the data to be processed to obtain data features; The data features are preprocessed to obtain the processed data features; Based on the degree of dispersion of the processed data features, the data to be clustered is determined; The data to be clustered is visualized to obtain a scatter plot of the data to be clustered.
9. The method according to claim 8, wherein determining the distribution density information of the data to be clustered includes: Based on the visualized scatter plot, the distribution density information of the data to be clustered is determined.
10. A clustering apparatus, the apparatus comprising: The first determining module is used to determine the distribution density information of the data to be clustered. The data to be clustered includes at least one of the following: image data, audio data; The second determining module is used to determine the center data and clustering parameters of the data under each of at least two distribution densities of the data to be clustered, based on the distribution density information of the data to be clustered; the clustering parameters include the cluster radius and a threshold for the number of scatter points; The first processing module is used to cluster the data to be clustered based on the center data and clustering parameters of the data under each distribution density, and to obtain the clustering result. The second determining module includes: The first determining submodule is used to obtain historical clustering results for each type of data; visualize the historical clustering results; adjust the visualized historical clustering results to obtain accurate historical clustering results; establish a correspondence between distribution density and cluster radius based on the accurate historical clustering results; and determine the cluster radius of data under each distribution density in different distribution densities of the data to be clustered based on the correspondence.
Citation Information
Patent Citations
Radar multi-target clustering method and device
CN110161464A