The Prediction of Pile Foundation Buried Depth Based on BP Neural Network Optimized by Quantum Particle Swarm Optimization

Due to the fluctuation of the bearing stratum and the distinct properties of the soil layer, the buried depth of the pile foundation will differ from each other as well. In practical construction, since the designed pile length is not definitely consistent with the actual pile length, masses of piles will be required to be cut off or supplemented, resulting in huge cost waste and potential safety hazards. Accordingly, the prediction of pile foundation buried depth is of great significance in construction engineering. In this paper, a nonlinear model based on coordinates and buried depth of piles was established by the BP neural network to predict the samples to be evaluated, the consequence of which indicated that the BP neural network was easily trapped in local extreme value, and the error reached 31%. Afterwards, the QPSO algorithm was proposed to optimize the weights and thresholds of the BP network, which showed that the minimum error of QPSO-BP was merely 9.4% in predicting the depth of bearing stratum and 2.9% in predicting the buried depth of pile foundation. Besides, this paper compared QPSO-BP with three other robust models referred to as FWA-BP, PSO-BP, and BP by three statistical tests (RMSE, MAE, and MAPE). +e accuracy of the QPSO-BP algorithm was the highest, which demonstrated the superiority of QPSO-BP in practical engineering.


Introduction
Pile foundation is one of the oldest foundation forms. With the development of history, pile foundation has become the most commonly used foundation form of high-rise buildings, significant structures, tunnels, bridges, offshore platforms, and other structures on soft ground [1]. Pile, as a member of foundation structure, is vertically or aslant set in the soil and has certain stiffness and bending shear capacity. It allows itself to pass through the soft compressible soil layer, compact the weak soil, and transmit part or all of the load from the superstructure to the soil layer or rock below with low compressibility and certain bearing capacity, thus avoiding the excessive settlement of the foundation and improving the bearing capacity of the soil layer [2]. As one of the most important steps in foundation construction, the construction of pile foundation is a large-scale project; meanwhile, there is also a problem of waste of materials. It is usually found that the designed length of pile is much higher or lower than the required value in actual engineering, which can be seen from Figure 1 Each pile to be bored would be surveyed in advance according to current construction technique.
ere is a construction technique of "one pile with one investigation" or "one pile with lots of investigation" [3], namely, each pile to be driven will be investigated in advance, and the pile length is designed by the elevation of pile bottom which is estimated by the most unfavorable principle, but this technique is not adopted in every project [4]. Only a few survey boreholes are arranged to predict the soil distribution of the whole site in general engineering.
When the irregular fluctuation of the bearing stratum changes greatly, it may result in a large elevation difference between the undrilled area and the nearby drilled area. erefore, in the area where the bearing stratum is relatively shallow, the pile will reach the bearing stratum too early and cannot continue going deeper. At this time, the pile head will extend too long from the soil and needs to be cut off, which can be seen from Figure 2 below. On the contrary, in the area where the bearing stratum is deeply distributed, the pile length will be insufficient and needs to be supplemented. e reason for this situation is that the variety of pile length is limited, especially the prefabricated pile. If the construction is carried out according to the designed pile length, a large number of piles will be cut off or supplemented, resulting in unnecessary waste in pile foundation engineering. erefore, this paper predicted the buried depth of pile foundation and bearing stratum, then made targeted technical scheme preparation and construction deployment in practical engineering according to the prediction results.
At present, there are few research studies on predicting the buried depth of pile foundation and the fluctuation of bearing stratum; however, in the field of pile foundation engineering, many scholars have made some achievements. In the static load test of pile foundation finished by Qi et al. [5], a first-order linear dynamic differential equation was derived by studying the settlement of pile under various loads. On the basis of gray system theory, the GM (1, 1) model of load-settlement relationship of single pile was established and employed to predict the ultimate bearing capacity and the complete load-settlement relationship. Despite the accurate prediction results obtained by this method, the uniformity of original data should be ensured. According to the measured data, Gao et al. [6] adopted the hyperbolic method to predict the bearing capacity of squeezed branch pile. Although the error between the predicted results and the measured curve was not great, the values predicted by this method were generally too large and had certain limitations. Deng et al. [7] used the superlong and large-diameter cast-in-place pile foundation of the Sutong Yangtze River Bridge as an example to calculate its settlement amount by adopting different specifications, and then a new empirical formula considering pile compression and modifying additional stress of the pile tip was proposed by comparing with the settlement value of the large-scale centrifugal model test. Afterwards, this formula was applied to verify the settlement value of a super large-scale pile group foundation on the Nei-Kun Line, and the calculation result of which was relatively consistent with the measured data. However, this formula was not suitable for the analysis of single pile settlement, which had certain limitations as well.
Most of the forecasting methods mentioned above rely on a fixed knowledge framework and can only be adopted under certain preconditions, which are rigid and not flexible enough. As a consequence, an intelligent technology that can deal with various problems flexibly and has self-learning awareness will be needed. Machine learning, as a technology that computers build models based on data to simulate human activities, can meet this condition. It possesses the strong generalization ability and has been applied in different aspects. Methods of machine learning were used by Ahmadi et al. [8] to successively predict the solubility of carbon dioxide (CO 2 ) in brines, porosity and permeability of petroleum reservoirs, the amount of dissolved calcium carbonate concentration throughout oil field brines, condensate-to-gas ratio in retrograded condensate gas reservoirs, solubility of hydrogen sulfide (H 2 S) in ionic liquids, etc. e prediction of pile foundation depth belongs to a highly nonlinear problem, which can also be analyzed by this method. e artificial neural network (ANN) is a kind of machine learning, which is a powerful intelligent learning tool with functions [9,10] such as mapping nonlinear relations, information processing, optimization calculation, classification, and recognition. It has been widely applied in the fields of model prediction, content prediction, cost control, fault diagnosis, information processing, construction engineering, mechanical engineering, medicine, etc., and the results were great as expected. Hamid et al. [11] built an ANN model based on the critical pressure (P c ), critical temperature (T c ), and molecular weight (M w ) of pure ionic liquids to predict the solubility of hydrogen sulfide (H 2 S) in different temperature, pressure, and concentration ranges. Moosavi et al. established an ANN model based on 214 data records of published CO 2 -foam injection tests into oilreservoir cores to predict the CO 2 -foam flooding performance for improving oil recovery. Shang et al. [12] proposed two kinds of ANN models to analyze the content and types of heavy metals in the soil based on the complex permittivity of materials, so as to determine whether the soil is contaminated. e first ANN model was adopted to confirm the presence of heavy metals in the site, and the second model was employed to classify the presence of heavy metals in the site. Alias et al. [13] completed the cost of the skeletal system of a building project through the ANN model. Sorsa et al. [14] detected and diagnosed the faults in the testing process based on three different ANN structures. Jin et al. [15] established an ANN model with water-cement ratio, specimen shape, and section size as input parameters based on the size effect of concrete compressive strength, then predicted the compressive strength with different section sizes. Suzuki [16] found it feasible to apply the improved ANN to reduce false positives in computer detection of pulmonary nodules in low-dose computed tomography images, and the results turned out to be great. e emergence of ANN provides a more convenient and intelligent prediction way for many fields. It no longer needs a large amount of statistical data to predict the future trend but can achieve a good prediction effect based on limited data. erefore, in this paper, the highly nonlinear problem of the prediction of pile foundation burial depth can be solved by relying on ANN.
Among them, the backpropagating (BP) neural network is the most widely used artificial neural network, which is a multilayer feedforward neural network trained according to the error backpropagation algorithm. It has a certain ability of summary and extension. Some mathematical analysis has demonstrated its ability to deal with any nonlinear problem to solve complex internal mechanisms [17]. However, there are still some shortcomings of the traditional BP network at present. (1) It is a complex process for the BP neural network to optimize the objective function by using the gradient descending method, and when the output of neurons is in the vicinity of 0 and 1, the weight error only changes within a small range.
is phenomenon causes training to almost stop, so that the efficiency of the BP neural network is low and the speed of the BP neural network is at a slow pace [18].
(2) From the mathematical point of view, the algorithm used by the BP neural network is mainly to search the local area, which will easily fall into the local extreme value. e final training curve presented is almost going to be a straight line, as a result of which the training of the network will fail [19].
(3) e prediction ability of the network is proportional to the learning ability within a certain range, but once beyond this range, the prediction ability of the BP neural network will decline with the improvement of the learning ability, which leads to the phenomenon of "overfitting." At this time, even if the network has learned a large sample, it cannot directly and correctly reflect its rules [20]. To sum up, there will be plenty of deficiency when the BP neural network is solely used for prediction; as a result, it is necessary to apply some algorithms to optimize the BP neural network and then establish a more accurate training model.
In recent years, several swarm intelligence optimization algorithms have emerged in an endless stream. is kind of algorithm is also one of the optimization algorithms that scholars pay the most attention to, which has the characteristics of simplicity and high efficiency when compared with others [21]. So that they have been also widely adopted in various fields. e swarm intelligence algorithm uses the group relations among some animals or individuals in the society, such as interaction, heredity, variation, cooperation, and other behaviors, to achieve the purpose of searching for optimal solution.
Fireworks algorithm (FWA) is a new swarm intelligence optimization algorithm proposed by Tan et al. [22] in recent years, which simulates the mechanism of the simultaneous explosion and diffusion of the firework explosion operator. It introduces the idea of concentration suppression in the Advances in Civil Engineering immune algorithm and the mechanism of distributed information sharing, thus having stronger global search capabilities [23]. Compared with traditional algorithms, the population of FWA is more diverse, and its characteristics have also attracted the attention of many scholars. However, the FWA still has several shortcomings. For example, when the explosion point range is large and there are many explosion operators, the targets generated by the explosion will overlap, resulting in irrelevant searches. en, it will greatly affect the optimization efficiency of FWA, which is the major cause of slower convergence speed and lower search accuracy [24]. Particle swarm optimization (PSO) algorithm [25], as one of the most classic optimization algorithms, is inspired by the foraging behavior of birds. It seeks the optimal value in the stochastic solution of particle swarm through constant iteration. Compared with FWA, it has the advantages of simple operation and fewer parameters to be adjusted [26]. Ahmadi et al. [27] used the neural network model optimized by the PSO algorithm to predict asphaltene precipitation due to natural depletion. Wang et al. [28] predicted the mechanical properties of hot rolled strip steel in material processing based on the PSO-BP model. Likewise, this PSO-BP model was applied by Ismail et al. [29] in the field of soilstructure composite interaction to predict the load-deformation characteristics of axially loaded piles as well. Shafiei et al. [30] predicted the solubility of hydrogen sulfide in different temperature, pressure, and concentration ranges in the same way. Ahmadi et al. used the PSO-ANN model to predict the dew point pressure of condensate gas reservoir. In another paper by the same author, estimation of efficiency of chemical flooding in oil reservoirs was predicted. Although the above literature studies have achieved relatively good prediction results, the PSO algorithm still has plenty of problems, and it has been proved that it is not a globally convergent algorithm [31]. In the meantime, it also has some problems to be solved, such as premature convergence, lack of dynamic adjustment of velocity, easy to fall into local extreme value, lack of randomness in particle position change, inability to effectively deal with discrete and combinatorial optimization, and limitation of search space [32]. From the perspective of dynamics, there is a point with potential energy field in the search area that attracts the particle swarm, causing the surrounding particles to constantly approach this point. When the velocity decreases to 0, the particles converge to this point as well. erefore, the motion of each particle in the traditional PSO algorithm is carried out along a fixed orbit, the velocity of the particle is always a finite value, and the search area of its feasible solution is also small [33]. In order to improve the global optimization capability of PSO, this algorithm needs to be optimized. As a result, the concept of quantum particle swarm algorithm (QPSO) was proposed by Sun [34].
Based on the traditional PSO algorithm, the QPSO algorithm randomizes the velocity of the particle. In the quantum space, the state of the particle is not represented by position and velocity vector any more, but by wave function. In this way, within the feasible region, the probability of particles appearing at a position is random, and the motion of particles is no longer along a fixed orbit. eir updated position in the next second has no correlation with the previous position; that is, the search can be carried out in the whole feasible solution region, which improves the global optimization performance of particles. Chen et al. [35] took the gear reducer of belt conveyor as the research object and optimized the parameters such as modulus, tooth width coefficient, and helical angle of the gear reducer based on the QPSO and PSO algorithm. e results showed that the optimization effect of QPSO was obviously better than that of PSO. Genetic algorithm (GA) and ANN, PSO, and QPSO algorithms were used by Lu et al. [36] to predict the parameters of the batch fermentation kinetic model. e results demonstrated that the prediction effect of QPSO in all aspects was superior to that of other algorithms. erefore, on the basis of the BP neural network, this paper used the QPSO algorithm to optimize the BP model and then predicted the buried depth of pile foundation. Finally, three error analysis tools, RMSE, MAE, and MAPE, were, respectively, employed to analyze its reliability and uncertainty.
Based on the above, this paper provides the following contributions. (1) In this paper, the ANN in machine learning was used to predict the buried depth of pile foundation. However, there were very few research studies on this topic before; as a result, it can be applied as a new field in practical engineering. (2) In this paper, the samples of piles were collected on the spot based on engineering examples. e relevant parameters of pile samples in this area were sorted out and summarized, which were X-coordinate, Y-coordinate, Z-coordinate, thickness of miscellaneous fill h 1 , thickness of silty clay h 2 , thickness of silt h 3 , thickness of fine sand h 4 , and pile buried depth H. Some samples were selected as training models. (3) In this paper, the steps of predicting test objects after optimizing the BP neural network by the QPSO algorithm were described in detail. (4) is paper used the QPSO algorithm to optimize the BP neural network for modeling training and then predicted the remaining samples in step (2). e great global optimization of the QPSO algorithm successfully made up for the defect that the traditional PSO algorithm was easy to fall into the local extreme value, and the prediction results were very close to the measured results, indicating that this method had achieved a good prediction effect in the research objects. (5) is paper compared the errors of the QPSO algorithm with other robust models: PSO algorithm, FWA, and BP neural network. e results showed that QPSO had higher prediction accuracy.
is paper also introduces the following parts. Section 2 introduces training parameters based on project example. Section 3 describes the concept of BP neural network and the optimization methods of PSO and QPSO algorithms. Section 4 is the error analysis after using different algorithms to optimize the BP neural network for prediction. Section 5 is the conclusion of the above description and the analysis of the predicted results. At the same time, this paper also gives an overview of how to apply this method in engineering examples with similar soil propriety.

