Evaluation of YOLOv8 and Centroid Tracking in Vehicle Detection, Classification, and Counting System

Authors

  • Kevin Dicky Dharmasaputra Universitas Amikom Yogyakarta
  • Bambang Pilu Hartato Universitas Amikom Yogyakarta

DOI:

https://doi.org/10.30871/jaic.v9i5.10873

Keywords:

YOLOv8, Centroid Tracking, Vehicle Detection, Vehicle Counting, Computer Vision

Abstract

An automatic vehicle detection and counting system is essential for Intelligent Transportation Systems (ITS) to monitor and manage traffic effectively. This study evaluates the performance of the lightweight YOLOv8n (nano) model for vehicle detection and classification, combined with a Centroid Tracking algorithm to improve vehicle counting accuracy. YOLOv8n was selected for its balance between computational efficiency and detection accuracy, making it suitable for devices with limited resources. The research involved collecting a dataset of seven vehicle classes (bus_l, bus_s, car, truck_l, truck_m, truck_s, truck_xl), followed by data preprocessing and training the YOLOv8n model for 40 epochs. Data augmentation techniques were applied to enhance data variability and improve model robustness. The Centroid Tracking algorithm was integrated to maintain vehicle identity across frames and prevent double counting. Model evaluation used precision, recall, F1-score, and mean Average Precision (mAP). Results show YOLOv8n achieved an overall [email protected] of 0.820. The “car” class attained the highest mAP of 0.963, while “truck_s” had the lowest at 0.665, mainly due to imbalanced data distribution. The Centroid Tracking effectively maintained object identities and provided consistent vehicle counts during testing. This combination offers a reliable and efficient system suitable for real-time traffic monitoring, parking management, and enhancing road safety. The YOLOv8n and Centroid Tracking-based system demonstrates strong potential for practical ITS applications, especially on devices with limited computational resources. Future work should focus on expanding the dataset and improving class balance to further enhance detection accuracy and system robustness.

Downloads

Download data is not yet available.

References

[1] A. P. H. Telaumbanua, T. P. Larosa, P. D. Pratama, R. H. Fauza, and A. M. Husein, “Vehicle Detection and Identification Using Computer Vision Technology with the Utilization of the YOLOv8 Deep Learning Method,” Sinkron, vol. 8, no. 4, pp. 2150–2157, 2023, doi: 10.33395/sinkron.v8i4.12787.

[2] L. J. Zhang, J. J. Fang, Y. X. Liu, H. Feng Le, Z. Q. Rao, and J. X. Zhao, “CR-YOLOv8: Multiscale Object Detection in Traffic Sign Images,” IEEE Access, vol. 12, 2024, doi: 10.1109/ACCESS.2023.3347352.

[3] J. Zhang, W. Xiao, B. Coifman, and J. P. Mills, “Vehicle Tracking and Speed Estimation from Roadside Lidar,” IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens., vol. 13, pp. 5597–5608, 2020, doi: 10.1109/JSTARS.2020.3024921.

[4] Q. Liu, H. Ye, S. Wang, and Z. Xu, “YOLOv8-CB: Dense Pedestrian Detection Algorithm Based on In-Vehicle Camera,” Electron., vol. 13, no. 1, 2024, doi: 10.3390/electronics13010236.

[5] N. Al Mudawi et al., “Vehicle Detection and Classification via YOLOv8 and Deep Belief Network over Aerial Image Sequences,” Sustain., vol. 15, no. 19, 2023, doi: 10.3390/su151914597.

[6] H. A. W. A. S. Sutikno, R. Kusumaningrum, “Improved car detection performance on highways based on YOLOv8 _ Sutikno _ Bulletin of Electrical Engineering and Informatics.pdf,” Inst. Adv. Eng. Sci. Publ. Bull. Electr. Eng. Informatics, vol. 9, 2024, doi: https://doi.org/10.11591/eei.v13i5.8031.

[7] N. U. A. Tahir, Z. Long, Z. Zhang, M. Asim, and M. ELAffendi, “PVswin-YOLOv8s: UAV-Based Pedestrian and Vehicle Detection for Traffic Management in Smart Cities Using Improved YOLOv8,” Drones, vol. 8, no. 3, pp. 1–20, 2024, doi: 10.3390/drones8030084.

[8] K. Gaur, J. Dhakar, S. Singh, and A. K. Khosla, “Nighttime Rainy Season Traffic Analysis: Vehicle Detection, Tracking, and Counting with YOLOv8 and DeepSORT,” J. Innov. Image Process., vol. 5, no. 3, pp. 214–228, 2023, doi: 10.36548/jiip.2023.3.001.

[9] H.-H. Ngo, “Vehicle-detection-based traffic density estimation at road intersections,” Int. J. Open Inf. Technol., vol. 11, no. 7, 2023.

[10] T. Sharma et al., “Deep Learning-Based Object Detection and Classification for Autonomous Vehicles in Different Weather Scenarios of Quebec, Canada,” IEEE Access, vol. 12, no. September 2023, pp. 13648–13662, 2024, doi: 10.1109/ACCESS.2024.3354076.

