## 2 Method
### Neighborhood Optimization Based on Multi-Scale Pyramid  
After the initial classification, the point clouds are basically classified correctly. Due to noise and other reasons, there are still some misclassifications in some details (such as edges). As shown in Figure 1d, most of the points in the scene have been correctly classified, and only a small part of them are misclassified. They mainly concentrate on edges and other places, and most of the points around the misclassified points are correctly classified. Therefore, it is necessary to further optimize the initial classification results to achieve a more accurate classification of the point clouds. Because local information is used as a feature to classify point clouds, the feature extraction relies heavily on a local region selection. In addition, the single point is taken as the basic unit of classification. Each point has its own characteristics, but because the two neighboring points are very close to each other and their neighborhoods are also very close, the extracted features will be very similar, which leads them to be more likely to be classified into the same class. Therefore, the neighbors of the misclassified points are also often misclassified. It is difficult to correct the misclassified points if only the points in the smaller local regions are used for the optimization. Therefore, we propose a classification results optimization method based on the multi-scale pyramid. The specific method is as follows:  
First, voxel filters with different radius scales are used to down-sample the point cloud after an initial classification, as shown in Formula (24). Each minimum voxel scale is twice as large as the last down-sampling, and sparse point clouds are gradually obtained. Following this, the \(q\)-level pyramid is constructed, and the initial classes of all the points in each level are retained. According to the characteristics of the point cloud down-sampling reflecting the structure information of the shape, the scale pyramid is constructed on three scales of \(q=3\) in this paper.  
Following this, the corresponding k-d tree is constructed from the point cloud in each layer of the pyramid. For each point in the original point cloud, a k-d tree is used to search for the radius of the nearest neighbors in the point cloud after the down-sampling. The class labels of the \(m\) point clouds searched within the radius of the \(l\)-th level are \(L^{l}=\left\{L_{1}^{l},\ldots,L_{m}^{l}\right\}\), \(L_{i}^{l}\in\left\{1,\ldots,c\right\}\), \(i=1,\ldots,m\), \(l=1,..\), \(q\); the radius parameters are different when each layer of the point cloud chooses its nearest neighbor. The method of calculation is as follows:  
\[r=k\cdot Presolution \tag{26}\]  
In the formula, \(r\) represents the scale radius parameter. \(Presolution\) is the resolution used by the current down-sampling point cloud. \(k\) is a fixed ratio threshold.  
Finally, the initial labels of all the nearest neighbors in the \(q\) levels are counted. The discriminant function \(1\left\{L_{i}^{l}=C\right\}\) represents the fact that when \(L_{i}^{l}\) belongs to class \(C\), its value is 1; otherwise, its value is 0. This is used to count the number of the initial labels belonging to each class. As shown in Formula (27), the mode label \(C^{*}\) is selected as the new class label for the current point.  
\[C^{*}=\begin{array}{c}\text{argmax }\sum_{l=1}^{d}\sum_{i}^{m}1\Big{\{}L_{i}^{l}=C \Big{\}}\\ C=L_{i}^{l}\in\{1,\ldots,c\}\end{array} \tag{27}\]  
Not only do the optimized point cloud classification results avoid a situation where the nearest neighbor is also misclassified, but they also solve the problem of too many far points in a large scale, thus achieving better results. The optimized point cloud classification results are shown in Figure 1e.