Night Traffic Flow Prediction Using K-Nearest Neighbors Algorithm

  • Dušan Mladenović University of Belgrade, Faculty of Transport and Traffic Engineering, Serbia
  • Slađana Janković University of Belgrade, Faculty of Transport and Traffic Engineering, Serbia
  • Stefan Zdravković University of Belgrade, Faculty of Transport and Traffic Engineering, Serbia
  • Snežana Mladenović University of Belgrade, Faculty of Transport and Traffic Engineering, Serbia
  • Ana Uzelac University of Belgrade, Faculty of Transport and Traffic Engineering, Serbia
Keywords: machine learning, traffic flow, prediction, K-Nearest Neighbors, Weka

Abstract

The aim of this research is to predict the total and average monthly night traffic on state roads in Serbia, using the technique of supervised machine learning. A set of data on total and average monthly night traffic has been used for training and testing of predictive models. The data set was obtained by counting the traffic on the roads in Serbia, in the period from 2011 to 2020. Various classification and regression prediction models have been tested using the Weka software tool on the available data set and the models based on the K-Nearest Neighbors algorithm, as well as models based on regression trees, have shown the best results. Furthermore, the best model has been chosen by comparing the performances of models. According to all the mentioned criteria, the model based on the K-Nearest Neighbors algorithm has shown the best results. Using this model, the prediction of the total and average nightly traffic per month for the following year at the selected traffic counting locations has been made.

Downloads

Download data is not yet available.

References

Aha, D. W., Kibler, D., & Albert, M. K. (1991). Instance-based learning algorithms. Machine learning, 6(1), 37-66. https://doi.org/10.1007/BF00153759

Alshaykha, A. M., & Shaban, A. I. (2021). Short-Term Traffic Flow Prediction Model Based On K-Nearest Neighbors and Deep Learning Method. Journal of Mechanical Engineering Research and Developments, 44(6), 113-122.

Boukerche, A., & Wang, J. (2020). Machine Learning-based traffic prediction models for Intelligent Transportation Systems. Computer Networks, 181, 107530. https://doi.org/10.1016/j.comnet.2020.107530

Cai, P., Wang, Y., Lu, G., Chen, P., Ding, C., Sun, J. (2016). A spatiotemporal correlative k-nearest neighbor model for shortterm traffic multistep forecasting. Transportation Research Part C: Emerging Technologies, 62, 21-34. https://doi.org/10.1016/j.trc.2015.11.002

Filipovska, M., & Mahmassani, H. S. (2020). Traffic flow breakdown prediction using machine learning approaches. Transportation research record, 2674(10), 560-570. https://doi.org/10.1177%2F0361198120934480

Guo, J., & Williams, B. M. (2010). Real-time short-term traffic speed level forecasting and uncertainty quantification using layered Kalman filters. Transportation Research Record, 2175(1), 28-37. https://doi.org/10.3141%2F2175-04

Janković, S., Zdravković, S., Mladenović, D., Mladenović, S., Uzelac, A. (2020). Traffic Volume Prediction Using Regression Decision Trees. Proceedings of the XLVII International Symposium on Operational Research - SYM-OP-IS ’20, Belgrade, Serbia, 287-292.

Karlaftis, M. G., Vlahogianni, E. I. (2011). Statistical methods versus neural networks in transportation research: Differences, similarities and some insights. Transportation Research Part C: Emerging Technologies, 19(3), 387-399. https://doi.org/10.1016/j.trc.2010.10.004

Kukadapwar, S. R., & Parbat, D. K. (2015). Modeling of traffic congestion on urban road network using fuzzy inference system. American Journal of Engineering Research, 4(12), 143-148.

Li, C., & Xu, P. (2021). Application on traffic flow prediction of machine learning in intelligent transportation. Neural Computing and Applications, 33(2), 613-624. https://doi.org/10.1007/s00521-020-05002-6

Liu, Z., Guo, J., Cao, J., Wei, Y., & Huang, W. (2018). A Hybrid Short-term Traffic Flow Forecasting Method Based on Neural Networks Combined with K-Nearest Neighbor. PROMET – Traffic & Transportation, 30(4), 445–456. https://doi.org/10.7307/ptt.v30i4.2651