[11] H. Wang, C. Liu, Y. Cai, L. Chen, and Y. Li, “YOLOv8-QSD: An Improved Small Object Detection Algorithm for Autonomous Vehicles Based on YOLOv8,” IEEE Trans. Instrum. Meas., vol. 73, 2024, doi: 10.1109/TIM.2024.3379090.

[12] Y. Li, Q. Fan, H. Huang, Z. Han, and Q. Gu, “A Modified YOLOv8 Detection Network for UAV Aerial Image Recognition,” Drones, vol. 7, no. 5, 2023, doi: 10.3390/drones7050304.

[13] P. Azevedo and V. Santos, “Comparative analysis of multiple YOLO-based target detectors and trackers for ADAS in edge devices,” Rob. Auton. Syst., vol. 171, 2024, doi: 10.1016/j.robot.2023.104558.

[14] H. Dou, S. Chen, F. Xu, Y. Liu, and H. Zhao, “Analysis of vehicle and pedestrian detection effects of improved YOLOv8 model in drone-assisted urban traffic monitoring system,” PLoS One, vol. 20, no. 3 March, pp. 1–22, 2025, doi: 10.1371/journal.pone.0314817.

[15] R. Bharadwaj, A. Billade, S. Chenna, A. Chandrapatle, and G. Chinchalpalle, “Wrong Way Vehicle Detection in Single and Double Lane,” Int. J. Recent Innov. Trends Comput. Commun., vol. 11, no. 6s, pp. 457–462, 2023, doi: 10.17762/ijritcc.v11i6s.6953.

[16] Z. Rahman, A. M. Ami, and M. A. Ullah, “A Real-Time Wrong-Way Vehicle Detection Based on YOLO and Centroid Tracking,” in 2020 IEEE Region 10 Symposium, TENSYMP 2020, 2020. doi: 10.1109/TENSYMP50017.2020.9230463.

[17] M. Sukkar, M. Shukla, D. Kumar, V. C. Gerogiannis, A. Kanavos, and B. Acharya, “Enhancing Pedestrian Tracking in Autonomous Vehicles by Using Advanced Deep Learning Techniques,” Inf., vol. 15, no. 2, pp. 1–16, 2024, doi: 10.3390/info15020104.

[18] Y. Du, X. Liu, Y. Yi, and K. Wei, “Optimizing Road Safety: Advancements in Lightweight YOLOv8 Models and GhostC2f Design for Real-Time Distracted Driving Detection,” Sensors (Basel)., vol. 23, no. 21, 2023, doi: 10.3390/s23218844.

[19] D. T. Mane, S. Sangve, S. Kandhare, S. Mohole, S. Sonar, and S. Tupare, “Real-Time Vehicle Accident Recognition from Traffic Video Surveillance using YOLOV8 and OpenCV,” Int. J. Recent Innov. Trends Comput. Commun., vol. 11, no. May, pp. 250–258, 2023, doi: 10.17762/ijritcc.v11i5s.6651.

[20] D. yuan Ge, X. fan Yao, W. jiang Xiang, and Y. ping Chen, “Vehicle detection and tracking based on video image processing in intelligent transportation system,” Neural Comput. Appl., vol. 35, no. 3, 2023, doi: 10.1007/s00521-022-06979-y.

[21] N. Sharma, S. Baral, M. P. Paing, and R. Chawuthai, “Parking Time Violation Tracking Using YOLOv8 and Tracking Algorithms,” Sensors, vol. 23, no. 13, 2023, doi: 10.3390/s23135843.

[22] H. Yi, B. Liu, B. Zhao, and E. Liu, “Small Object Detection Algorithm Based on Improved YOLOv8 for Remote Sensing,” IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens., vol. 17, 2024, doi: 10.1109/JSTARS.2023.3339235.

[23] E. Soylu and T. Soylu, “A performance comparison of YOLOv8 models for traffic sign detection in the Robotaxi-full scale autonomous vehicle competition,” Multimed. Tools Appl., vol. 83, no. 8, 2024, doi: 10.1007/s11042-023-16451-1.

[24] X. Wang, H. Gao, Z. Jia, and Z. Li, “BL-YOLOv8: An Improved Road Defect Detection Model Based on YOLOv8,” Sensors (Basel)., vol. 23, no. 20, 2023, doi: 10.3390/s23208361.

[25] Y. Wu, T. Liao, F. Chen, H. Zeng, S. Ouyang, and J. Guan, “Overhead Power Line Damage Detection: An Innovative Approach Using Enhanced YOLOv8,” Electron., vol. 13, no. 4, 2024, doi: 10.3390/electronics13040739.

Downloads

Published

2025-10-08

How to Cite

[1]
K. D. Dharmasaputra and B. P. Hartato, “Evaluation of YOLOv8 and Centroid Tracking in Vehicle Detection, Classification, and Counting System”, JAIC, vol. 9, no. 5, pp. 2310–2319, Oct. 2025.

Similar Articles

1 2 3 4 5 > >> 

You may also start an advanced similarity search for this article.