Academic Journal of Computing & Information Science, 2026, 9(9); doi: 10.25236/AJCIS.2026.090903.
Ruiyang Xue
School of Transportation and Logistics, Southwest Jiaotong University, Chengdu, China
Freeway traffic combines high speeds with little room for recovery, so a short car-following conflict can escalate into a severe crash within seconds. This paper develops a machine-learning framework that identifies and predicts the driving risk level of individual freeway mainline vehicles from trajectory data. Risk is described by two surrogate safety measures that accumulate over a whole vehicle trajectory instead of being evaluated at a single instant: the time-integrated time-to-collision (TIT), which measures how long a vehicle stays in a hazardous state, and the potential collision severity (PCS), which measures how violent a potential collision would be. Trajectories from the US 101 section of the Next Generation Simulation (NGSIM) dataset are cleaned, restricted to passenger cars in a car-following state, and converted into the two indicators. K-means, hierarchical and spectral clustering are compared for labelling risk levels, and the number of levels is selected with the elbow method, the silhouette coefficient and the Calinski-Harabasz index. K-means with four levels (no, low, medium and high risk) gives the most compact and interpretable partition, and the four levels differ consistently in speed, in spacing and in both risk indicators. The labelled data are then used to train two ensemble classifiers, XGBoost and random forest, on sliding windows extracted from I-80 trajectories. Because the high-risk class is scarce, the training set is re-sampled before learning. Random forest reaches the highest accuracy (98.35%) and F1 score (94.97%), whereas XGBoost reaches the highest overall recall (93.09%) and recovers the largest share of high-risk windows.
Traffic Engineering, Machine Learning, Driving Risk Assessment, Surrogate Safety Measures, Ensemble Learning
Ruiyang Xue. Driving Risk Identification and Assessment for Freeway Mainline Vehicles Based on Machine Learning. Academic Journal of Computing & Information Science (2026), Vol. 9, Issue 9: 15-22. https://doi.org/10.25236/AJCIS.2026.090903.
[1] China Industry Information Network (2020) Analysis of Car Ownership and the Number of Drivers in China in 2020. (In Chinese) http://www.chyxx.com
[2] Zhang, B. (2019) Analysis of Freeway Traffic Accident Patterns and Influencing Factors. Master's Thesis, People's Public Security University of China, Beijing. (In Chinese)
[3] Reason, J., Manstead, A., Stradling, S., Baxter, J. and Campbell, K. (1990) Errors and Violations on the Roads: A Real Distinction? Ergonomics, 33, 1315-1332.
[4] Wang, X. and Xu, X. (2019) Assessing the Relationship between Self-Reported Driving Behaviors and Driver Risk Using a Naturalistic Driving Study. Accident Analysis & Prevention, 128, 8-16.
[5] Wang, C., Xie, Y., Huang, H. and Liu, P. (2021) A Review of Surrogate Safety Measures and Their Applications in Connected and Automated Vehicles Safety Modeling. Accident Analysis & Prevention, 157, 106157.
[6] Wang, Y., Li, Z., Liu, P., et al. (2024) Surrogate Safety Measures for Traffic Oscillations Based on Empirical Vehicle Trajectories Prior to Crashes. Transportation Research Part C: Emerging Technologies, 161, 104543.
[7] Shi, X., Wong, Y.D., Li, M.Z.F., et al. (2018) Key Risk Indicators for Accident Assessment Conditioned on Pre-Crash Vehicle Trajectory. Accident Analysis & Prevention, 117, 346-356.
[8] Chen, T., Shi, X., Wong, Y.D., et al. (2020) Predicting Lane-Changing Risk Level Based on Vehicles' Space-Series Features: A Pre-Emptive Learning Approach. Transportation Research Part C: Emerging Technologies, 116, 102646.
[9] Xue, Q., Jiang, Y. and Lu, J. (2020) Identification Method of Dangerous Driving Behaviour Based on Trajectory Data. China Journal of Highway and Transport, 33, 11. (In Chinese)
[10] Zheng, K. (2019) Research on Traffic Operation Risk Prediction Method of Urban Bridge-Tunnel Connection Section Based on Multi-Source Data. Master's Thesis, Chongqing Jiaotong University, Chongqing. (In Chinese)
[11] Shi, X., Wong, Y.D., Li, M.Z.F., et al. (2019) A Feature Learning Approach Based on XGBoost for Driving Assessment and Risk Prediction. Accident Analysis & Prevention, 129, 170-179.
[12] Xing, L., He, J., Li, Y., et al. (2020) Comparison of Different Models for Evaluating Vehicle Collision Risks at Upstream Diverging Area of Toll Plaza. Accident Analysis & Prevention, 135, 105343.
[13] Coifman, B. and Li, L. (2017) A Critical Evaluation of the Next Generation Simulation (NGSIM) Vehicle Trajectory Dataset. Transportation Research Part B: Methodological, 105, 362-377.
[14] Hayward, J. (1971) Near Misses as a Measure of Safety at Urban Intersections. Pennsylvania Transportation and Traffic Safety Center, University Park.
[15] Minderhoud, M.M. and Bovy, P.H.L. (2001) Extended Time-to-Collision Measures for Road Traffic Safety Assessment. Accident Analysis & Prevention, 33, 89-97.
[16] Tang, S., Lu, Y., Liao, Y., Cheng, K. and Zou, Y. (2024) A New Surrogate Safety Measure Considering Temporal-Spatial Proximity and Severity of Potential Collisions. Applied Sciences, 14, 2711.
[17] Cunto, F. and Saccomanno, F.F. (2008) Calibration and Validation of Simulated Vehicle Safety Performance at Signalized Intersections. Accident Analysis & Prevention, 40, 1171-1179.
[18] Meng, X., Xu, H., Wang, H., et al. (2012) Rear-End Conflict in Freeway Work Zones Based on TTC and DRAC. Traffic Information and Safety, 30, 5. (In Chinese)
[19] Oh, C. and Kim, T. (2010) Estimation of Rear-End Crash Potential Using Vehicle Trajectory Data. Accident Analysis & Prevention, 42, 1888-1893.
[20] Xie, J., Qin, Y., Peng, B., et al. (2021) Risk Discrimination and Conflict Prediction of Vehicle Car-Following Behaviour in Multi-Lane Weaving Sections. Journal of Transportation Systems Engineering and Information Technology, 21, 131. (In Chinese)
[21] Wang, B., Gao, L. and Juan, Z. (2018) Conflict Analysis of Lane Changing in Weaving Areas Based on Time-to-Avoidance. Journal of System Simulation, 30, 9. (In Chinese)
[22] Chen, T., He, T., Benesty, M., et al. (2015) XGBoost: Extreme Gradient Boosting. R Package Version 0.4-2, 1-4.
[23] Speiser, J.L., Miller, M.E., Tooze, J. and Ip, E. (2019) A Comparison of Random Forest Variable Selection Methods for Classification Prediction Modeling. Expert Systems with Applications, 134, 93-101.
[24] Chawla, N.V., Bowyer, K.W., Hall, L.O. and Kegelmeyer, W.P. (2002) SMOTE: Synthetic Minority Over-Sampling Technique. Journal of Artificial Intelligence Research, 16, 321-357.
[25] Han, H., Wang, W.Y. and Mao, B.H. (2005) Borderline-SMOTE: A New Over-Sampling Method in Imbalanced Data Sets Learning. Advances in Intelligent Computing, ICIC 2005, Hefei, 878-887.