Intelligent traffic systems are emerging and becoming part of smart city infrastructure that requires computer vision applications to provide traffic information like vehicle classification and counting in real-time. Vehicle counting helps detect heavy traffic on roads, and vehicle classification helps enforce further processes like speed estimation to enforce speed limit laws based on the vehicle class. Deep learning computer vision-based systems provide automatic feature extractions that are robust to changes in lighting, shadows, and occlusions. This paper proposes a software solution for a real-time traffic monitoring system based on a cutting-edge single-stage deep learning model through the state-of-the-art YOLOv8 algorithm. YOLOv8 is the most recent model of the YOLO family, which provides object detection and classification through its CNN architecture. The proposed work detects vehicles and counts them based on their class. The four common vehicle classes are sedan cars, buses, trucks, and motorcycles, and a counter for each class is displayed on the system’s output screen in real-time and recorded in a log file. The results of the proposed system running on the Nvidia GTX 1070 GPU show an average accuracy of 96.58% with an average error of 3.42% for vehicle detection and an average accuracy of 97.54% with a 2.46% average error for vehicle counting. For vehicle classification, the results for the four vehicle classes (car, bus, truck, and motorcycle) show an accuracy of (94.7%, 94.7%, 96.2%, 99.7%), precision (95%, 100%, 81.4%, 100%), recall (97.9%, 36.3%, 100%, 66.6%), and the f1-score (96.3%, 53.2%, 89.7%, 79.9%), respectively. Index Terms— Computer Vision, Deep Learning, Vehicle Detection, Traffic Analysis, YOLO.
Read full abstract