# Detection Model on Fatigue Driving Behaviors Based on the Operating Parameters of Freight Vehicles
## 2 Materials and Methods
### Extraction of Vehicle Operating Parameters  
#### 2.2.1 Data Preprocessing  
The data sampling frequency of the vehicle operating parameters is 1 s, and the driving duration is calculated according to the vehicle operating time and speed value. Taking into account factors such as data collection errors, short-term temporary parking, and other factors that do not relieve driver fatigue, when the duration operating velocity is continuously 0 km/h and does not exceed 200 s, then the vehicle is regarded as in a temporary stop state. This paper considers that the vehicle is still in operation. If the calculated driving duration for some samples is less than 300 s, it is still regarded as the vehicle is not running. In addition, if the driving duration of some samples is longer than 300 s, but the speed at each moment during the driving duration is lower than 10 km/h, it is still regarded as the vehicle is not running. Due to the large amount of data, the Python software is used to write a program to calculate the driving duration and extract the start and end time of each segment of driving.  
The operating parameters of the vehicle directly obtained from the system mainly include heading angle, roll angle, speed, lateral acceleration, and longitudinal acceleration. By deriving the heading angle, roll angle, and speed, the heading angular velocity, roll angular velocity, and acceleration can be obtained. In this way, eight operating parameters of the vehicle can be obtained. As the degree of fatigue deepens, the driver's ability to perceive, react, and judge will become weaker, resulting in abnormal fluctuations in vehicle control variables and state variables. In this paper, by monitoring the heading angle, roll angle, speed, lateral acceleration, and longitudinal acceleration of the vehicle, the heading angle, roll angle, and velocity parameter data are derived to obtain the heading angular velocity, roll angular velocity, and acceleration, and the vehicle is monitored through these parameters: whether there is a deviation in the trajectory of the vehicle, whether the vehicle is driving smoothly, and whether there are behaviors such as sudden braking, rapid acceleration, sharp turning, and rapid lane change. Taking the heading angle \(\alpha\) by deriving to obtain the heading angular velocity \(\beta\) as an example, since the vehicle operating parameter is a smooth discrete function and the information density is large enough (the time interval is 1 s), the increment of the independent variable when deriving the derivation is \(\Delta t=1\), and the specific calculation is Formula (1) [32].  
Take the vehicle heading angle \(\alpha\) as an example:  
\[\beta=\frac{d\alpha}{dt}=\underset{\Delta t=1}{lim}\frac{\alpha_{t}-\alpha_{t- 1}}{\Delta t}=\frac{\alpha_{t}-\alpha_{t-1}}{1}=\alpha_{t}-\alpha_{t-1} \tag{1}\]  
where \(\beta\) is the current heading angular velocity of the vehicle at the current moment \(t\); \(\alpha_{t}\) is the current heading angle value at moment \(t\); and \(\alpha_{t-1}\) is the vehicle heading angle value at moment \(t-1\).  
On the basis of obtaining the eight operating parameters of the vehicle, the absolute mean value and standard deviation of each parameter are calculated under different time windows (5 s, 10 s, 15 s, 20 s, and 30 s), so that a total of eighty operating parameters of the vehicle are obtained. Taking the heading angle \(\alpha\) as an example, the calculation method is shown in Formulas (2) and (3).  
\[\alpha_{mean}=\frac{1}{N}\sum_{i=1}^{N}\lvert\alpha_{i}\rvert \tag{2}\]  
where \(\alpha_{mean}\) is the absolute mean value of heading angle; \(N\) is the length of the time window, with the \(N\) values of 5, 10, 15, 20, and 30; and \(\alpha_{i}\) is the heading angle value of the \(i\)-th sample.  
\[\alpha_{STD}=\sqrt{\frac{1}{N-1}(\alpha_{i}-\alpha_{m})^{2}} \tag{3}\]where \(\alpha_{STD}\) is the standard deviation of heading angle; and \(\alpha_{m}\) is the mean value of the heading angles.  
\[\alpha_{m}=\frac{1}{N}\sum_{i=1}^{N}\alpha_{i} \tag{4}\]