Project Profile.
e project is located in the East Campus of Yangtze University in Jingzhou District, Jingzhou City, Hubei Province, which was to build dormitory and canteen in this area. According to the design document, this investigation site with pile location layout is shown in Figures 3-5 below. e distribution of boreholes and piles can be obtained from the figure. Each long black dotted line, such as "11-11′," represents "11-11′ section" of boreholes from K64 to K67. According to the section drawings, the soil stratification at each borehole from K64 to K67 can be known. First of all, the piles at the boreholes were selected as the data of the network model, X-coordinate, Y-coordinate, and Z-coordinate of each pile were taken according to the coordinate information provided by layout drawings, and the length of the bearing stratum and the buried depth of pile were obtained from the section drawings. In order to make the selected data representative, 43 piles were randomly selected as the training samples and 10 piles were randomly selected as the prediction samples from the boreholes of investigation in the figure. With the difference of the geographical location, the fluctuation of the bearing stratum of the site will have a certain trend of change as well. e process of driving the pile into the bearing stratum needs to pass through different soil layers on the upper side. However, the thickness of each soil layer at the undetected coordinates is an uncertain unknown. As the thickness of the soil layer is different, the depth of the bearing layer changes to another number, which will affect the buried depth of the pile. According to the field data, the piles were all driven into the fine sand layer, which indicated that the fine sand layer was the bearing stratum. e depth of the sample pile into the first layer of soil called miscellaneous fill is h 1 , the depth of the sample pile into the second layer of soil called silty clay is h 2 , the depth of the sample pile into the third layer of soil called silt is h 3 , and the depth of the sample pile into the fourth layer of soil called fine sand is h 4 which presents the bearing stratum. H is the sum of h 1 , h 2 , h 3 , and h 4 , which represents the buried depth of pile. e depth of the sample pile into different layers of soil can be calculated by combining the geological profile and the data of pile buried depth H measured from actual engineering. Based on the above, the X-coordinate, Y-coordinate, and Z-coordinate of each pile were collected as input parameters for model training. In this training, to predict the fluctuation of the bearing stratum is to predict the depth of h 4 , to predict the buried depth of pile is to predict the depth of H, and the thickness of h 4 is less than the thickness of fine sand layer. In addition, H � h 1 + h 2 + h 3 + h 4 , H and h 4 are output parameters. e schematic diagram is shown in Figure 6.

