# An Established Theory of Digital Twin Model for Tunnel Construction Safety Assessment
## 4 Establishment of DT Construction Model
### Establish Virtual Model
#### 4.3.2 Data-Driven Machine Learning Models  
In the construction process, construction elements change with time. To make the virtual model keep a real-time reflection of the real world, machine learning algorithms are introduced into the knowledge model to analyze and process the data. Machine learning algorithms give the virtual model the ability to interact and evolve with the physical world by mining data rules.  
The long-short term memory (LSTM) and other time-space series prediction algorithms are used for prediction during construction [41]. Therefore, this paper chooses LSTM as the driving algorithm of the knowledge model.  
LSTM makes up for the defect of the Recurrent Neural Network which finds it difficult to solve the problem of long-distance dependence. LSTM consists of an input layer, an LSTM layer, a fully connected layer, and an output layer. In the LSTM layer, the transmission of information is controlled by the input gate, forget gate and output gate inside the neuron. Each gate has an activation function, called \(\sigma_{1},\sigma_{2},\sigma_{3}\). There is an output function in each input gate and the output gate. The specific structure is shown in Figure 7. In the figure, \"pro\" represents the multiplication relationship between elements, and \"sum\" represents the addition relationship between elements. \(f_{t}\) represents the processing result of the activation function of the forgetting gate, \(i_{t}\) represents the processing result of the activation function of the input gate, and \(o_{t}\) represents the result of the activation function processing of the output gate. Unit status is the core element of LSTM, and \(C_{t-1}\) is the memory information output from the previous unit, which is processed by the function of the current LSTM layer to obtain the output memory information \(C_{t}\). \(h_{t-1}\) and \(h_{t}\) respectively are the processing result of the activation function of the input gate, and \(o_{t}\) represents the result of the activation function processing of the output gate.  
Figure 6: The process of the establishment of a twin virtual model.  
identify the output results of the two LSTM units, and X represents input information. The specific relationship is as follows:  
1. Input and standardize data. The data loading algorithm is divided into the training set and test set, which are divided into 90% and 10% in this paper. The data are standardized to improve the efficiency and prediction accuracy of the algorithm, which can obtain better fitting and prevent training divergence.
2. Algorithm parameter setting. In this paper, the time window is positioned as a time step; at each time step of the input sequence, the LSTM network learns to predict the value of the next time step. The parameters of the prediction network are set, including training times, gradient threshold, initial learning rate, learning rate decline cycle, learning rate decline factor, etc.
3. Algorithm training and prediction effect check. In this paper, after the above parameters are set, the algorithm model is trained. If the training result is qualified, input the test group data to verify the prediction effect. If the training result is unqualified, adjust the above parameters and repeat the above steps.