Real-time Traffic Monitoring System Based on Deep Learning and YOLOv8

Keywords: Computer vision, Deep learning, Object detection, Traffic monitoring, YOLOv8


Computer vision applications are important nowadays because they provide solutions to critical problems that relate to traffic in a cost-effective manner to reduce accidents and preserve lives. This paper proposes a system for real-time traffic monitoring based on cutting-edge deep learning techniques through the state-of-the-art you-only-look-once v8 algorithm, benefiting from its functionalities to provide vehicle detection, classification, and segmentation. The proposed work provides various important traffic information, including vehicle counting, classification, speed estimation, and size estimation. This information helps enforce traffic laws. The proposed system consists of five stages: The preprocessing stage, which includes camera calibration, ROI calculation, and preparing the source video input; the vehicle detection stage, which uses the convolutional neural network model to localize vehicles in the video frames; the tracking stage, which uses the ByteTrack algorithm to track the detected vehicles; the speed estimation stage, which estimates the speed for the tracked vehicles; and the size estimation stage, which estimates the vehicle size. The results of the proposed system running on the Nvidia GTX 1070 GPU show that the detection and tracking stages have an average accuracy of 96.58% with an average error of 3.42%, the vehicle counting stage has an average accuracy of 97.54% with a 2.46% average error, the speed estimation stage has an average accuracy of 96.75% with a 3.25% average error, and the size estimation stage has an average accuracy of 87.28% with a 12.72% average error.


Download data is not yet available.

Author Biographies

Saif B. Neamah, Department of Computer Sciences, University of Technology, Baghdad, Iraq

Saif B. Neamah is an Assistant Lecturer at the Department of Computer Sciences, University of Technology, Iraq. He got the B.Sc. degree in Computer Sciences - Data Security, the M.Sc. degree in Computer Sciences. His research interests are in Artificial Intelligence, Deep Learning and Computer Vision.

Abdulamir A. Karim, Department of Computer Sciences, University of Technology, Baghdad, Iraq

Abdulamir A. Karim is a Professor at the Department of Computer Sciences, University of Technology, Iraq. He got the B.Sc. degree in Statistics and the M.Sc. & Ph.D. degrees in Computer Sciences. His research interests are in Image Processing, Patterns Recognition and Data Compression


AlNujaidi, K., AlHabib, G., and AlOdhieb, A., 2023. Spot-the-camel: Computer vision for safer roads. International Journal of Artificial Intelligence and Applications (IJAIA), 14(2), pp.1-10. DOI:

Alzubaidi, L., Zhang, J., Humaidi, A.J., Al-Dujaili, A., Duan, Y., Al-Shamma, O., Santamaría, J., Fadhel, M.A., Al-Amidie, M., and Farhan, L., 2021. Review of deep learning: Concepts, CNN architectures, challenges, applications, future directions. Journal of Big Data, 8(1), p.53. DOI:

Awotunde, J.B., Jimoh, R.G., Imoize, A.L., Abdulrazaq, A.T., Li, C.T., and Lee, C.C., 2023. An enhanced deep learning-based deepfake video detection and classification system. Electronics, 12(1), p.87. DOI:

Berna, S.J., Swathi S., Devi, C.Y., and Varalakshmi, D., 2020. Distance and speed estimation of moving object using video processing. International Journal for Research in Applied Science and Engineering Technology (IJRASET), 8(5), pp.2605-2612. DOI:

Costa, L.R., Rauen, M.S., and Fronza, A.B., 2020. Car speed estimation based on image scale factor. Forensic Science International, 310, p.110229. DOI:

Dias, T., Fonseca, T., Vitorino, J., Martins, A., Malpique, S., and Praça, I., 2023. From Data to Action: Exploring AI and IoT-Driven Solutions for Smarter Cities. Springer, Cham. DOI:

Djukanović, S., Bulatović, N., and Čavor, I., 2022. ADataset for Audio-video Based Vehicle Speed Estimation. Cornell University, New York, pp.1-4.

Farooq, M.S., and Kanwal, S., 2023. Traffic Road Congestion System using by the Internet of Vehicles (IoV), Networking and Internet Architecture, Cornell University, New York, arXiv:2306.00395, pp.1-9.

Gupta, U., Kumar, U., Kumar, S., Shariq, M., and Kumar, R., 2022. Vehicle speed detection system in highway. International Research Journal of Modernization in Engineering Technology and Science, 4(5), pp.406-411.

Hakim, H., and Fadhil, A., 2021. Survey: Convolution neural networks in object detection. Journal of Physics: Conference Series, 1804, pp.1-18. DOI:

Hussain, M., 2023. YOLO-v1 to YOLO-v8, the rise of YOLO and its complementary nature toward digital manufacturing and industrial defect detection. Machines, 11, p.677. DOI:

Jocher, G., Chaurasia, A., and Qiu, J., 2023. YOLO by Ultralytics (Version 8.0.0). Available from: [Last accessed on 2023 Aug 07].

Jocher, G., Chaurasia, A., and Qiu, J., 2023. YOLOv8 Docs by Ultralytics (Version 8.0.0).Available from: [Last accessed on 2023 Aug 07].

King, R., 2023. Github Repo MMYOLO. Available from: [Last accessed on 2023 Aug 07].

Koyuncu, H., and Koyuncu, B., 2018. Vehicle speed detection by using camera and image processing software. The International Journal of Engineering and Science (IJES),7(9), pp.64-72.

Lin, C.J., Jeng, S.Y., and Lioa, H.W., 2021. A real-time vehicle counting, speed estimation, and classification system based on virtual detection zone and YOLO. Mathematical Problems of Applied System Innovations for IoT Applications, 2021, p.1577614. DOI:

Liu, C., Huynh, D., Sun, C., Reynolds, M., and Atkinson, S., 2021. A vision-based pipeline for vehicle counting, speed estimation, and classification. IEEE Transactions on Intelligent Transportation Systems, 22(12), pp.7547-7560. DOI:

Raheem, F.A., and AbdulHussain, A.A., 2020. Deep learning convolution neural networks analysis and comparative study for static alphabet ASL hand gesture recognition. Journal of Xidian University, 14(4), pp.1871-1881. DOI:

Sarker, I.H., 2021. Deep learning: Acomprehensive overview on techniques, taxonomy, applications and research Directions. SN Computer Science,2, p.420. DOI:

Shihab, M.R., Ghani, R.F., and Mohammed, A.J., 2022. Machine learning techniques for vehicle detection. Iraqi Journal of Computers, Communications, Control and Systems Engineering (IJCCCE), 22(4), pp.1-12. DOI:

WHO, 2018. Global Status Report on Road Safety 2018. World Health Organization, Geneva.Yasir, M.A., and Ali, Y.H., 2021. Review on real time background extraction: Models, applications, environments, challenges and evaluation approaches. International Journal of Online and Biomedical Engineering, 17(2), pp.37-68. DOI:

Zhang, Y., Sun, P., Jiang, Y., Yu, D., Weng, F., Yuan, Z., Luo, P., Liu, W., and Wang, X., 2022. ByteTrack: Multi-Object Tracking by Associating Every Detection Box, Computer Vision and Pattern Recognition, Cornell University, New York, arXiv:2110.06864, pp.1-14. DOI:

How to Cite
Neamah, S. B. and Karim, A. A. (2023) “Real-time Traffic Monitoring System Based on Deep Learning and YOLOv8”, ARO-THE SCIENTIFIC JOURNAL OF KOYA UNIVERSITY, 11(2), pp. 137-150. doi: 10.14500/aro.11327.