Geological Overview.
e terrain of the site is relatively flat, and the absolute elevation value of the ground is in the range of 31.5 m-32.88 m, which belongs to the first-grade terraced geomorphic unit on the north bank of the Yangtze River. ere is no adverse geological action such as landslide, soil collapse, and debris flow. According to the detailed investigation report of the site, the area within this depth range can be divided into artificial fill soil layer, Quaternary Holocene alluvium and Quaternary Upper Pleistocene alluvium and diluvium according to its genetic type and sedimentary age [37].
According to their properties and composition, the geotechnical layers can be classified into the following parts, which are distributed as follows: (1) artificial fill soil layer (Q ml ), miscellaneous fill, brown, moist, and loose. e main component is clay, containing a small amount of plant rhizomes. is layer is distributed in the whole field, and the soil uniformity is poor. e thickness is 0.4 m-1.7 m. (2) Quaternary Holocene alluvium (Q al 4 ), silty clay, yellowishbrown to grayish-brown, soft to plastic, saturated, full-field distribution. is layer contains a small amount of ferromanganese nodules and medium compressibility. ), pebbles, gray, white and other colors, medium dense to dense state, low compressibility, and fullfield distribution. e main component is quartzite, with good roundness and poor sorting. e particle size is generally 3∼5 cm, and the larger particle size is greater than 7 cm, of which the particle size greater than 2 cm accounts for about 51%. e filling material between pebbles is fine silty sand.
It can be seen from the above data that the thickness and uniformity of each layer are greatly different.

