Bucketed Ranking-based Losses for Efficient Training of Object Detectors

Feyza Yavuz,Baris Can Cam,Adnan Harun Dogan,Kemal Oksuz,Emre Akbas,Sinan Kalkan
2024-07-19
Abstract:Ranking-based loss functions, such as Average Precision Loss and Rank&Sort Loss, outperform widely used score-based losses in object detection. These loss functions better align with the evaluation criteria, have fewer hyperparameters, and offer robustness against the imbalance between positive and negative classes. However, they require pairwise comparisons among $P$ positive and $N$ negative predictions, introducing a time complexity of $\mathcal{O}(PN)$, which is prohibitive since $N$ is often large (e.g., $10^8$ in ATSS). Despite their advantages, the widespread adoption of ranking-based losses has been hindered by their high time and space complexities. In this paper, we focus on improving the efficiency of ranking-based loss functions. To this end, we propose Bucketed Ranking-based Losses which group negative predictions into $B$ buckets ($B \ll N$) in order to reduce the number of pairwise comparisons so that time complexity can be reduced. Our method enhances the time complexity, reducing it to $\mathcal{O}(\max (N \log(N), P^2))$. To validate our method and show its generality, we conducted experiments on 2 different tasks, 3 different datasets, 7 different detectors. We show that Bucketed Ranking-based (BR) Losses yield the same accuracy with the unbucketed versions and provide $2\times$ faster training on average. We also train, for the first time, transformer-based object detectors using ranking-based losses, thanks to the efficiency of our BR. When we train CoDETR, a state-of-the-art transformer-based object detector, using our BR Loss, we consistently outperform its original results over several different backbones. Code is available at <a class="link-external link-https" href="https://github.com/blisgard/BucketedRankingBasedLosses" rel="external noopener nofollow">this https URL</a>
Computer Vision and Pattern Recognition
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to improve the efficiency of ranking - based loss functions in object detection training. Specifically, existing ranking - based loss functions such as Average Precision Loss and Rank&Sort Loss, although they perform better than commonly - used score - based loss functions in object detection tasks, require a comparison between every pair of positive and negative samples, resulting in a time complexity of O(PN), where P is the number of positive samples and N is the number of negative samples. In practical applications, especially when the number of negative samples is very large (for example, in ATSS, N can reach 10^8), this will lead to an overly long training time and a high space complexity, thus limiting the wide application of these loss functions. To solve this problem, the author proposes Bucketed Ranking - based Losses. By grouping negative samples into B buckets (B << N), the number of samples that need to be compared pairwise is reduced, thereby reducing the time complexity. This method not only improves the training efficiency but also maintains the same accuracy as the un - bucketed version, and for the first time enables the use of ranking - based loss functions to train Transformer - based object detectors, such as Co - DETR, further enhancing performance. In summary, the main contribution of this paper lies in proposing a new method that retains the advantages of ranking - based loss functions while significantly reducing their computational complexity, enabling these loss functions to efficiently train object detection models on large - scale datasets as well.