Skip to main content
QUICK REVIEW

[Paper Review] Class Imbalance in Object Detection: An Experimental Diagnosis and Study of Mitigation Strategies

Nieves Crasto|arXiv (Cornell University)|Mar 11, 2024
Advanced Statistical Methods and ModelsMathematics3 citations
TL;DR

This paper proposes a benchmarking framework using a custom 10-class long-tailed dataset (COCO-ZIPF) to study foreground-foreground class imbalance in YOLOv5, a single-stage object detector. It evaluates sampling, loss reweighting, and data augmentation strategies, finding that mosaic and mixup augmentation significantly improve mean Average Precision (mAP), while sampling and loss reweighting degrade performance in this one-stage setting.

ABSTRACT

Object detection, a pivotal task in computer vision, is frequently hindered by dataset imbalances, particularly the under-explored issue of foreground-foreground class imbalance. This lack of attention to foreground-foreground class imbalance becomes even more pronounced in the context of single-stage detectors. This study introduces a benchmarking framework utilizing the YOLOv5 single-stage detector to address the problem of foreground-foreground class imbalance. We crafted a novel 10-class long-tailed dataset from the COCO dataset, termed COCO-ZIPF, tailored to reflect common real-world detection scenarios with a limited number of object classes. Against this backdrop, we scrutinized three established techniques: sampling, loss weighing, and data augmentation. Our comparative analysis reveals that sampling and loss reweighing methods, while shown to be beneficial in two-stage detector settings, do not translate as effectively in improving YOLOv5's performance on the COCO-ZIPF dataset. On the other hand, data augmentation methods, specifically mosaic and mixup, significantly enhance the model's mean Average Precision (mAP), by introducing more variability and complexity into the training data. (Code available: https://github.com/craston/object_detection_cib)

Motivation & Objective

  • To address the underexplored issue of foreground-foreground class imbalance in single-stage object detectors like YOLOv5.
  • To create a realistic, small-scale benchmark dataset (COCO-ZIPF) reflecting real-world edge deployment scenarios with limited object classes.
  • To evaluate the effectiveness of sampling, loss reweighting, and data augmentation strategies in mitigating class imbalance within a reproducible PyTorch-based framework.
  • To provide a modular, open-source benchmarking framework supporting YOLOv5 and YOLOv5-nano for edge deployment.

Proposed method

  • Constructed COCO-ZIPF, a 10-class subset of COCO-2017 with a Zipfian distribution to simulate real-world long-tailed data, prioritizing common classes like 'person' and rare ones like 'truck'.
  • Developed a PyTorch-based benchmarking framework for YOLOv5s and YOLOv5-nano to enable reproducible training and modular integration of datasets and mitigation techniques.
  • Evaluated three mitigation strategies: Class-Aware Sampling (CAS), Repeat Factor Sampling (RFS), and loss reweighting using class-specific weights derived from the inverse frequency of each class.
  • Applied data augmentation techniques, specifically mosaic and mixup, with a 0.3 probability of application, and explored modified versions to prioritize under-represented classes.
  • Used mean Average Precision (mAP) and loss components (classification and objectness) as primary evaluation metrics across training epochs.
  • Tuned the classification loss weight from 0.5 to 0.05 to balance the influence of classification and objectness losses, especially in early training.

Experimental results

Research questions

  • RQ1How do standard class imbalance mitigation strategies—sampling, loss reweighting, and data augmentation—perform in a single-stage detector like YOLOv5 under foreground-foreground class imbalance?
  • RQ2Does the effectiveness of these strategies differ significantly between two-stage and one-stage detectors, particularly in long-tailed detection scenarios?
  • RQ3Can targeted data augmentation that prioritizes under-represented classes improve detection performance for rare objects without harming overall mAP?
  • RQ4How does the choice of loss function and its component weighting affect model convergence and mAP in long-tailed object detection?
  • RQ5To what extent do data augmentation techniques like mosaic and mixup uniformly improve performance across both frequent and rare classes?

Key findings

  • Mosaic and mixup data augmentation significantly improved mAP in YOLOv5s trained on COCO-ZIPF, with the model using both techniques surpassing the baseline mAP.
  • The model trained without mosaic augmentation achieved the lowest mAP, indicating that mosaic is crucial for performance in this setting.
  • Loss reweighting, even after tuning the classification loss weight from 0.5 to 0.05, failed to improve mAP and remained below the baseline, indicating counterproductive effects in one-stage detectors.
  • Sampling strategies (CAS and RFS) led to a marginal decrease in mAP compared to the baseline, suggesting they are ineffective or harmful in the YOLOv5 single-stage setting.
  • Augmentation improved performance uniformly across all classes, benefiting both over- and under-represented categories, without requiring class-specific sampling adjustments.
  • Attempts to enhance rare-class detection by modifying mosaic and mixup to prioritize under-represented classes resulted in only marginal gains and a slight drop in over-represented class performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.