Optimization Algorithms for Pile Depth Prediction
3.1. Implementation of BP Neural Network Algorithm. As the name suggests, the neural network is an artificial intelligence algorithm to simulate the human brain nervous system, which has a strong self-learning ability and can deal with complex nonlinear models [9,10]. rough the connections of countless neurons, it can carry out huge parallel processing and analysis on the information of the previous input layer and then pass it to the next layer. A large amount of training can constantly update the weights of the neuronal connections in the front and rear layers, so as to achieve the goal of reducing error and meeting people's expectations. X-coordinate, Y-coordinate, and Z-coordinate of pile were regarded as input parameters for model training of the BP algorithm. Besides, the depth of bearing stratum h 4 and buried depth of pile H were regarded as output parameters. e detailed process can be described as the following steps. Advances in Civil Engineering e error between predicted values and measured values was analyzed. During the process of prediction, there was no correlation between the input and output parameters, which was a nonlinear function. As a result, the three-layer network for nonlinear function can meet the training requirements in the BP algorithm [17]. e diagram is shown in Figure 7. e S-type action function shown in (1) is its activation function [38]: where x k is the input parameter of the input layer; v j is the output parameter of hidden layer; y k is the output parameter of output layer; w jk is the connection weight of neurons between the input layer unit and the hidden layer unit; and w ij is the connection weight of neurons between hidden layer unit to output layer unit. e number of neurons of input layer, hidden layer, and output layer is, respectively, n, m, and l. e training process was as follows: (1) Since the activation function of the neural network is a logarithmic S-type function, it may have the problem of convergence; that is, the infinite or infinitesimal results appear in the calculation process. erefore, the input data of X-coordinate, Y-coordinate, and Z-coordinate and output data h 4 and H of the samples should be normalized first, which was to make these values vary from 0 to 1.
(2) e values randomly generated in the interval [−1, 1] were taken, and the initial values were assigned to the weights. (3) e independent variable parameters of the processed sample data were input at the corresponding nodes of the input layer, and the output values of the BP neural network were calculated at the corresponding nodes of the output layer through the action of weight and activation function. (4) e output values of the BP neural network training were compared with the expected values, and then the error between them was calculated. (5) e error obtained was propagated back from the output layer, and the weight was corrected according to the gradient method when it reached the first layer, and then step (3) was repeated and recalculated. (6) e above steps (1)-(5) were repeated until the error function satisfied equation: After the BP neural network had been trained according to the above steps, the trained network model could be used to predict the samples. Based on the measured data from engineering project, 43 and 10 piles were, respectively, selected as input and test vectors, and each pile was determined by three parameters. e BP algorithm with single hidden layer was adopted in this paper. It was difficult to determine the number of neurons in the hidden layer, and the neurons affected the determination of accuracy to a certain degree. If the number of neurons was too small, the algorithm had almost no ability to train. On the contrary, if the number of neurons was too large, the training time would be extended, which was easy to fall into the local optimal solution. As a result, the normal predicted values were not available to obtain. Generally, there are three methods to identify hidden layer neurons [39]: (1) For FangfaGorman theory, the relation between the number of neurons S and the input parameter N is S � log 2 N; (2) for Kolmogorov theory, the relation between the number of neurons S and the input parameter N is S � 2N + 1; (3) the relation between the number of neurons S and the input parameter N and the output parameter M is S � sqrt (0.43 MN + 0.12NN + 2.54 M + 0.77 N + 0.35) + 0.51. e input parameter N was 3, and the output parameter M was 2 in this BP training; thus, the calculated S using the above three method was, respectively, 1.58, 7, and 3.45. Since the number of neurons needed to be an integer,   Figure 3: e investigation site with pile location layout of dining hall. 6 Advances in Civil Engineering three values of 2, 4, and 7 were selected for prediction and the errors of them were compared in the later section. e transfer function in hidden layer and output layer was S-type tangent function and logarithmic function, respectively. e network training function was "traingdx," gradient descent method was used during learning process, and the learning rate was adaptive.

