# Automated Tunnel Point Cloud Segmentation and Extraction Method
## 2 Materials and Methods
### Cross-Section Segmentation and Segment Extraction
#### 2.2.2 Tunnel Inter-Ring Segmentation  
The second step of the TMatch algorithm is to perform fine classification of the tunnel point cloud. Fine classification primarily involves normalizing the previously assigned labels, enabling precise extraction of each tunnel ring and lining segment through label-based identification. After TMatch processing, the tunnel point cloud shows distinct differentiation between tunnel rings, but the labels remain irregular. To further optimize label consistency, this study applies the Gaussian Mixture Model (GMM), a statistical model that assumes the data are generated by a mixture of several Gaussian distributions and are used for clustering and density estimation to fit the probability distribution of the tunnel scalar field. GMM calculates boundary points that divide the scalar field data into multiple intervals, from which point cloud data for each interval are extracted. Since the tunnel is arranged in a circular shape and the scalar field exhibits periodic characteristics, GMM fitting is particularly advantageous. The GMM is a probabilistic model that assumes data are composed of multiple Gaussian distributions weighted together. Its parameters include weights, means, and variances, which are determined using maximum likelihood estimation (MLE). The goal of MLE is to optimize the model's log-likelihood function to maximize the probability of generating the observed data. However, because GMM involves latent variables (i.e., the specific Gaussian component to which each data point belongs is unknown), directly optimizing the likelihood function is complex. Therefore, the expectation-maximization (EM) algorithm is employed for parameter optimization. Figure 6: Tunnel classification visualization under clustering algorithm. The EM algorithm iteratively updates parameters to achieve maximum likelihood estimation, including the following two steps:  
1. E-step (expectation step): Calculate the probability (posterior probability) of each data point belonging to each Gaussian component. \[\gamma_{ij}=\frac{w_{i}\cdot\mathcal{N}(x_{j}|\mu_{i},\sigma_{i}^{2})}{\sum \limits_{k=1}^{n}w_{k}\cdot\mathcal{N}(x_{j}|\mu_{k},\sigma_{k}^{2})}\] (7)
2. M-step (maximization step): Update the model parameters, including the weights, means, and variances, based on the posterior probabilities calculated in the E-step. \[w_{i}=\frac{1}{N}\sum\limits_{j=1}^{N}\gamma_{ij}\] (8) \[\mu_{i}=\frac{\sum\limits_{j=1}^{N}\gamma_{ij}\cdot x_{j}}{\sum\limits_{j=1} ^{N}\gamma_{ij}}\] (9) \[\sigma_{i}^{2}=\frac{\sum\limits_{j=1}^{N}\gamma_{ij}\cdot\left(x_{j}-\mu_{i }\right)^{2}}{\sum\limits_{j=1}^{N}\gamma_{ij}}\] (10)  
Here, \(w_{i}\) represents the weight of the i-th Gaussian component, \(\mu_{i}\) is the mean, and \(\sigma_{i}^{2}\) is the variance. The iterative process of the EM algorithm progressively approximates the maximum value of the log-likelihood function, yielding the optimal parameters for the GMM. GMM models the data distribution as a weighted sum of multiple Gaussian distributions, and its probability density function can be expressed as:  
\[P(x)=\sum\limits_{i=1}^{n}w_{i}\cdot\mathcal{N}(x\Big{|}\mu_{i},\sigma_{i}^{2}) \tag{11}\]  
Using the above method, the tunnel point cloud data are precisely segmented into multiple intervals. Figure 7 illustrates the segmentation intervals determined using the GMM. Figure 7: Segmentation intervals determined by the GMM. The intervals obtained through scalar field fitting are further used to extract the tunnel cross-sections, as shown in Figure 8, where the tunnel cross-sections have been further subdivided. As shown in Figure 8, after the tunnel scalar field extraction method is completed, the majority of the tunnel segments have been accurately extracted. The point cloud files are assigned a second layer of labels, indicating different ring numbers and their corresponding interval point clouds.