Road accidents are a leading cause of preventable death and injury worldwide. Predicting accident severity in advance enables authorities to take preventive actions and improve emergency response. This paper presents a comprehensive data-driven machine learning approach using historical Road Traffic Accident (RTA) data. A Random Forest Classifier categorizes accident severity into Slight Injury, Serious Injury, and Fatal Injury classes. The dataset undergoes preprocessing including missing value handling, label encoding, feature selection, and MinMaxScaler normalization. The system achieves an overall accuracy of 85.1% and a weighted F1-score of 0.85 with ROC-AUC values of 0.89–0.95 across all classes. The trained model is deployed as a Streamlit web application providing real-time severity predictions with confidence scores and Folium-based geospatial map visualization.
Introduction
Road traffic accidents are a major global public health issue, causing around 1.35 million deaths annually and millions of injuries. Traditional accident analysis methods struggle with large and complex datasets, while machine learning offers better prediction by identifying nonlinear relationships among accident factors.
This study proposes a Random Forest-based accident severity classification system using a real-world Road Traffic Accident (RTA) dataset. The system includes comprehensive data preprocessing (missing value handling, label encoding, feature selection, normalization, and stratified train-test splitting), feature importance analysis, and deployment as an interactive Streamlit web application with real-time predictions, confidence scores, user authentication, and Folium-based geospatial visualization.
The RTA dataset contains features such as road surface type, weather, light conditions, vehicle type, number of casualties, and day of the week. Accident severity is classified into three categories: Slight Injury, Serious Injury, and Fatal Injury. To address class imbalance, the model uses balanced class weighting.
The Random Forest classifier, configured with 100 decision trees, achieved 85.1% accuracy and a weighted F1-score of 0.85, outperforming Logistic Regression, Decision Tree, Support Vector Machine, and Gradient Boosting models. ROC-AUC analysis showed strong predictive performance, with the highest AUC (0.95) for Fatal Injury. Feature importance analysis identified Number of Casualties, Road Surface Type, and Weather Conditions as the most influential predictors.
Conclusion
This paper presented a data-driven machine learning framework for road accident severity prediction. The Random Forest Classifier achieves 85.1% accuracy and a weighted F1-score of 0.85 across three severity classes, outperforming five baseline classifiers. ROC-AUC scores of 0.89–0.95 confirm strong discriminative performance across all classes.
The deployed Streamlit application provides real-time predictions with confidence scoring and Folium geospatial visualization, making the system practical for operational use. The project demonstrates that machine learning can transform road safety management from reactive to proactive, enabling timely emergency response, optimized resource allocation, and evidence-based policy design.
References
[1] World Health Organization, \"Global Status Report on Road Safety,\" WHO Press, Geneva, 2018.
[2] L. F. Herrera-Quintero et al., \"Smart ITS Sensor for Transportation Planning Based on IoT Approaches Using Serverless and Microservices Architecture,\" IEEE Intell. Transp. Syst. Mag., vol. 10, no. 2, pp. 17–27, Dec. 2018.
[3] T. S. J. Darwish and K. A. Bakar, \"Fog Based Intelligent Transportation Big Data Analytics in the Internet of Vehicles Environment,\" IEEE Access, vol. 6, pp. 15679–15701, 2018.
[4] V. Neale et al., \"An Overview of the 100-Car Naturalistic Study and Findings,\" in Proc. 19th Int. Tech. Conf. Enhanced Safety Vehicles, Jun. 2005, pp. 1–6.
[5] T. A. Dingus et al., \"Driver Crash Risk Factors and Prevalence Evaluation Using Naturalistic Driving Data,\" Proc. Nat. Acad. Sci. USA, vol. 113, no. 10, pp. 2636–2641, 2016.
[6] A. Abdelrahman et al., \"Driver Behavior Classification in Crash and Near-Crash Events Using 100-CAR Dataset,\" in Proc. IEEE GLOBECOM, Dec. 2017, pp. 1–6.
[7] G. S. Aoude et al., \"Driver Behavior Classification at Intersections and Validation on Large Naturalistic Dataset,\" IEEE Trans. Intell. Transp. Syst., vol. 13, no. 2, pp. 724–736, Jun. 2012.
[8] G. Castignani et al., \"Driver Behavior Profiling Using Smartphones,\" in Proc. IEEE ITSC, Oct. 2013, pp. 552–557.
[9] P. Handel et al., \"Insurance Telematics: Opportunities and Challenges with the Smartphone Solution,\" IEEE Intell. Transp. Syst. Mag., vol. 6, no. 4, pp. 57–70, Dec. 2014.
[10] T. Chakravarty et al., \"MobiDriveScore: Mobile Sensor Based Driving Risk Assessment,\" in Proc. ICST, Dec. 2013, pp. 1–6.
[11] S. Daptardar et al., \"Hidden Markov Model Based Driving Event Detection from Mobile Inertial Sensor Data,\" in Proc. IEEE Sensors, Nov. 2015, pp. 1–4.
[12] C. G. Quintero et al., \"Driver Behavior Classification Model Based on an Intelligent Driving Diagnosis System,\" in Proc. IEEE ITSC, Sep. 2012, pp. 894–899.
[13] G. Castignani et al., \"Driver Behavior Profiling Using Smartphones: A Low-Cost Platform for Driver Monitoring,\" IEEE Intell. Transp. Syst. Mag., vol. 7, no. 1, pp. 91–102, Dec. 2015.
[14] N. Arbabzadeh and M. Jafari, \"A Data-Driven Approach for Driving Safety Risk Prediction Using Driver Behavior and Roadway Information,\" IEEE Trans. Intell. Transp. Syst., vol. 19, no. 2, pp. 446–460, Feb. 2018.
[15] J. F. Junior et al., \"Driver Behavior Profiling Using Smartphone Sensors and Machine Learning,\" PLOS ONE, vol. 12, no. 4, Apr. 2017.
[16] L. M. Bergasa et al., \"DriveSafe: An App for Alerting Inattentive Drivers and Scoring Driving Behaviors,\" in Proc. IEEE Intell. Vehicles Symp., Jun. 2014, pp. 240–245.
[17] E. Romera et al., \"Presenting the Public UAH-DriveSet Naturalistic Driving Dataset for Driver Behaviour Analysis,\" in Proc. IEEE ITSC, Nov. 2016, pp. 1–6.
[18] C.-W. You et al., \"CarSafe App: Alerting Drowsy and Distracted Drivers Using Dual Cameras on Smartphones,\" in Proc. ACM MobiSys, 2013, pp. 13–26.
[19] H. Eren et al., \"Estimating Driving Behavior by a Smartphone,\" in Proc. IEEE Intell. Vehicles Symp., Jun. 2012, pp. 234–239.
[20] K. Tang et al., \"Modeling Drivers’ Dynamic Decision-Making Behavior During Phase Transition Period Based on Hidden Markov Model Theory,\" IEEE Trans. Intell. Transp. Syst., vol. 17, no. 1, pp. 206–214, Jan. 2016.