Clustering Algorithm and Apparatus for Concise Point Cloud Datasets Based on Attention Mechanism
By using an attention-based point cloud dataset clustering algorithm, the problems of large data volume and uneven data quality are solved, achieving efficient simplification and quality improvement, which is applicable to fields such as 3D modeling, robot navigation and autonomous driving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGNAN UNIV
- Filing Date
- 2023-04-18
- Publication Date
- 2026-07-17
AI Technical Summary
Point cloud datasets are characterized by large data volume, inconsistent quality, and uneven distribution. Existing methods may lose information or introduce noise during processing, making it difficult to meet the application requirements of high precision and high efficiency.
A simplified point cloud dataset clustering algorithm based on attention mechanism is adopted. Through data preprocessing, density and curvature calculation, attention mechanism clustering and minimum spanning tree construction, point cloud data is filtered and sampled to remove noise and outliers, thereby reducing the size of the dataset.
It improves the quality and processing efficiency of point cloud datasets, reduces noise and redundancy, provides more accurate data support, and enhances the performance of object detection and target tracking tasks.
Smart Images

Figure CN116452842B_ABST
Abstract
Description
Technical Field
[0001] The technical field of this invention is machine learning and data science, and in particular, it relates to a clustering algorithm and apparatus for a simplified point cloud dataset based on an attention mechanism. Background Technology
[0002] Point cloud datasets are widely used in various applications, including 3D modeling, robot navigation, autonomous driving, and virtual reality. However, due to issues such as large data volume, inconsistent quality, and uneven distribution, the analysis and processing of point cloud datasets remains a challenge. This is especially true in applications requiring high precision, efficiency, and accuracy, where the quality requirements for point cloud datasets are even higher, necessitating further processing and optimization.
[0003] The main methods for improving point cloud datasets include: Data cleaning and denoising: Methods such as filtering and smoothing remove noise and outliers from the point cloud dataset to improve data quality and accuracy. However, data cleaning and denoising may result in the loss of some useful information; for example, some real points may be mistakenly identified as noise or outliers and deleted. Data resampling: Resampling the point cloud dataset can reduce or increase the number of points in the original dataset to adapt to different application scenarios and needs. However, data resampling may lead to the loss or duplication of data information. For example, downsampling may cause the dataset to lose some detailed information, while upsampling may result in some duplicate or meaningless points. Data augmentation and synthesis: By combining, overlaying, and transforming different point cloud datasets, richer and more diverse datasets can be generated to improve the coverage and representativeness of the dataset. However, data augmentation and synthesis may introduce some false data information or noise, requiring certain screening to ensure the quality and reliability of the generated dataset. Summary of the Invention
[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by this invention is the large amount of point cloud datasets, inconsistent quality, and uneven distribution.
[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0008] In a first aspect, embodiments of the present invention provide a clustering algorithm for a simplified point cloud dataset based on an attention mechanism, comprising:
[0009] Perform data preprocessing on the point cloud dataset;
[0010] Calculate the density and curvature of the preprocessed data;
[0011] A noisy hierarchical density clustering algorithm based on attention mechanism is used to cluster point cloud datasets according to density and curvature (HDBSCAN).
[0012] The point cloud data is sampled based on the clustering results to reduce the size of the dataset, thereby simplifying the point cloud dataset while maintaining the same accuracy.
[0013] As a preferred clustering algorithm for simplified point cloud datasets based on attention mechanisms, where:
[0014] The data preprocessing includes:
[0015] The point cloud data is normalized to restrict the data in the array to the range [0,1]. The formula is as follows:
[0016]
[0017] Where X is the original data, X min and X max These are the minimum and maximum values of the original data, respectively.
[0018] X norm It is the normalized data.
[0019] As a preferred clustering algorithm for simplified point cloud datasets based on attention mechanisms, where:
[0020] The calculation of density and curvature of the preprocessed data includes:
[0021] Curvature C is an attribute characterizing the change in surface slope in point cloud data. It is an indicator describing the surface topography of point clouds, including mean curvature and Gaussian curvature. Its calculation formula is as follows:
[0022]
[0023] C gaussian =λ max ×λ min
[0024] λ max and λ minIt is the principal curvature of each point in the point cloud (there are infinitely many orthogonal curvatures at a certain point on the surface, among which there exists a curve whose curvature is maximized, and this curvature is maximized by λ). max The curvature perpendicular to the surface of maximum curvature is the minimum value λ. min The principal curvature is the reciprocal of the radius of curvature obtained by least-squares fitting of each point in the point cloud;
[0025] The eigenvalues of the covariance matrix are used as the radius of curvature, and then the curvature is calculated. Specifically, a k-dimensional tree (kdtree) is constructed, the nearest neighbor of each point is found using the k-dimensional tree, and the covariance matrix of each point is calculated; the eigenvalues and eigenvectors of each covariance matrix are obtained, thereby calculating the curvature of each point; the curvature is normalized and scaled to the range [0,1].
[0026] As a preferred clustering algorithm for simplified point cloud datasets based on attention mechanisms, where:
[0027] The calculation of density and curvature of the preprocessed data also includes:
[0028] The density of a point cloud is estimated by calculating the number of points in the neighborhood of each point. Using a k-dimensional tree, given a radius, the number of points contained within a circle of that radius for each point is calculated as a density estimate; specifically, the point density ρ can be calculated using the following formula:
[0029]
[0030] Where n is the number of data points in the dataset, x i ε is the position of the i-th point, ε is a radius value, and f(x) is an indicator function that returns 1 when its parameter is true and 0 otherwise.
[0031] Specifically, a k-dimensional tree is constructed. For each point, the k-dimensional tree is used to query the neighbors within the radius of the point, and the number of neighbors is counted as the density value of the point. The density is then normalized and scaled to the range of [0,1].
[0032] As a preferred clustering algorithm for simplified point cloud datasets based on attention mechanisms, where:
[0033] The clustering of the point cloud dataset includes:
[0034] Introducing the Attention mechanism involves the following steps: First, for each input vector, a linear transformation is performed to obtain three vectors: key, query, and value. Then, the query and key vectors are transformed...
[0035] The similarity between the query and the key is calculated to obtain the attention score. The specific steps are as follows: the dot product of the query and the key is used as the attention score, which is then input into the softmax function for normalization to obtain the attention weight; finally, the output of the attention mechanism is obtained by weighted sum of the attention weight and the value.
[0036] The density of data points is calculated using a KNN-based method, and then the mutual reachability distances between data points are calculated to achieve spatial transformation. The formula is as follows:
[0037] core k (x)=d(x,N k (x))
[0038] core k (x) is the core distance of point x to its k-th nearest point, d(x,N) k (x) represents its distance from the k-th point;
[0039] The formula for mutual reachability distance is:
[0040] d k (a,b)=max{core k (a),core k (b),d(a,b)}
[0041] d k (a,b) represents the distance between points a and b that can be reached from each other; core k (a) is the core distance of the k nearest neighbor; d k (a,b) is the Euclidean distance between points a and b.
[0042] As a preferred clustering algorithm for simplified point cloud datasets based on attention mechanisms, where:
[0043] The clustering of the point cloud dataset further includes: constructing a minimum spanning tree of the distance-weighted graph. Specifically, the minimum spanning tree is constructed using the Prim algorithm, and the edges of the tree are sorted by distance and iterated to create a new merged cluster for each tree edge; setting the minimum cluster size, compressing the dataset layer structure, calculating the stability of each cluster using λ = 1 / d, and extracting the clusters with better stability from the dataset as the final clustering result. The formula for evaluating stability is:
[0044] ∑ p∈cluster (λ p -λ b )
[0045] Where, λ p Let λ be the value of point p that causes it to leave its cluster; λ bThe λ value is used to split the cluster into itself.
[0046] As a preferred clustering algorithm for simplified point cloud datasets based on attention mechanisms, where:
[0047] The sampling of point cloud data based on clustering results includes: removing points with cluster labels of -1 (i.e., noise points) from the point cloud data based on the clustering results; calculating the weight of each cluster, whereby the weight of each cluster is defined as the ratio of the number of points contained in each cluster to the total number of points in the clustering results; and performing weighted sampling for each cluster.
[0048] As a preferred clustering algorithm for simplified point cloud datasets based on attention mechanisms, where:
[0049] The weighted sampling for each cluster includes: for a cluster A, first calculate the number of points to be sampled, where the number of sampling points is the weight of cluster A multiplied by the total number of input point cloud data, and rounded up; if the number of points in cluster A is less than or equal to the number of points to be sampled, then all points in cluster A are directly added to the sampling result; otherwise, a specified number of points are randomly sampled from cluster A and added to the sampling result; a specified number of data points are selected from the sampling result as the output result to ensure that the number of sampling points for each point cloud data is the same.
[0050] In a second aspect, embodiments of the present invention provide a computing device, including:
[0051] Memory and processor;
[0052] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the one or more programs are executed by the one or more processors, the one or more processors implement the clustering algorithm for a simplified point cloud dataset based on an attention mechanism as described in any embodiment of the present invention.
[0053] Thirdly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the clustering algorithm for the simplified point cloud dataset based on the attention mechanism.
[0054] The beneficial effects of this invention are as follows: This method can effectively segment and filter point cloud datasets, remove noise and outliers, effectively improve the quality of point cloud datasets, reduce noise and redundant data in the datasets, and improve the accuracy and reliability of the data; it can improve the processing efficiency and accuracy of point cloud datasets, and provide more accurate, efficient and reliable data support for tasks such as object detection and target tracking in point cloud-related fields. Attached Figure Description
[0055] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0056] Figure 1 This is an overall flowchart of the clustering algorithm for a simplified point cloud dataset based on an attention mechanism as described in the first embodiment of the present invention;
[0057] Figure 2 This is a comparison chart of the sampling point cloud data and the original data in a simulation example of the clustering algorithm for the simplified point cloud dataset based on the attention mechanism described in the second embodiment of the present invention. Detailed Implementation
[0058] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0059] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0060] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0061] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.
[0062] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0063] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0064] Example 1
[0065] Reference Figure 1 This is the first embodiment of the present invention, which provides a clustering algorithm for a simplified point cloud dataset based on an attention mechanism, comprising:
[0066] S1: Perform data preprocessing on the point cloud dataset;
[0067] Specifically, the data preprocessing includes:
[0068] The point cloud data is normalized to restrict the data in the array to the range [0,1]. The formula is as follows:
[0069]
[0070] Where X is the original data, X min and X max These are the minimum and maximum values of the original data, X. norm It is the normalized data.
[0071] S2: Calculate the density and curvature of the preprocessed data;
[0072] Specifically, the calculation of density and curvature of the preprocessed data includes:
[0073] Curvature C is an attribute characterizing the change in surface slope in point cloud data. It is an indicator describing the surface topography of point clouds, including mean curvature and Gaussian curvature. Its calculation formula is as follows:
[0074]
[0075] Cgaussian =λ max ×λ min
[0076] λ max and λ min It is the principal curvature of each point in the point cloud (there are infinitely many orthogonal curvatures at a certain point on the surface, among which there exists a curve whose curvature is maximized, and this curvature is maximized by λ). max The curvature perpendicular to the surface of maximum curvature is the minimum value λ. min The principal curvature is the reciprocal of the radius of curvature obtained by least-squares fitting of each point in the point cloud;
[0077] The radius of curvature is estimated using the eigenvalues of the covariance matrix, and then the curvature is calculated. Specifically, a k-dimensional tree is constructed, the nearest neighbor of each point is found using the k-dimensional tree, and the covariance matrix of each point is calculated. The eigenvalues and eigenvectors of each covariance matrix are calculated to calculate the curvature of each point. The curvature is then normalized to scale it to the range [0,1].
[0078] Furthermore, the density of the point cloud is estimated by calculating the number of points in the neighborhood of each point. Using a k-dimensional tree, given a radius, the number of points contained within a circle of that radius for each point is calculated as a density estimate; specifically, the point density ρ can be calculated using the following formula:
[0079]
[0080] Where n is the number of data points in the dataset, x i ε is the position of the i-th point, ε is a radius value, and f(x) is an indicator function that returns 1 when its parameter is true and 0 otherwise.
[0081] Specifically, a k-dimensional tree is constructed. For each point, the k-dimensional tree is used to query the neighbors within the radius of the point, and the number of neighbors is counted as the density value of the point. The curvature is normalized and scaled to the range of [0,1].
[0082] It should be noted that the commonly used features in point cloud datasets are as follows:
[0083] 1. Location: The most basic feature in a point cloud dataset is the location information of each point, usually represented by three coordinate values: x, y, and z. These coordinate values can be used to calculate information such as the distance and direction between points.
[0084] 2. Color: Points in a point cloud dataset typically also contain color information, which can represent the color of objects in the scene, light intensity, and so on. Color information is usually represented by the values of the red, green, and blue color channels.
[0085] 3. Normal Vectors: Points in a point cloud dataset typically also contain normal vectors, which represent the orientation and tilt of the surface in which each point lies. Normal vector information is commonly used to calculate the lighting effects and surface details of the surface.
[0086] 4. Curvature: Points in a point cloud dataset can also contain curvature information, which characterizes the property of surface slope variation in the point cloud data and is an indicator describing the surface topography of the point cloud. Curvature information is commonly used for tasks such as shape analysis and object detection.
[0087] 5. Density: Density information refers to the number of points contained in each unit area (e.g., per cubic centimeter) of point cloud data. Density information is crucial in point cloud data processing because it describes information such as the sampling density, spatial distribution, and surface details of the point cloud data.
[0088] It should be noted that in point cloud classification tasks, objects of different shapes often have different densities and curvatures, which are the most discriminative. Therefore, this method selects curvature and density as features to input the clustering algorithm.
[0089] S3: Use the noisy hierarchical density clustering algorithm (HDBSCAN) based on the attention mechanism to perform clustering and filtering on the point cloud dataset according to density and curvature;
[0090] Specifically, the Attention mechanism is introduced, with the following steps: First, each input vector is linearly transformed to obtain three vectors: key, query, and value. Then, the similarity between the query and key is calculated to obtain an attention score. Specifically, the dot product of the query and key is used as the attention score, which is then input into the softmax function for normalization to obtain the attention weights. Finally, the output of the attention mechanism is obtained by weighted sum of the attention weights and the value.
[0091] The density of data points is calculated using a KNN-based method, and then the mutual reachability distances between data points are calculated to achieve spatial transformation. The formula is as follows:
[0092] core k (x)=d(x,N k (x))
[0093] core k (x) is the core distance of point x to its k-th nearest point, d(x,N) k (x) represents its distance from the k-th point;
[0094] The formula for mutual reachability distance is:
[0095] d k (a,b)=max{core k (a),core k (b),d(a,b)}
[0096] d k (a,b) represents the distance between points a and b that can be reached from each other; core k (a) is the core distance of the k nearest neighbor; d k (a,b) is the Euclidean distance between points a and b.
[0097] Furthermore, a minimum spanning tree of the distance-weighted graph is constructed. Specifically, the minimum spanning tree is built using the Prim algorithm, and the edges of the tree are sorted by distance and iterated, creating a new merged cluster for each edge of the tree. The minimum cluster size is set, the dataset hierarchical structure is compressed, and the stability of each cluster is calculated using λ = 1 / d. Clusters with better stability are extracted from the dataset as the final clustering result. The formula for evaluating stability is:
[0098] ∑ p∈cluster (λ p -λ b )
[0099] Where, λ p Let λ be the value of point p that causes it to leave its cluster; λ b The λ value is used to split the cluster into itself.
[0100] It should be noted that the Attention mechanism is a commonly used technique in machine learning, used to weight input information to better capture relevant features in the model. The Attention mechanism can weight and combine information from different parts, allowing the model to focus more on information relevant to the task at hand. This method introduces the Attention mechanism into a noisy hierarchical density clustering algorithm (HDBSCAN algorithm) to obtain better features.
[0101] S4: Sampling of point cloud data based on clustering results reduces the size of the dataset, thus simplifying the point cloud dataset while maintaining accuracy.
[0102] Specifically, the sampling of point cloud data based on clustering results includes: removing points with cluster labels of -1 (i.e., noise points) from the point cloud data based on the clustering results; calculating the weight of each cluster, whereby the weight of each cluster is defined as the ratio of the number of points contained in each cluster to the total number of points in the clustering results; and performing weighted sampling for each cluster.
[0103] Furthermore, the weighted sampling for each cluster includes: for a cluster A, first calculating the number of points to be sampled, where the number of sampling points is the weight of cluster A multiplied by the total number of input point cloud data, and rounded up; if the number of points in cluster A is less than or equal to the number of points to be sampled, then all points in cluster A are directly added to the sampling result; otherwise, a specified number of points are randomly sampled from cluster A and added to the sampling result; a specified number of data points are selected from the sampling result as the output result, ensuring that the number of sampling points for each point cloud data is the same.
[0104] Example 2
[0105] Reference Figure 2 As an embodiment of the present invention, a clustering algorithm for a simplified point cloud dataset based on an attention mechanism is provided. To verify the beneficial effects of the present invention, a simulation experiment is conducted for scientific demonstration.
[0106] The dataset used in this test is modelnet40_normal_resampled, a point cloud dataset for classification. It contains 40 classes, with 9843 point cloud datasets in the training set and 2468 point cloud datasets in the validation set. Each point cloud dataset (in txt format) represents a specific class object. Point cloud datasets consist of many points, and in the ModelNet40 dataset, each point contains information in six dimensions: [x, y, z, n]. x ,n y ,n z ], where (x,y,z) represents the coordinates of the point in space, (n x ,n y ,n z ) represents the normal vector of the point in space.
[0107] First, the information of each point cloud data point is read in, and density (radius set to 1) and curvature are calculated. Then, the obtained density and curvature features are normalized and used as input to the HDBSCAN clustering algorithm based on the Attention mechanism (the result of this algorithm is mainly affected by two parameters, set to min_cluster_size = 80 and min_sample = 10). Next, data is filtered and sampled based on the clustering results (sampling points n = 5000). The visualization result of the sampled point cloud data is as follows: Figure 2 Figure a shows the filtered airplane, and Figure b shows the airplane from the official data. Finally, the filtered data was input into the PointNet++ classification network for model training (batch_size=24, epoch=200, learning_rate=0.001) and validated. The results are shown in Table 5-1.
[0108] Table 5-1 Comparison of Model Accuracy
[0109] Model Instance accuracy Classification accuracy official 0.905825 0.869462 This method 0.940291 0.914231
[0110] The instance accuracy in the table is defined as the ratio between the number of correctly classified instances on the test set and the total number of instances, regardless of the category. The formula is as follows:
[0111]
[0112] Where k represents the number of correctly classified instances, and n represents the total number of instances.
[0113] The classification accuracy in the table refers to the average of the accuracy calculated for each category and then applied across all categories. The formula is as follows:
[0114]
[0115] Where acc i is the prediction accuracy for category i, and M is the total number of categories.
[0116] As shown in Table 5-1, the model trained using the data selected through this method exhibits significant improvements in both instance accuracy and classification accuracy compared to the model trained on the official data. This indicates that this method effectively filters out important data, reduces the size of the dataset, and achieves the goal of dataset simplification.
[0117] It should be noted that 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 preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A clustering algorithm for a simplified point cloud dataset based on an attention mechanism, characterized in that, include: Perform data preprocessing on the point cloud dataset; Calculate the density and curvature of the preprocessed data; The point cloud dataset is clustered and filtered based on density and curvature using a noisy hierarchical density clustering algorithm (HDBSCAN) based on the attention mechanism. The point cloud data is sampled based on the clustering results to reduce the size of the dataset, thereby simplifying the point cloud dataset while maintaining the same accuracy. The calculation of density and curvature of the preprocessed data includes: curvature C It is an attribute characterizing the change in surface slope in point cloud data, and is an indicator describing the surface topography of point clouds. It includes mean curvature and Gaussian curvature, and its calculation formula is: λ max and λ min It is the principal curvature of each point in the point cloud. There are infinitely many orthogonal curvatures passing through a certain point on the surface. Among them, there exists a curve whose curvature is maximized. This curvature is the maximum value. λ max The curvature perpendicular to the surface of maximum curvature is the minimum value. λ min The principal curvature is the reciprocal of the radius of curvature obtained by least-squares fitting of each point on the point cloud; The eigenvalues of the covariance matrix are used as the radius of curvature, and then the curvature is calculated. Specifically, a k-dimensional tree (kdtree) is constructed, the nearest neighbor of each point is found using the k-dimensional tree, and the covariance matrix of each point is calculated; the eigenvalues and eigenvectors of each covariance matrix are calculated, thereby calculating the curvature of each point; the curvature is normalized and scaled to the range of [0, 1]. The calculation of density and curvature of the preprocessed data also includes: The density of a point cloud is estimated by calculating the number of points in the neighborhood of each point. Using a k-dimensional tree (kdtree), given a radius, the number of points contained within a circle of that radius for each point is calculated as a density estimate; specifically, the density of points... ρ Calculate using the following formula: in, n It is the number of data points in the dataset. x i It is the first i The position of each point ε It is a radius value. f(x) It is an indicator function that returns 1 if its argument is true, and 0 otherwise. Specifically, a k-dimensional tree is constructed. For each point, the k-dimensional tree is used to query the neighbors within the radius of the point, and the number of neighbors is counted as the density value of the point. The density is then normalized and scaled to the range of [0, 1]. The clustering and filtering of the point cloud dataset includes: The Attention mechanism is introduced, with the following steps: First, each input vector is linearly transformed to obtain three vectors: key, query, and value. Then, the similarity between the query and key is calculated to obtain an attention score. Specifically, the dot product of the query and key is used as the attention score, which is then input into the softmax function for normalization to obtain the attention weights. Finally, the output of the attention mechanism is obtained by weighted summing of the attention weights and the value. The density of data points is calculated using a KNN-based method, and then the mutual reachability distances between data points are calculated to achieve spatial transformation. The formula is as follows: in core k (x) It is targeted at the point x The distance of its first k The core distance of the nearest point d(x,N k (x)) Indicates its distance from the first k The length of each point; The formula for mutual reachability distance is: d k (a,b) for a、b The distance between points that can reach each other; core k (a) for k Core distance of the nearest lower point; d k (a,b) for a、b Euclidean distance between points; The sampling of point cloud data based on clustering results includes: removing points with cluster labels of -1 (i.e., noise points) from the point cloud data based on the clustering results; calculating the weight of each cluster, whereby the weight of each cluster is defined as the ratio of the number of points contained in each cluster to the total number of points in the clustering results; and performing weighted sampling for each cluster.
2. The clustering algorithm for simplified point cloud datasets based on attention mechanism as described in claim 1, characterized in that, The data preprocessing includes: The point cloud data is normalized to restrict the data in the array to the range [0, 1]. The formula is as follows: in, X It is the raw data. X min and X max These are the minimum and maximum values of the original data, respectively. X norm It is the normalized data.
3. The clustering algorithm for simplified point cloud datasets based on attention mechanism as described in claim 2, characterized in that, The clustering and filtering of the point cloud dataset also includes: constructing a minimum spanning tree of the distance-weighted graph; specifically, constructing the minimum spanning tree using the Prim algorithm, sorting and iterating the tree edges by distance, and creating a new merged cluster for the edges of each tree; setting the minimum cluster size, compressing the dataset layer structure, and using... λ=1 / d The stability of each cluster is calculated, and the cluster with better stability is extracted from the dataset as the final clustering result. The formula for evaluating stability is: in, λ p for p The point is to leave the cluster. λ value; λ b For the cluster to split into itself λ value.
4. The clustering algorithm for simplified point cloud datasets based on attention mechanism as described in claim 3, characterized in that, The weighted sampling for each cluster includes: for a cluster A, first calculate the number of points to be sampled, where the number of sampling points is the weight of cluster A multiplied by the total number of input point cloud data, and rounded up; if the number of points in cluster A is less than or equal to the number of points to be sampled, then all points in cluster A are directly added to the sampling result; otherwise, a specified number of points are randomly sampled from cluster A and added to the sampling result; a specified number of data points are selected from the sampling result as the output result to ensure that the number of sampling points for each point cloud data is the same.
5. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the clustering algorithm for the simplified point cloud dataset based on the attention mechanism as described in any one of claims 1 to 4.
6. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the clustering algorithm for a simplified point cloud dataset based on an attention mechanism as described in any one of claims 1 to 4.