## 3 Training Methods and Prediction Results of Fully Connected Neural Networks  
The data were input into the artificial neural network model for training. It was found that due to the small amount of data and low data complexity, there will be obvious overfitting problems, and the operation speed will be greatly slowed down, when the neural network structure has more than three hidden layers. The prediction results are shown in Figure 5. It can be seen that the training set fits well, but there is a large deviation in the test set data. Therefore, the number of hidden layers in the neural network model is determined to be one to two, and four different numbers of neurons, three, five, eight, and ten, are tried for each hidden layer, and the neural network is constructed in a fully connected manner with the same number of neurons in adjacent hidden layers. The activation function used is the tanh function, and the LM, BR, and GD algorithms are used to predict the physical and mechanical properties of the soil. Among them, since the BR algorithm can complete the validation during training, no validation set is needed. The learning rate of the model is 0.001, and the convergence standard is 0.0001.  
Figure 4: A genetic algorithm is used to improve the neural network structure.  
The process of constructing the neural network model begins with organizing the input and corresponding output data into an i \(\times\) j matrix form, where i represents the dimension of the input data, and j represents the number of input data samples. Because different types of variables may differ significantly in absolute value, it is necessary to normalize the input data to ensure that all variables have equal impact weight on the results. The normalization is carried out according to Equation (8), where \(x_{\text{max}}\) and \(x_{\text{min}}\) represent the maximum and minimum values of the samples, respectively; x represents the input value; and \(x_{g}\) represents the normalized output result.  
\[x_{g}=\frac{x-x_{\text{min}}}{x_{\text{max}}-x_{\text{min}}} \tag{8}\]  
After normalization, these input values are processed through the input layer and then enter the hidden layer. The entire matrix calculation process is shown in Equation (9) [34], where \(N^{t}\) is the neural network value matrix of the \(t\)-th layer, and \(W_{t}\) and \(B_{t}\) are the weight matrix and bias matrix, respectively, between the \(t\)-th and (\(t-1\))-th layers.  
\[N^{t}=\tanh(W_{t}N^{t-1}+B_{t})=1-\frac{2}{\exp[2(W_{t}N^{t-1}+B_{t})+1]} \tag{9}\]  
The output layer directly outputs the calculated value. After the data in the hidden layer is propagated to the output layer, it undergoes calculation and inverse normalization to output the corresponding predicted value \(y^{c}\). The calculation process is shown in Equation (10), where \(y^{c}\) is the predicted value, and \(y_{\text{min}}\), \(y_{max}\) are the minimum and maximum values in the measured data, and the inverse normalization operation is performed on the output value of the output layer.  
\[y^{c}=y_{\text{min}}+\left\{1-\frac{2}{\exp[2(W_{q}N^{q-1}+B_{q})+1]}\right\} (y_{max}-y_{min}) \tag{10}\]  
After obtaining the predicted values, the mean square error \(\epsilon^{2}\) between the predicted values and the actual values is analyzed using Equation (11) as the criterion. Backpropagation is used to continuously optimize the bias matrix and weight matrix to minimize the mean square error and obtain the optimized neural network model. Finally, the trained neural network model is used to predict soil properties.  
\[\epsilon^{2}=(y^{c}-y)^{2} \tag{11}\]  
Figure 5: Prediction results of soil plastic limit based on an ANN with three hidden layers.