Implementation of PSO-BP Algorithm.
e process of the BP algorithm optimized by PSO is shown as follows [40]: (1) Firstly, the maximum number of iterations required, the number of independent variables required by the objective function, the maximum particle velocity, and the position information of particles were set as the whole search space. In addition, the velocity and position coordinates were initialized randomly in the velocity interval and search space, and each particle was given an initialized random flight velocity. (2) e fitness function was defined, and each particle would have an extreme value, which was the individual extreme value and the optimal solution of the unit particle. en, a global value was found from the optimal solution of all particles, that was, the global optimal solution. Finally, this optimal solution was updated after comparing with the global optimal solution obtained in history. (3) e updating velocity and position [41] were, respectively, shown in equations: where ω is inertial factor and a nonnegative value.
When ω is large, the ability to find the global optimal solution is strong, but the ability to find the local optimal solution is weak. When ω is small, the ability to find the global optimal solution is weak, but the ability to find the local optimal solution is strong. erefore, the ability to find the global and local optimal solution can be adjusted by different values of ω. C 1 and C 2 are learning factors, and current research studies [42] have investigated that a better solution can be obtained when C 1 and C 2 are constants. e values of C 1 and C 2 are between [0, 4], which are equal to 2 in general. e random (0, 1) is a random value on the interval [0, 1]. P id is the individual extremum of i-th variable at d-dimension; P gd is the global optimal solution at d-dimension.
e weights and thresholds optimized by PSO can be assigned as initial value for training and prediction of the BP algorithm [40]. e detailed process is shown in Figure 8.
e PSO-BP algorithm can be realized in two methods. (1) By combining the powerful global searching ability of the PSO algorithm with the local searching ability of the BP neural network, the global searching performance of the PSO algorithm is used to compensate for the topological structure, weight, and threshold of the BP neural network, so as to optimize the generalization and training ability, and the overall searching performance of the BP neural network. (2) e BP algorithm is added to the PSO algorithm, and the optimization performance of the PSO algorithm is improved through the powerful training and learning skills of the neural network, which can reduce the huge required workload and accelerate the convergence of the PSO algorithm. In this paper, the first method was adopted to obtain the optimal initial threshold through the PSO algorithm, and it was assigned to the BP algorithm to improve the efficiency and accuracy.
However, in the PSO algorithm, the convergence form of the particle is along the orbit, and the maximum velocity of the particle is always a finite value, which leads to certain limitations in the search area of the PSO, which cannot guarantee that it can search the whole feasible space, and the global convergence will be affected [33].

