## 4 GTNet Earth Pressure Balance Formation Identification Method
### Data Encoder  
In this section, when the sand and gravel formation is excavated with discontinuous distribution, the tunneling signals, such as the cutterhead torque and cutterhead thrust, will fluctuate in response to the changes in the formation. Combined with the measured cutterhead tunneling data, the type of formation for cutterhead tunneling is identified based on the changes in the tunneling data, and a network model for formation identification in earth pressure balance shield tunneling based on GTNet is established. The data sequence is first passed through the input embedding layer to convert each data point mark into the corresponding vector representation, which is expressed as \(x_{emb}\) = Embedding (\(x\)). Since there is no positional information when the sequence enters the Transformer model, positional encoding is required to add positional information to each position in the input sequence. The formula is as follows:  
\[\mathrm{PE}_{(pos,2i)}=\sin\biggl{(}\frac{pos}{10000^{2i/d_{\mathrm{model}}}} \biggr{)} \tag{2}\]  
\[\mathrm{PE}_{(pos,2i+1)}=\cos\biggl{(}\frac{pos}{10000^{2i/d_{\mathrm{model}}}} \biggr{)} \tag{3}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Coefficient** & **Cutterhead Thrust** & **Cutterhead Torque** & **Tunneling Speed** & **Cutterhead Speed** \\ \hline Cutterhead thrust & 1 & 0.594 & 0.457 & 0.521 \\ Cutterhead torque & 0.594 & 1 & 0.550 & 0.507 \\ Tunneling speed & 0.457 & 0.550 & 1 & 0.166 \\ Cutterhead speed & 0.521 & 0.507 & 0.166 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Correlation analysis. In the formula, _pos_ is the position of the data point in the sequence, and \(i\) is the dimension of the position encoding. _dmodel_ is the dimension of the model. Equation (4) represents the position encoding at the given position pos and dimension _2i_, and Equation (5) represents the position encoding at the given position pos and dimension _2i_+1. Sine encoding is used in even positions and cosine encoding is used in odd positions. On the left side of the Transformer structure diagram is the encoder module. \(N\) being 6 indicates the superposition of six encoders. The encoder module includes multi-head self-attention, residual connection and layer normalization, and fully connected feedforward neural networks. The basis of multi-head self-attention is the self-attention mechanism. The Transformer model processes the input sequence based on the self-attention mechanism. The correlations among different positions are established. Thereby, the dependencies among various parts of the sequence are captured. Compared with traditional machine learning methods, Transformer has more advantages in parallel processing and handles long-distance dependencies more effectively. The self-attention mechanism is the core of the model. When the data is processed sequentially, the information at different positions is weighted to capture the dependencies. The query vectors, key vectors, and value vectors are introduced. The formula for calculating the attention scores of positions \(i\) and \(j\) is given as follows:  
\[x^{m}=\text{Attention}(Q_{i},K_{j},V_{i})=\text{SoftMax}\left(\frac{Q_{i} \cdot K_{j}^{T}}{\sqrt{d_{k}}}\right)V_{i},\ \ \ m\in\{c,s\} \tag{4}\]  
where \(Q_{i}\) is the position query vector \(i\), \(K_{j}\) is the position key vector \(j\), and \(d_{k}\) is the key vector dimension, and the query, key, and value vectors are expressed as follows:  
\[Q_{i}=x_{i}W^{Q},\ K_{j}=x_{i}W^{K},\ V_{i}=x_{i}W^{V} \tag{5}\]  
The role of SoftMax is to highlight the relationship between the two data, calculate the attention weights, and perform weighted summation on the value vectors at each position to obtain the attention score. For the model's attention layer and allowing the model to learn different information in different representation subspaces.