Lv, Y., Duan, Y., Kang, W., Li, Z., & Wang, F. Y. (2015). Traffic flow prediction with big data: a deep learning approach. IEEE Transactions on Intelligent Transportation Systems, 16(2), 865-873. https://doi.org/10.1109/TITS.2014.2345663

Ma, S. F., He, G. G., Wang, S. T. (2001). A traffic flow forecast supported system based multi-agent. Intelligent Transportation Systems. IEEE Intelligent Transportation Systems Conference Proceedings, 25-29 Aug 2001, Oakland, CA, USA, 620-624.

Magalhaes, R. P., Lettich, F., Macedo, J. A., Nardini, F. M., Perego, R., Renso, C., & Trani, R. (2021). Speed prediction in large and dynamic traffic sensor networks. Information Systems, 98, 101444. https://doi.org/10.1016/j.is.2019.101444

Marković, H., Dalbelo Bašić, B., Gold, H., Dong, F., Hirota, K. (2010). GPS Data-based Non-parametric Regression for Predicting Travel Times in Urban Traffic Networks. Promet – Traffic & Transportation, 22(1), 1-13. https://doi.org/10.7307/ptt.v22i1.159

Mohammed, O., & Kianfar, J. (2018). A Machine Learning Approach to Short-Term Traffic Flow Prediction: A Case Study of Interstate 64 in Missouri. 2018 IEEE International Smart Cities Conference (ISC2).

Pang, X., Wang, C., & Huang, G. (2016). A short-term traffic flow forecasting method based on a three-layer k-nearest neighbor non-parametric regression algorithm. Journal of Transportation Technologies, 6(4), 200-206. http://dx.doi.org/10.4236/jtts.2016.64020

Park, H., Haghani, A., Samuel, S., & Knodler, M. A. (2018). Real-time prediction and avoidance of secondary crashes under unexpected traffic congestion. Accident Analysis & Prevention, 112, 39–49. https://doi.org/10.1016/j.aap.2017.11.025

Peng, T., Tang, Z. (2015). A small scale forecasting algorithm for network traffic based on relevant local least squares support vector machine regression model. Applied Mathematics & Information Sciences, 9(2L), 653-659. http://dx.doi.org/10.12785/amis/092L41

Public Enterprise “Roads of Serbia”. (2012). Manual for road design in the Republic of Serbia. Belgrade: Public Enterprise “Roads of Serbia”.

Shamshad, N., Sarwr, D. (2020). A review of Traffic Flow Prediction Based on Machine Learning approaches. International Journal of Scientific & Engineering Research, 11(3), 126-130.

Sénquiz-Díaz, C. (2021). Transport infrastructure quality and logistics performance in exports. Economics-Innovative and Economic Research, 9(1), 107-124. https://doi.org/10.2478/eoik-2021-0008

Shankar, H., Raju, P. L. N., & Rao, K. R. M. (2012). Multi model criteria for the estimation of road traffic congestion from traffic flow information based on fuzzy logic. Journal of Transportation Technologies, 2(01), 50.

Stojčić, M. (2018). Application of ANFIS model in road traffic and transportation: a literature review from 1993 to 2018. Operational Research in Engineering Sciences: Theory and Applications, 1(1), 40-61. https://doi.org/10.31181/oresta19012010140s

Toan, T. D., & Truong, V.-H. (2020). Support Vector Machine for Short-Term Traffic Flow Prediction and Improvement of Its Model Training using Nearest Neighbor Approach. Transportation Research Record: Journal of the Transportation Research Board, 2675(4), 362–373. https://doi.org/10.1177%2F0361198120980432

Vlahogianni, E. I., Karlaftis, M. G., Golias, J. C. (2005). Optimized and meta-optimized neural networks for short-term traffic flow prediction: a genetic approach. Transportation Research Part C: Emerging Technologies, 13(3), 211-234. https://doi.org/10.1016/j.trc.2005.04.007