Implementation of QPSO-BP Algorithm.
Based on the traditional PSO algorithm, the QPSO algorithm randomizes the velocity of the particle. In the quantum space, the state of the particle is not represented by position and velocity vector, but by wave function. Due to the uncertainty principle, the probability of a particle appearing at a certain place x is expressed by a probability density function, and no longer along a fixed orbit. As a result, the position of the particle has no relationship with the previous position [43]. e evolution equations of each dimension of the particle state are shown by the following equations: where P id is the attractor of the i-th particle in the evolutionary iteration, X id is the current position of the i-th  Figure 5: e investigation site with pile location layout of 24# student dormitory.
particle, φ id and u id are uniformly distributed random numbers on [0, 1], and L id represents the characteristic length of the attractor and potential well, which is used to describe the search range of a particle, and L id can be shown in the following equation [43]: where MBP i d (t) is the mean best position, and α is the compression-expansion factor. By substituting equations (7) into (6), the iterative equation (8) below of quantum group evolution can be obtained: e size of the particle swarm is set as M. e implementation of its specific steps is as follows. (1) Initialize the particle swarm and set the maximum number of iterations.
(2) Determine and initialize the individual optimal extremum and global optimal extremum of the particle swarm.
(3) e fitness value of each particle is calculated. (4) e individual optimal extremum of each particle and global optimal extremum of the particle swarm are updated. (5) e new position of the particle swarm is calculated according to equation (8), and then the original particle swarm is updated. (6) Repeat steps (2)-(5) until the fitness values of the particle swarm meet the convergence condition.
e above is the principle and realization of QPSO, and the method of using the QPSO algorithm to optimize the BP neural network is similar to that of PSO. e explanation in Section 3.2 above can be used as a reference.

