Towards Robust Object Detection: Bayesian RetinaNet for Homoscedastic Aleatoric Uncertainty Modeling

Natalia Khanzhina, Alexey Lapenok, Andrey FilchenkovarXiv 2021

Abstract

According to recent studies, commonly used computer vision datasets contain about 4% of label errors. For example, the COCO dataset is known for its high level of noise in data labels, which limits its use for training robust neural deep architectures in a real-world scenario. To model such a noise, in this paper we have proposed the homoscedastic aleatoric uncertainty estimation, and present a series of novel loss functions to address the problem of image object detection at scale. Specifically, the proposed functions are based on Bayesian inference and we have incorporated them into the common community-adopted object detection deep learning architecture RetinaNet. We have also shown that modeling of homoscedastic aleatoric uncertainty using our novel functions allows to increase the model interpretability and to improve the object detection performance being evaluated on the COCO dataset.

Introduction

Even the "gold standard" datasets in computer vision, such as MS COCO, are not immune to imperfections. Recent investigations suggest that approximately 4% of labels in these datasets contain errors, ranging from misclassified objects to poorly aligned bounding boxes. Standard deep learning models typically treat these ground truth labels as absolute truth, leading to overfitting on noise and degraded performance in real-world applications.

To address this, we introduce Bayesian RetinaNet, a framework designed to account for inherent noise in training labels. By modeling homoscedastic aleatoric uncertainty—the constant level of noise inherent to a specific task—we enable the model to handle data uncertainty without requiring complex architectural changes. Our approach utilizes two novel loss functions that act as "drop-in" replacements for standard ones, allowing the model to learn to be less "trusting" of potentially erroneous labels.

Proposed Methodology

Our approach focuses on modifying the loss landscape to incorporate probabilistic inference. We introduce two primary innovations:

1. Bayesian Focal Loss

This is a modification of the standard Focal Loss used for classification. It incorporates a noise scalar ($\sigma$) that allows the model to "down-weight" its reliance on potentially noisy class labels. As shown in the loss curves, adjusting $\sigma$ changes how the model penalizes classification errors, effectively providing a mathematical mechanism for the model to express uncertainty about a label.

Behavior of the Bayesian Focal Loss under different noise parameters (sigma).

2. Bayesian Smooth L1 Loss

Designed for bounding box regression, this loss combines Gaussian and Laplace likelihoods to better handle outliers in localization data. By treating the loss as a probabilistic inference problem, the model gains robustness against poorly aligned ground truth boxes.

One of the key advantages of this method is that it is architecture-agnostic. We implemented these losses in a standard RetinaNet with a ResNet-50 backbone. During training, the model learns not just the object features, but also the optimal noise parameters for the tasks.

Experimental Results

We evaluated Bayesian RetinaNet on the MS COCO 2017 dataset, which contains over 330,000 images. COCO is an ideal benchmark for this research as its human-annotated nature introduces the very noise our model aims to mitigate.

Performance Gains

The Bayesian RetinaNet consistently outperformed the baseline across all primary metrics. On the COCO test-dev set, our model achieved a 37.4% mAP, representing a significant 1.7% absolute increase over the standard RetinaNet baseline of 35.7%.

Comparative performance metrics on the COCO test-dev set showing improvements across all precision thresholds.

Interpretability and Task-Specific Noise

Beyond raw performance, the model provides valuable insights into the dataset itself. By inspecting the learned noise scalars, we found that the classification task in COCO is significantly noisier (uncertainty $\approx 0.805$) than the localization task (uncertainty $\approx 0.124$). This aligns with the intuition that categorizing an object among 80 classes is inherently more prone to human error than drawing a bounding box.

Conclusion and Future Work

Bayesian RetinaNet demonstrates that robust object detection can be achieved by simply employing more "honest" loss functions that account for data uncertainty. While our current work focuses on homoscedastic (constant) noise, future research will explore heteroscedastic modeling, where the model predicts uncertainty for each individual object instance. Additionally, we plan to validate these Bayesian losses across other popular architectures like SpineNet and ATSS to further demonstrate their universal utility in creating noise-resilient computer vision systems.

Summary updated

BibTeX
@misc{khanzhina2021towards,
  author = {Natalia Khanzhina and Alexey Lapenok and Andrey Filchenkov},
  title = {{Towards Robust Object Detection: Bayesian RetinaNet for Homoscedastic Aleatoric Uncertainty Modeling}},
  year = {2021},
  eprint = {2108.00784},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.00784},
}
Figure