Optimizing Vehicle Counting Accuracy Using YOLOv8: A Comparative Study of Configuration Settings and Real-World Traffic Video Analysis

Irfan Maliki, Muhammad Rizky Pratama Solahudin · 2024

Accurate vehicle counting is a crucial component of modern traffic management and the development of efficient transportation systems. This research focuses on automatically counting vehicles by type using the YOLOv8 method, an advanced object detection algorithm. YOLOv8 offers superior detection capabilities and efficiency compared to its previous versions and is capable of real-time application. In this study, the YOLOv8 model was trained on a dataset comprising 1675 frames that represented various traffic conditions. The frames were annotated into four vehicle categories: cars, motorcycles, trucks, and buses. Several model configurations were tested and evaluated to assess the model’s performance in detecting and counting different types of vehicles. Model performance was measured based on accuracy and error rates, with the Mean Absolute Percentage Error method being used to calculate error rates. The testing process involved comparing the automatic vehicle counts generated by the system to manual counts. The results showed that, with a configuration using an frame size of 640, a confidence threshold of 0.3, and an Intersection over Union value of $\mathbf{0. 5}$, the YOLOv8 model achieved an overall accuracy of 73.07%. The details of accuracy for each vehicle class was as follows: $\mathbf{9 6. 3 7 \%}$ for cars, $\mathbf{7 3. 8 8 \%}$ for motorcycles, $\mathbf{5 9. 5 0 \%}$ for trucks, and $\mathbf{7 3. 1 0 \%}$ for buses. The lowest MAPE recorded was 26.93%. These findings indicate that the model demonstrated higher accuracy in detecting cars and motorcycles compared to buses and trucks. Optimizing the configuration parameters significantly impacts the accuracy of vehicle detection, particularly in complex traffic environments. This research contributes to the field by demonstrating an optimized approach to automatic vehicle counting, with implications for enhancing the effectiveness of automated traffic monitoring systems under varying traffic conditions.

Read the paper · More papers on PaperTik