Prediction Results of Different Models.
e original 43 groups of data for training were shown in Table 1, which were prepared to form a database to predict the other 10  groups of samples to be evaluated, where X-coordinate, Ycoordinate, and Z-coordinate were input parameters and h 4 and H were output parameters. e original 10 groups of data to be evaluated are shown in Table 2.
e first was the prediction result of the BP neural network. As mentioned above, the number of hidden layer neurons was calculated by three different methods, which were 2, 4, and 7, respectively. erefore, three different prediction results and error comparison for h 4 and H based on the number of neurons in the hidden layer were obtained, which are shown in Figures 9-12.
It can be known from the above figures that different numbers of hidden layer neurons can affect the forecast results. When the number of neurons in the hidden layer was 7, the errors of the BP neural network in predicting h 4 and H were smaller than that of the other two neurons. is phenomenon indicated the forecast result of the second method mentioned in Section 3.1 named Kolmogorov theorem was the best. In addition, no matter how many neurons there were, the errors Input transform layer Input layer Output layer Output transform layer Hide layer Actual output Actual input  Advances in Civil Engineering between the prediction results of the sample using the BP neural network algorithm and the actual values were still very large. Especially, for the prediction results of h 4 , the maximum error was up to about 41% when the number of neurons was 2 and was up to about 31% when the number of neurons was 7.
Besides, it was found in Figures 9 and 10 that the curves of prediction results of the BP neural network were all relatively gentle and the basic trend was a straight line, which proved that the BP network is easy to fall into the characteristics of searching for local optimal solution. erefore, in order to compensate the lack of global search capacity of the BP network, the QPSO algorithm was going to be employed to optimize the BP network model when the number of neurons in the hidden layer was 7.
e linear fitting formula for predicting h 4 and H had been calculated. e calculation results indicated that the deviation between the prediction values and the actual values reached 58.8%, which demonstrated the necessity of using the QPSO-BP algorithm. In order to intuitively observe the error comparison between different algorithms, relative error was adopted to compare the accuracy of QPSO-BP, PSO-BP, and FWA-BP. e formula can be seen in the following equation: where x p is the predicted value and x a is the actual value. e parameter settings of the BP neural network and QPSO algorithm were as described below. e number of iterations of the BP network was 1000, the training goal of the BP network was 0.01, the learning rate of the BP network was 0.001, the population size of the QPSO algorithm was 20, the dimension of the QPSO algorithm was 30, and the iteration termination error of QPSO was 10 −7 . Compared with other models, QPSO was simple to operate and had fewer parameters to set. e predicted curves of different models are shown in Figures 13 and 14. e predicted error curves of different models are shown in Figures 15 and 16.
According to Figures 15 and 16, a conclusion can be confirmed that the relative error of QPSO-BP was the smallest compared with that of PSO-BP, FWA-BP, and linear fitting. In the process of predicting h 4 , the minimum relative error was 9.4%, the maximum relative error was only 14.7%, and all of the errors were basically around 11%; in the process of predicting H, the maximum relative error was merely 2.9%, which confirmed the powerful prediction accuracy of QPSO. Furthermore, the prediction curve of

10
Advances in Civil Engineering QPSO-BP possessed the characteristic of fluctuation, rather than an almost flat straight line like the BP network. is showed that QPSO successfully compensated for the lack of global search characteristics of BP and was not easy to fall into the endless loop of finding local optimal solution. After comparison and analysis, the accuracy of these models in descending order was QPSO-BP > PSO-BP > FWA-BP > linear fitting. Figure 17 shows the convergence curves of QPSO-BP, PSO-BP, and FWA-BP. It can be seen from the figure that the curve of decreasing fitness of QPSO-BP started to be very smooth and tended to a fixed value after iterating for about 25 times, and then the program stopped iterating when the number of iterations was around 143, which presented the optimal value of QPSO-BP had been discovered. Besides, from the comparison of the iterative curves of the other two algorithms, it can be seen that the decline rate of QPSO in the early stage was the fastest, and it was the first of the three models to converge in the subsequent iterative process, which demonstrated the capability of fast search and convergence of QPSO. e above conclusions indicated that it was feasible to use the QPSO-BP method in machine learning to predict the buried depth of pile foundation and the fluctuation of bearing stratum, and the particle swarm optimization algorithm was already a relatively mature optimization algorithm compared with many other algorithms, which was not difficult to implement. QPSO-BP has the advantages of fast search and fast convergence speed, simple operation, and high precision; therefore, it was more reasonable to apply this algorithm in this paper.

