## 3 Shield Tunneling Anomaly Detection and Scenario Identification
### Feature Presentation and Identification of Shield Tunneling Scenario  
The anomaly detection model can only feedback whether anomalies occurred during the shield tunneling process. To provide effective references for the construction process, it is necessary to further identify the scenarios of anomalies that occur. Therefore, we use accumulated historical shield tunneling data and corresponding scenarios to explore the features of known shield tunneling scenarios, providing references for identifying pending shield tunneling scenarios. We achieve the representation and identification of shield tunneling scenarios based on the correlation of multidimensional construction parameters. The model structure is shown in Figure 3.  
For a specific shield tunneling scenario \(r\), it is assumed that the shield tunneling scenario is represented by the correlation of \(m\) construction parameters in a continuous sequence of \(n\) rings. The correlation is represented using the Pearson correlation coefficient, which is calculated as follows:  
\[corr_{X,Y}=\frac{\text{cov}(X,Y)}{\sigma_{X}\sigma_{Y}} \tag{6}\]  
In the Formula (6), \(\text{cov}(X,Y)\) represents the covariance between variable \(X\) and variable \(Y\), while \(\sigma_{X}\) and represent the standard deviations of variable \(X\) and variable \(Y\), respectively. Therefore, the final feature matrix representing the shield tunneling scenario \(r\) is constructed as follows:  
\[s_{r}=\begin{cases}corr_{11}^{1}&corr_{12}^{1}&\dots&corr_{(m-1)m}^{1}\\ corr_{11}^{2}&corr_{12}^{2}&\dots&corr_{(m-1)m}^{2}\\ \dots&\dots&\dots&\dots\\ corr_{11}^{n}&corr_{12}^{n}&\dots&corr_{(m-1)m}^{n}\end{cases}\]  
Figure 3: Shield tunneling scenario presentation and identification model.  
Assuming that there are \(q\) known scenarios in the historical project data, there will be \(q\) feature matrices representing the known shield tunneling scenarios. These matrices form a parameter correlation base of known shield tunneling scenarios, denoted as \(S_{known}=\left\{s_{1},s_{2}\ldots,s_{q}\right\}\).  
The different dimensions of the feature matrix representing the shield tunneling scenarios have different meanings. The Mahalanobis distance takes into account the differences between different dimensions when calculating matrix similarity [35]. Therefore, we use the Mahalanobis distance between feature matrices of different shield tunneling scenarios as a measure of similarity for shield tunneling scenarios. A smaller Mahalanobis distance indicates a higher similarity between scenarios. Specifically, when identifying a pending scenario, the first step is to construct a feature matrix \(s\) that represents the characteristics of that shield tunneling segment. Next, \(s\) is compared with the feature matrices in a parameter correlation base of known shield tunneling scenarios. The matching formula is shown as Formula (7).  
\[s\_result=\text{argmin MD}(s,\,s_{i})\ (i=1,2,\ldots,q,s_{i}\in S_{known}) \tag{7}\]  
In Formula (7), MD\((s,\,s_{i})\) represents the Mahalanobis distance between the feature matrix s and that of a known shield tunneling scenario \(i\). A smaller value indicates a higher similarity between the pending scenario and scenario \(i\). And \(s\_result\) represents a known shield tunneling scenario with a feature matrix most similar to \(s\).  
In addition, we also set a similarity threshold \(\theta\) based on the distribution of MD values for the same scenarios in the parameter correlation base of known shield tunneling scenarios. If MD \((s,\,s_{s\_result})<\theta\), the pending scenario belongs to the shield tunneling scenario \(s\_result\). If MD \((s,\,s_{s\_result})>\theta\), the pending scenario will be identified as a new scenario.