A Real-Time Early Warning Framework for Multi-Dimensional Driving Risk of Heavy-Duty Trucks Using Trajectory Data
Abstract
1. Introduction
2. Literature Review
2.1. Driving Behavior Risk Measurement
2.2. Driving Style Clustering
2.3. Driving Behavior Risk Warning
- (1)
- Risk measurement has evolved from evaluating single risk indicators to utilizing multi-dimensional dynamic features extracted from trajectory data. This data-driven approach, which captures subtle vehicle kinematics, has become the cornerstone for significantly enhancing the accuracy and timeliness of warnings, holding substantial technical value for the proactive prevention of traffic accidents.
- (2)
- Driving style clustering has progressed from simple behavior frequency counts to incorporating techniques such as feature engineering and unsupervised learning. By categorizing drivers into groups with distinct risk profiles, such as cautious, aggressive, or fatigue-prone, this approach enables the development of targeted safety interventions and management strategies.
- (3)
- Modern real-time warning systems have progressed beyond generic notifications to providing context-sensitive alerts. Through the integration of multi-source data and sophisticated models like LightGBM, these systems analyze complex scenarios (e.g., lane-changing or car-following on slopes) in real-time to evaluate dynamic risk levels. Consequently, they generate targeted guidance and decision-making support for drivers based on the specific driving context.
3. Methodology
3.1. Data Description and Preprocessing
3.2. Definition of Risk Metrics
3.2.1. Quantitative Metrics
- (1)
- Lateral displacement coefficient of variation R1(t)
- (2)
- Longitudinal acceleration fluctuation index R2(t)
- (3)
- Dynamic collision risk index R3(t)
3.2.2. Threshold-Based Metrics
- (1)
- Lateral displacement threshold metric R4(t)
- (2)
- Longitudinal acceleration threshold metric R5(t)
- (3)
- Car-following risk threshold metric R6(t)
3.3. Risk Measurement Model Development
- (1)
- Data acquisition
- (2)
- Data normalization
- (3)
- Calculation of information load
- (a)
- Variability (represented by standard deviation)
- (b)
- Conflict (based on inter-indicator correlation)
- (c)
- Comprehensive quantification of information content
- (4)
- Weight calculation
3.4. Clustering Procedure
- (a)
- Data preprocessing: The comprehensive risk score series is standardized using Z-score normalization to eliminate scale effects.
- (b)
- Determine the number of clusters k: The elbow method is applied by examining the inflection point in the within-cluster sum of squared errors (SSEs) across different k values to identify the optimal number of clusters.
- (c)
- Perform K-means++ clustering: Centroids are initialized according to the algorithm’s procedure, followed by an iterative “assignment-update” process until the centroids stabilize. After clustering, each cluster represents a risk pattern, which can be labeled as a distinct risk level, thereby achieving a classified assessment of driving behavior risk.
3.5. Real-Time Warning Procedure
- (a)
- Initialization and Data Stream: After system initialization, a sliding window with a length of 40 frames is maintained for the real-time input data stream, storing the risk category labels (provided by the aforementioned clustering results) for the most recent 40 time frames.
- (b)
- Parallel Prediction: When a new frame of data arrives, both the Mode Method and the Last Value Method are applied simultaneously based on the category sequence within the current window to predict the risk category for the next frame.
- (c)
- Warning Trigger: If the output of either prediction method (or a combined prediction result according to predefined rules) is a “high-risk” category, the system immediately triggers a warning signal to alert the driver or monitoring platform.
- (d)
- Window Update: The newly arrived actual data and its category label are added to the window, and the oldest frame of data is removed, keeping the window size constant to enable rolling prediction.
4. Results and Analysis
4.1. Results of Risk Measurement and Clustering
4.1.1. Risk Measurement Result
4.1.2. Clustering Analysis
- (a)
- Type 1 (low-risk behavior, proportion: 66.70%): This type had the lowest comprehensive score of 0.3086. The mean values of all quantitative indicators (R1~R3) were below the overall average, and the threshold indicators (R4~R6) were almost never triggered. The box plot showed a concentrated distribution with no outliers, indicating stable driving behavior with controllable risk, consistent with the definition of “low risk”.
- (b)
- Type 2 (medium-risk lane-pressing behavior, proportion: 2.37%): This type consistently triggered the lateral displacement threshold R4(t), indicating a tendency to persistently drive on or over lane markings, which poses risks to vehicles in adjacent lanes. The box plot contains outliers, suggesting that some behaviors may involve additional risks (such as sudden acceleration/deceleration) and should be closely monitored in warning systems.
- (c)
- Type 3 (medium-risk weaving behavior, proportion: 26.69%): The coefficient of variation for lateral displacement R1(t) was the highest among all types at 2.5684, reflecting frequent trajectory oscillations. Although no thresholds were triggered, the high dispersion in the box plot (multiple outliers) indicates unstable behavior that may cause surrounding vehicles to take evasive action.
- (d)
- Type 4 (high-risk behavior, proportion: 0.03%): This type had the highest comprehensive score of 1.0650, and its dynamic collision risk index R3(t) was also the highest at 1.7878. The other three indicators were also at elevated levels, indicating a combination of multiple risks such as lateral displacement, sudden acceleration/deceleration, and tailgating. Although this behavior is extremely rare, it carries a very high accident probability and requires real-time intervention.
- (e)
- Type 5 (medium-risk sudden acceleration/deceleration behavior, proportion: 0.03%): This type had the highest longitudinal acceleration fluctuation index R2(t) at 3.4196 and consistently triggered the longitudinal acceleration threshold R5(t), indicating abrupt acceleration/deceleration that may lead to rear-end collisions. Similar to Types 2 and 3, the box plot showed outliers, suggesting potential compound risks.
- (f)
- Type 6 (medium-risk tailgating behavior, proportion: 4.18%): This type consistently triggered the following risk threshold R6(t), indicating tailgating behavior that poses risks to the leading vehicle in the same lane. Outliers in the box plot suggest that some behaviors may be accompanied by sudden acceleration or trajectory deviation, requiring contextual analysis to determine the root cause of the risk.
4.2. Performance Evaluation of the Warning Method
4.2.1. Overall Accuracy Comparison
4.2.2. Class-Balanced and High-Risk Event Performance
4.2.3. Performance Analysis of Early Warning Methods Based on Confusion Matrix
4.3. Detailed Case Analysis
- (1)
- Type 1 (low-risk behavior): the final-value method achieved an accuracy of 98.87%, substantially outperforming the mode method (88.61%). This difference can be attributed to the stable nature of Type-1 behavior. By utilizing the most recent state, the final-value method reliably captures the current low-risk profile. In contrast, the mode method depends on historical data patterns, which may introduce latency-related errors.
- (2)
- Type 2 (medium-risk lane departure) and Type 6 (medium-risk following too closely): the final-value method achieved accuracy rates exceeding 98% in both cases, whereas the mode method attained only approximately 83% to 85%. These results indicate that the final-value method demonstrates markedly higher sensitivity to short-term, medium-risk behavioral changes and exhibits superior adaptability.
- (3)
- Type 3 (medium-risk weaving driving): the final-value method achieved an accuracy of 96.79%, significantly outperforming the mode method (68.79%). This substantial gap indicates that weaving behavior is inherently dynamic and transient. The final-value method effectively captures such real-time trajectory variations, whereas the mode method, relying on a longer historical window, tends to smooth out critical risk features. This often results in delayed detection and increased misjudgment.
- (4)
- Type 4 (high-risk behavior) and Type 5 (medium-risk rapid acceleration/deceleration): for Type 4, the accuracy of the mode method was extremely low (20.00%) compared to a relatively high accuracy of 86.67% for the final-value method. In Type 5, the mode method failed entirely (0.00% accuracy), whereas the final-value method achieved 66.67%. This stark contrast likely stems from the very small sample sizes of both types (each representing only 0.03% of the total). Relying on historical patterns derived from larger datasets, the mode method struggles to generalize effectively to such rare behaviors. While the final-value method was less affected by sample scarcity, its accuracy in these two cases remained the lowest among all behavior types. This further highlights the inherent challenge in predicting rare, high-risk events.
5. Discussion
5.1. Risk Clustering Results Analysis
5.2. Model Performance and Comparative Analysis
5.3. Implications of Rare High-Risk Event Detection
5.4. Limitations and Future Research
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Zhang, X. Research of Truck Driver Safety Assessment and Risk Cause. Master’s Thesis, North China University of Technology, Beijing, China, 2024. [Google Scholar]
- Yu, Z.; Cai, K. Perceived risks toward in-vehicle infotainment data services on intelligent connected vehicles. Systems 2022, 10, 162. [Google Scholar] [CrossRef]
- Li, H.; Wang, W.; Yao, Y.; Zhao, X.; Zhang, X. A review of truck driver persona construction for safety management. Accid. Anal. Prev. 2024, 206, 107694. [Google Scholar] [CrossRef]
- Hua, J.; Li, B.; Wang, L.; Lu, G. How left-turning vehicles deal with conflicts at intersections: Driving behavior model based on relative motion risk quantification. Phys. A Stat. Mech. Its Appl. 2025, 661, 130393. [Google Scholar] [CrossRef]
- Wen, J.; Zhan, X.; Wu, C.; Xiao, X.; Lyu, N. Risky driving behavior propagation: A novel stochastic SIR model and two-stage risk quantification method. Phys. A Stat. Mech. Its Appl. 2023, 629, 129192. [Google Scholar] [CrossRef]
- Xiong, J.; Chen, Z. Truck driving assessment for Chinese logistics and transportation companies based on a safety climate test system. Systems 2024, 12, 177. [Google Scholar] [CrossRef]
- Li, Y.; Pu, Z.; Liu, P.; Qian, T.; Hu, Q.; Zhang, J.; Wang, Y. Efficient predictive control strategy for mitigating the overlap of EV charging demand and residential load based on distributed renewable energy. Renew. Energy 2025, 240, 122154. [Google Scholar] [CrossRef]
- Chen, X.; Wu, S.; Shi, C.; Huang, Y.; Yang, Y.; Ke, R.; Zhao, J. Sensing data supported traffic flow prediction via denoising schemes and ANN: A comparison. IEEE Sens. J. 2020, 20, 14317–14328. [Google Scholar] [CrossRef]
- Wang, Z.; Li, H.; Wang, Q. An approach to truck driving risk identification: A machine learning method based on optuna optimization. IEEE Access 2025, 13, 42723–42732. [Google Scholar] [CrossRef]
- Kovaceva, J.; Isaksson-Hellman, I.; Murgovski, N. Identification of aggressive driving from naturalistic data in car-following situations. J. Saf. Res. 2020, 73, 225–234. [Google Scholar] [CrossRef]
- Hyun, K.K.; Jeong, K.; Tok, A.; Ritchie, S.G. Assessing crash risk considering vehicle interactions with trucks using point detector data. Accid. Anal. Prev. 2019, 130, 75–83. [Google Scholar] [CrossRef]
- Chen, S.; Cheng, K.; Yang, J.; Zang, X.; Luo, Q.; Li, J. Driving behavior risk measurement and cluster analysis driven by vehicle trajectory data. Appl. Sci. 2023, 13, 5675. [Google Scholar] [CrossRef]
- Zhang, C.; Ma, Y.; Khattak, A.; Chen, S.; Xing, G.; Zhang, J. Driving style identification and its association with risky driving behaviors among truck drivers based on GPS, load condition, and in-vehicle monitoring data. J. Transp. Saf. Secur. 2024, 16, 507–541. [Google Scholar] [CrossRef]
- Hou, X.; Zhang, R.; Yang, M.; Cheng, S. Modeling the lane-changing behavior of non-motorized vehicles on road segments via social force model. Phys. A Stat. Mech. Its Appl. 2024, 633, 129415. [Google Scholar] [CrossRef]
- Cheng, R.; Lou, H.; Wei, Q. Analysis of the impact for mixed traffic flow based on the time-varying model predictive control. Systems 2025, 13, 481. [Google Scholar] [CrossRef]
- Song, J.; Xu, S.; Feng, C.; Peng, L. An improved rapidly-exploring approach to off-road path planning by leveraging dynamic velocity constraints and trajectory smoothing. IET Intell. Transp. Syst. 2026, 20, e70148. [Google Scholar] [CrossRef]
- Li, Y.; Cai, J.; Wang, X.; Ouyang, S. Driving style characteristics based lane-changing intention recognition research for truck drivers near highway ramps. Traffic Inj. Prev. 2025, 2025, 2507671. [Google Scholar] [CrossRef] [PubMed]
- Zhu, Y.; Ma, Y.; Chen, S.; Khattak, A.J.; Pang, Q. Identifying potentially risky intersections for heavy-duty truck drivers based on individual driving styles. Appl. Sci. 2022, 12, 4678. [Google Scholar] [CrossRef]
- de Zepeda, M.; Meng, F.; Su, J.; Zeng, X.-J.; Wang, Q. Dynamic clustering analysis for driving styles identification. Eng. Appl. Artif. Intell. 2021, 97, 104096. [Google Scholar] [CrossRef]
- Chen, Y.; Wang, K.; Lu, J. Feature selection for driving style and skill clustering using naturalistic driving data and driving behavior questionnaire. Anal. Prev. 2023, 185, 107022. [Google Scholar] [CrossRef]
- Li, B.; Liu, Y.; Zhao, J.; Xu, X.; Dong, P.; Chen, S.; Wu, X.; Liu, X.; Qi, H. Representing-behavior-based online driving style recognition and its road verification. Eng. Appl. Artif. Intell. 2025, 156, 111241. [Google Scholar] [CrossRef]
- Wu, X.; Yan, L.; Li, H. Forward collision warning system using multi-modal trajectory prediction of the intelligent vehicle. Proc. Inst. Mech. Eng. Part D J. Automob. Eng. 2024, 238, 358–373. [Google Scholar] [CrossRef]
- Ding, N.; Gao, H.; Zhang, H.; Huang, Y.; Wu, C. Characterizing driver fingerprinting of new energy vehicles in risky scenarios: A naturalistic driving study. Green Energy Intell. Transp. 2025, 4, 100320. [Google Scholar] [CrossRef]
- Peng, L.; Huang, J.; Zhou, T.; Xu, S. V2V-enabled cooperative adaptive cruise control strategy for improving driving safety and travel efficiency of semi-automated vehicle fleet. IET Intell. Transp. Syst. 2023, 17, 2190–2204. [Google Scholar] [CrossRef]
- Shao, Y.; Shi, X.; Zhang, Y.; Xu, Y.; Chen, W.; Ye, Z. Adaptive forward collision warning system for hazmat truck drivers: Considering differential driving behavior and risk levels. Accid. Anal. Prev. 2023, 191, 107221. [Google Scholar] [CrossRef] [PubMed]
- Zhang, X.; Wang, X.; Bao, Y.; Zhu, X. Safety assessment of trucks based on GPS and in-vehicle monitoring data. Accid. Anal. Prev. 2022, 168, 106619. [Google Scholar] [CrossRef] [PubMed]
- Xie, J.; Xia, Y.; Qian, Z.; Liu, B.; Qin, Y. Lane-change risk warning in interweaving area considering information from intelligent connected near-neighboring vehicles. J. Traffic Transp. Eng. 2023, 23, 287–300. [Google Scholar]
- Liang, B.; Zhu, S.; Long, H.; Niu, J.A.; Qin, C.; Li, H. Driving risk assessment in exit areas of highway tunnels based on driving behavior characteristics: Methods and case studies. Tunn. Undergr. Space Technol. 2025, 157, 106354. [Google Scholar] [CrossRef]
- Irshayyid, A.; Chen, J.; Xiong, G. A review on reinforcement learning-based highway autonomous vehicle control. Green Energy Intell. Transp. 2024, 3, 100156. [Google Scholar] [CrossRef]
- Li, Q.; Cheng, R.; Ge, H. Short-term vehicle speed prediction based on BiLSTM-GRU model considering driver heterogeneity. Phys. A Stat. Mech. Its Appl. 2023, 610, 128410. [Google Scholar] [CrossRef]
- Pan, C.; Dai, Z.; Zhang, Y.; Zhang, H.; Fan, M.; Xu, J. An approach for accurately extracting vehicle trajectory from aerial videos based on computer vision. Measurement 2025, 242, 116212. [Google Scholar] [CrossRef]
- Zhang, H.; Tan, X.; Fan, M.; Pan, C.; Zheng, Z.; Luo, S.; Xu, J. Accurate detection and tracking of small-scale vehicles in high-altitude unmanned aerial vehicle bird-view imagery. J. Adv. Transp. 2023, 2023, 5384844. [Google Scholar] [CrossRef]
- Tang, J.; Hu, J.; Hao, W.; Chen, X.; Qi, Y. Markov Chains based route travel time estimation considering link spatio-temporal correlation. Phys. A Stat. Mech. Its Appl. 2020, 545, 123759. [Google Scholar] [CrossRef]