Error Analysis of Different Models.
In order to further prove the powerful prediction accuracy of QPSO, three statistical test methods were, respectively, used [44][45][46], namely, RMSE, MAE, and MAPE. e three formulas can be obtained from equations (10)- (12), and the error comparison of different algorithms can be seen in Table 3 in detail. RMSE is root mean square error, which represents the square root of the ratio of the square deviation between the actual value and the predicted value to the number of test sets. It evaluates the model by the following criteria: the smaller the value of RMSE, the smaller the error of the model and the higher the accuracy. When the actual value is completely consistent with the predicted value, it means this model is a perfect model: where x ai is the actual value, x pi is the predicted value, and n is the number of test sets. MAE is mean absolute error, which represents the average of the absolute values of the deviations of all predicted values and the arithmetic mean. It evaluates the model by the following criteria: the smaller the value of MAE, the smaller the error of the model and the higher the accuracy. Similar to RMSE, when the actual value is exactly the same as the predicted value, it is also a perfect model: MAPE is mean absolute percentage error, which measures the relative errors between the average predicted value and the actual value on the test set [40]. It evaluates the model by the following criteria, the smaller the value of MAE, the smaller the error of the model and the higher the accuracy. Similar to RMSE and MAE, it is also an ideal model when the actual value is consistent with the predicted value: According to the statistical tests, the minimum RMSE of QPSO-BP was only about 0.48, that of PSO-BP was about 0.99, and that of FWA was about 1. 94, while the maximum RMSE of BP reached 3.16. Similarly, the MAE and MAPE values of QPSO were the minimum values compared with those of the other three models, which confirmed our checking calculation above. Furthermore, by separately comparing the prediction results of h 4 and H, the accuracy of these models was as the following orders, QPSO-BP > PSO-BP > FWA-BP > BP, which was also echoed above.
Because of its high accuracy, fast convergence, and few parameters, QPSO successfully demonstrates its advantages in practical application.

Application of QPSO-BP in Practical
Engineering. In a practical project similar to the geological condition of the project in Section 2.2, the method proposed in this paper can be adopted to predict the distribution of bearing stratum and the buried depth of pile foundation. e specific implementation steps are as follows: (1) it is necessary and the most critical step for professional personnel to conduct geotechnical investigation, which determine whether the soil properties in the area meet the predicted conditions or not.
(2) e designers should determine the specific location of each pile foundation in AutoCAD based on the pile foundation design drawings and geotechnical investigation report, and then sort out the X-coordinate, Y-coordinate, and Z-coordinate, which must be based on the geodetic origin. (3) e QPSO-BP model is employed to predict the indicators to be predicted with a method similar to that in this paper. (4) According to the prediction results, the length of the precast pile in the area with different bearing depth can be determined, and then the pile number and corresponding coordinates are recorded. Finally the piles will be driven into the soil layer one by one in the actual engineering.

Conclusion
It is of great significance to determine the fluctuation of bearing stratum and the buried depth of pile foundation before construction, which can effectively reduce the project cost and avoid unnecessary losses. e QPSO-BP model was adopted to deal with this highly nonlinear problem, and the following part is a summary of the specific work completed in this paper: (1) Based on engineering examples, the BP network model was used to predict the fluctuation of bearing stratum and the buried depth of pile foundation in this paper. Besides, when the number of neurons S in the hidden layer and the input parameters N meet S � 2N + 1, the error of prediction results was the minimum. (2) e prediction results indicated that the BP network would easily fall into the local optimal solution, and the error between the predicted value and the actual value was quite large; the maximum error of which reached about 41% when the number of neurons was 2 and 31% when the number of neurons was 7. erefore, although the predicted value of the BP neural network could be used as a reference, its algorithm still had shortcomings and disadvantages. erefore, it needed to be optimized. (3) e QPSO algorithm was adopted to optimize the BP network, and then the model of QPSO-BP was no longer trapped in the infinite loop of searching for local optimal solution. e relative error was merely 9.4% in predicting h 4 and 2.9% in predicting H. Besides, two other optimization algorithms (FWA and PSO) were used to optimize the BP model, and the results demonstrated the high accuracy of QPSO-BP. e error of QPSO-BP was the smallest of the three algorithms. (4) ree different statistical tests (RMSE, MAE, and MAPE) were further employed to evaluate the accuracy of the three models. e calculation results of the three statistical tests were consistent with the above, and the accuracy followed the order of QPSO-BP > PSO-BP > FWA-BP. Data Availability e case analysis data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.