Vlahogianni, E. I., Karlaftis, M. G., Golias, J. C. (2007). Spatio-temporal short-term urban traffic volume forecasting using genetically optimized modular networks. Computer-Aided Civil and Infrastructure Engineering, 22(5), 317-325. https://doi.org/10.1111/j.1467-8667.2007.00488.x

Wang, J. & Shi, Q. (2013). Short-term traffic speed forecasting hybrid model based on chaos-wavelet analysis-support vector machine theory. Transportation Research Part C: Emerging Technologies, 27, 219-232. https://doi.org/10.1016/j.trc.2012.08.004

Wang, Y., Zhang, D., Liu, Y., Dai, B., & Lee, L. H. (2019). Enhancing transportation systems via deep learning: A survey. Transportation research part C: emerging technologies, 99, 144-163. https://doi.org/10.1016/j.trc.2018.12.004

Williams, B. M., Durvasula, P. K., & Brown, D. E. (1998). Urban freeway traffic flow prediction: application of seasonal autoregressive integrated moving average and exponential smoothing models. Transportation Research Record, 1644(1), 132-141. https://doi.org/10.3141%2F1644-14

Williams, B. M. & Hoel, L. A. (2003). Modeling and forecasting vehicular traffic flow as a seasonal ARIMA process: Theoretical basis and empirical results. Journal of Transportation Engineering, 129(6), 664-672. https://doi.org/10.1061/(ASCE)0733-947X(2003)129:6(664)

Witten, I. H., Frank, E., Hall, M. A. & Pal, C. J. (2017). Data Mining: Practical Machine Learning Tools and Techniques. (4th ed.). Burlington, USA: Morgan Kaufmann.

Xu, Y., Kong, Q. & Liu, Y. (2013). Short-term traffic volume prediction using classification and regression trees. Proceedings of the 2013 IEEE Intelligent Vehicles Symposium (IV), Gold Coast, Australia, 493-498.

Yasin Çodur, M., Tortum, A. (2015). An artificial neural network model for highway accident prediction: A case study of Erzurum, Turkey. Promet – Traffic & Transportation, 27(3), 217-225. https://doi.org/10.7307/ptt.v27i3.1551

Zaki, J. F., Ali-Eldin, A. M. T., Hussein, S. E., Saraya, S. F., & Areed, F. F. (2016). Framework for Traffic Congestion Prediction. International Journal of Scientific & Engineering Research, 7(5), 1205-1210. https://hdl.handle.net/1887/46907

Zhang, L., Liu, Q., Yang, W., Wei, N., & Dong, D. (2013). An Improved K-nearest Neighbor Model for Short-term Traffic Flow Prediction. Procedia - Social and Behavioral Sciences, 96, 653–662. https://doi.org/10.1016/j.sbspro.2013.08.076

Zhang, Y., & Xie, Y. (2007). Forecasting of short-term freeway volume with v-support vector machines. Transportation Research Record, 2024(1), 92-99. https://doi.org/10.3141%2F2024-11

Zhang, Y., Zhou, Y., Lu, H., & Fujita, H. (2020). Traffic Network Flow Prediction Using Parallel Training for Deep Convolutional Neural Networks on Spark Cloud. IEEE Transactions on Industrial Informatics, 16(12), 7369-7380. https://doi.org/10.1109/TII.2020.2976053

Zheng, Z. & Su, D. (2014) Short-term traffic volume forecasting: a k-nearest neighbor approach enhanced by constrained linearly sewing principle component algorithm. Transportation Research Part C: Emerging Technologies, 43, 143-157. https://doi.org/10.1016/j.trc.2014.02.009

Zou, T., He, Y., Zhang, N., Du, R., & Gao, X. (2015). Short-Time Traffic Flow Forecasting Based on the K-Nearest Neighbor Model. Fifth International Conference on Transportation Engineering - ICTE 2015. September 26–27, 2015, Dailan, China.

Published
2022-03-24
How to Cite
Mladenović, D., Janković, S., Zdravković, S., Mladenović, S., & Uzelac, A. (2022). Night Traffic Flow Prediction Using K-Nearest Neighbors Algorithm. Operational Research in Engineering Sciences: Theory and Applications, 5(1), 152-168. https://doi.org/10.31181/oresta240322136m