# Detection Model on Fatigue Driving Behaviors Based on the Operating Parameters of Freight Vehicles
## 2 Materials and Methods
### Construction of Detection Model on Fatigue Driving Behaviors  
#### 2.3.1 Model Construction  
The \(k\)-nearest neighbor algorithm is used to construct the fatigue driving detection model. The core idea of the algorithm is that if the fatigue degree of the sample isunknown and most \(k\)-nearest samples of the sample in the feature space belong to a certain fatigue degree, then the sample also belongs to this degree. The \(k\) value is usually an integer not greater than 20 [35]. In order to enhance the accuracy and reliability of the \(k\)-nearest neighbor algorithm, the work considers the influence of the \(k\) value and the number of training samples on the accuracy of fatigue detection. The extracted sample set \(X\) of different fatigue degrees constitutes a matrix of \(n\times(m+1)\) (see Formula (5)). Since each vehicle operating parameter represents different attributes, and the value of each parameter has a different order of magnitude and value range, it is necessary to normalize each column of the parameter values before using the algorithm. In \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Vehicle Operating Parameters**} & \multirow{2}{*}{\begin{tabular}{c} **Time** \\ **Window** \\ **(S)** \\ \end{tabular} } & \multicolumn{2}{c}{**Mean (Standard Deviation)**} & \multicolumn{2}{c}{**Multiple Comparison Test (Z Statistics)**} \\ \cline{3-8}  & & \begin{tabular}{c} **Severe** \\ **Fatigue** \\ \end{tabular} & \multirow{2}{*}{\begin{tabular}{c} **Fatigue** \\ \end{tabular} } & \multirow{2}{*}{\
\begin{tabular}{c} **Alert** \\ **(1.482)** \\ \end{tabular} } & \multirow{2}{*}{\(\alpha^{2}\)/F} & \multirow{2}{*}{
\begin{tabular}{c} **Fatigue-Severe** \\ **Fatigue** \\ \end{tabular} } & \multirow{2}{*}{\(\alpha^{2}\)/F} & \multirow{2}{*}{\(\alpha^{2}\)/F} & \multirow{2}{*}{\(\alpha^{2}\)/F} \\ \cline{3-8}  & & & & & & & \\ \hline Standard deviation of heading angle & 20 & 4.621 & 1.655 & 0.465 & & & & \\ Absolute mean value of & (3.946) & (1.482) & (0.421) & 167.227 & \(-\)6.093 & \(-\)12.925 & \(-\)6.832 \\ Absolute mean value of & 20 & (0.951) & 0.488 & 0.161 & & & & \\ heading angular velocity & (1.117) & (1.238) & (0.091) & 180.424 & \(-\)6.155 & \(-\)13.417 & \(-\)7.262 \\ Standard deviation of heading angular velocity & 20 & 1.482 & 0.981 & 0.240 & 169.561 & \(-\)5.662 & \(-\)12.986 & \(-\)7.324 \\ Standard deviation of Roll angle & 20 & (4.026) & (5.201) & (0.130) & 169.561 & \(-\)5.662 & \(-\)12.986 & \(-\)7.324 \\ Absolute mean value of roll angular velocity & 20 & 0.866 & 0.649 & 0.462 & & & \\ Absolute mean value of lateral acceleration & 20 & (0.465) & (0.274) & (0.233) & 63.015 & \(-\)2.708 & \(-\)7.861 & \(-\)5.108 \\ Standard deviation of lateral acceleration & 20 & (0.160) & 0.374 & 0.312 & 47.591 & \(-\)4.247 & \(-\)6.832 & \(-\)3.585 \\ Standard deviation of lateral acceleration & 30 & (0.182) & (0.132) & (0.131) & 161.106 & \(-\)5.108 & \(-\)12.617 & \(-\)7.509 \\ Standard deviation of lateral acceleration & 15 & 0.616 & 0.463 & 0.355 & & & & \\ Standard deviation of roll angular velocity & (0.137) & (0.100) & (0.083) & 167.455 & \(-\)5.908 & \(-\)12.925 & \(-\)7.016 \\  & 0.588 & 0.468 & 0.383 & & & & \\ angular velocity & (0.287) & (0.192) & (0.187) & 35.318 & \(-\)3.400 & \(-\)5.908 & \(-\)3.508 \\ Driving duration & / & 4.033 & 3.879 & 1.949 & 146.645 & \(-\)6.532 & \(-\)11.417 & \(-\)8.993 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Statistical analysis results of vehicle operating parameters (significantly affected) under different fatigue degrees. this paper, the maximum-minimum method is used for normalization (see Formula (6)), and the normalized sample set \(X^{*}\) of three fatigue degrees is obtained [36]. \[X=\left[ \begin{array}{cccccc}x_{11}&\ldots&x_{1t}&\ldots&x_{1m}&x_{1m+1}\\ &&\vdots&\vdots&\vdots&\vdots\\ x_{k1}&\ldots&x_{kt}&\ldots&x_{km}&x_{km+1}\\ &&\vdots&\vdots&\vdots&\vdots\\ x_{n1}&\ldots&x_{nt}&\ldots&x_{mm}&x_{nm+1}\end{array}