Abstract
Loss Rank Mining (LRM) is a plug-and-play training strategy designed to mitigate the class imbalance problem in real-time, one-stage object detectors. By selectively filtering the final feature map to focus backpropagation on the most challenging predictions—those with the highest loss—LRM significantly enhances detection accuracy. Evaluations on the KITTI dataset demonstrate improvements of up to 5.32% mAP without introducing any computational overhead during inference.
Addressing Class Imbalance in One-Stage Detectors
A fundamental challenge in object detection is the extreme class imbalance between foreground objects and background regions. While two-stage detectors like Faster R-CNN utilize region proposal networks to filter out easy background examples, one-stage detectors such as YOLO prioritize speed by processing the entire image in a single pass. This efficiency comes at the cost of being overwhelmed by "easy" background examples during training, which can degrade the model's ability to learn complex object features.
Existing solutions like Online Hard Example Mining (OHEM) are often incompatible with one-stage architectures because they rely on Region-of-Interest (RoI) pooling. Similarly, Focal Loss, while effective for some models, can be difficult to integrate into detectors with complex, multi-task loss functions. LRM addresses these gaps by providing an architecture-agnostic method that operates directly on the final feature map.
The Loss Rank Mining Method
The core innovation of LRM is a training-time module that identifies and prioritizes "hard" examples. The process is integrated into the standard training loop as follows:
- Forward Pass: The input image is processed through the backbone and detection layers to generate a final feature map containing $N$ predictions.
- Loss Ranking: The loss is computed for every prediction. These are then ranked in descending order.
- Mask Generation: A binary mask $M$ is created, where only the top-$K$ predictions with the highest loss values are active (set to 1), while others are zeroed out.
- Filtered Backpropagation: The feature map is multiplied by this mask. Consequently, gradients only flow back through the selected hard examples, forcing the network to optimize for the most difficult cases.
To prevent the model from focusing on redundant boxes for the same object, LRM incorporates Non-Maximum Suppression (NMS) during the ranking stage. This ensures that the $K$ slots are utilized for diverse challenging regions.
Experimental Results and Performance Gains
The authors evaluated LRM across multiple benchmarks and backbones, including Darknet and MobileNet.
- KITTI Dataset: Using a MobileNet-YOLOv2 baseline, LRM increased mAP from 51.98% to 57.30%. Notably, performance on the "tram" class improved by over 14%.
- PASCAL VOC: On a Darknet-YOLOv2 baseline, LRM achieved a 2.27% absolute gain in mAP, reaching 77.40%.
- Comparison with Focal Loss: LRM outperformed Focal Loss by over 3% mAP on YOLOv2. The authors attribute this to LRM's ability to work with multi-task loss functions without requiring mathematical modifications to the loss objective itself.
Crucially, because LRM is only active during training, it adds zero cost to inference, making it ideal for real-time applications.
Analysis of Hyperparameters and Future Directions
The effectiveness of LRM is sensitive to the choice of $K$ (the number of hard examples) and the NMS threshold used during ranking. As shown in the experimental analysis, the optimal $K$ varies depending on the dataset and the use of NMS.
Current limitations include the need for manual tuning of the hyperparameter $K$. Future research aims to develop self-adaptive mechanisms that adjust $K$ dynamically during training. Additionally, instead of completely discarding "easy" examples, future iterations may explore soft-weighting schemes to preserve subtle information while still prioritizing hard examples.
Summary updated