[Paper Review] Optimized Loss Functions for Object detection: A Case Study on Nighttime Vehicle Detection
This paper proposes a dual-optimization framework for object detection in nighttime vehicle detection, introducing Neg-IoU (for hard negative sample classification) and MIoU (a Mahalanobis-distance-based localization loss) to improve correlation between classification and localization. The method achieves 45.9% AP and 44.8% AP75 on a dense nighttime dataset, with 7.6% relative AP gain over baseline by jointly optimizing both loss functions.
Loss functions is a crucial factor that affecting the detection precision in object detection task. In this paper, we optimize both two loss functions for classification and localization simultaneously. Firstly, by multiplying an IoU-based coefficient by the standard cross entropy loss in classification loss function, the correlation between localization and classification is established. Compared to the existing studies, in which the correlation is only applied to improve the localization accuracy for positive samples, this paper utilizes the correlation to obtain the really hard negative samples and aims to decrease the misclassified rate for negative samples. Besides, a novel localization loss named MIoU is proposed by incorporating a Mahalanobis distance between predicted box and target box, which eliminate the gradients inconsistency problem in the DIoU loss, further improving the localization accuracy. Finally, sufficient experiments for nighttime vehicle detection have been done on two datasets. Our results show than when train with the proposed loss functions, the detection performance can be outstandingly improved. The source code and trained models are available at https://github.com/therebellll/NegIoU-PosIoU-Miou.
Motivation & Objective
- To address the misclassification of negative samples in nighttime vehicle detection, particularly false positives from street lights resembling vehicle tail lights.
- To resolve gradient inconsistency in DIoU loss that hinders convergence and localization accuracy.
- To enhance detection performance by establishing a bidirectional correlation between classification and localization heads using IoU-aware loss functions.
- To validate the effectiveness of the proposed loss functions on real-world nighttime datasets with challenging lighting and occlusion conditions.
Proposed method
- Introduces a modified classification loss by multiplying cross-entropy loss with an IoU-based coefficient, enabling localization-aware classification for both positive and negative samples.
- Proposes MIoU loss using Mahalanobis distance between predicted and ground-truth boxes to unify gradient directions of center distance and normalized distance, eliminating gradient inconsistency in DIoU.
- Employs a learnable parameter γ to weight the IoU-based coefficient in classification loss, allowing adaptive emphasis on hard negative samples.
- Uses a weighted sum of classification and localization losses with a learnable α to balance the two objectives during training.
- Applies ablation studies to optimize α and γ on two datasets, identifying optimal hyperparameters for maximum performance.
- Validates the method on two real-world nighttime vehicle detection datasets with diverse lighting and vehicle density.
Experimental results
Research questions
- RQ1Can incorporating IoU information into negative sample classification reduce false positives from background structures resembling vehicles (e.g., street lights)?
- RQ2Does replacing DIoU with a Mahalanobis-distance-based loss (MIoU) improve localization convergence and accuracy by resolving gradient inconsistency?
- RQ3What is the optimal balance between classification and localization loss terms (α) and the weighting of IoU in the classification head (γ) for nighttime detection?
- RQ4To what extent does the joint optimization of both loss functions improve mAP and AP75 in real-world nighttime scenarios?
- RQ5Can the proposed method generalize to datasets with higher vehicle density and complex lighting conditions?
Key findings
- The proposed method achieved 45.9% mAP and 44.8% AP75 on Dataset2, representing a 7.6% relative improvement in mAP over the baseline.
- The Neg-IoU component alone contributed 2.3% absolute mAP gain and 3.9% AP75 gain, significantly reducing false positives from background structures.
- With optimal hyperparameters (α=1.0, γ=1.75), the method achieved 45.7% mAP and 44.0% AP75 on Dataset1, a 7.6% relative mAP improvement.
- Visualization results confirmed a marked reduction in false detections caused by surrounding illuminations, particularly for negative samples with vehicle-like structures.
- The MIoU loss effectively resolved gradient inconsistency in DIoU, leading to faster convergence and improved localization accuracy.
- Ablation studies confirmed that joint optimization of both loss functions yields the highest performance, with the best results achieved at α=1.0 and γ=1.75.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.