Semantic segmentation model training method, semantic segmentation method, storage medium and terminal
The self-supervised learning method is used to learn features from unlabeled aerial laser point cloud data, which solves the problem of high label dependence in aerial laser point cloud semantic segmentation and achieves efficient semantic segmentation effects, especially in the case of a small number of labels. the classification accuracy.
Patent Information
- Application Number
- CN202210443785.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-04-26
AI Technical Summary
Existing technologies rely on a large number of semantic labels in aerial laser point cloud semantic segmentation, resulting in high human and economic costs, and it is difficult for traditional methods to effectively process large-scale aerial laser point cloud data under unsupervised conditions, especially due to sparse point density and scene The problem is that the scope is large and the category scale is not uniform.
The self-supervised learning method is used to learn the underlying features of the data from unlabeled aerial laser point cloud data. By cutting scene blocks, rotating and scaling, building a feature learning model, selecting positive and negative samples, and using the loss function to train the feature learning model, finally Its parameters are used as the initial values of the semantic segmentation model for fine-tuning to reduce dependence on labels.
It achieves efficient semantic segmentation of aerial laser point clouds with the participation of a small number of semantic labels in training, improving classification accuracy. Especially when there is a serious shortage of semantic labels, it can achieve a classification performance of more than 94%, reducing over-reliance on annotated data.
Smart Images