| Parameter | Unit | Description |
|---|---|---|
| Frame | - | The frame in which the vehicle appears |
| ID | - | Unique identifier (assigned in ascending order based on entry time into the video) |
| Class | - | Vehicle type (0—Passenger car; 1—Mini/Light truck; 2—Two-axle truck; 3—Heavy-duty truck) |
| Y | m | Lateral coordinate of the vehicle’s center (indicating lateral displacement) |
| Width | m | Width of the vehicle in meters (m) |
| Velocity, Acceleration | km/h, m/s2 | Instantaneous speed in km/h and acceleration in m/s2 |
| Dist. to left marking | m | Distance from the vehicle’s trajectory point to the left lane marking |
| Dist. to right marking | m | Distance from the vehicle’s trajectory point to the right lane marking |
| Following dist. | m | Distance between the subject vehicle and the preceding vehicle |
| TTC | s | Time to collision with the preceding vehicle |
| Risk Type | Metric | Mode Method (%) | Final-Value Method (%) |
|---|---|---|---|
| Type 1 | Precision | 89.0 | 99.0 |
| Recall | 89.0 | 99.0 | |
| Type 2 | Precision | 84.0 | 99.0 |
| Recall | 83.0 | 99.0 | |
| Type 3 | Precision | 69.0 | 97.0 |
| Recall | 69.0 | 97.0 | |
| Type 4 | Precision | 100.0 | 92.9 |
| Recall | 20.0 | 86.7 | |
| Type 5 | Precision | 0.0 | 100.0 |
| Recall | 0.0 | 66.7 | |
| Type 6 | Precision | 83.0 | 99.0 |
| Recall | 85.0 | 99.0 |
| Warning Method | Average Response Delay (s) | Warning Consistency (%) |
|---|---|---|
| Mode method | 5.48 | 20.0 |
| Final-value method | 0.04 | 86.7 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Luo, Q.; Lu, X.; Zang, Z.; Gong, H.; Guo, X.; Chen, X. A Real-Time Early Warning Framework for Multi-Dimensional Driving Risk of Heavy-Duty Trucks Using Trajectory Data. Systems 2026, 14, 204. https://doi.org/10.3390/systems14020204
Luo Q, Lu X, Zang Z, Gong H, Guo X, Chen X. A Real-Time Early Warning Framework for Multi-Dimensional Driving Risk of Heavy-Duty Trucks Using Trajectory Data. Systems. 2026; 14(2):204. https://doi.org/10.3390/systems14020204
Chicago/Turabian StyleLuo, Qiang, Xi Lu, Zhengjie Zang, Huawei Gong, Xiangyan Guo, and Xinqiang Chen. 2026. "A Real-Time Early Warning Framework for Multi-Dimensional Driving Risk of Heavy-Duty Trucks Using Trajectory Data" Systems 14, no. 2: 204. https://doi.org/10.3390/systems14020204
APA StyleLuo, Q., Lu, X., Zang, Z., Gong, H., Guo, X., & Chen, X. (2026). A Real-Time Early Warning Framework for Multi-Dimensional Driving Risk of Heavy-Duty Trucks Using Trajectory Data. Systems, 14(2), 204. https://doi.org/10.3390/systems14020204

