## 2 Methods
### Point-Cloud Coordinate Transformation and Section Fitting Denoising Based on Huber Loss Function  
The PCA-based point-cloud coordinate transformation can align the tunnel point cloud's main axis direction with the target axis (Z-axis direction), so that the tunnel section becomes parallel to the XY plane of the Cartesian coordinate system. However, for the tunnel point cloud after coordinate transformation, the actual tunnel section is not orthogonal to the XY plane, and the point cloud contains a large amount of noise points generated by tunnel ancillary facilities. To address this issue, this study proposes a method for tunnel-section coordinate system transformation and section fitting denoising based on the Huber loss function. The Huber loss function was proposed by statistician [PERSON] in [PERSON] (2016). It combines the square error (for small deviations) and the linear error (for large deviations), as shown in Equation (10). Therefore, this fitting method is more robust to outliers. Based on the  
Figure 5: Schematic of the rotated point-cloud spatial distribution (unit: meters) (a) XYZ coordinate system (b) XY plane (c) XZ plane. principle of the Huber loss function and some vector algebra and Euclidean geometry principles, this study proposes the following method and formula. The principle of the Huber loss function is illustrated in Figure 6. The objective of fitting using the Huber loss is to minimize the loss between the fitting function and all the points, as shown in Equation (11). In this study, the fitting result using the Huber loss function is a circular equation. This equation describes the distribution and geometric parameters of the tunnel cross-sectional point cloud, laying the foundation for subsequent point-cloud coordinate transformation and denoising. In this circular equation, the circle's center is defined as \((h_{0},k_{0})\), and the radius is \(R_{0}\). By minimizing this loss function, the circle's center \((h_{0},k_{0})\) and radius \(R_{0}\) can be determined. In this study, the geometric parameters of the tunnel cross-section are fitted using the Huber loss function \(L_{\delta}(r_{i})\), which serves as the basis for coordinate system transformation and point-cloud denoising. \[L_{\delta}(r_{i})=\left\{ \begin{array}{ll}0.5\cdot r_{i}^{2}&if|r_{i}|\leq \delta\\ \delta\cdot(|r_{i}|-0.5\cdot\delta)&if|r_{i}|>\delta\end{array} \right. \tag{10}\]  
\[min_{h,k,r}=\sum_{i=1}^{N}\omega_{i}L_{\delta}(r_{i}) \tag{11}\]  
In the Equation (10), \(\delta\) is a parameter used to control the transition of the function from squared residuals to linear residuals. When the absolute value of the residual is less than or equal to \(\delta\), the loss function behaves as squared residuals, making the loss function smoother for small residuals. When the absolute value of the residual exceeds \(\delta\), the loss function transitions to a linear increase, reducing the influence of outliers on the fitting result. \(|r_{i}|\) represents the absolute residual between the fitted value and the actual value. \(\omega_{i}\) is the weight parameter, which controls the impact of the point-cloud data's error on the total loss. In Equation (11), the subscripts \(h\), \(k\), and \(r\) represent the parameters optimized in the minimization process, which represent the x-coordinate of the circle center, the y-coordinate of the circle center, and the radius of the circle, respectively. The algorithm continuously adjusts these three parameters to minimize the Huber loss function, and the obtained equation is the circle equation with the best fitting effect for the tunnel point-cloud section. The Huber loss function can fit the center, axis of symmetry, and other geometric information of the tunnel cross-section. Using this geometric information, the axis of symmetry  
Figure 6: Diagram of the Huber loss function principle (unit: meters). direction \(v_{sym}\) for each cross-sectional point set \(X_{seg}\) can be computed.