## 2 Methodology
### Improved K-Means Clustering Algorithm  
In the process of 3D reconstruction, a threshold should be set to separate and extract the target and background data from the GPR detection data. At present, the setting of this threshold is highly subjective in most studies. [PERSON] et al. [50] proposed a threshold calculation method based on attribute analysis and K-means clustering analysis, which was successfully applied to the 3D visualization process of tunnel caves and effectively solved the problem of over-reliance on the empirical judgment of researchers in the selection of amplitude threshold in traditional methods.  
The K-means clustering algorithm is an unsupervised learning method. Its basic principle is that for a given data set, the data set is divided into \(k\) clusters according to the Euclidean distance between data points in the sample until the distance between the data in the same cluster are small enough and the distance between clusters is considerable enough [51; 52]. Suppose there is a data set \(M=\{x_{1}\), \(x_{2}\), \(\ldots\), \(x_{m}\}\)[53], which needs to be clustered into \(k\) clusters; then, the calculation formula of the sum of the squares of the errors is shown in Equation (12):  
\[E=\sum_{i=1}^{k}\sum_{x\in C_{i}}\|x-\mu_{i}\|^{2} \tag{12}\]  
Equation (13) shows the corresponding cluster's mean vector formula:  
\[\mu_{i}=\frac{1}{|C_{i}|}\sum_{x\in C_{i}}x \tag{13}\]  
where \(k\) is the number of clusters, \(C_{i}\) is the cluster, \(\mu_{i}\) is the centroid, and \(x\) is the data point.  
The basic flow of the K-means clustering algorithm is shown in Figure 7. First, \(k\) samples are selected from data set \(M\) as the initial clustering center of \(k\) clusters. According to the minimum Euclidean distance between each data point and the initial clustering center, the data set is divided into \(k\) clusters. Then, the clustering centers of each cluster are recalculated. The final clustering result can be obtained by repeating the above steps until the \(k\) clustering centers do not change.  
The K-means clustering algorithm has a good classification effect, fast convergence speed, and uncomplicated implementation process, so it is widely used. However, this algorithm is sensitive to noise and abnormal values, and the selection of the initial clustering center will also affect the clustering results of K-means [54]. Aiming at this defect, in recent years, many studies improved the traditional K-means algorithm [55; 56; 57; 58] and achieved good results. Among them, [PERSON] et al. [58] combined the K-means algorithm with the Agglomerative Hierarchical Clustering (AHC) algorithm and proposed the K-means-AHC algorithm. The AHC algorithm is a hierarchical clustering algor  
Figure 6: BP imaging.  
and will not be affected by the cluster number and initial clustering center, but has a high complexity and slow computing speed [59]. Therefore, the K-means-AHC algorithm combines the advantages of these two algorithms. First, the data set is divided into several initial class clusters using the K-means algorithm processing method. Second, based on the initial class cluster formed, the AHC algorithm is adopted to merge the smaller initial class cluster into a larger class cluster that meets the requirements. This method not only preserves the fast operation time but also avoids the acute problem of the traditional K-means algorithm regarding selecting the initial clustering center.