A point cloud analysis method based on dual geometry learning and adaptive sparse attention
Through the point cloud analysis method of dual geometry learning and adaptive sparse attention, the problem of insufficient utilization of geometric information and high computational complexity in point cloud analysis in the existing technology is solved, and more efficient point cloud feature extraction and classification segmentation are achieved. Task performance improvements.
Patent Information
- Application Number
- CN202410765456.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-14
Smart Images

Figure CN118397192B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of point cloud analysis methods, and specifically relates to a point cloud analysis method based on dual geometry learning and adaptive sparse attention. Background Art
[0002] With the rapid development of various 3D acquisition technologies in recent years, point clouds have been widely used in many fields, including autonomous driving, robot navigation, 3D scene understanding, etc. However, unlike images, point clouds are essentially a collection of points in three-dimensional space, showing sparse, disordered and irregular intrinsic properties, which makes it difficult to directly use powerful convolutional neural networks to process point clouds. To solve this problem, some methods convert point clouds into regular data formats such as voxel grids and multi-view images by data preprocessing, and then use convolutional neural networks to extract features. However, these methods will cause the loss of geometric information due to the conversion of data formats, and bring additional computational burdens. For this reason, recent research focuses on algorithms that directly process point clouds. This type of method directly takes the original point cloud as input, builds the neighborhood of each center point, establishes the geometric and semantic relationship between point pairs, and applies multi-layer perceptrons and pooling functions to extract local features of points. In addition, in order to capture the long-range dependencies between point clouds, some methods use self-attention structures to obtain global information, but these methods usually require high computational complexity and computing resources, which limits their application in practical scenarios. Therefore, there are still many challenges in implementing effective and efficient point cloud analysis algorithms for downstream tasks such as classification and segmentation.
[0003] At present, the mainstream point cloud analysis methods for tasks such as classification and segmentation usually adopt a hierarchical network structure. Such algorithms continuously downsample the encoder to reduce the number of point clouds and expand the receptive field, and use various feature extraction algorithms to extract hierarchical features. Since point clouds are composed of three-dimensional points in space, geometric structure information is crucial for point clouds. At present, the mainstream local feature extraction algorithms usually focus on the construction of geometric relationships between point pairs. Some initial methods simply use the relative three-dimensional coordinates between point pairs to explicitly represent geometric relationships, but this does not fully consider the structural information in the neighborhood. Subsequent convolution-based methods further enhance the use of geometric relationships by learning to generate attention weights from the relative position information between point pairs. However, such methods are usually complex and only have high performance in some specific scenarios, and lack generalization. In order to obtain global information to enhance the feature representation of point clouds, some of the latest methods draw on the practice of self-attention mechanism in the image field and apply it to point cloud analysis tasks. PCT directly applies the self-attention mechanism to the entire point cloud and proposes an offset attention to obtain global information. However, since the attention mechanism is proportional to the square of the number of points in the point cloud, the complexity of PCT is too high. PointASNL achieves information exchange through self-attention in point clouds between adjacent coding layers, which alleviates the computational complexity to a certain extent. Point Transformer proposes a vector attention mechanism based on semantic feature differences in local areas. However, this method does not take advantage of the self-attention mechanism in capturing long-distance contextual information, which limits the receptive field. Summary of the invention
[0004] To solve the above problems, the present invention proposes a point cloud analysis method based on dual geometry learning and adaptive sparse attention for classification and segmentation tasks. The method first proposes a dual geometry learning module, which uses the neighborhood triangle structure to obtain the geometric descriptor of each point, and then generates geometric features through the relative geometric descriptors between point pairs. Secondly, a dual geometry context aggregation module is proposed to effectively aggregate the geometric features and semantic features in the neighborhood to obtain local context information. Finally, an adaptive sparse attention module is proposed to effectively and efficiently obtain global information. By dynamically selecting a small number of global representative points, more efficient long-distance information aggregation is achieved with very little computational complexity.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] A point cloud analysis method based on dual geometry learning and adaptive sparse attention, the method comprising the following steps:
[0007] Step 1: Input point cloud data ,in, represents the number of points in the point cloud, Represents the input feature dimension of the point cloud;
[0008] Step 2: Based on the dual geometry learning module, a neighborhood triangle representation of each point in the point cloud is constructed to obtain the geometric descriptor of each point. The neighborhood of each point is obtained in each encoding layer, and geometric features are generated through the relative geometric descriptors between point pairs.
[0009] Step 3: Based on the dual geometric context aggregation module, the acquired geometric features and semantic features are fused to obtain local context information;
[0010] Step 4: Based on the adaptive sparse attention module, use the input features of each point to learn the score of each point and adaptively select the one with the highest score. points as global representative points, and use the attention mechanism to fuse the information of global representative points to obtain global context information;
[0011] Step 5: Add the local context information obtained in step 3 and the global context information obtained in step 4 to obtain the final fused features. After obtaining several layers of encoded features, for classification tasks, the classification is directly output through the fully connected layer. For segmentation tasks, the point cloud resolution is gradually restored through upsampling and skip connections, and the classification results of each point are output.
[0012] The beneficial effects of the present invention are:
[0013] The present invention fully exploits local geometric structure information and uses simple feature addition and pooling to achieve more effective local context information aggregation; the importance of each point is adaptively learned through the input features of the point cloud, and a small number of points are selected as global representative points for feature fusion to obtain global context information, which greatly reduces the computational complexity of the global attention mechanism and also demonstrates superior performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a flow chart of a point cloud analysis method based on dual geometry learning and adaptive sparse attention of the present invention;
[0015] Figure 2 A network structure diagram of a dual geometry context aggregation module provided by an embodiment of the present invention;
[0016] Figure 3 A network structure diagram of an adaptive sampling process provided by an embodiment of the present invention;
[0017] Figure 4 A network structure diagram of an adaptive sparse attention module provided in an embodiment of the present invention;
[0018] Figure 5 A diagram of a point cloud classification and segmentation network architecture provided by an embodiment of the present invention;
[0019] Figure 6 A schematic diagram for comparing segmentation results provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0021] like Figure 1 As shown in the figure, a flow chart of a point cloud analysis method based on dual geometry learning and adaptive sparse attention is shown in the figure. First, step 1: the format of the input point cloud data is ,in is the number of points in the point cloud, It is the input feature dimension of the point cloud, usually represented by the three-dimensional coordinates of the point, and sometimes also includes RGB color information or intensity information, etc. In order to make full use of the structural information in the point cloud, step 2: construct a neighborhood triangle representation of each point in the point cloud based on the dual geometry learning module, and obtain the geometric descriptor of each point through the center point, normal, and edge attributes of the triangle. Secondly, the neighborhood of each point is obtained in each encoding layer, and geometric features are generated through the relative geometric descriptors between point pairs; in order to aggregate local context information, step 3: based on the dual geometry context aggregation module, the obtained geometric features and semantic features are fused to obtain local context information; in order to obtain global information and reduce computational complexity, step 4: based on the adaptive sparse attention module, the input features of the point are used to adaptively learn the score of each point, and then the one with the highest score is selected points as global representative points, and then use the attention mechanism to fuse the information of the global representative points to obtain the global context information. Much smaller than the number of points in the point cloud Therefore, adaptive sparse attention can effectively reduce the computational complexity of the global self-attention mechanism. Step 5: Add the local context information obtained in step 3 and the global context information obtained in step 4 to obtain the final fusion feature. After obtaining several layers of encoding features, for classification tasks, the classification results are directly output through the fully connected layer, while for segmentation tasks, the encoding-decoding structure is adopted to gradually restore the resolution of the point cloud through upsampling and skip connections to output the classification results of each point.
[0022] Specifically, the network structures of the dual geometric learning module, the dual geometric context aggregation module, and the adaptive sparse attention module are introduced below.
[0023] 1. Dual geometry learning module
[0024] Geometric information is crucial in point cloud analysis. In order to enhance geometric representation, a dual geometry learning module is proposed. Specifically, for each point in the point cloud, two neighboring points are selected to form a neighborhood triangle representation. For a given center point , and its two neighboring points are and , the two sides of the triangle It can be expressed as:
[0025] ,
[0026] Then the center point, normal and edge attributes of the triangle are generated through the above triangle representation, which are expressed as:
[0027] ,
[0028] in, is the centroid of the triangle, is the normal to the triangle plane, is the average value of the two sides of the triangle. These three attributes show the intrinsic geometric properties of the local area and can provide more detailed local shape and structure information than three-dimensional coordinates. Then a multi-layer perceptron is used to encode these three attributes into a geometric descriptor. To represent the points in the point cloud, that is:
[0029] ,
[0030] The obtained geometric descriptor Instead of 3D coordinates, it provides richer geometric properties for subsequent feature extraction. Previous methods usually use the relative 3D coordinates between point pairs to generate geometric features. , so the relative geometric descriptors between point pairs are used as the basis for generating geometric features. First, the neighborhood of each point is obtained through the ball query algorithm, and then the geometric features are generated through the relative geometric descriptors between the neighboring points and the center point, that is:
[0031] ,
[0032] in, is a multi-layer perceptron, It is The geometric descriptor of the neighbor points, It is a generated geometric feature that provides rich geometric neighborhood information for subsequent feature aggregation.
[0033] 2. Dual Geometry Context Aggregation Module
[0034] After obtaining the geometric features generated by the dual geometry learning module, the dual geometry context aggregation module is used to aggregate local features. Figure 2 As shown in Figure 2, two dual geometric context aggregation modules are proposed, namely the strided dual geometric context aggregation module and the residual dual geometric context aggregation module. In the strided dual geometric context aggregation module, for the input feature , first use a multi-layer perceptron layer Encode it to get , and then use the farthest point sampling to get the downsampled sub-point cloud, and then use the ball query algorithm to group the point cloud to get multiple neighborhoods, where the first The semantic features and geometric descriptors of the neighbor points are and , geometric features are obtained through dual geometry learning modules Then, through a multi-layer perceptron Encoded and semantic features After addition, the local context information of the output is obtained through maximum pooling For the residual dual geometric context aggregation module, no downsampling operation is used to maintain the same resolution as the input, aiming to enhance feature representation and expand the receptive field. , first use a multi-layer perceptron layer Encode it to get Then, the point cloud is grouped by the ball query algorithm to obtain multiple neighborhoods, where the first The semantic features and geometric descriptors of the neighbor points are and , the generated geometric features are obtained through the dual geometry learning module Then, we use the multi-layer perceptron layer Encoded and semantic features Add them together, and then use the maximum pooling to obtain the output aggregate features. In order to match the dimension of the input features, a multi-layer perceptron layer is used The aggregated features are transformed into the same dimension as the input features and finally combined with the input features Add up to get the final local context information .
[0035] 3. Adaptive Sparse Attention Module
[0036] At present, the method based on the global self-attention mechanism has high requirements for computational complexity. In order to effectively obtain global information while reducing computational complexity, this paper proposes an adaptive sparse attention module. First, adaptive sampling is used to obtain global representative points, such as Figure 3 As shown, for the input Point cloud of points, first input features Apply a linear layer and activation function to get the score for each point ,Right now:
[0037] ,
[0038] in, is a linear layer, is the sigmoid activation function, the score of each point In (0,1), select the one with the highest score The points are used as global representative points for subsequent feature fusion.
[0039] like Figure 4 As shown in the figure, the global feature fusion process of the adaptive sparse attention module is given. The input features are Figure 3 Adaptive sampling is obtained In order to make the adaptive sampling process trainable, the scores generated during the sampling process are With input features Multiply to get the query feature, that is:
[0040] ,
[0041] The key features come from the features of the global representative points and are subtracted from the query features to obtain the relationship matrix :
[0042] ,
[0043] Represents the features of the global representative points. The obtained relationship matrix establishes the global relationship between the input point cloud and the global representative points. Then, the multi-layer perceptron and The activation function obtains the attention coefficient, and multiplies and aggregates it with the value features of the multi-layer perceptron to obtain the global fusion feature. ,Right now:
[0044] ,
[0045] in, and They are all multi-layer perceptrons. Finally, the input features And global fusion features The global context information is further processed by the multi-layer perceptron, namely:
[0046] ,
[0047] The global feature fusion module only needs to fuse The features of the global representative points are combined, which greatly reduces the computational complexity. At the same time, since the characteristics of adjacent points in the local area are very similar, simply fusing the information of all points will bring a certain redundancy. This method adaptively selects the most representative global representative point, which can also reduce the shortcomings caused by this redundancy.
[0048] In summary, the network architecture based on dual geometric learning and adaptive sparse attention is as follows Figure 5 As shown in the figure, it is mainly used for point cloud classification and segmentation tasks. For the input point cloud, the geometric descriptor of each point is first obtained, and then the multi-layer perceptron is used for feature encoding. Subsequently, the dual geometric context learning module and the adaptive sparse attention module are used to extract features. In order to further reduce the computational complexity and improve efficiency, the adaptive sparse attention module is only used in the middle two layers to fuse global information. For classification tasks, the classification results are directly output through pooling and multi-layer perceptron, while for segmentation tasks, upsampling and skip connections are required to gradually restore the point cloud resolution to output the classification results of each point.
[0049] like Figure 6 As shown in the figure, the segmentation effect diagram of the method is shown. The large indoor point cloud dataset S3DIS proposed by Stanford University is used. It can be seen that for the input point cloud, the prediction result of the method is very close to the real label. In the first row, the method selects different real scenes such as conference rooms and offices. For example, by comparing the results of the first column, the prediction results of the method and the real results are visually highly the same, and there are prediction errors only at the edges of some walls, which proves the effectiveness of the method.
[0050] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A point cloud analysis method based on dual geometry learning and adaptive sparse attention, characterized in that: The method comprises the following steps: Step 1: Input point cloud data ,in, represents the number of points in the point cloud, Represents the input feature dimension of the point cloud; Step 2: Based on the dual geometry learning module, a neighborhood triangle representation of each point in the point cloud is constructed to obtain the geometric descriptor of each point. The neighborhood of each point is obtained in each encoding layer, and geometric features are generated through the relative geometric descriptors between point pairs. Step 3: Based on the dual geometric context aggregation module, the acquired geometric features and semantic features are fused to obtain local context information; Step 4: Based on the adaptive sparse attention module, use the input features of each point to learn the score of each point and adaptively select the one with the highest score. The point is used as the global representative point, and the attention mechanism is used to fuse the information of the global representative point to obtain the global context information; Step 5: Add the local context information obtained in step 3 and the global context information obtained in step 4 to obtain the final fused features. After obtaining several layers of encoded features, for classification tasks, the classification is directly output through the fully connected layer. For segmentation tasks, the point cloud resolution is gradually restored through upsampling and skip connections, and the classification results of each point are output.
2. The point cloud analysis method based on dual geometry learning and adaptive sparse attention according to claim 1, characterized in that: The step 2 comprises: For a given center point in the point cloud , and its two neighboring points are and , the two sides of the triangle Respectively expressed as , the geometric properties of the triangle are calculated as follows: , in, represents the centroid of the triangle, represents the normal of the triangle plane, Represents the average value of the two sides of the triangle, using a multi-layer perceptron to encode the geometric properties of the triangle into a geometric descriptor To represent the points in the point cloud, that is: , In the formula, represents the first multi-layer perceptron; The ball query algorithm is used to obtain the neighborhood of each point, and then the neighbor points and the center point are The relative geometric descriptors between generate geometric features, namely: , in, It is The geometric descriptors of the neighboring points, represents the generated geometric features, Represents the second multi-layer perceptron.
3. The point cloud analysis method based on dual geometry learning and adaptive sparse attention according to claim 2, characterized in that: The step 3 comprises: The dual geometry context aggregation module includes a stride dual geometry context aggregation module or a residual dual geometry context aggregation module; In the strided dual geometry context aggregation module, for the input features , first use a multi-layer perceptron Encode it to get Then, the farthest point sampling is used to obtain the downsampled sub-point cloud, and the point cloud is grouped by the ball query algorithm to obtain multiple neighborhoods, where the first The semantic features and geometric descriptors of the neighbor points are and , the generated geometric features are obtained through the dual geometry learning module Then, using the multi-layer perceptron Encoded and semantic features Add, and finally obtain the local context information of the output through maximum pooling ; In the residual dual geometry context aggregation, for the input features , first use a multi-layer perceptron Encode it to get Then, the point cloud is grouped by the ball query algorithm to obtain multiple neighborhoods, where the first The semantic features and geometric descriptors of the neighbor points are and , the generated geometric features are obtained through the dual geometry learning module Then, using the multi-layer perceptron Encoded and semantic features Add, and obtain the output aggregate features through maximum pooling, using a multi-layer perceptron layer The aggregated features are transformed into the same dimension as the input features and finally combined with the input features Add up to get the final local context information .
4. The point cloud analysis method based on dual geometry learning and adaptive sparse attention according to claim 3, characterized in that: The step 4 comprises: First, input features of each point in the point cloud Apply a linear layer and activation function to get the score for each point ,Right now: , in, represents a linear layer, Represents the sigmoid activation function, selecting the one with the highest score points as global representative points; The score of each point generated during the sampling process With input features Multiply to get the query feature : , Constructing a relationship matrix : , Represents the characteristics of the global representative point, and the relationship matrix obtained A global relationship between the input point cloud and the global representative points is established; The attention coefficient is obtained through the multi-layer perceptron and ReLU activation function, and the global fusion feature is obtained by multiplying and aggregating with the value feature after the multi-layer perceptron. ,Right now: , in, and Respectively represent the corresponding and Multi-layer perceptron operation; Then input features And global fusion features The final output global context information is obtained after being processed by the third multi-layer perceptron : 。
