Power transmission line tree segmentation method and system based on supervised learning
By introducing supervised learning and graph neural networks into single tree segmentation technology, combined with the geometric relationship of point cloud data, the existing technology's problems of insufficient single tree segmentation accuracy and poor processing of complex terrain are solved, and a higher level of accuracy is achieved. Segmentation accuracy and better adaptability.
Patent Information
- Application Number
- CN202411426418.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The prior art has problems such as insufficient accuracy in single wood segmentation, poor treatment effect on complex terrain and dense forest areas, large parameter dependence, insufficient adaptability and high computational complexity.
Using a method based on supervised learning, we construct an adjacency graph of point cloud data, introduce geometric relationships, and combine it with a graph neural network model to use single tree instance labels for supervised training to capture local and global features and improve the single tree segmentation effect.
It significantly improves the accuracy of single tree segmentation, can effectively distinguish the point cloud characteristics of different trees in complex terrain and dense forest areas, reduces dependence on parameter selection, and reduces computational complexity.
Smart Images

Figure CN119339081A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image segmentation, and in particular relates to a method and system for segmenting trees on a power transmission line based on supervised learning. Background Art
[0002] At present, the technology used for single tree segmentation on power transmission lines mainly relies on the processing and analysis of airborne LiDAR point cloud data. The point cloud single tree segmentation method based on airborne LiDAR data usually includes the following steps: first, the point cloud data is preprocessed, including removing ground points and noise points, and then the tree point cloud is segmented using different algorithms. Typical methods include segmentation methods based on canopy height model (CHM), clustering methods based on point cloud density, and graph cut algorithms.
[0003] For example, the canopy height model (CHM)-based method generates CHM images from LiDAR data, and then uses image processing technology to perform regional segmentation of the tree crown and extract individual tree information. This method relies on the generation accuracy of CHM, and has limited processing effects on dense forest areas and complex terrain. Clustering algorithms such as K-means and DBSCAN use the spatial distribution characteristics of point cloud data to segment point cloud data into different individual trees, and then extract individual tree information based on the geometric characteristics of the individual trees. However, the effectiveness of clustering algorithms is limited by parameter selection, and their adaptability to point cloud data of different densities and shapes is insufficient. The graph cut algorithm constructs an adjacency graph of point cloud data and uses the cut algorithm in graph theory to perform segmentation. It can better process the global information of point cloud data, but the computational complexity is relatively high.
[0004] Although the above-mentioned existing technologies have achieved certain results in single tree segmentation, there are still some significant shortcomings and deficiencies. First, the CHM-based method may cause the loss of details of the point cloud data due to the need for data rasterization and interpolation processing in the process of generating CHM, especially in dense forest areas and the extraction accuracy of the lower structure in the canopy is low. In addition, this method is sensitive to terrain changes and is not ideal when dealing with complex terrain. Secondly, clustering methods based on point cloud density, such as K-means and DBSCAN, are highly dependent on parameters and are difficult to automatically adapt to point cloud data of different densities and shapes. They are easily affected by noise and uneven density of point cloud data, resulting in poor segmentation results. The K-means algorithm requires the number of single trees to be set in advance and lacks adaptability; although the DBSCAN algorithm can automatically determine the number of single trees, it is very sensitive to the choice of distance thresholds, and different thresholds will significantly affect the segmentation results. In addition, these clustering algorithms have high computational complexity and low processing efficiency when processing large-scale point cloud data.
[0005] In summary, the existing technology has the following shortcomings in single tree segmentation: the effect is not ideal when dealing with complex terrain and dense forest areas, it is highly dependent on parameter selection, the adaptive ability is insufficient, the calculation complexity is high, and the processing efficiency is low. Therefore, this field still needs to explore technologies with higher single tree segmentation accuracy, which can also ensure the segmentation effect in complex terrain and dense forest areas. Summary of the invention
[0006] The purpose of the present invention is to solve the technical problems that the accuracy of single tree segmentation in the prior art needs to be improved and it is difficult to ensure the segmentation effect in complex terrain and dense forest areas, and further provide a method and system for tree segmentation of power transmission lines based on supervised learning. Among them, the technical solution of the present invention introduces the geometric relationship of point cloud data by constructing an adjacency graph of point cloud data, and at the same time introduces a network model that can extract global features and local features at the same time, and combines the supervised learning deep model with supervised training to capture local and global features at the same time through the adjacency graph, thereby improving the single tree segmentation effect. In addition, the present invention uses the set single tree instance label information to perform supervised learning training on the model, and can learn and distinguish the point cloud features of different trees even in complex terrain and dense forest areas, significantly improving the accuracy of segmentation.
[0007] To this end, on one hand, the present invention provides the following technical solutions:
[0008] A method for segmenting trees on a power transmission line based on supervised learning comprises the following steps:
[0009] Step 1: Obtain point cloud data collected along the transmission line channel;
[0010] Step 2: construct an adjacency graph using the point cloud data, where the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points;
[0011] Step 3: Input the adjacency graph into the constructed supervised learning deep model to obtain feature space parameters, map the feature space parameters to the single tree instance label space to obtain the single tree instance label probability distribution, and then use the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution as the single tree segmentation prediction result of the corresponding point;
[0012] The single tree instance label is a number or a code, which is used to identify whether it is a single tree or an identifier representing a single tree individual; the supervised learning deep model simultaneously extracts global features and local features from the adjacency graph, and then generates the feature space parameters;
[0013] Among them, by collecting point cloud data samples and the actual values of the single tree instance labels corresponding to the points, processing is performed according to steps 2 and 3, and then supervised learning model training is performed based on the predicted values of the single tree instance labels and the actual values of the single tree instance labels.
[0014] Further optionally, the supervised learning deep model is a graph neural network. If a graph convolutional network in the graph neural network is selected, the graph convolutional network includes a multi-layer graph convolutional layer and a fully connected layer, wherein the calculation formula of the multi-layer graph convolutional layer is expressed as:
[0015] H (l+1) =σ(AH (l) W (l) )l≥0
[0016] Among them, H (l+1) , H (l) The distribution represents the node feature matrix of the l+1th layer and the lth layer, W (l) is the weight matrix of the lth layer, σ l represents the activation function of the lth layer; when the graph convolution is the initial layer, H (0) =X, X is the node feature matrix, the size is N×F, N is the number of nodes, that is, the number of points in the point cloud, F is the feature dimension, corresponding to the coordinates of the points in the point cloud; A is the adjacency matrix determined based on the adjacency graph, and the adjacency matrices of the same point cloud corresponding to different layers of the graph convolution layer are the same or different;
[0017] The calculation formula of the fully connected layer of the graph convolutional network is expressed as:
[0018] E=σ(ZW fc +b fc )
[0019] Among them, E represents the feature space parameter of the fully connected layer output, Z is the output of the last graph convolution layer or the output of the previous fully connected layer, and W fc 、b fc Respectively represent the weight matrix and bias vector of the fully connected layer. If there are two or more fully connected layers, the weight matrix and bias vector of each fully connected layer are independent of each other. fc is the activation function of the fully connected layer.
[0020] Further optionally, the single tree instance label represents a single tree individual identifier. When the model is trained based on the predicted value of the single tree instance label and the actual value of the single tree instance label, the training is performed using a constructed loss function, and the loss function at least includes a contrast loss function and / or a Rand coefficient loss function.
[0021] Further optionally, the contrast loss function is expressed as:
[0022]
[0023] in, is the contrast loss function, e i and e jRespectively represent the i-th and j-th rows of the feature space parameters E extracted by the fully connected layer, representing the feature vectors of points i and j, represents the set of point pairs of the same single tree instance, Represents a set of point pairs of different single tree instances. m is the boundary value and a hyperparameter used to control the distance threshold between different instances.
[0024] Further optionally, the Rand coefficient loss function is expressed as:
[0025]
[0026] in, is the Rand coefficient loss function, where pred = {pred 1 ,pred 2 ,...pred n}, represents the predicted value of the single tree instance label of all points, pred i is the predicted value of the single instance label of the i-th point, label = {label 1 ,label 2 ,...label n} is the true value of the single instance label of all points, label i is the true value of the single tree instance label of the i-th point, and the calculation formula of the ARI loss function is:
[0027]
[0028] Wherein, a represents the number of point pairs whose predicted and true labels are in the same tree, b represents the number of point pairs whose predicted and true labels are not in the same tree, c represents the number of point pairs whose predicted labels are in the same tree but whose true labels are not in the same tree, d represents the number of point pairs whose predicted labels are not in the same tree but whose true labels are in the same tree, and the predicted label and the true label correspond to the predicted tree instance label and the true tree instance label respectively;
[0029] It represents the number of combinations of selecting two points from n points.
[0030] Further optionally, in step 2, constructing an adjacency graph using the point cloud data is to construct an adjacency graph using a kNN algorithm, a distance threshold method, a density-based method, or based on Delaunay triangulation.
[0031] Further optionally, after acquiring the point cloud data, the method further includes preprocessing the point cloud data, wherein the preprocessing at least includes normalization processing.
[0032] In another aspect, the present invention provides a segmentation system based on the above method, comprising at least:
[0033] A point cloud data acquisition module, used to acquire point cloud data collected along the transmission line channel;
[0034] An adjacency graph construction module, used to construct an adjacency graph using the point cloud data, wherein the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points;
[0035] A feature extraction and segmentation module is used to input the adjacency graph into the constructed supervised learning deep model to obtain feature space parameters, map the feature space parameters to the single tree instance label space to obtain the single tree instance label probability distribution, and then use the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution as the single tree segmentation prediction result of the corresponding point;
[0036] The single tree instance label is a number or a code used to identify whether it is a single tree or an individual identifier of a single tree; the supervised learning deep model simultaneously extracts global features and local features from the adjacency graph, and then generates the feature space parameters.
[0037] In a third aspect, the present invention provides an electronic terminal, comprising at least:
[0038] one or more processors;
[0039] a memory storing one or more computer programs;
[0040] The processor calls the computer program to implement:
[0041] A method and system for segmenting trees on power transmission lines based on supervised learning.
[0042] In a fourth aspect, the present invention provides a computer-readable storage medium, characterized in that: a computer program is stored, and the computer program is called by a processor to implement:
[0043] A method and system for segmenting trees on power transmission lines based on supervised learning.
[0044] Beneficial Effects
[0045] Compared with the existing method, the advantages of the present invention are:
[0046] Different from the existing unsupervised clustering algorithms that do not use label information for supervised learning, resulting in unsatisfactory results and low segmentation accuracy when dealing with complex terrain and dense forest areas, the technical solution of the present invention further sets single tree instance labels, and realizes single tree segmentation by combining a network that can simultaneously extract global features and local features for supervised learning, so that the model can learn and distinguish the point cloud features of different trees even in complex terrain and dense forest areas, significantly improving the segmentation accuracy. In particular, the technical solution of the present invention uses the adjacency graph to strengthen the local features of the tree point cloud, processes the adjacency graph through a neural network, fully utilizes the geometric relationship of the point cloud data, captures the local and global features of the point cloud data, and enhances the model's adaptability to complex scenes.
[0047] In addition, considering that existing methods face great challenges in instance numbering consistency. If the commonly used supervised learning semantic segmentation method is directly applied to the task of segmenting individual trees on power transmission lines, it cannot effectively handle the numbering problem between different tree instances, resulting in the instability of the segmentation results. In the preferred embodiment of the present invention, the instance numbering problem is solved by designing contrast loss and adjusting the Rand index (ARI) loss. The contrast loss constrains the point pair distance within the same instance to be minimized and the point pair distance between different instances to be maximized. The ARI loss eliminates the influence of the instance numbering order on the evaluation results by measuring the consistency between the segmentation results and the true labels, and the model can automatically adapt to point cloud data of different densities and shapes, reducing dependence on parameter selection. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flow chart of a segmentation method provided by an embodiment of the present invention;
[0049] Figure 2 It is a schematic diagram of point cloud subset division;
[0050] Figure 3 It is a visualization diagram of the point cloud adjacency graph;
[0051] Figure 4 It is a schematic diagram of the graph neural network structure provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] Existing single-tree segmentation methods for power transmission lines are not ideal when dealing with complex terrain and dense forest areas. In particular, methods based on the canopy height model (CHM) and clustering algorithms are prone to losing the details of point cloud data in complex terrain and dense forest areas, and are unable to accurately extract point cloud data of the lower structure of the canopy, resulting in reduced segmentation accuracy. In addition, existing single-tree segmentation methods rely heavily on parameter selection and lack adaptive capabilities. They require manual adjustment of parameters to adapt to point cloud data of different densities and shapes, making the operation complex and inflexible. Existing technologies can usually only capture local or global features of point cloud data, and it is difficult to take both into account at the same time, resulting in unsatisfactory segmentation results. For example, the canopy height model (CHM) focuses on local canopy structure, and the graph cut algorithm focuses on global information, but it is difficult to take both into account.
[0053] In order to improve the segmentation accuracy, the technical solution of the present invention provides a power transmission line tree segmentation method based on supervised learning to achieve single tree segmentation according to the following technical ideas:
[0054] Step 1: Obtain point cloud data collected along the transmission line channel;
[0055] Step 2: Use point cloud data to construct an adjacency graph, where the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points;
[0056] Step 3: Input the adjacency graph into the constructed graph neural network model to obtain feature space parameters, map the feature space parameters to the single tree instance label space to obtain the single tree instance label probability distribution, and then use the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution as the single tree segmentation prediction result of the corresponding point;
[0057] Among them, by collecting point cloud data samples and the actual value of the single tree instance label corresponding to the point, processing is carried out according to steps 2 and 3, and then supervised learning model training is performed based on the predicted value of the single tree instance label and the actual value of the single tree instance label. The single tree instance label is a number or a code used to identify whether it is a single tree or an individual identifier.
[0058] It should be understood that the "single tree" referred to in the present invention refers to a single tree detected in the transmission line channel. Each point in the point cloud data represents a part of a tree, and multiple points combined represent the entire tree. In the single tree segmentation task, the goal is to divide each point into different tree (single tree) instances through the model.
[0059] In some embodiments, a single tree instance label is used to identify whether the point is on a single tree, that is, the classification task is used to identify whether it is a single tree; in some embodiments, a single tree instance label is a unique identifier assigned to each tree to distinguish different trees. For example, suppose there are three trees in the point cloud data along the transmission line, and the point cloud data of each tree is composed of multiple points. The model needs to assign a label to each point to indicate which tree the point belongs to. Individual labels can be numbers or codes, for example: the point cloud data of tree A is assigned label "1", the point cloud data of tree B is assigned label "2", and the point cloud data of tree C is assigned label "3".
[0060] Among them, the above technical process constructs an adjacency graph of point cloud data, introduces the geometric features of point clouds, and integrates them into the graph neural network, and then combines the single tree instance labels to achieve the combination of supervised learning and graph neural network for single tree segmentation, effectively improving the accuracy of single tree segmentation. In addition, based on the above technical ideas, in some embodiments, there is a problem of inconsistent single tree instance numbering, that is, in the semantic segmentation task of supervised learning, the label numbers of different instances are inconsistent, which affects the training and evaluation of the model. For example, in the task of tree segmentation on power transmission lines, each tree will be assigned a single tree instance number (label). However, in actual applications, the numbering of the same tree may not be consistent in different data sets, different training batches or different model predictions. For example, in one training, tree A is numbered 1, while in another training or in another part of the data set, tree A may be numbered 2. If the existing deep learning semantic segmentation method is used directly, the following problems will arise:
[0061] 1. Inconsistency in training and prediction: The model may give different instance numbers to the same tree in different datasets or different training batches, making it difficult for the model to stably learn the characteristics of different trees.
[0062] 2. Inconsistency in evaluation: When evaluating model segmentation performance, simply comparing numbers can cause confusion because numbers output by different models do not necessarily correspond to the same tree.
[0063] To this end, the present invention further solves the problem of inconsistent instance numbers through an optimized loss function. The designed contrast loss and Rand loss are equivalent to comparing the consistency of labels, and do not depend on the specific value of the instance number, optimizing the segmentation effect of the model, and ensuring the accuracy and consistency of the results; and preferably using a graph convolutional network (GCN), through the multi-layer convolutional layer and the fully connected layer, to achieve the extraction of local features and global features. The present invention will be further described below in conjunction with the embodiments.
[0064] Embodiment 1:
[0065] This embodiment provides a method for segmenting trees on a power transmission line based on supervised learning, comprising the following steps:
[0066] Step 1: Obtain the point cloud data collected along the transmission line channel and perform data preprocessing.
[0067] Step 1.1: Read point cloud data files. This embodiment reads pre-stored original point cloud data files from a storage device, each file containing three-dimensional coordinates (X, Y, Z) of multiple points and corresponding single tree instance labels.
[0068] As shown in Table 1 below:
[0069] Table 1: The first 10 columns of data of a line point cloud
[0070]
[0071]
[0072] Step 1.2: Normalization. Normalize the three-dimensional coordinates (X, Y, Z) of the point cloud data so that the value of each dimension is between 0 and 1. The normalization formula is as follows:
[0073]
[0074] Among them, P represents the original point cloud, which consists of coordinates (X, Y, Z), and max(P) and min(P) represent the maximum and minimum values of the point cloud data. Normalization processing helps to eliminate the scale differences between different point cloud data and improve the stability of network training. As shown in Table 2 below:
[0075] Table 2 The first 10 columns of data after normalization of a line point cloud
[0076]
[0077] Step 2: Construct the adjacency graph.
[0078] Step 2.1: Point cloud data division. Since the point cloud data is collected along the transmission line channel, the size of each point cloud data segment is relatively large. Therefore, in this embodiment, the point cloud of different segments is preferably divided into several subsets according to certain rules, and then different numbers of subsets are selected as training sets and test sets according to a ratio of 7:3. Figure 2 As shown, this embodiment fits the center line of the point cloud in the X and Y directions, and makes a number of vertical lines on the center line, and uses the vertical lines to divide the point cloud file into a number of subsets.
[0079] In other feasible embodiments, whether to segment and the ratio of the training set and the test set are adaptively set / adjusted according to the amount of point cloud data and experimental results.
[0080] Step 2.2: Adjacency graph construction. The adjacency graph is used to represent the connection relationship between points in the point cloud data. In the adjacency graph, each point is a node, and the edge between nodes represents the adjacency relationship between two points. The main purpose of constructing the adjacency graph is to introduce geometric information into the point cloud data to help the graph neural network extract effective features.
[0081] In this embodiment, the kNN algorithm is selected to construct the adjacency graph. In other feasible embodiments, algorithms for converting point cloud data into an adjacency graph are all feasible and fall within the protection scope of the present invention, such as a distance threshold method, a density-based method, and a Delaunay triangulation-based method.
[0082] The following is an example of the k-nearestneighbors (kNN) algorithm:
[0083] For each point, calculate its Euclidean distance to the other points, and then select the k points closest to it as the adjacent points of the point, and then construct the adjacency matrix A. The element A in the adjacency matrix is ij The value of indicates whether there is an edge between point i and point j. If A ij is 1, indicating that there is an edge between point i and point j; if A ij If it is 0, there is no edge, and the element A of the adjacency matrix ij It is expressed as:
[0084]
[0085] Among them, kNN(i) represents the set of nearest neighboring points of point i, which can be expressed as:
[0086] kNN(i)={j|j∈argsort({d(i,j)})[1:k+1]}
[0087] argsort({d(i,j)}) represents the index set of points sorted from smallest to largest in terms of distance, and [1:k+1] represents the index of the first k+1 points. In this embodiment, k=10 is set, and an adjacency graph is constructed for the point cloud subsets. Taking the first subset in the training set as an example, points with adjacency relationships are connected together, and the constructed adjacency graph is visualized as follows: Figure 3 As shown, in other feasible embodiments, the value of k is adaptively adjusted according to the accuracy requirement.
[0088] Step 3: Build a supervised learning deep model.
[0089] Step 3.1: Graph convolution layer feature extraction. After obtaining the adjacency graph (adjacency matrix) of the point cloud data in step 2, the local and global features of the point cloud data are extracted through several layers of graph convolution layers. The calculation formula of the graph convolution layer is as follows:
[0090] H (l+1)=σ l (AH (l) W (l) )l≥0
[0091] Among them, H (l) is the node feature matrix of the lth layer, W (l) is the weight matrix of this layer, learned by the network, σ l In particular, when the graph convolution is the initial layer, H (0) =X, X is a node feature matrix with a size of N×F, N is the number of nodes, and F is the feature dimension. norm , represents the normalized point cloud data, the number of nodes N is equal to the number of points in the point cloud, and F = 3 represents the dimension of the point coordinates (x, y, z).
[0092] In the above formula, the adjacency matrix A is fixedly obtained in step 2. In this embodiment, the adjacency matrix A used in different graph convolution layers for the same point cloud subset is the same. In the prior art, multi-scale graph convolution can use different adjacency matrices in different layers to represent adjacency relationships of different scales; the self-attention mechanism can dynamically calculate the weights of the adjacency matrix, so that the adjacency relationship can be adaptively adjusted according to the node features, which is also applicable to the technical solution of the present invention.
[0093] like Figure 4 As shown, the graph neural network model of this embodiment is provided with three layers of graph convolution layers, which respectively accept the output features and adjacency matrix from the previous layer of graph convolution as input. When it is the first layer of graph convolution, the output of the previous layer is the original point cloud data; secondly, two layers of fully connected layers are provided to further map the features extracted by the graph convolution into the high-dimensional feature space.
[0094] Step 3.2: Fully connected layer processing. The extracted features are further processed through two layers of fully connected layers. If l layers of graph convolutional layers are used before, the calculation formula of the two layers of fully connected layers is as follows:
[0095] Z=σ(H (l) W fc1 +b fc1 )
[0096] E=σ(ZW fc2 +b fc2 )
[0097] W fc1 , W fc2 Represent the weight matrix of the fully connected layer, b fc1 、b fc2They represent the bias vectors of the fully connected layer, both of which are obtained through network training. σ represents the activation function, and this embodiment selects the ReLU function. This embodiment gradually extracts the local features of the point cloud data through the hierarchical structure of the graph convolutional network, while retaining the global information in the adjacency relationship, so the final feature is a combination of these two aspects.
[0098] It should be noted that this embodiment combines supervised learning with a graph convolutional network (GCN). In the construction of the graph neural network model GNN, the present invention can select other graph neural network architectures, such as GraphSAGE, GAT (graph attention network), etc. These architectures have different mechanisms in feature extraction, which may improve the performance of the model. Secondly, the same purpose can be achieved by extracting point cloud features using architectures such as Transformer without using a graph convolutional network. That is, supervised learning deep models that can simultaneously extract local and global features from an adjacency graph can be regarded as meeting the needs of the present invention, but the effects of different network architectures are different. For example, GraphSAGE extracts local information through neighbor sampling and captures global information layer by layer; GAT dynamically allocates the importance of neighbors through a self-attention mechanism, thereby processing local and global features at the same time. Although Transformer is not a graph convolution, it can capture global relationships and process local features at the same time through a global attention mechanism, that is, the above examples can extract global and local features at different levels.
[0099] Step 4: Construct the loss function.
[0100] This embodiment preferably integrates the contrast loss function and the Rand coefficient loss function. Other feasible embodiments may also introduce other loss functions to solve the problem of inconsistent tree instance numbers, such as clustering loss. The clustering loss optimizes the single tree segmentation effect of the model by constraining the distance between similar points.
[0101] The contrast loss function and the Rand coefficient loss function designed in this embodiment are as follows:
[0102] Step 4.1: Design a contrastive loss function. The contrastive loss function is mainly used to ensure that points of the same instance (i.e. points belonging to the same tree) are closer in the embedding space, and points of different instances (i.e. points belonging to different trees) are farther away in the feature space. Based on this, the contrastive loss function formula is designed as follows:
[0103]
[0104] Among them, e i and e j Respectively represent the i-th and j-th rows of the feature space E extracted by the fully connected layer, representing the feature vectors of points i and j:
[0105] e i =E[i,:]
[0106] represents a set of point pairs of the same instance, represents a set of point pairs of different instances, m is a boundary value, and is a key hyperparameter used to control the distance threshold between different instances. The specific value is not limited in the present invention.
[0107] Step 4.2: Design an Adjusted Rand Index loss function. The Adjusted Rand Index (ARI) is used to evaluate the consistency between the clustering results and the true labels. In order to further constrain the output of the model, the present invention designs an ARI loss function based on supervised learning based on ARI to supervise the difference between the predicted single tree segmentation results and the true single tree segmentation results. First, map the feature space E to the single tree instance label space:
[0108] S = Softmax(EW+b)
[0109] Among them, S represents the probability distribution of the single tree instance label after mapping, W and b are the weights and biases of the fully connected layer, and for each point, the label with the highest probability is selected as the predicted label:
[0110]
[0111] Among them, pred i is the predicted label of the i-th point. Based on this, the ARI loss function is defined to supervise the consistency of the predicted label and the true label:
[0112]
[0113] The calculation formula of ARI is:
[0114]
[0115] Among them, a represents the number of point pairs whose predicted and true labels are in the same tree, b represents the number of point pairs whose predicted and true labels are not in the same tree, c represents the number of point pairs whose predicted labels are in the same tree but whose true labels are not in the same tree, and d represents the number of point pairs whose predicted labels are not in the same tree but whose true labels are in the same tree.
[0116] It represents the number of combinations of selecting two points from n points.
[0117] Finally, the loss function of the constructed network is the weighted sum of contrast loss and ARI loss:
[0118]
[0119] Among them, λ 1 and λ 2 is the weight hyperparameter of the loss function, which is used to balance the contribution of contrast loss and ARI loss. In this embodiment, λ 1 =0.6,λ 2 =0.4. In other feasible embodiments, λ 1 and λ 2 The value of is adjusted adaptively.
[0120] Step 5: Train the model and output the single tree instance segmentation results.
[0121] Using the previously constructed adjacency graph, network structure, and loss function, train the single tree instance segmentation network model. First, initialize the graph neural network model and define the optimizer. Input the point cloud data into the model, and calculate the feature vector and the probability distribution of the single tree instance label through the graph convolution layer and the fully connected layer. Calculate the total loss using the contrast loss function and the ARI loss function. Calculate the gradient and update the model weights through the backpropagation algorithm. Repeat the process of forward propagation, loss calculation, backpropagation, and weight update until the preset number of training rounds is reached or the loss converges.
[0122] After training is completed, the point cloud data of the transmission line to be tested is input into the trained model to obtain the probability distribution of the single tree instance label of each point, and the single tree instance label of each point is output to achieve single tree instance segmentation. In practical applications, after obtaining the point cloud data to be segmented, an adjacency graph is constructed, and then the trained model is input to obtain the probability distribution of the single tree instance label of each point, and then the segmentation result is obtained.
[0123] Embodiment 2:
[0124] The embodiment of the present invention provides a segmentation system based on the above-mentioned power transmission line tree segmentation method, which at least includes: a point cloud data acquisition module, an adjacency graph construction module, and a feature extraction and segmentation module.
[0125] Among them, the point cloud data acquisition module is used to acquire point cloud data collected along the transmission line channel; the adjacency graph construction module is used to construct an adjacency graph using the point cloud data, the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points; the feature extraction and segmentation module is used to input the adjacency graph into the constructed graph neural network model to obtain feature space parameters, and the feature space parameters are mapped to the single tree instance label space to obtain the single tree instance label probability distribution, and then the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution is used as the single tree segmentation prediction result of the corresponding point.
[0126] In some embodiments, the segmentation system also includes a model training module, which is used to collect point cloud data samples and the actual values of the individual tree instance labels of the points, and perform supervised learning model training based on the predicted values of the individual tree instance labels and the actual values of the individual tree instance labels.
[0127] In some embodiments, the segmentation system may also load a model pre-trained according to the above method, thereby achieving single tree segmentation of the point cloud to be segmented.
[0128] It should be understood that the specific implementation process of the above-mentioned unit modules refers to the method content, and the present invention will not be specifically repeated here, and the division of the above-mentioned functional module units is only a division of logical functions. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. At the same time, the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0129] Embodiment 3:
[0130] An electronic terminal provided by an embodiment of the present invention at least comprises: one or more processors; and a memory storing one or more computer programs;
[0131] The processor calls the computer program to implement: steps of a method and system for segmenting trees on power transmission lines based on supervised learning.
[0132] The specific implementation is:
[0133] Step 1: Obtain point cloud data collected along the transmission line channel;
[0134] Step 2: construct an adjacency graph using the point cloud data, where the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points;
[0135] Step 3: Input the adjacency graph into the constructed graph neural network model to obtain feature space parameters, map the feature space parameters to the single tree instance label space to obtain the single tree instance label probability distribution, and then use the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution as the single tree segmentation prediction result of the corresponding point;
[0136] The single tree instance label is a single tree number / code, which is used to identify whether it is a single tree and its individual label;
[0137] Among them, by collecting point cloud data samples and the actual values of the single tree instance labels of the points, processing is performed according to steps 2 and 3, and then supervised learning model training is performed based on the predicted values of the single tree instance labels and the actual values of the single tree instance labels.
[0138] The terminal also includes: a communication interface for communicating with external devices and performing data exchange transmission, such as communicating with external ECG equipment to obtain ECG data.
[0139] The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0140] If the memory, processor and communication interface are implemented independently, the memory, processor and communication interface can be connected to each other through a bus and communicate with each other. The bus can be an industrial standard architecture bus, a peripheral device interconnection bus or an extended industrial standard architecture bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0141] Optionally, in a specific implementation, if the memory, processor and communication interface are integrated on a chip, the memory, processor and communication interface can communicate with each other through an internal interface.
[0142] For the specific implementation process of each step, please refer to the description of the above method.
[0143] It should be understood that in the embodiments of the present invention, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the type of device.
[0144] Embodiment 4:
[0145] The present invention provides a computer-readable storage medium, characterized in that: a computer program is stored, and the computer program is called by a processor to implement:
[0146] A method and system for segmenting trees on power transmission lines based on supervised learning.
[0147] The specific implementation is:
[0148] Step 1: Obtain point cloud data collected along the transmission line channel;
[0149] Step 2: construct an adjacency graph using the point cloud data, where the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points;
[0150] Step 3: Input the adjacency graph into the constructed graph neural network model to obtain feature space parameters, map the feature space parameters to the single tree instance label space to obtain the single tree instance label probability distribution, and then use the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution as the single tree segmentation prediction result of the corresponding point;
[0151] The single tree instance label is a single tree number / code, which is used to identify whether it is a single tree and its individual label;
[0152] Among them, by collecting point cloud data samples and the actual values of the single tree instance labels of the points, processing is performed according to steps 2 and 3, and then supervised learning model training is performed based on the predicted values of the single tree instance labels and the actual values of the single tree instance labels.
[0153] For the specific implementation process of each step, please refer to the description of the above method.
[0154] The readable storage medium is a computer-readable storage medium, which may be an internal storage unit of the controller described in any of the foregoing embodiments, such as a hard disk or memory of the controller. The readable storage medium may also be an external storage device of the controller, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the controller. Further, the readable storage medium may also include both an internal storage unit of the controller and an external storage device. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0155] Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling 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 readable 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. Various media that can store program codes.
[0156] In summary, in order to improve the accuracy of single tree segmentation, the present invention not only proposes to strengthen the tree point cloud features through the adjacency graph, but also introduces the geometric relationship of the point cloud data, so that the graph convolution network can capture local and global features at the same time, thereby improving the segmentation accuracy in complex scenes. Furthermore, by using label information, the model can accurately distinguish point clouds of different categories (trees). GCN effectively extracts multi-scale features in point cloud data through graph structure information to ensure the accuracy and robustness of the segmentation results. Supervised learning provides a clear learning goal, that is, assigning different single tree instance labels to each point. The model can learn more useful features during the training process. And through the design of contrast loss and ARI loss, the model can automatically adapt to point cloud data of different densities and shapes, reducing dependence on parameter selection. Contrast loss ensures that the point pair distance within the same instance is minimized and the point pair distance between different instances is maximized, so that the model can effectively distinguish the point clouds of different trees. ARI eliminates the problem of the difference in the order of predicted tree numbers and real tree numbers. By measuring the consistency between the segmentation results and the real labels, the segmentation effect of the model is optimized to ensure the accuracy and consistency of the results.
[0157] It should be emphasized that the examples described in the present invention are illustrative rather than restrictive, and therefore the present invention is not limited to the examples described in the specific embodiments. Any other embodiments derived by those skilled in the art based on the technical solution of the present invention that do not depart from the purpose and scope of the present invention, whether modified or replaced, also fall within the scope of protection of the present invention.
Claims
1. A method for segmenting trees on power transmission lines based on supervised learning, characterized in that: The following steps are involved: Step 1: Obtain point cloud data collected along the transmission line channel; Step 2: construct an adjacency graph using the point cloud data, where the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points; Step 3: Input the adjacency graph into the constructed supervised learning deep model to obtain feature space parameters, map the feature space parameters to the single tree instance label space to obtain the single tree instance label probability distribution, and then use the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution as the single tree segmentation prediction result of the corresponding point; The single tree instance label is a number or a code, which is used to identify whether it is a single tree or a single tree individual identifier; the supervised learning deep model simultaneously extracts global features and local features from the adjacency graph, and then generates the feature space parameters; Among them, by collecting point cloud data samples and the actual values of the single tree instance labels corresponding to the points, processing is performed according to steps 2 and 3, and then supervised learning model training is performed based on the predicted values of the single tree instance labels and the actual values of the single tree instance labels.
2. The method according to claim 1, characterized in that: The supervised learning deep model is a graph neural network. If a graph convolutional network in the graph neural network is selected, the graph convolutional network includes a multi-layer graph convolutional layer and a fully connected layer. The calculation formula of the multi-layer graph convolutional layer is expressed as: H (l+1) =s l (AH (l) W (l) )l≥0 Among them, H (l+1) , H (l) The distribution represents the node feature matrix of the l+1th layer and the lth layer, W (l) is the weight matrix of the lth layer, σ l represents the activation function of the lth layer; when the graph convolution is the initial layer, H (0) =X, X is the node feature matrix, the size is N×F, N is the number of nodes, that is, the number of points in the point cloud, F is the feature dimension, corresponding to the coordinates of the points in the point cloud; A is the adjacency matrix determined based on the adjacency graph, and the adjacency matrices of the same point cloud corresponding to different layers of the graph convolution layer are the same or different; The calculation formula of the fully connected layer of the graph convolutional network is expressed as: E=σ fc (ZW fc +b fc ) Among them, E represents the feature space parameter of the fully connected layer output, Z is the output of the last graph convolution layer or the output of the previous fully connected layer, and W fc 、b fc Respectively represent the weight matrix and bias vector of the fully connected layer. If there are two or more fully connected layers, the weight matrix and bias vector of each fully connected layer are independent of each other. fc is the activation function of the fully connected layer.
3. The method according to claim 1, characterized in that: The single tree instance label represents a single tree individual identifier. When the model is trained based on the predicted value of the single tree instance label and the actual value of the single tree instance label, the training is performed using a constructed loss function, and the loss function at least includes a contrast loss function and / or a Rand coefficient loss function.
4. The method according to claim 3, characterized in that: The contrast loss function is expressed as: in, is the contrast loss function, e i and e j Respectively represent the i-th and j-th rows of the feature space parameters E extracted by the fully connected layer, representing the feature vectors of points i and j, represents the set of point pairs of the same single tree instance, Represents a set of point pairs of different single tree instances. m is the boundary value and a hyperparameter used to control the distance threshold between different instances.
5. The method according to claim 3, characterized in that: The Rand coefficient loss function is expressed as: in, is the Rand coefficient loss function, where pred = {pred1, pred2, ...pred n }, represents the predicted value of the single tree instance label of all points, pred i is the predicted value of the single instance label of the i-th point, label = {label1, label2, ... label n } is the true value of the single instance label of all points, label i is the true value of the single tree instance label of the i-th point, and the calculation formula of the ARI loss function is: Wherein, a represents the number of point pairs whose predicted and true labels are in the same tree, b represents the number of point pairs whose predicted and true labels are not in the same tree, c represents the number of point pairs whose predicted labels are in the same tree but whose true labels are not in the same tree, d represents the number of point pairs whose predicted labels are not in the same tree but whose true labels are in the same tree, and the predicted label and the true label correspond to the predicted tree instance label and the true tree instance label respectively; It represents the number of combinations of selecting two points from n points.
6. The method according to claim 1, characterized in that: The use of the point cloud data to construct an adjacency graph in step 2 is to use a kNN algorithm or a distance threshold method or a density-based method or to construct an adjacency graph based on Delaunay triangulation.
7. The method according to claim 1, characterized in that: After acquiring the point cloud data, the point cloud data is preprocessed, and the preprocessing at least includes normalization processing.
8. A segmentation system based on the method according to any one of claims 1 to 7, characterized in that: At least: A point cloud data acquisition module, used to acquire point cloud data collected along the transmission line channel; An adjacency graph construction module, used to construct an adjacency graph using the point cloud data, wherein the nodes of the adjacency graph represent the points of the point cloud, and the edges represent the adjacency relationship between two points; A feature extraction and segmentation module is used to input the adjacency graph into the constructed supervised learning deep model to obtain feature space parameters, map the feature space parameters to the single tree instance label space to obtain the single tree instance label probability distribution, and then use the predicted value of the single tree instance label with the maximum probability in the single tree instance label probability distribution as the single tree segmentation prediction result of the corresponding point; The single tree instance label is a number or a code used to identify whether it is a single tree or an individual identifier of a single tree; the supervised learning deep model simultaneously extracts global features and local features from the adjacency graph, and then generates the feature space parameters.
9. An electronic terminal, characterized in that: At least: one or more processors; a memory storing one or more computer programs; The processor calls the computer program to implement: The steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored, which is called by a processor to implement: The steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Target detection method based on global convolution and local deep convolution fusion
CN111428765A
Weak supervision point cloud semantic segmentation method for cross-scene contrast learning
CN114187446A
Single tree segmentation process method for forest measurement trees
CN114511572A
Domain-adaptive laser radar point cloud semantic segmentation method and device, and storage medium
CN115841574A
Automatic driving multi-mode picture and point cloud instance segmentation method based on weak supervision
CN116935356A