SMART TRAFFIC CONGESTION PREDICTION USING MACHINE LEARNING

Author

Santhana Preethi B S,Mrs. J. Steffi


Abstract

 Traffic congestion is a major challenge in urban transportation systems because changing vehicle density, road occupancy, speed, weather, traffic-signal conditions, accidents, and temporal patterns can alter congestion levels. This paper presents a machine learning-based Smart Traffic Congestion Prediction System that classifies traffic conditions into Low, Medium, and High congestion levels. The proposed system uses a dataset of 5,000 traffic records and eleven predictive attributes, including source, destination/designation, vehicle count, traffic speed, road occupancy, traffic-light state, weather condition, accident report, sentiment score, hour, and day-of-week information. Categorical attributes are encoded using one-hot encoding, while numerical attributes are passed through the preprocessing pipeline. A Random Forest classifier with 100 trees, balanced class weighting, and a fixed random state is trained using an 80:20 stratified train-test split. Experimental evaluation on 1,000 test records produces an accuracy of 93.20%, weighted precision of 93.25%, weighted recall of 93.20%, and weighted F1-score of 93.21%. The trained model is integrated into a Flask web application, with SQLite used to store prediction history and dashboard statistics. The system provides a practical interface for entering traffic conditions and obtaining congestion predictions with model confidence. The study demonstrates how a lightweight machine learning and web-based architecture can support data-driven traffic monitoring and congestion assessment.



Keywords

Traffic congestion prediction, machine learning, Random Forest, intelligent transportation systems, Flask, SQLite, traffic classification.



Full Text:

Download Paper PDF


References


[1] M. Shaygan, C. Meese, W. Li, X. G. Zhao, and M. Nejad, “Traffic prediction using artificial intelligence: Review of recent advances and emerging opportunities,” Transportation Research Part C: Emerging Technologies, vol. 145, Art. no. 103921, 2022, doi: 10.1016/j.trc.2022.103921.

[2] P. Xie, T. Li, J. Liu, S. Du, X. Yang, and J. Zhang, “Urban flow prediction from spatiotemporal data using machine learning: A survey,” Information Fusion, vol. 59, pp. 1–12, 2020, doi: 10.1016/j.inffus.2020.01.002.

[3] “A comprehensive review of traffic prediction: From traditional machine learning to AutoML,” Neurocomputing, vol. 666, Art. no. 132148, 2026, doi: 10.1016/j.neucom.2025.132148.

[4] L. Breiman, “Random forests,” Machine Learning, vol. 45, pp. 5–32, 2001, doi: 10.1023/A:1010933404324.

[5] “AI and ML Based Traffic Prediction System to Improve City Commutes,” in Proc. 2025 2nd Int. Conf. on Artificial Intelligence, Metaverse, and Cybersecurity (ICAMAC), Dubai, UAE, 2025, doi: 10.1109/ICAMAC67779.2025.11398412.

[6] “Machine Learning-Based Traffic Flow Prediction and Management,” in Proc. 2025 6th Int. Conf. on Inventive Research in Computing Applications (ICIRCA), Coimbatore, India, 2025, doi: 10.1109/ICIRCA65293.2025.11089788.

Share your valuable work from Social Media Buttons