# Semantic Segmentation Method for Road Intersection Point Clouds Based on Lightweight LiDAR
## 2 Materials and Methods
### Point Cloud Semantic Segmentation Model
#### 2.3.2 Improved Feature Aggregation Module  
RandLA-Net's random sampling method significantly reduces memory usage. However, due to the non-uniform distribution of 3D point clouds in space, random sampling may not accurately retain the geometric features of the point cloud, potentially resulting in a loss of effective information during downsampling. To enhance the model's feature learning capabilities, we improve upon the original network's local feature aggregation module (LFA), resulting in an improved feature aggregation module composed of a spatial information encoding layer, an aggregation pooling layer, and a dilated residual layer. The architecture of the improved feature aggregation module is shown in Figure 3.  
(1) Spatial Information Encoding Layer: This layer explicitly encodes the coordinate information of the point cloud, allowing the network to learn the local spatial structure of the original point cloud from the relative distances and positional relationships between points. For each central sampling point, the original network uses the K-nearest neighbors (KNN) algorithm to select several of the closest points to enhance their features for describing the local spatial features of the central point. The KNN algorithm is essentially a non-parametric, instance-based learning method used for classification and regression tasks. It operates on the principle that data points with similar attributes are likely to be close together in feature space. However, points close in space to the central point may not share similar feature information, especially at the boundaries between different categories of point clouds. Consequently, such points may misrepresent local features and hinder the model's ability to capture the point cloud's spatial structure, as illustrated in Figure 4.  
Figure 2: The overall architecture of improved RandLA-Net. The steps for the spatial information encoding layer are as follows:  
* Step 1: Establishing Neighborhood Point Sets Using the K-nearest neighbors (KNN) algorithm, calculate the Euclidean distance from each point in the point cloud to the central sampling points. For each central sampling point, select the K-closest neighborhood points, denoted as \(\{\mathrm{p}_{\mathrm{i}}^{1},\cdots,\mathrm{p}_{\mathrm{i}}^{k},\cdots,\mathrm{p }_{\mathrm{i}}^{K}\}(\mathrm{k}=1,\cdots,\mathrm{K})\). * Step 2: Constructing the Feature Similarity Matrix Taking the central point \(\mathrm{p}_{\mathrm{i}}\) as an example, the difference between \(\mathrm{p}_{\mathrm{i}}\) and its neighborhood point \(\mathrm{p}_{\mathrm{i}}^{k}\) is represented by the differences in their feature vectors (including color and intensity): \[\mathrm{d}(\mathrm{p}_{\mathrm{i}},\mathrm{p}_{\mathrm{i}}^{k})=||\mathrm{f} _{\mathrm{i}}-\mathrm{f}_{\mathrm{i}}^{k}||\] (5) where \(\mathrm{f}_{\mathrm{i}}\) and \(\mathrm{f}_{\mathrm{i}}^{k}\) are the feature vectors corresponding to \(\mathrm{p}_{\mathrm{i}}\) and \(\mathrm{p}_{\mathrm{i}}^{k}\), respectively. The smaller the \(\mathrm{d}(\mathrm{p}_{\mathrm{i}},\mathrm{p}_{\mathrm{i}}^{k})\) is, the higher the similarity of features is between that \(\mathrm{p}_{\mathrm{i}}^{k}\) and the central point \(\mathrm{p}_{\mathrm{i}}\). Figure 4: Diagram of neighborhood selection for the center point in KNN. Figure 3: The architecture of the improved feature aggregation module (FA*). Repeat the above process for K neighborhood points to construct a feature similarity matrix (K \(\times\) 1). According to the matrix, select the K\({}_{\text{new}}\) neighborhood points with the highest similarity to each central point, denoted as \(\{\text{p}_{1}^{1},\cdots,\text{p}_{i}^{k},\cdots,\text{p}_{i}^{K_{\text{new}}} \}(\text{k}=1,\cdots,\text{K}_{\text{new}})\). * Step 3: Relative Position Encoding To enrich local spatial information, explicitly encode the relative position of the point cloud based on the similar neighborhood point set \(\{\text{p}_{1}^{1},\cdots,\text{p}_{i}^{k},\cdots,\text{p}_{i}^{K_{\text{new}}} \}(\text{k}=1,\cdots,\text{K}_{\text{new}})\).