Figure CN114926469B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of point cloud semantic segmentation, and in particular relates to an aerial laser point cloud semantic segmentation model training method based on self-supervised learning (SSL), a semantic segmentation method, a storage medium and a terminal. Background Art
[0002] Semantic information is crucial for complex three-dimensional urban reconstruction, and efficient and reliable semantic information directly affects the city digital twin. Aerial laser point cloud provides a compact and efficient representation of three-dimensional scenes, reconstructing the real environment as a digital twin in information space, and has developed into a standard spatiotemporal geographic data source. Point cloud semantic segmentation is a key task for efficient understanding of the real environment in information space, and is also the primary problem for the three-dimensional structuring of real scenes.
[0003] In the early days, due to the limitations of software and hardware, the development of airborne laser point clouds was slow. For semantic segmentation tasks, most of the research scholars focused on the use of manual features to supervise machine learning methods. The traditional semantic segmentation method (see Weinmann M, Jutzi B, Hinz S, et al. Semantic point cloud interpretation based on optimal neighborhoods, relevant features and efficient classifiers [J]. ISPRS Journal of Photogrammetry and Remote Sensing, 2015, 105: 286-304.) can be summarized into four steps: neighborhood selection, feature extraction, feature selection, and supervised classification. The traditional manual feature method has greatly limited the development of point cloud semantic understanding because it relies too much on low-level features designed manually, has low accuracy and poor migration ability.
[0004] The development of deep learning in computer vision has redefined the development direction of point clouds. Then, networks such as PointNet (see Qi CR, Su H, Mo K, et al. Pointnet: Deep learning on point sets for 3d classification and segmentation: Proceedings of the IEEE conference on computer vision and pattern recognition, 2017[C]) and PointNet++ (see Qi CR, Yi L, Su H, et al. Pointnet++: Deep hierarchical feature learning on point sets in a metric space[J]. Advances in neural information processing systems, 2017, 30.) appeared, which can directly process irregular point clouds. In the practical application of aerial laser semantic segmentation, hardware limitations and deployment difficulties have put forward new requirements. Researchers pay more attention to lightweight and efficient network architectures, such as RandLA-Net (see Hu Q, Yang B, Xie L, et al. RandLA-Net: Efficient Semantic Segmentation of Large-Scale PointClouds: 2020 IEEE / CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020[C].) for fast semantic segmentation tasks of large scenes, and KPConv (see Thomas H, Qi CR, Deschaud J, et al. Kpconv: Flexible and deformable convolution for point clouds: Proceedings of the IEEE / CVF international conference on computer vision, 2019[C].) using the lightweight KP-FCNN framework for semantic segmentation tasks. These methods have achieved remarkable performance on public aerial laser point cloud datasets, but they all require a large amount of semantic labels as prior information. On the one hand, the labeling process requires manpower costs, and on the other hand, collecting large-scale point clouds requires huge economic costs or may not even be available.
[0005] When there is no supervision information, how to ensure the classification quality of the network for semantic segmentation of point clouds is a problem that must be solved in large-scale aerial laser point clouds. Drawing on the development achievements of 2D images, researchers first focus on weak supervision and self-supervision. In the past two years, weak supervision research on semantic segmentation tasks of point clouds has achieved good results, but we are concerned about how to use a large amount of unlabeled point cloud data to achieve information gain and avoid the problem of sample imbalance in large-scale aerial laser point clouds. Self-supervised learning can autonomously and flexibly learn massive amounts of unlabeled data to solve the above problems. At present, there are few point cloud semantic segmentation tasks based on self-supervised learning and they are concentrated on indoor point clouds and ground point cloud data. Compared with other types of point clouds, aerial laser point clouds use longer scanning distances and different sparsity of point density. On the other hand, the scene range is large, the category scales included are extremely inconsistent, and the data geometric instances obtained by scanning from a bird's-eye view are often more, which is not applicable in terms of methods. Based on the above problems and urgent needs, it is very necessary to explore self-supervised learning semantic segmentation technology for aerial laser point clouds. Summary of the invention
[0006] The purpose of the present invention is to provide an aerial laser point cloud semantic segmentation model training method, a semantic segmentation method, a storage medium and a terminal, so as to learn the underlying features of the data from a large amount of unlabeled aerial laser point cloud data, so as to achieve the participation of only a small amount of aerial laser point cloud semantic labels in the training and complete the efficient aerial laser point cloud semantic segmentation task.
[0007] The present invention solves the above technical problems through the following technical solutions: a method for training an aerial laser point cloud semantic segmentation model, comprising the following steps:
[0008] The obtained unlabeled aerial laser point cloud data is used as a first training sample set, and the obtained labeled aerial laser point cloud data is used as a second training sample set;
[0009] Cut out a plurality of pairs of scene blocks from the first training sample set, and for each pair of the scene blocks, any point in one of the scene blocks has a corresponding point matching it in the other scene block, the two matching points are matching points, and the two non-matching points are non-matching points;
[0010] Rotating and scaling each pair of the scene blocks respectively to obtain transformed scene blocks;
[0011] Constructing a feature learning model, and inputting the transformed scene blocks into the feature learning model respectively to obtain corresponding embedded features;
[0012] Selecting positive and negative samples from the first training sample set according to the matching points and non-matching points in the scene block and the embedded features to obtain positive embedded features and negative embedded features; wherein the positive pairs refer to the selected representative matching points, and the negative pairs refer to the selected representative non-matching points;
[0013] Constructing a loss function, and training the feature learning model according to the loss function and the positive pair embedding features and the negative pair embedding features to obtain a trained feature learning model;
[0014] A semantic segmentation model with the same backbone framework as the feature learning model is constructed, the parameters of the trained feature learning model are used as the initial values of the parameters of the semantic segmentation model, and the semantic segmentation model is trained and fine-tuned using the second training sample set to obtain a final semantic segmentation model.
[0015] Furthermore, the specific implementation process of selecting positive and negative samples for the first training sample set is:
[0016] Calculating the geometric features of each point cloud in the scene block;
[0017] Based on the geometric features of the point cloud, all non-matching points in each pair of the scene blocks are clustered to obtain a clustering result of the non-matching points;
[0018] The clustering results of non-matching points are used to screen the most difficult negative samples to complete the selection of positive and negative samples, where the most difficult negative sample refers to the point closest to the positive sample in the extracted feature space.
[0019] Further, the geometric features of each point cloud include flatness, surface variation and normal vector;
[0020] The calculation formula of the flatness is:
[0021] P=(λ2-λ3) / λ1
[0022] The calculation formula of the surface change is:
[0023] S V =λ3 / (λ1+λ2+λ3)
[0024] Among them, P is flatness, S V is the surface variation, λ1, λ2, λ3 are all covariance tensors Σ i , and λ1≥λ2≥λ3≥0, p m For any point cloud p i The set of m nearest neighboring points of is the center point cloud,
[0025] The normal vector is:
[0026]
[0027]
[0028] in, is the point cloud p i The normal vector, n x ,n y ,n z are the three-dimensional coordinates of the normal vector, x i ,y i ,z i is the point cloud p i The three-dimensional coordinates of , A, B, C, and D are all fitting coefficients.
[0029] Furthermore, the specific implementation process of clustering all non-matching points in each pair of the scene blocks is as follows:
[0030] Step a: Randomly select K point clouds in the scene block as the initial class center in is the tth iteration class G l Center, the initial value of t is 0;
[0031] Step b: Calculate the distance from each point cloud to the cluster center, and assign each point cloud to the cluster with the closest cluster center according to the distance to form the clustering result C t ;
[0032] Step c: For each clustering result C t Calculate its new class center;
[0033] Step d: Determine whether the convergence condition is met. If so, output C * =C t ; Otherwise, let t=t+1 and return to step b.
[0034] Furthermore, the specific implementation process of using the clustering results of non-matching points to screen the most difficult negative samples is as follows:
[0035] If the clustering results of the most difficult negative samples are the same, the sample will not be taken out as a negative sample until the negative sample pairs do not belong to the same clustering results.
[0036] Furthermore, the specific expression of the loss function is:
[0037]
[0038] in, is the loss value, d(·) represents the distance between two embedded features, h is the dimension of the input feature, and is the embedded feature of the matching points in each pair of scene blocks, v k is the feature of the most difficult negative sample, t p is the distance to the opposite boundary, t n is the boundary distance of the negative pair, Ω is the set of positive pairs in each pair of scene blocks, [x] + represents the function max(0,x), Represents the distance of the embedding features of the most difficult negative samples that satisfy different conditions of clustering results, g(·) is the clustering result, are the point clouds in each pair of scene blocks respectively.
[0039] Furthermore, the backbone frameworks of the feature learning model and the semantic segmentation model are both KP-FCNN frameworks.
[0040] The present invention also provides an aerial laser point cloud semantic segmentation method, comprising the following steps:
[0041] Acquire aerial laser point cloud data;
[0042] Based on the semantic segmentation model trained by the above-mentioned aerial laser point cloud semantic segmentation model training method, semantic segmentation processing is performed on the aerial laser point cloud data.
[0043] The present invention also provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transient storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the aerial laser point cloud semantic segmentation model training method or the steps of the aerial laser point cloud semantic segmentation method are executed.
[0044] The present invention also provides a terminal, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor runs the computer program, the steps of the above-mentioned aerial laser point cloud semantic segmentation model training method or the above-mentioned aerial laser point cloud semantic segmentation method are executed.
[0045] Beneficial Effects
[0046] Compared with the prior art, the advantages of the present invention are:
[0047] The present invention provides an aerial laser point cloud semantic segmentation model training method, a semantic segmentation method, a storage medium and a terminal. The model training method includes an upstream auxiliary task and a downstream semantic segmentation task. The auxiliary task and the semantic segmentation task both use the same backbone framework KP-FCNN. The KP-FCNN framework has a fast training speed and is highly adaptable to aerial laser point clouds with imbalanced categories. In the auxiliary task, large-scale unlabeled aerial laser point cloud data is used, and matching point pairs are constructed using data enhancement technology. In the positive and negative sample selection stage, a clustering algorithm is used to remove negative samples with similar features based on the most difficult negative samples mined, so that the feature learning model can learn purer negative samples, and the model considers feature similarity based on learning spatial invariance information in the auxiliary task. In the semantic segmentation task, the weight parameters learned in the auxiliary task are used to initialize the semantic segmentation model parameters, so as to achieve information gain of the semantic segmentation task and surpass the baseline supervision network. In particular, when the semantic labels are seriously insufficient (10% of the training set), the classification accuracy is greatly improved, which can reach more than 94% of the performance of all training data. The self-supervised learning network of the present invention reduces the model's excessive reliance on labeled data, effectively improves the performance of semantic segmentation of small-sample aerial laser point clouds, and has great application value for small-sample training and learning in actual engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only one embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 is a flow chart of a semantic segmentation model training method according to an embodiment of the present invention;
[0050] Figure 2 It is the ISPRS training set in the semantic segmentation task in the embodiment of the present invention, wherein Section A is the entire training set and Section B is the training set of its four proportions.
[0051] Figure 3 is a flowchart of auxiliary tasks in an embodiment of the present invention;
[0052] Figure 4 is a diagram of the point cloud positive and negative sample selection process in an embodiment of the present invention;
[0053] Figure 5 1 is a graph showing the test results of five training sets in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following is a clear and complete description of the technical solutions in the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0056] like Figure 1 As shown, an aerial laser point cloud semantic segmentation model training method provided by an embodiment of the present invention is mainly composed of an upstream auxiliary task and a downstream semantic segmentation task. The auxiliary task is unsupervised comparative learning, which realizes the learning of the underlying structure information of the data through a large amount of unlabeled aerial laser point cloud data. The semantic segmentation task is supervised learning. The upstream auxiliary task provides initialization of model weight parameters for the downstream semantic segmentation task, and the information learned by the auxiliary task is passed to the semantic segmentation task through the model weight parameters. Then, a small amount of labeled aerial laser point cloud data is used to train and fine-tune the model to reduce the model's excessive dependence on labels.
[0057] The model training method specifically includes the following steps:
[0058] Step 1: Construction of training sample set: The acquired unlabeled aerial laser point cloud data is used as the first training sample set, and the acquired labeled aerial laser point cloud data is used as the second training sample set.
[0059] The first training sample set involved in the auxiliary task comes from the DALES dataset. The data in the first training sample set includes 40 dense urban areas with a size of 500m×500m, covering 10km 2 The total number of points in the dataset exceeds 500 million, of which 29 are training blocks and 11 are test blocks.
[0060] The second training sample set involved in the semantic segmentation task comes from the ISPRS dataset. The second training sample set covers a dense urban area of 399m×421m, with a total of 750,000 points. The second training sample set is labeled with Vaihingen 3D semantics provided by ISPRS, such as Figure 2 As shown in Figure 1, Section B is 10%, 20%, 40%, 60%, and 100% of the data volume cut out from the entire training set, and the five-ratio data sets are areas with large data volumes that contain areas with small data volumes.
[0061] Step 2: Cropping of scene blocks: Cropping multiple pairs of scene blocks from the first training sample set.
[0062] Assume the first training sample set X = {x 1 ,…,x i ,…,x N}, where N is the number of point clouds in the first training sample set, x i ∈R 3+d Represents a point cloud containing xyz three-dimensional coordinates and d-dimensional features. A large number of paired scene blocks can be cut out from the first training sample set X and Where n is the number of point clouds in the scene block, X1 and X2 represent the same scene, and each point in the scene block X1 There is a corresponding point in scene block X2 To match it, is a pair of matching points. and When matching, With other points in scene block X2 No match Matching points refer to the points at the same position in each pair of scene blocks, e.g. Non-matching points refer to points at different positions in each pair of scene blocks, e.g.
[0063] Step 3: Transformation of scene blocks: Rotate and scale each pair of scene blocks to obtain transformed scene blocks.
[0064] Before the scene blocks are imported into the feature learning model, each pair of scene blocks is rigidly transformed. The rigid transformation includes rotation (0 to 360°) and scaling (0.8 to 1.2). Then, there is a mapping relationship between the two transformed scene blocks.
[0065] Step 4: Construction of feature learning model: Construct a feature learning model and input the transformed scene blocks into the feature learning model respectively to obtain the corresponding embedded features.
[0066] In this embodiment, both the feature learning model and the semantic segmentation model use the same backbone framework KP-FCNN, which is implemented based on the PyTorch framework and uses an RTX 3090 GPU for training and testing. The backbone framework KP-FCNN has local storage of data to be processed at each layer. This preprocessing step is completed in the preprocessing stage. This strategy greatly improves the training efficiency. In terms of feature learning ability, KP-FCNN utilizes strongly deformed kernel convolution operations to make the context more perceptual and effectively aggregate information from adjacent categories. KP-FCNN includes an encoder and a decoder. The encoder contains two convolution blocks, namely kernel point convolution and strided kernel point convolution. The decoder uses the closest upsampling to ensure the addition of point-by-point features. The features transmitted from the encoder layer are connected to the upsampled features through skip links, and the connected features are processed by unary convolution, which is equivalent to the multi-layer perceptron shared in PointNet.
[0067] KP-FCNN is very flexible and allows any number of kernel points and kernel point layouts, which is critical for the convolution operator. The kernel points and kernel point layouts can be set based on the balance between computational cost and description ability. KP-FCNN uses kernel point convolution to calculate features and directly operates on point clouds. When a scene block X is input, s When it comes to KP-FCNN, in the five-layer encoder, regular grid sampling is used as the downsampling method, and in the four-layer decoder, the upsampling method uses nearest neighbor sampling. At the end of the forward propagation, a 64-dimensional embedding feature V is obtained. s Therefore, the transformed scene blocks are imported into the feature learning model respectively, and the output embedding feature v s =f(x s ), s = 1, 2, where f() is the embedding function, i.e., the result of the forward propagation of the feature learning model, v s For scene block X s The embedding function f() maps the scene block to the feature space through the KP-FCNN framework, and X1 is mapped to X2 is mapped to Matching point (positive) corresponding features must be similar to each other and not to matching point features Different. Contrastive learning is achieved by minimizing the loss function.
[0068] Step 5: Selection of positive and negative samples: According to the matching points in the scene blocks, the non-matching points after clustering, and the embedded features, the positive and negative samples of the first training sample set are selected to obtain the embedded features of the positive pair and the embedded features of the negative pair, such as Figure 3 As shown; the positive pair refers to the selected representative matching points, and the negative pair refers to the selected representative non-matching points.
[0069] Self-supervised learning uses auxiliary tasks to mine the underlying information of the data from large-scale unlabeled point cloud data through self-supervised signals, and transfers the learned knowledge to the semantic segmentation task through the feature learning model weights. Unlike fully supervised methods, self-supervised learning relies on unsupervised contrastive learning strategies as auxiliary tasks, uses unlabeled point cloud learning, reduces the dependence on semantic labels, uses pre-trained weights as the initial values of the downstream semantic segmentation network, and fine-tunes the weights for small sample labeled point clouds.
[0070] Contrastive learning is an unsupervised learning method with good representation learning capabilities. Its goal is to learn the mapping relationship f from the original features to the embedding space, so as to use the distance metric function in the feature space to bring the same objects (positive samples) closer and pull different objects (negative samples) apart. Specifically, for any anchor point x, the goal of contrastive learning is to learn the embedding function f so that the similarity measure of the positive sample pair is much larger than the similarity measure of the negative sample pair:
[0071] Q c (f(x),f(x + ))>>Q c (f(x),f(x - )) (1)
[0072] Among them, given an anchor point x, x + Represented as a positive sample of x, that is, x + is a point similar or identical to the anchor point x, - Represented as a negative sample of x, that is, x - For points different from the anchor point x, the distance metric function Q c Used to measure the similarity between features.
[0073] For each anchor point There is a corresponding matching point and a hardest negative example in is the point in scene block X2 The point with the most similar features, the most difficult negative sample refers to the point closest to the positive sample in the extracted feature space. The number of negative samples (i.e. non-matching points) is so large that it is impossible to process all negative samples. Contrastive learning considers processing the most difficult negative samples. The most difficult negative sample is the non-matching point closest to the anchor point x in the embedded feature learned by f(). In order to exclude the existence of similar semantics in the most difficult negative samples, the k-means clustering algorithm is used based on the geometric features to guide the filtering operation of the most difficult negative samples. The specific implementation process is as follows:
[0074] Step 5.1: Calculate the geometric features of each point cloud in the scene block.
[0075] In this embodiment, the geometric features of each point cloud include planarity, surface variation, and normal vector. Any point p in the scene block i The specific calculation of the geometric characteristics is as follows:
[0076] The calculation formula for flatness is:
[0077] P=(λ2-λ3) / λ1 (2)
[0078] The calculation formula for the surface change is:
[0079] S V =λ3 / (λ1+λ2+λ3) (3)
[0080] Among them, P is flatness, S V is the surface variation, λ1, λ2, λ3 are all covariance tensors Σ i , and λ1≥λ2≥λ3≥0, p m For any point cloud p i The set of m nearest neighboring points of is the center point cloud,
[0081] Normal vector of point cloud It is to fit a plane based on the points in the neighborhood, and the normal direction of the plane is the normal vector of the point. The neighborhood of the point is:
[0082]
[0083] The general form of the plane to be fitted is:
[0084] Ax+By+Cz+D=0 (4)
[0085] A 2 +B 2 +C 2 =1 (5)
[0086] The least squares method is used to fit the plane, that is, to solve the following minimum value problem:
[0087]
[0088] By taking the derivative and setting the derivative to 0 and eliminating D from the system of equations, we can obtain the following linear equations:
[0089]
[0090] where M is the covariance matrix, And so on.
[0091] This is a typical solution to the system of equations on the unit circle. In general, the covariance matrix is non-singular, so the above equation has no exact solution and can only find an approximate solution. Let W = [A, B, C] T satisfy:
[0092]
[0093] Using the Lagrange multiplier method, a new optimization function is constructed:
[0094] f(n,λ)=(MW) T MW+λ(1-W T W) (9)
[0095] It can be deduced that the solution of the above formula is the normalized eigenvector corresponding to the minimum eigenvalue of the covariance matrix M.
[0096] So we can get the normal vector of the point cloud:
[0097]
[0098] in, is the point cloud p i The normal vector, x i ,y i ,z i is the point cloud p i The three-dimensional coordinates of , A, B, C, and D are all fitting coefficients.
[0099] Surface changes can well distinguish between planar structures and non-planar structures. On the basis of the three-dimensional coordinates of the point cloud, adding geometric features is conducive to K-means clustering, making the clustering results more reasonable and accurate, and thus making the distinction between positive and negative pairs more accurate.
[0100] Step 5.2: Based on the geometric features of the point cloud, cluster all non-matching points in each pair of scene blocks to obtain the clustering results of non-matching points. The specific implementation process of clustering is:
[0101] Step 5.21: Randomly select K point clouds in the scene block as the initial class center in is the tth iteration class G l Center, the initial value of t is 0;
[0102] Step 5.22: Calculate the distance from each point cloud to the cluster center, and assign each point cloud to the cluster with the closest cluster center according to the distance to form the clustering result C t ;
[0103] Step 5.23: For each clustering result C t Calculate its new class center, that is, calculate the sample mean of each current class as the new class center;
[0104] Step 5.24: Determine whether the convergence condition is met. If so, output C * =C t ; Otherwise, let t=t+1 and return to step 5.22.
[0105] The convergence condition of this embodiment is to reach the number of iterations or to meet the stopping condition, and the parameter K of the K-means clustering algorithm is set to 9.
[0106] Step 5.3: Use the clustering results of non-matching points to screen the most difficult negative samples and complete the selection of positive and negative samples. The most difficult negative sample refers to the point closest to the positive sample in the extracted feature space. The specific implementation process is:
[0107] If the clustering results of the most difficult negative samples are the same, the sample will not be taken out as a negative sample until the negative sample pairs do not belong to the same clustering results.
[0108] For the most difficult negative sample mining, it is not necessary to use all points for mining. Only some points are considered in the loss function. In this embodiment, the number of positive pairs is set to 4096 and the number of negative samples is set to 2048. Figure 4 As shown in Figure 1, K-means clustering provides a cluster for the point cloud. In some cases, the most difficult negative pairs are removed from the same cluster and other absolute negative samples are reselected as sample points. For example, in the traditional most difficult negative mining algorithm, Figure 4 Points in (c) and are considered as negative pairs, however, these points belong to the same cluster, so points are selected from the most difficult candidate negative pairs in point cloud contrastive learning. and As a negative pair, Figure 4 (d) Because the two points are not in the same cluster, the accuracy of positive and negative sample selection is improved, so that positive and negative samples are highly distinguished; at the same time, the similarity of geometric features is considered to ensure that more meaningful information is used for comparative learning.
[0109] Step 6: Constructing the loss function and training the model: Construct the loss function, train the feature learning model according to the loss function and the positive and negative embedded features, and obtain the trained feature learning model.
[0110] Using the four types of points extracted Construct the loss function, the specific expression is:
[0111]
[0112] in, is the loss value, d(·) represents the distance between two embedded features, h is the dimension of the input feature. and is the embedded feature of the matching points in each pair of scene blocks, v k is the feature of the most difficult negative sample, t p is the distance from the opposite boundary (in this embodiment, t p is set to 0.2), t n is the boundary distance of the negative pair (in this embodiment t n Set to 2), Ω is the set of positive pairs in each pair of scene blocks, [x] + Represents the function max(0,x). Represents the distance of the embedding features of the most difficult negative samples that satisfy different conditions of clustering results, When the clustering results are different, c i,k =1, then find Otherwise, reselect negative samples. g(·) is the clustering result, Representing point clouds do not belong to the same cluster. are the point clouds in each pair of scene blocks respectively. In formula (11), the first part is to bring the positive sample pairs closer, and the following two parts are to distance the negative samples.
[0113] This embodiment uses a stochastic gradient descent optimization algorithm to optimize the model weight parameters, with a learning rate of 0.1 and a weight decay setting of 0.0001.
[0114] Step 7: Construction and training of semantic segmentation model: Construct a semantic segmentation model with the same backbone framework as the feature learning model, use the parameters of the trained feature learning model as the initial values of the semantic segmentation model parameters, and use the second training sample set to train and fine-tune the semantic segmentation model to obtain the final semantic segmentation model.
[0115] Since the auxiliary task has the same backbone framework as the semantic segmentation task, after pre-training the auxiliary task, the trained weight parameters are used as the initialization weights of the downstream semantic segmentation task. A small amount of labeled aerial laser point clouds (i.e., the second training sample set) is used to train the semantic segmentation model, and the hyperparameters are fine-tuned.
[0116] The semantic segmentation model is different from the feature learning model in that a unary convolution is added to the last layer to achieve 64-D to D in the downstream semantic segmentation task. out Transformation of dimensional features, D out is the number of categories.
[0117] The weight parameters of the feature learning model are used as the initial values of the weight parameters of the semantic segmentation model. The semantic segmentation model is trained using the five subsets divided by the second training sample set to obtain the semantic segmentation model under different training data. During the training process, 200 iterations are set as one epoch, the learning rate is set to 0.001 at the beginning, and the decay rate is 0.9 every 5 epochs. The model convergence is expected to take 50 epochs.
[0118] The ISPRS test set was selected for semantic segmentation model capability verification. For complete testing, the semantic segmentation model randomly selected spheres in the test area, and each point was repeatedly input into the model at least 20 times to obtain the average prediction probability. This repetition is to avoid misclassifying points near the sphere boundary (whose geometry may be incomplete).
[0119] The evaluation index uses overall accuracy (OA) and average F1 score to evaluate the performance of point cloud semantic segmentation. OA is calculated as the percentage of correctly classified scores to the total score, and the F1 score is the harmonic mean of the accuracy and recall rate of each category, and the formula is defined as follows:
[0120]
[0121] Among them, for each category, TP is the number of points belonging to this category that are correctly classified, TN is the number of points that do not belong to this category that are not classified into this category, FP is the number of points that do not belong to this category that are classified into this category, and FN is the number of points in this category that are misclassified.
[0122] The semantic segmentation model of the present invention is trained using five proportions of training subsets, and the performance is verified on the test set, such as Figure 5 As shown. With 10% of the training data, Table 1 shows the F1 score of each category, and the last two columns show the overall OA and average F1 score.
[0123] Table 1. Evaluation table of 10% ISPRS training data (%)
[0124]
[0125] The semantic segmentation model training method (i.e., self-supervised learning method) described in the invention has improved performance in five data ratios compared to the benchmark directly trained supervised learning algorithm, and still achieved good results in semantic segmentation when the data volume is small (10% data volume). The present invention reduces the excessive reliance of conventional directly trained supervised learning algorithms on supervised samples, and can obtain better semantic segmentation performance under small sample labeled aerial laser point cloud training data.
[0126] An embodiment of the present invention also provides an aerial laser point cloud semantic segmentation method, comprising the following steps:
[0127] Step 1: Obtain aerial laser point cloud data;
[0128] Step 2: Based on the semantic segmentation model trained by the aerial laser point cloud semantic segmentation model training method as described above, the aerial laser point cloud data of step 1 is semantically segmented to obtain an ideal aerial laser point cloud semantic segmentation result.
[0129] What is disclosed above is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or modifications within the technical scope disclosed in the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A method for training an aerial laser point cloud semantic segmentation model, characterized in that: The following steps are involved: The obtained unlabeled aerial laser point cloud data is used as a first training sample set, and the obtained labeled aerial laser point cloud data is used as a second training sample set; Cut out a plurality of pairs of scene blocks from the first training sample set, and for each pair of the scene blocks, any point in one of the scene blocks has a corresponding point matching it in the other scene block, the two matching points are matching points, and the two non-matching points are non-matching points; Rotating and scaling each pair of the scene blocks respectively to obtain transformed scene blocks; Constructing a feature learning model, and inputting the transformed scene blocks into the feature learning model respectively to obtain corresponding embedded features; Selecting positive and negative samples from the first training sample set according to the matching points and non-matching points in the scene block and the embedded features to obtain positive embedded features and negative embedded features; The positive pairs refer to the selected representative matching points, and the negative pairs refer to the selected representative non-matching points. Constructing a loss function, and training the feature learning model according to the loss function and the positive pair embedding features and the negative pair embedding features to obtain a trained feature learning model; Constructing a semantic segmentation model with the same backbone framework as the feature learning model, using the parameters of the trained feature learning model as the initial values of the parameters of the semantic segmentation model, and using the second training sample set to train and fine-tune the semantic segmentation model to obtain a final semantic segmentation model; The specific implementation process of selecting positive and negative samples for the first training sample set is: Calculating the geometric features of each point cloud in the scene block; Based on the geometric features of the point cloud, all non-matching points in each pair of the scene blocks are clustered to obtain a clustering result of the non-matching points; The clustering results of non-matching points are used to screen the most difficult negative samples and complete the selection of positive and negative samples. The most difficult negative sample refers to the point closest to the positive sample in the extracted feature space. The geometric features of each point cloud include flatness, surface variation and normal vector; The calculation formula of the flatness is: P=(λ2-λ3) / λ1 The calculation formula of the surface change is: S V =λ3 / (λ1+λ2+λ3) Among them, P is flatness, S V is the surface variation, λ1, λ2, λ3 are all covariance tensors Σ i , and λ1≥λ2≥λ3≥0, p m For any point cloud p i The set of m nearest neighboring points of is the center point cloud, The normal vector is: in, is the point cloud p i The normal vector, n x ,n y ,n z are the three-dimensional coordinates of the normal vector, x i ,y i ,z i is the point cloud p i The three-dimensional coordinates of , A, B, C, and D are all fitting coefficients; The specific implementation process of clustering all non-matching points in each pair of scene blocks is as follows: Step a: Randomly select K point clouds in the scene block as the initial class center in is the tth iteration class G l Center, the initial value of t is 0; Step b: Calculate the distance from each point cloud to the cluster center, and assign each point cloud to the cluster with the closest cluster center according to the distance to form the clustering result C t ; Step c: For each clustering result C t Calculate its new class center; Step d: Determine whether the convergence condition is met. If so, output C * =C t ; Otherwise, let t=t+1 and return to step b.
2. The method for training an aerial laser point cloud semantic segmentation model according to claim 1, wherein: The specific implementation process of using the clustering results of non-matching points to screen the most difficult negative samples is: If the clustering results of the most difficult negative samples are the same, the sample will not be taken out as a negative sample until the negative sample pairs do not belong to the same clustering results.
3. The method for training an aerial laser point cloud semantic segmentation model according to claim 1 or 2, characterized in that: The specific expression of the loss function is: in, is the loss value, d(·) represents the distance between two embedded features, h is the dimension of the input feature, and is the embedded feature of the matching points in each pair of scene blocks, v k is the feature of the most difficult negative sample, t p is the distance to the opposite boundary, t n is the boundary distance of the negative pair, Ω is the set of positive pairs in each pair of scene blocks, [x] + represents the function max(0,x), Represents the distance of the embedding features of the most difficult negative samples that satisfy different conditions of clustering results, g(·) is the clustering result, are the point clouds in each pair of scene blocks respectively.
4. The method for training an aerial laser point cloud semantic segmentation model according to claim 1 or 2, characterized in that: The backbone frameworks of the feature learning model and the semantic segmentation model are both KP-FCNN frameworks.
5. A method for semantic segmentation of aerial laser point clouds, characterized in that: The following steps are involved: Acquire aerial laser point cloud data; Based on the semantic segmentation model trained by the aerial laser point cloud semantic segmentation model training method according to any one of claims 1 to 4, semantic segmentation processing is performed on the aerial laser point cloud data.
6. A computer-readable storage medium, wherein the computer-readable storage medium is a non-volatile storage medium or a non-transient storage medium, and a computer program is stored thereon, wherein: When the computer program is executed by a processor, the steps of the aerial laser point cloud semantic segmentation model training method described in any one of claims 1 to 4, or the steps of the aerial laser point cloud semantic segmentation method described in claim 5 are executed.
7. A terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor runs the computer program, the processor executes the steps of the aerial laser point cloud semantic segmentation model training method described in any one of claims 1 to 4, or the steps of the aerial laser point cloud semantic segmentation method described in claim 5.
