# Machine Learning-Based 3D Soil Layer Reconstruction in Foundation Pit Engineering
## 3 Data Enhancement Algorithm of Soil Layers
### Soil Layer Generation Algorithm  
The purpose of the algorithm is to simulate the real soil layer generation process, generate simulated soil layer data, and expand the training dataset for soil layers. In practical engineering, soil layer modeling typically relies on borehole data. However, due to the scarcity of borehole data, the resulting soil layer datasets are often small. Therefore, we designed a soil layer generation algorithm to acquire a sufficient amount of data. The algorithm dynamically generates three types of soil layers based on varying input parameters. It allows customization of the thickness and proportion of each soil layer, thereby enhancing soil layer diversity. When generating hiatus soil layers, the coordinates of the hiatus plot are entered, and when generating fault soil layers, the coordinates of the fault and the thickness of the fault are entered. In this algorithm, the following definitions are introduced:  
Definition 1 (Statum elevation): The elevation is the height of the stratum in three-dimensional space, denoted by \(E\). Definition 2 (Rectangular bottom vertex coordinate set of the stratum): The bottom vertex coordinate set is the polygon vertex coordinates at the soil layer's bottom, represented by the set \(D\), where \(D=\{d_{1},d_{2},\ldots,d_{n}\}\). For each \(d_{i}\in D\), \(d_{i}\) is defined as \(\{x_{i},y_{i}\}\), where \(x_{i}\) and \(y_{i}\) are the coordinates of the \(i^{th}\) vertex in the \(X\) and \(Y\) directions, respectively. Definition 3 (Three-dimensional grid): A three-dimensional grid divides three-dimensional entities in space. In our algorithm, the three-dimensional grid is conceptualized as a small cuboid and represented by the tuple \(G\), where \(G=\{g_{1},g_{2},g_{3}\}\). Here, \(g_{1},g_{2}\), and \(g_{3}\) represent the length, width, and height of the cuboids in the grid, respectively. Definition 4 (Soil layer proportion): The soil layer proportion refers to the ratio of the average thickness of each soil stratum to the total thickness across all layers. This parameter's design can enhance the diversity of generated soil layer configurations. The proportion is denoted by the set \(L=\{L_{1},L_{2},\ldots,L_{num}\}\), where \(L_{i}\) represents the proportion of the \(i^{th}\) soil layer, ensuring that \(\sum_{i=1}^{num}L_{i}=1\). Definition 5 (Hiatus coordinate set): The hiatus coordinate set represents the triangular vertex coordinates of the missing portion of the soil layer projected onto the \(X\)Z plane. It is defined as an ordered set, \(S_{h}=\{S_{h1},S_{h2},\ldots,S_{hm}\}\), where each \(S_{hi}\) denotes the coordinates of the \(i^{th}\) vertex. Here,  
Figure 5: Schematic representation of three types of soil layers. \(S_{hi}\) is a binary tuple, \(S_{hi}=(s_{hx},s_{hz})\). As shown in Figure 5b, the hiatus soil layer typically forms an inverted triangular shape, with the vertices labeled as points \(A\), \(B\), and \(C\) defining the boundaries of the missing region._  
**Definition 6 (Fault soil layer coordinate set). ** _The fault soil layer coordinate set represents the endpoint coordinates of the line segment projected by the fault portion of the soil layer onto the XZ plane. It is defined as an ordered tuple, \(S_{s}=\{S_{\text{s1}},S_{\text{s2}}\}\), where each \(S_{si}\) denotes the coordinates of the \(i^{th}\) endpoint. Here, \(S_{hi}\) is a binary tuple, \(S_{si}=(s_{sx},s_{s_{\text{s2}}})\). As shown in Figure 5c, the coordinate set of points \(A\) and \(B\) is \(S_{s}\), which defines the boundaries of the fault line segment._  
**Definition 7 (Fault soil layer subsidence height). ** _This term describes the height of the whole soil subsidence on one side of the fault line segment, symbolized as \(d_{s}\)._  
**Definition 8 (Smooth curve function set). ** _A set of functions designed to generate smooth surfaces, represented by the set \(F=\{f_{1},f_{2},\ldots,f_{n}\}\), where \(f_{i}\) is a B-spline curve function. Each curve has \(g_{f}\) control points determined by Formula (1).