# Prediction of Truck Fuel Consumption Based on Crossformer-LSTM Characteristic Distillation
## 4 Data Source and Preprocessing
### Data Preprocessing
#### 4.2.2 Outlier Handling  
The following data processing methods were employed to ensure the accuracy of model training and prediction: First, we removed missing values from the dataset to maintain data integrity and consistency. Following this step, the dataset contains 14,439 samples. Second, for excessively large or small outliers, we used box plots to analyze each feature. The box plot calculates the quartiles (\(Q1\), \(Q3\)) and interquartile range (\(IQR\)) to determine \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Vehicle ID** & **Timestamp** & **Altitude (m)** & **Speed (km/h)** & **RFM** & **Cumulative Fuel (L)** & **Mileage (km)** &... \\ \hline Vehicle A & 6 January 2021 9:12:32 & 297 & 33 & 1160 & 100,742 & 238,172.3 &... \\ Vehicle A & 6 January 2021 9:12:37 & 295 & 35 & 1160 & 100,743 & 238,172.3 &... \\ Vehicle A & 6 January 2021 9:12:42 & 301 & 30 & 870 & 100,743 & 238,172.3 &... \\ \(\vdots\) & : & : & : & : & : & : \\ Vehicle A & 6 January 2021 9:22:47 & 317 & 39 & 1150 & 100,743 & 238,176.2 &... \\ Vehicle A & 6 January 2021 9:22:52 & 319 & 41 & 1130 & 100,744 & 238,176.2 &... \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Vehicle data sample. \begin{table}
\begin{tabular}{c c} \hline \hline
**Feature (Abbreviation)** & **Description** \\ \hline Braking Count (BC) & Total number of braking events within two kilometers \\ RPM & Average RPM within two kilometers \\ Average Altitude (AA) & Average altitude within two kilometers \\ Uphill (Uh) & Average uphill height within two kilometers \\ Downhill (Dh) & Average downhill height within two kilometers \\ Peak Speed (PS) & Maximum speed within two kilometers \\ Bottom Speed (BS) & Minimum speed within two kilometers \\ Average Speed (AS) & Average speed within two kilometers \\ Speed Standard Deviation (SSD) & Standard deviation of speed within two kilometers \\ Acceleration Time (AT) & Acceleration time within two kilometers \\ Deceleration Time (DT) & Deceleration time within two kilometers \\ Cruise Time (CT) & Cruise time within two kilometers \\ Acceleration Share (AS) & Share of acceleration time relative to total time within two kilometers \\ Deceleration Share (DS) & Share of deceleration time relative to total time within two kilometers \\ Cruise Share (CS) & Share of cruise time relative to total time within two kilometers \\ Fuel Consumption (FC) & Fuel consumption within two kilometers \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Feature Description. the upper and lower bounds for outliers. Specifically, the outlier bounds are calculated as follows:  
\[\textit{Upper Bound}=Q3+1.5\times IQR \tag{7}\]  
\[\textit{Lower Bound}=Q1-1.5\times IQR \tag{8}\]  
In the data preprocessing step, values falling outside of the established bounds were adjusted to the corresponding upper or lower limits. This was performed to restrict outliers within a reasonable range, minimizing their influence on model training and prediction. It is important to note that, for outlier detection, we define outliers as extreme values that significantly deviate from the normal data distribution. For instance, an excessively high number of braking events is often associated with equipment malfunction or other abnormal conditions. However, occasional braking due to traffic accidents or congestion is not considered an outlier, as it is temporary and does not affect the general pattern of braking frequency observed in the two-kilometer intervals. Therefore, such cases are not excluded and do not negatively impact the model. To further visually demonstrate the outliers in the data, we plotted box plots to show the distribution of each feature. Given the large volume of data and the number of features, displaying box plots for all features may result in overly complex visuals. Therefore, we selected four key features--PS, BS, MS, and SSD--and presented box plots for 30 data points of each feature, as shown in Figure 2. The first subplot displays the box plot for the raw data, while the second subplot shows the box plot after outlier handling.