Table of Contents
Fetching ...

Comparing YOLOv5 Variants for Vehicle Detection: A Performance Analysis

Athulya Sundaresan Geetha

TL;DR

This work evaluates five YOLOv5 variants (n6s, s6s, m6s, l6s, x6s) for vehicle detection across five classes with a 416×416 dataset and 40-epoch training in PyTorch, using precision, recall, F1, and $mAP$ metrics ($mAP_{50}$ and $mAP_{50-95}$) to compare performance. It applies extensive data augmentation (random crops, rotations, shear, grayscale, HSV, mosaic, and more) and reports class-wise and overall performance, including confusion-matrix analyses. The results indicate that YOLOv5n6s achieves a strong precision-recall balance for Cars, while YOLOv5s6s and YOLOv5m6s improve recall; YOLOv5l6s is robust for Cars but less effective for Motorcycles/Bicycles, and YOLOv5x6s performs well for Cars/Buses but struggles with Motorcycles. These findings inform variant selection for real-time traffic management and point to persistent confusions between visually similar classes, suggesting directions for dataset enhancement and targeted augmentation. Future work could extend evaluation to more diverse scenarios and domains, improving detection of challenging classes and robustness to occlusions.

Abstract

Vehicle detection is an important task in the management of traffic and automatic vehicles. This study provides a comparative analysis of five YOLOv5 variants, YOLOv5n6s, YOLOv5s6s, YOLOv5m6s, YOLOv5l6s, and YOLOv5x6s, for vehicle detection in various environments. The research focuses on evaluating the effectiveness of these models in detecting different types of vehicles, such as Car, Bus, Truck, Bicycle, and Motorcycle, under varying conditions including lighting, occlusion, and weather. Performance metrics such as precision, recall, F1-score, and mean Average Precision are utilized to assess the accuracy and reliability of each model. YOLOv5n6s demonstrated a strong balance between precision and recall, particularly in detecting Cars. YOLOv5s6s and YOLOv5m6s showed improvements in recall, enhancing their ability to detect all relevant objects. YOLOv5l6s, with its larger capacity, provided robust performance, especially in detecting Cars, but not good with identifying Motorcycles and Bicycles. YOLOv5x6s was effective in recognizing Buses and Cars but faced challenges with Motorcycle class.

Comparing YOLOv5 Variants for Vehicle Detection: A Performance Analysis

TL;DR

This work evaluates five YOLOv5 variants (n6s, s6s, m6s, l6s, x6s) for vehicle detection across five classes with a 416×416 dataset and 40-epoch training in PyTorch, using precision, recall, F1, and metrics ( and ) to compare performance. It applies extensive data augmentation (random crops, rotations, shear, grayscale, HSV, mosaic, and more) and reports class-wise and overall performance, including confusion-matrix analyses. The results indicate that YOLOv5n6s achieves a strong precision-recall balance for Cars, while YOLOv5s6s and YOLOv5m6s improve recall; YOLOv5l6s is robust for Cars but less effective for Motorcycles/Bicycles, and YOLOv5x6s performs well for Cars/Buses but struggles with Motorcycles. These findings inform variant selection for real-time traffic management and point to persistent confusions between visually similar classes, suggesting directions for dataset enhancement and targeted augmentation. Future work could extend evaluation to more diverse scenarios and domains, improving detection of challenging classes and robustness to occlusions.

Abstract

Vehicle detection is an important task in the management of traffic and automatic vehicles. This study provides a comparative analysis of five YOLOv5 variants, YOLOv5n6s, YOLOv5s6s, YOLOv5m6s, YOLOv5l6s, and YOLOv5x6s, for vehicle detection in various environments. The research focuses on evaluating the effectiveness of these models in detecting different types of vehicles, such as Car, Bus, Truck, Bicycle, and Motorcycle, under varying conditions including lighting, occlusion, and weather. Performance metrics such as precision, recall, F1-score, and mean Average Precision are utilized to assess the accuracy and reliability of each model. YOLOv5n6s demonstrated a strong balance between precision and recall, particularly in detecting Cars. YOLOv5s6s and YOLOv5m6s showed improvements in recall, enhancing their ability to detect all relevant objects. YOLOv5l6s, with its larger capacity, provided robust performance, especially in detecting Cars, but not good with identifying Motorcycles and Bicycles. YOLOv5x6s was effective in recognizing Buses and Cars but faced challenges with Motorcycle class.
Paper Structure (21 sections, 13 equations, 11 figures, 1 table)

This paper contains 21 sections, 13 equations, 11 figures, 1 table.

Figures (11)

  • Figure 1: Sample image of the vehicle dataset dataset.
  • Figure 2: Comparison of precision values across YOLOv5 versions.
  • Figure 3: Comparison of recall values for YOLOv5 versions.
  • Figure 4: Comparison of precision values across YOLOv5 versions.
  • Figure 5: Comparison of mAP50 values across all five YOLOv5 variants.
  • ...and 6 more figures