# Prediction Model for Shield Tunneling Roll Angle and Pitch Angle: A PCA-PSO-LGBM Approach
## 3 Case Study
### Data Analysis and Processing
#### 3.2.1 Analysis and Processing of Excavation Parameters  
The shield machine relies on sensors to record various parameters during the excavation process. The recording frequency of the shield tunnelling parameters collected in this article is once every minute, totaling 474 rings of data. Each ring of data includes multiple moments of cutterhead speed, roll angle, pitch angle, and other excavation parameters. Taking the data of the 636 th ring as an example, the process of constructing the dataset in units of rings is illustrated below. 1. Delete data from non-excavation states  
The excavation process of the shield machine is not just simple forward movement. It also includes various non-excavation states such as stopping, inspection, maintenance, and tool replacement. The data from these non-excavation states are of little significance to this study and need to be identified and deleted. Figure 8 shows the changes in cutterhead torque, total thrust force, tunnelling speed, and cutterhead speed for Ring 636. It can be seen that a large portion of the data in a ring are zero, as indicated by the red line in the figure. Only when the cutterhead torque, total thrust force, tunnelling speed, and cutterhead speed are all non-zero can it be determined that the shield machine is in an excavation state. Therefore, a function to discriminate the excavation state of the shield machine is established:  
\[f(x)=\left\{ \begin{array}{l}1,(x\
eq 0)\\ 0,(x=0)\end{array} \right., \tag{11}\]  
\[S=f(CT)\cdot f(TF)\cdot f(AS)\cdot f(CS), \tag{12}\]  
\[S=\left\{ \begin{array}{l}1,(Excavation\;\mbox{state})\\ 0,(Non-excavation\;\mbox{state})\end{array} \right., \tag{13}\]  
Figure 7: Geological profile of shield section. where \(f(x)\) is the excavation state discrimination function, \(S\) represents the shield excavation state, and \(CT\), \(TF\), \(AS\), \(CS\) represent the cutterhead torque, total thrust force, tunnelling speed, and cutterhead speed, respectively. After obtaining the excavation state data for each ring of the shield, it is also necessary to identify and delete any outliers within each ring. These outliers are noise data generated during the recording process at the shield site, often deviating significantly from most of the data and not reflecting the true excavation state of the shield. This article used the box plot method to identify outliers in the excavation parameters for each ring of the shield separately. A box plot is a statistical graph composed of a box and a pair of whiskers, used to display the distribution of one or more sets of continuous quantitative data. The box is made up of the first quartile \(Q_{1}\), the median (second quartile \(Q_{2}\)), and the third quartile \(Q_{3}\). The range of the whiskers is determined according to the following equation:  
\[1.5 IQR=1.5\times(Q_{3}-Q_{1}), \tag{14}\]  
Values outside the ends of the whiskers can be considered outliers. Additionally, a median line and mean value can also be added to the box plot. Figure 8: The variations in the main tunnelling parameters for Ring 636: (**a**) cutterhead torque; (**b**) total thrust force; (**c**) cutterhead speed; (**d**) tunnelling speed. Taking Ring 636 as an example, Figure 9 shows the data distribution of roll angle and pitch angle. It can be seen that the data distributions of both roll angle and pitch angle are relatively concentrated, with three outliers identified in the roll angle and no outliers in the pitch angle. The identification of outliers for other excavation parameters followed this same process. After identifying and deleting the outliers within each ring's excavation parameters, the average value of each excavation parameter was calculated to represent the value of that parameter for the ring. Among the numerous processed excavation parameters, we selected 11 directly adjustable excavation parameters as input parameters for the subsequent model based on the relevant literature [24; 29; 30] and suggestions from on-site construction personnel.