# Replacement of Fault Sensor of Cutter Suction Dredger Mud Pump Based on MCNN Transformer
## 3 The Model Framework and Data Preprocessing
### Data Cleaning and Normalization  
To validate the prediction of shaft seal water pressure under the introduced algorithm, the research data are sourced from the construction data of the \"Hua An Long\" CSD on 1 November 2022. These data comprises 97 dimensions(columns) from 18:00:20 to 23:59:58 BJT. Seventy percent of the dataset is partitioned randomly for training the machine learning model, with the remaining thirty percent reserved for model performance assessment. An illustrative sample of the system monitoring data from CSD is presented in Table 1.  
Before training the algorithm, it is necessary to filter out data from non-dredging operations and abnormal data, which can guarantee the efficacy of the training dataset. To achieve this, three rules are proposed for defining and distinguishing non-dredging operations and abnormal data: (1) Sensing parameters unrelated to dredging, including direction; (2) Data recorded during the start and end stages. Figure 4 illustrates the changes in the shaft seal water pressure of the underwater pump and 1# pump during the entire operation process. Specifically, subfigures 1 and subfigure 4 and 5 represent the start and end state of dredging respectively. It is worth to mentioning that the complete dredging process is divided into three stages: the initial stage, the operation stage and the finish stage. The initial stage and the finish stage belong to the non-dredging state, and their values transition from 0 to stable value and then back to 0. Thus, this part of the data can be removed; (3) Images 2 and 3 in Figure 4 are during the operation and the data theoretically  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Time**} & **Underwater Pump** & **Underwater Pump** & **34 Pump Shan Soil** & & **Underwater Model** & **24 Road Pump** \\  & **Shift Soil Water** & **Second Soil Water** & **Wave Pressure (Bat)** & **Wave Pressure (Bat)** & **Wave Speed (Bat)** & **Wave Speed (Bat)** \\ \hline
2022-141 1800-2  
belongs to the dredging operation stage, but their value changes suddenly and irregularly. Thus, this part of the value can be deleted or interpolated. To be more specific, in the algorithm of abnormal data processing, firstly, the upper and lower quartiles (Q1 and Q3) of each column of data were calculated. Then, the interquartile range (IQR) was calculated as Q1-Q3, and the threshold for outliers was defined as 1.5. Then, the lower and upper bounds for determining outliers were calculated as follows:  
\[Lower_{Bound} =\text{Q}_{1}\ +\text{threshold}\times\text{IQR} \tag{1}\] \[Upper_{Bound} =\text{Q}_{3}+\text{threshold}\times\text{IQR} \tag{2}\]  
Finally, outliers were removed within the upper and lower limits. Taking one monitoring point (Shaft seal water pressure) of CSD as an example, this method effectively detects the outlier and remove it, this process can be summarized as Figure 5.  
The construction data features for CSD originate from diverse sources, exhibiting varying dimensions, orders of magnitude, and significant disparities in their scales, making them unsuitable for direct computation [32]. Hence, the application of normalization is typically an essential preprocessing step in machine learning [33]. This study focuses on predicting shaft end seal water pressure, which is a representative multi-input single-output prediction model. To ensure precision and facilitate comparison, normalization is necessary to standardize dimension and span variations. Normalization can be expressed as Equation (3). \[\text{x}^{\prime}=\frac{\text{x}-\text{min}(\text{X})}{\text{max}(\text{X})- \text{min}(\text{X})}\times(\text{b}-\text{a})+\text{a} \tag{3}\]  
Figure 4: Shaft seal water pressure during dredging stage. Figure 5: Outlier detection and repair. where x is the original data point, min(X) and max(X) are the minimum and maximum value of all data points in the data set, respectively, a and b are the minimum and maximum values of the target range.