Weak supervision indoor point cloud semantic segmentation method and device based on clustering thought and medium
Through clustering ideas and attention mechanisms, a weakly supervised indoor point cloud semantic segmentation method with a hierarchical clustering structure is constructed, which solves the problem of insufficient accuracy and computing power requirements in the existing technology, and achieves efficient point cloud semantic segmentation, especially Superior performance with minimal markup.
Patent Information
- Application Number
- CN202410703553.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-03-26
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-10
AI Technical Summary
Existing weakly supervised indoor point cloud semantic segmentation methods have shortcomings in accuracy and computing power requirements, especially inefficient utilization of limited information and limited generalization capabilities.
Using a method based on clustering ideas, multi-scale point cloud features are extracted through the Transformer model, and the attention mechanism and hierarchical clustering structure are used to construct a cluster query network. The model is trained under weak supervision conditions based on cluster center constraints to improve the model accuracy. Point cloud scene understanding ability.
While using a very small amount of annotations, it achieves segmentation accuracy comparable to fully supervised methods, reduces computing power requirements, increases calculation speed, and significantly improves the model's generalization ability.
Smart Images

Figure CN118628736A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of indoor point cloud semantic segmentation, and in particular to a weakly supervised indoor point cloud semantic segmentation method, device and medium based on clustering idea. Background Art
[0002] With the continuous development of indoor point cloud algorithms, current fully supervised algorithms have achieved fairly high accuracy in various downstream tasks of indoor point clouds. However, despite the excellent performance of fully supervised methods, their reliance on a large amount of labeled data and their lack of generalization ability when facing new scenes limit their widespread use in practical applications. In view of this challenge, researchers have recently begun to turn to the study of weakly supervised / unsupervised indoor point cloud semantic segmentation algorithms to optimize this problem.
[0003] CN116664835A discloses an unsupervised three-dimensional point cloud semantic segmentation method and related equipment, the method includes: determining a number of superpoints according to point cloud data; obtaining the superpoint features of each superpoint through a point cloud feature extractor, clustering each superpoint to obtain a number of growing superpoints; obtaining the superpoint features of each growing superpoint through a point cloud feature extractor, clustering each growing superpoint to obtain a number of semantic primitives; determining the pseudo-labels of each point in the point cloud data according to each semantic primitive, and training the point cloud feature extractor according to the pseudo-labels; judging whether the point cloud feature extractor has reached the training target, if not, continuing to perform the above steps until the training target is reached; clustering each semantic primitive finally obtained to obtain a number of semantic category features, and determining the semantic segmentation result of the point cloud data according to each semantic category feature. However, this method clusters the determined superpoints to obtain semantic primitives, thereby obtaining pseudo-labels, which is an unsupervised method, and the final segmentation accuracy is not high enough, and the training steps are relatively complex, requiring high computing power.
[0004] When applying weak supervision methods to semantic segmentation of indoor point clouds, two key issues need to be addressed: first, selecting appropriate labels as weak supervision labels, and second, how to effectively utilize limited information. There is no method in the prior art that utilizes limited information based on the distribution characteristics of point cloud semantic features. Summary of the invention
[0005] The purpose of the present invention is to provide a weakly supervised indoor point cloud semantic segmentation method, device and medium based on clustering idea, utilizing the characteristic that points of the same semantic category are clustered in feature space to form clusters, while points of different semantic categories are distributed far away in feature space, and utilizing limited information based on the distribution characteristics of point cloud semantic features, giving important prior information to the model's learning of point cloud features, improving the model's ability to understand point cloud scenes, and achieving point cloud semantic segmentation with high performance, low computing power requirements and fast computing speed.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A weakly supervised indoor point cloud semantic segmentation method based on clustering idea includes the following steps:
[0008] Step 1: Obtain indoor point cloud data and use the point cloud feature extractor based on the Transformer model to extract multi-scale indoor point cloud features;
[0009] Step 2: Use the attention mechanism to design the query module and grouping module, and construct the clustering query block and the semantic category clustering query block;
[0010] Step 3: Use multiple clustering query blocks and semantic category clustering query blocks to stack to form a clustering query network and build an indoor point cloud semantic segmentation model with a hierarchical clustering structure;
[0011] Step 4: Use the manually designed cluster center constraints to guide the model to learn global semantic information and train the indoor point cloud semantic segmentation model under weak supervision;
[0012] Step 5: Input the indoor scene point cloud to be detected into the trained indoor point cloud semantic segmentation model to obtain the predicted indoor point cloud segmentation result.
[0013] In the step 1, the point cloud feature extractor performs hierarchical sampling on the acquired indoor point cloud data, divides the point cloud space into multiple non-overlapping stereo windows, obtains the neighborhood point set of each point according to the distribution of the points in the window, and uses the attention mechanism to allow the points in the point cloud to learn a large number of neighboring points, a small number of medium-distance points, and not to learn long-distance points, and extracts and learns the local features contained in the neighborhood point set of each point in the point cloud.
[0014] In the step 1, the layered sampling strategy is specifically as follows: divide the stereo window into small-sized windows, densely sample the sub-point cloud framed by the small-sized stereo window, and obtain a group of dense neighboring points; secondly divide the stereo window into large-sized windows, frame the range of the large-sized stereo window, use the farthest point to sample the point cloud within the framed range to obtain a group of sparse points, and the large-sized stereo window is spliced by the small-sized stereo windows; the point set obtained by the layered sampling contains point cloud information from different stereo window sizes and different sampling densities, and the sparse points sampled by the large-sized stereo window and the dense points sampled by the small-sized stereo window together constitute a neighborhood point set;
[0015] The point cloud feature extractor applies a stratified sampling strategy to stratify and sample two sets of neighborhood point sets for each point, and performs two calculations of the attention mechanism. The first stratified sampling uses the stratified sampling strategy to directly process the input point cloud, and the second stratified sampling uses the stratified sampling strategy to process the point cloud after the window is moved. The specific method of the window movement is to divide the point cloud into large-size stereo windows, and move the window in units of the large-size stereo windows, change the relative positions between the windows, destroy the original structure of the point cloud and reorganize it to form a new point cloud for stratified sampling;
[0016] The two sets of neighborhood point sets obtained are used as keys in the attention mechanism to help points in the point cloud query local information of different scales and maintain the ability of the point cloud feature extractor to handle long-distance dependencies.
[0017] In the step 2, a number of clusters equal to the number of semantic categories in the point cloud scene, namely, semantic category clusters, is defined in the feature space. At the same time, an additional group of clusters, called intermediate layer clusters, is introduced to extract local features of the point cloud in the middle of the semantic category clusters. The centers of the intermediate layer clusters are updated in the clustering query block to learn the local features of the point cloud. The centers of the semantic category clusters are updated in the semantic category clustering query block to learn the global features of the point cloud. The calculations in the clustering query block and the semantic category clustering query block are completed by a query module and a grouping module.
[0018] The query module in the cluster query block uses a masked attention mechanism to allow the middle-layer cluster centers to learn the local features of the point cloud; the query module in the semantic category cluster query block uses a masked attention mechanism to allow the semantic category cluster centers to learn the local features extracted by the middle-layer cluster centers, and establish the ability of the indoor point cloud semantic segmentation model to understand the global semantic features of the indoor space. The calculation formula of the query module is as follows:
[0019] Q=Linear q (Q)
[0020] K=Linear k (F)
[0021] V=Linear v (F)
[0022] PE bias =MLP(F P )
[0023] PE addend =MLP(P Q )-MLP(P F )
[0024]
[0025] Among them, Q represents the characteristics of the subject of the query, P Q represents the coordinate information corresponding to Q; F represents the characteristics of the query key and value, P F Indicates the coordinate information corresponding to F, α indicates the mask, PE addend With PE bias Both represent positional encoding, Linear represents linear layer, MLP represents multi-layer perceptron, and × represents element-wise product.
[0026] The grouping module clusters the points into clusters according to the similarity between the features of the points and the features of the cluster centers, and provides a mask for calculation for the next query module to ensure that the cluster centers can only access the points within their respective clusters. The grouping module of the cluster query block only calculates the mask required by the attention mechanism, so that the cluster centers can only learn the features of the points within the cluster; the grouping module of the semantic category cluster query block calculates the semantic category score of the semantic category cluster center, and maps the global features learned by the semantic category cluster center back to each point in the point cloud. The calculation formula of the grouping module is as follows:
[0027]
[0028] α=δ(β>t)
[0029]
[0030]
[0031] Among them, β represents and F k The similarity between Q represents the semantic score corresponding to the center of the semantic category cluster, S P represents the point-wise semantic score, F k represents the point-by-point features of the point cloud, σ represents the sigmoid function, t is the preset threshold, δ represents the linear interpolation function, Represents the center of the semantic category cluster.
[0032] In step 4, the cluster center constraint includes the cluster center binary cross entropy loss and the cluster center contrast loss, where:
[0033] The cluster center binary cross entropy loss is supervised by the semantic category cluster center Q c The corresponding semantic score S Q , establish the connection between semantic category clusters and semantic categories, and convert S Q With the identity matrix defined Compare and apply binary cross entropy loss to constrain Q cTo ensure that it carries accurate global semantic information, the unit matrix E has diagonal elements with values of 1 and all other elements are 0, and C is the number of semantic categories;
[0034] The cluster center contrast loss constraint Q c Different tensors in, ensure that when i≠j, the tensor q i With q j There is a clear difference between them, which can be expressed as:
[0035]
[0036] Where τ is a constant.
[0037] In step 4, the loss function of the indoor point cloud semantic segmentation model is expressed as:
[0038]
[0039] in, represents the cross entropy loss of the point-wise semantic scores, represents the cluster center binary cross entropy loss, represents the cluster center contrast loss, λ bce , ck Represents the weight of the corresponding loss.
[0040] A weakly supervised indoor point cloud semantic segmentation device based on clustering idea includes a memory, a processor, and a program stored in the memory. When the processor executes the program, the method described above is implemented.
[0041] A storage medium stores a program, which implements the method described above when executed.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] 1. The present invention proposes an indoor point cloud segmentation method specially designed for weak supervision. When using 1% and 0.1% of the annotation amount of the point cloud, it achieves a model performance comparable to that of the full supervision method with high segmentation accuracy.
[0044] Second, the present invention proposes a hierarchical clustering structure, introduces the concept of cluster in the feature space, and guides the model to learn the global semantic features of point clouds.
[0045] 3. The present invention proposes a clustering query network, designs a query module and a clustering module, and applies clustering ideas to improve the model's ability to understand point cloud scenes.
[0046] 4. The present invention proposes cluster center binary cross entropy loss and cluster center contrast loss, and ensures that the cluster query network applies clustering ideas to learn the global semantic information of the point cloud through constraints, thereby further ensuring the effectiveness of the method.
[0047] 5. The present invention uses subtraction to replace the dot multiplication operation in the attention mechanism, which maintains the powerful performance of the attention mechanism while having low computing power requirements and fast calculation speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flow chart of the method of the present invention;
[0049] Figure 2 It is a schematic diagram of the indoor point cloud semantic segmentation model of the present invention;
[0050] Figure 3 It is a schematic diagram of the structure of the query module and the grouping module of the present invention. DETAILED DESCRIPTION
[0051] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0052] This embodiment provides a weakly supervised indoor point cloud semantic segmentation method based on clustering idea, such as Figure 1 As shown, the following steps are included:
[0053] Step 1: Obtain indoor point cloud data and use the point cloud feature extractor based on the Transformer model to extract multi-scale indoor point cloud features.
[0054] In this embodiment, the point cloud feature extractor adopts an innovative hierarchical sampling strategy. By dividing the point cloud space into multiple non-overlapping stereo windows, the neighborhood point set of each point is obtained according to the distribution of points in windows of different sizes. Then, through the masked attention mechanism, the points in the point cloud learn a large amount of information about neighboring points and a small amount of information about medium-distance points, but do not learn information about distant points. Each point in the point cloud is used as the query subject of the attention mechanism, and the local features contained in the neighborhood point set of this point are extracted and learned.
[0055] In addition to this hierarchical sampling strategy, the point cloud feature extractor divides the point cloud into blocks and reorganizes them so that points that were not originally in the domain point set of a point due to their long distance can appear in the point set of that point after the window moves. This allows the points in the point cloud to contact long-distance points, ensuring that the points in the point cloud can not only obtain information from their domain, but also obtain information from points that are farther away in space.
[0056] The specific layered sampling strategy is as follows: perform small-size stereo window division, densely sample the sub-point cloud framed by the small-size stereo window, and obtain a set of dense neighboring points; secondly, perform large-size stereo window division, and in order to limit the number of mid-distance points in the domain point set, the point cloud feature extractor samples the point cloud within the frame range of the large-size stereo window but not within the frame range of the target small-size stereo window, and uses the farthest point to sample the point cloud within the frame range to obtain a set of sparse points, where the large-size stereo window is spliced by small-size stereo windows. The point set obtained by layered sampling contains point cloud information from different stereo window sizes and different sampling densities. The sparse points sampled by the large-size stereo window and the dense points sampled by the small-size stereo window together constitute a neighborhood point set;
[0057] The point cloud feature extractor adopts a window moving strategy to enhance its ability to handle long-distance dependencies. It applies a layered sampling strategy to layer-sample two sets of neighborhood point sets for each point, and performs two calculations of the attention mechanism. The first layered sampling uses the layered sampling strategy to directly process the input point cloud, and the second layered sampling uses the layered sampling strategy to process the point cloud after the window is moved. The specific way of window movement is to divide the point cloud into large-size stereo windows, and move the window with the large-size stereo windows as units, change the relative position between windows, destroy the original structure of the point cloud and reorganize it to form a new point cloud for layered sampling. In this way, the point cloud feature extractor allows points that were not originally in the domain point set of a point because of the long distance to appear in the point point set after the window is moved, so that the points in the point cloud can contact long-distance points, enhancing the ability to handle long-distance dependencies.
[0058] In the above way, the point set obtained by layered sampling contains point cloud information from different stereo window sizes and different sampling densities. The sparse points sampled from the large-size stereo window and the dense points sampled from the small-size window together form a domain point set. After layered sampling of different target small-size windows, the point cloud feature extractor will eventually sample a series of domain point sets. Finally, these neighborhood point sets are used as keys in the attention mechanism to help points in the point cloud query local information of different scales and maintain the feature extractor's ability to handle long-distance dependencies.
[0059] The point cloud feature extractor uses a U-Net-like structure. The input point cloud first passes through multiple downsampling blocks, each of which increases the dimension of the point cloud features, reducing the number of points while expanding the receptive field of the points. After multiple downsampling blocks are stacked, the multi-scale features of the point cloud are extracted in a pyramid hierarchical structure, and finally high-dimensional features are obtained. The coordinate information of the points is always retained during the downsampling process. 1It is composed of coordinates and extracted high-dimensional features. 1 ) comes from this. Then, the high-dimensional feature F 1 Through multiple residual connections and multiple upsampling blocks, a set of multi-scale features {F 1 , F 2 , ..., F k}, where each F i Both with F 1 It contains the semantic features extracted during the downsampling process and the retained coordinate information, so F i The size is N i ×(3+D i ), where F k The size is (3+D k ), which is the point-by-point feature of the point cloud.
[0060] Step 2: Use the attention mechanism to design the query module and grouping module, and construct the clustering query block and the semantic category clustering query block.
[0061] This embodiment defines a number of clusters in the feature space that is the same as the number of semantic categories in the point cloud scene, namely, semantic category clusters, and introduces an additional group of clusters, called intermediate layer clusters, to extract local features of the point cloud in the middle of the semantic category clusters, thereby overcoming the problem that the centers of the semantic category clusters are difficult to converge. A group of cluster centers is assigned to each of the two groups of clusters, and the local semantic features and global semantic features of the point cloud are learned respectively. In the present invention, the basis for determining which semantic category a point in a point cloud belongs to is the semantic category cluster to which the point belongs after processing, and which semantic category cluster it belongs to is determined by the similarity between its features and the centers of the semantic category clusters.
[0062] This embodiment uses the attention mechanism to construct the query module and the grouping module to help the defined cluster center learn the local and global features of the point cloud. The main function of the query module is to use the mutual attention mechanism with mask, supplemented by position encoding, to allow the cluster center to learn semantic information from the features of the points belonging to the cluster. The role of the grouping module is to introduce the clustering idea by grouping the point cloud, divide the point cloud into different clusters, and provide support for feature learning. Using the query module and the grouping module, a clustering query block and a semantic category clustering query block are constructed. The query module and the grouping module in the clustering query block and the query module and the grouping module in the semantic category clustering query block only differ slightly in input and output and a small number of calculation details, while the overall function and calculation process are the same.
[0063] The query module in the clustering query block uses a masked attention mechanism to allow the intermediate layer clustering centers to learn the local features of the point cloud; the query module in the semantic category clustering query block uses a masked attention mechanism to allow the semantic category clustering centers to learn the local features extracted by the intermediate layer clustering centers, and establish the indoor point cloud semantic segmentation model's ability to understand the global semantic features of the indoor space.
[0064] like Figure 3 As shown in Figure 1, the query module takes three main tensors as input, one is the subject of the query, the second is the receptor of the query, and the last is the mask. In addition to the mask, one tensor is used as the query and the other tensor is used as the key and value. However, due to different functions, the query module in the cluster query block and the query module in the semantic category cluster query block receive different inputs. The query module in the cluster query block takes the middle layer cluster center Q h As Query, point cloud feature F i As Key and Value; the query module of the semantic clustering category query block uses the semantic category cluster center Q c As Query, the middle layer cluster center Q h As Key and Value. h It is initialized by sampling the farthest point from the point-by-point features, and the coordinate information is also retained during sampling. c It is represented by a set of learnable tensors, and its coordinate information is also represented by learnable tensors.
[0065] Figure 3 In the above example, Q represents the characteristics of the subject of the query, and P Q Indicates the coordinate information corresponding to Q; F represents the characteristics of the query receptor (Key and Value), P F Indicates the coordinate information corresponding to F; the mask is represented by α, and the calculation formula is as follows:
[0066] Q=Linear q (Q)
[0067] K=Linear k (F)
[0068] V=Linear v (F)
[0069] PE bias =MLP(P F )
[0070] PE addend =MLP(P Q )-MLP(P F )
[0071]
[0072] Among them, PE addend With PE bias All represent positional encoding, Linear represents linear layer, MLP represents multi-layer perceptron, and × represents element-by-element product. In this calculation process, subtraction is used to replace the dot multiplication operation in the attention mechanism, which maintains the powerful performance of the attention mechanism while reducing the amount of calculation.
[0073] The grouping module clusters points into clusters based on the similarity between the features of the points and the features of the cluster centers, and provides a mask for the next query module to calculate, to ensure that the cluster centers can only access the points within their respective clusters. The grouping module of the cluster query block only calculates the mask required by the attention mechanism, so that the cluster centers can only learn the features of the points within the cluster; the grouping module of the semantic category cluster query block calculates the semantic category scores of the semantic category cluster centers, and maps the global features learned by the semantic category cluster centers back to each point in the point cloud. The grouping module uses the features calculated in the query module as the And the point-by-point features F of the point cloud k As input, the application of clustering concept in the present invention is concentratedly embodied.
[0074] The grouping module first With F k Based on this similarity, the grouping module divides the points in the point cloud into different clusters, represented by a binary mask α, to ensure that each cluster center obtains the point features within its cluster. β is calculated by With the pointwise feature F k Perform point multiplication and calculate it through a Sigmoid function, the formula is expressed as:
[0075]
[0076] The binary mask α calculated by the grouping module of the current cluster query block will be sent to the next cluster query block to participate in the operation of the query module to limit each cluster center to only learn the features of the points within its cluster. Therefore, α also needs to be interpolated to adapt to the size of the point cloud features input in the next cluster query block.
[0077] After obtaining the similarity β, the grouping module generates a binary mask α by setting a threshold t. Specifically, the grouping module sets the value of β greater than the threshold position to 1, indicating a valid value, and the formula is:
[0078] α=δ(β>t)
[0079] Wherein, δ represents the linear interpolation function.
[0080] The grouping module in the semantic category clustering query block does not calculate the binary mask α, but needs to calculate the semantic score S corresponding to the center of the semantic category cluster. Q , and further through the semantic category cluster center Q c and pointwise features F k The similarity β k To assign a semantic score to each point in the point cloud, we get a point-by-point semantic score S P .
[0081]
[0082] Step 3: Use multiple clustering query blocks and semantic category clustering query blocks to stack to form a clustering query network and build an indoor point cloud semantic segmentation model with a hierarchical clustering structure.
[0083] Specifically, in the cluster query block, the center of the intermediate cluster is updated to learn the local features of the point cloud, and in the semantic category cluster query block, the center of the semantic category cluster is updated to learn the global features of the point cloud. Multiple cluster query blocks and one semantic category cluster query block are stacked to form a cluster query network, and the clustering idea is applied to learn the semantic information of the point cloud to complete the semantic segmentation task.
[0084] The present invention gives the semantic category cluster center to the defined semantic category cluster The typical semantic features used to characterize the corresponding semantic categories are represented by a set of learnable tensors. c By learning the features of point clouds, it is continuously updated iteratively until excellent semantic feature expression capabilities are achieved.
[0085] Q c In the size of , C refers to the number of semantic categories contained in the indoor point cloud. Generally speaking, C is a small number, which is three to four orders of magnitude different from the number of points N in the point cloud. For example, the point cloud in the ScanNet v2 dataset only contains 20 semantic categories, while the input points of the model when processing this dataset are tens of thousands. This will cause Q to be too large during training. c Too many point cloud features are received, which leads to the problem of difficulty in convergence.
[0086] In order to overcome this problem, the present invention introduces an additional group of clusters, called the middle layer clusters, and also assigns a cluster center to this group of clusters, called the middle layer cluster center
[0087] Different from Q represented by a learnable tensor c , Q h The initialization is to use the farthest point sampling method to obtain the point-by-point features F of the point cloud. k This is done by sampling in .
[0088] Qh In the size of , H refers to the total number of middle layer clusters, (3+Q q ) indicates Q h It is formed by concatenating the spatial coordinates obtained by sampling the farthest point and the features of the point.
[0089] Q c Although the dimension is similar to Q h Same, but Q c The 3 in the dimension is also represented by a learnable tensor, which does not contain specific coordinate information. The purpose of using a learnable tensor to generate a pseudo coordinate information is to h The first is to align operations, and the second is to try to learn the general positions of different semantics in the scene space.
[0090] The middle layer cluster uses the local semantic homogeneity of the point cloud to extract the local features of the point cloud and concentrates them on the middle layer cluster center Q h In the present invention, the middle layer cluster acts as a bridge connecting local and global information. h After learning the local information of the point cloud, the semantic category cluster center Q c Just need to Q h By learning and further aggregating the features expressed, the global semantic information of the point cloud can be learned.
[0091] In order to realize the feature extraction process from local features to global semantic features through the hierarchical clustering structure we constructed, the present invention designs a clustering query block and a semantic category clustering query block, and stacks multiple clustering query blocks and a semantic category clustering query block, such as Figure 2 As shown in , a clustering query network is formed.
[0092] Step 4: Use the hand-designed cluster center constraints to guide the model to learn global semantic information and train the indoor point cloud semantic segmentation model under weak supervision.
[0093] The application of clustering methods in indoor point cloud semantic segmentation methods requires that the semantic category cluster centers need to have sufficient expression capabilities for the semantic information contained in their corresponding semantic categories, and there should be obvious differences between the semantic category cluster centers expressing different semantic categories. c It includes C tensors, each representing the semantic information of C different semantic categories. In order to accurately and effectively cluster the point cloud into the semantic category cluster to which it belongs according to the extracted features, Q c The following two conditions need to be met: First, Q cEach tensor in the point cloud needs to have sufficient expressive power to convey the semantic information of its corresponding semantic category; secondly, there should be obvious differences between tensors expressing different semantic categories. The former ensures that when clustering is correct, the points in the point cloud can be assigned accurate semantic scores according to the semantic category clusters they belong to; the latter can reduce the possibility of confusion between the clusters to which the point cloud features are clustered due to the close similarity between the points and the centers of multiple semantic category clusters. Based on the above, in addition to the semantic score S for each point, P Common cross entropy loss of In addition, the present invention also designs a set of cluster center constraints to supervise Q c These constraints consist of two components: the cluster center binary cross entropy loss and the cluster center contrastive loss.
[0094] In order to meet the requirement that the semantic category cluster center has sufficient expressive power for the semantic information contained in its corresponding semantic category, the cluster center binary cross entropy loss is introduced, and a unit matrix with the same size as the number of semantic categories is used as the supervision label. The cluster center binary cross entropy loss supervises the semantic category cluster center Q c The corresponding semantic score S Q , establish the connection between semantic category clusters and semantic categories, and ensure Q c Carry accurate global semantic information. To achieve this goal, this embodiment will Q c Send it to a linear layer activated by the Sigmoid function to get the semantic score The tensors representing different semantic categories in Qc should obtain the highest score in the corresponding semantic category. Therefore, this embodiment defines a unit matrix As a label for supervision, the unit matrix E has diagonal elements with values of 1 and all other elements are 0.
[0095] Based on this, we design the cluster center binary cross entropy loss. This loss is calculated by dividing S Q Compare with the identity matrix E defined above and apply a binary cross entropy loss to constrain Q c This ensures that after training, Q c It can carry accurate and effective global semantic information and provide a reliable basis for point cloud clustering.
[0096] Q c There should be obvious differences between the tensors corresponding to different semantic categories in . Therefore, the cluster center contrast loss is introduced to meet the requirement that the centers of clusters of different semantic categories are far apart in the feature space, so as to reduce the possibility of confusion between the clusters into which the point cloud features are clustered due to the close similarity between the centers of multiple semantic category clusters. The cluster center contrast loss constraint Q c Different tensors in, ensure that when i≠j, the tensor q i With q jThere is a clear difference between them, which can be expressed as:
[0097]
[0098] Here, τ is a constant, usually set to 0.07.
[0099] Then, the overall loss function of the indoor point cloud semantic segmentation model is expressed as:
[0100]
[0101] in, represents the cross entropy loss of the point-wise semantic scores, represents the cluster center binary cross entropy loss, represents the cluster center contrast loss, λ bce , cl Represent the weights of the corresponding losses, which are set to 0.01 and 0.1 respectively during training.
[0102] Step 5: Input the indoor scene point cloud to be detected into the trained indoor point cloud semantic segmentation model to obtain the predicted indoor point cloud segmentation result.
[0103] This embodiment performs well in the indoor point cloud semantic segmentation task, and the performance is mainly evaluated by the average intersection over union ratio. When using weakly supervised labels with 1% and 0.1% annotations of the point cloud, the present invention achieves excellent performance on the test set of the ScanNet v2 dataset:
[0104] When using 1% of the annotation amount of the point cloud, the present invention achieves an impressive average intersection-over-union ratio of 66.7%.
[0105] When using 0.1% of the annotation amount of the point cloud, the present invention still maintains excellent performance and achieves an average intersection-over-union ratio of 60.6%.
[0106] These results show that the present invention has achieved excellent performance in the weakly supervised indoor point cloud semantic segmentation task, is a cutting-edge method in the current field, and has the highest accuracy among the methods using the same weakly supervised labels.
[0107] The present invention uses a method of randomly sampling a certain proportion of points in the entire point cloud scene and labeling them to obtain weakly supervised labels. Although such annotation information is relatively limited, it is the most intuitive and conforms to the logic of point cloud annotation. Compared with the use of other forms of weakly supervised labels, the use of such labels does not require additional complex process design and model structure design, reduces the complexity of the training process, and reduces the difficulty of obtaining labels. Moreover, this method is more friendly for the migration of relatively mature fully supervised methods. In addition, the present invention utilizes limited information based on the distribution characteristics of point cloud semantic features, gives important prior information to the model's learning of point cloud features, and improves the model's ability to understand point cloud scenes.
[0108] The above is an introduction to a method embodiment. The following is a further explanation of the solution of the present invention through an apparatus embodiment.
[0109] This embodiment provides a weakly supervised indoor point cloud semantic segmentation device based on clustering concept, including a memory, a processor, and a program stored in the memory, and the processor implements the method described above when executing the program.
[0110] Specifically, the device includes:
[0111] The feature extraction module is used to obtain indoor point cloud data and extract multi-scale indoor point cloud features using a point cloud feature extractor based on the Transformer model;
[0112] The query block building module is used to design the query module and the grouping module using the attention mechanism, and to build the clustering query block and the semantic category clustering query block;
[0113] A semantic segmentation model building module is used to stack multiple clustering query blocks and semantic category clustering query blocks to form a clustering query network, and to build an indoor point cloud semantic segmentation model with a hierarchical clustering structure;
[0114] The semantic segmentation model training module is used to guide the model to learn global semantic information using manually designed cluster center constraints and train the indoor point cloud semantic segmentation model under weak supervision;
[0115] The detection module is used to input the indoor scene point cloud to be detected into the trained indoor point cloud semantic segmentation model to obtain the predicted indoor point cloud segmentation result.
[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0117] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0118] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A weakly supervised indoor point cloud semantic segmentation method based on clustering idea, characterized in that: The following steps are involved: Step 1: Obtain indoor point cloud data and use the point cloud feature extractor based on the Transformer model to extract multi-scale indoor point cloud features; Step 2: Use the attention mechanism to design the query module and grouping module, and construct the clustering query block and the semantic category clustering query block; Step 3: Use multiple clustering query blocks and semantic category clustering query blocks to stack to form a clustering query network and build an indoor point cloud semantic segmentation model with a hierarchical clustering structure; Step 4: Use the manually designed cluster center constraints to guide the model to learn global semantic information and train the indoor point cloud semantic segmentation model under weak supervision; Step 5: Input the indoor scene point cloud to be detected into the trained indoor point cloud semantic segmentation model to obtain the predicted indoor point cloud segmentation result.
2. According to the weakly supervised indoor point cloud semantic segmentation method based on clustering idea in claim 1, it is characterized in that: In the step 1, the point cloud feature extractor performs hierarchical sampling on the acquired indoor point cloud data, divides the point cloud space into multiple non-overlapping stereo windows, obtains the neighborhood point set of each point according to the distribution of the points in the window, and uses the attention mechanism to allow the points in the point cloud to learn a large number of neighboring points, a small number of medium-distance points, and not to learn long-distance points, and extracts and learns the local features contained in the neighborhood point set of each point in the point cloud.
3. According to the weakly supervised indoor point cloud semantic segmentation method based on clustering idea in claim 2, it is characterized in that: In the step 1, the layered sampling strategy is specifically as follows: divide the stereo window into small-sized windows, densely sample the sub-point cloud framed by the small-sized stereo window, and obtain a group of dense neighboring points; secondly divide the stereo window into large-sized windows, frame the range of the large-sized stereo window, use the farthest point to sample the point cloud within the framed range to obtain a group of sparse points, and the large-sized stereo window is spliced by the small-sized stereo windows; the point set obtained by the layered sampling contains point cloud information from different stereo window sizes and different sampling densities, and the sparse points sampled by the large-sized stereo window and the dense points sampled by the small-sized stereo window together constitute a neighborhood point set; The point cloud feature extractor applies a stratified sampling strategy to stratify and sample two sets of neighborhood point sets for each point, and performs two calculations of the attention mechanism. The first stratified sampling uses the stratified sampling strategy to directly process the input point cloud, and the second stratified sampling uses the stratified sampling strategy to process the point cloud after the window is moved. The specific method of the window movement is to divide the point cloud into large-size stereo windows, and move the window in units of the large-size stereo windows, change the relative positions between the windows, destroy the original structure of the point cloud and reorganize it to form a new point cloud for stratified sampling; The two sets of neighborhood point sets obtained are used as keys in the attention mechanism to help points in the point cloud query local information of different scales and maintain the ability of the point cloud feature extractor to handle long-distance dependencies.
4. According to the weakly supervised indoor point cloud semantic segmentation method based on clustering idea in claim 1, it is characterized in that: In the step 2, a number of clusters equal to the number of semantic categories in the point cloud scene, namely, semantic category clusters, is defined in the feature space. At the same time, an additional group of clusters, called intermediate layer clusters, is introduced to extract local features of the point cloud in the middle of the semantic category clusters. The centers of the intermediate layer clusters are updated in the clustering query block to learn the local features of the point cloud. The centers of the semantic category clusters are updated in the semantic category clustering query block to learn the global features of the point cloud. The calculations in the clustering query block and the semantic category clustering query block are completed by a query module and a grouping module.
5. According to the weakly supervised indoor point cloud semantic segmentation method based on clustering idea as described in claim 4, it is characterized in that: The query module in the cluster query block uses a masked attention mechanism to allow the middle layer cluster centers to learn local features of the point cloud; The query module in the semantic category clustering query block uses a masked attention mechanism to allow the semantic category clustering center to learn the local features extracted by the intermediate layer clustering center, and establish the indoor point cloud semantic segmentation model's ability to understand the global semantic features of the indoor space. The calculation formula of the query module is as follows: Q=Linear q (Q) K=Linear k (F) V=Linear v (F) EP bias =MLP(P F ) EP addend =MLP(P Q )-MLP(P F ) Among them, Q represents the characteristics of the subject of the query, P Q represents the coordinate information corresponding to Q; F represents the characteristics of the query key and value, P F Indicates the coordinate information corresponding to F, α indicates the mask, PE addend With PE bias Both represent positional encoding, Linear represents linear layer, MLP represents multi-layer perceptron, and × represents element-wise product.
6. According to the weakly supervised indoor point cloud semantic segmentation method based on clustering idea in claim 5, it is characterized in that: The grouping module clusters the points into clusters according to the similarity between the features of the points and the features of the cluster centers, and provides a mask for calculation for the next query module to ensure that the cluster centers can only access the points within their respective clusters. The grouping module of the cluster query block only calculates the mask required by the attention mechanism, so that the cluster centers can only learn the features of the points within the cluster; the grouping module of the semantic category cluster query block calculates the semantic category score of the semantic category cluster center, and maps the global features learned by the semantic category cluster center back to each point in the point cloud. The calculation formula of the grouping module is as follows: α=δ(β>t) Among them, β represents and F k The similarity between Q represents the semantic score corresponding to the center of the semantic category cluster, S P represents the point-wise semantic score, F k represents the point-by-point features of the point cloud, σ represents the sigmoid function, t is the preset threshold, δ represents the linear interpolation function, Represents the center of the semantic category cluster.
7. According to the weakly supervised indoor point cloud semantic segmentation method based on clustering idea in claim 1, it is characterized in that: In step 4, the cluster center constraint includes the cluster center binary cross entropy loss and the cluster center contrast loss, where: The cluster center binary cross entropy loss is supervised by the semantic category cluster center Q c The corresponding semantic score S Q , establish the connection between semantic category clusters and semantic categories, and convert S Q With the identity matrix defined Compare and apply binary cross entropy loss to constrain Q c To ensure that it carries accurate global semantic information, the unit matrix E has diagonal elements with values of 1 and all other elements are 0, and C is the number of semantic categories; The cluster center contrast loss constraint Q c Different tensors in, ensure that when i≠j, the tensor q i With q j There is a clear difference between them, which can be expressed as: Where τ is a constant.
8. The weakly supervised indoor point cloud semantic segmentation method based on clustering idea according to claim 1 is characterized in that: In step 4, the loss function of the indoor point cloud semantic segmentation model is expressed as: in, represents the cross entropy loss of the point-wise semantic scores, represents the cluster center binary cross entropy loss, represents the cluster center contrast loss, λ bce , cl Represents the weight of the corresponding loss.
9. A weakly supervised indoor point cloud semantic segmentation device based on clustering idea, comprising a memory, a processor, and a program stored in the memory, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
10. A storage medium having a program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Point cloud semantic segmentation method and system based on local neighborhood attention
CN119785032A
Small sample point cloud semantic segmentation method and system based on multi-view text supervision and guidance
CN120726330A
