Weakly-Supervised Semantic Segmentation by Learning Label Uncertainty

Robby Neven, Davy Neven, Bert De Brabandere, Marc Proesmans, Toon GoedeméarXiv 2021

TL;DR

This paper introduces a novel loss function that enables semantic segmentation models to learn from cheap, noisy bounding-box labels by explicitly modeling "label uncertainty." By mixing a small fraction of pixel-perfect labels with many bounding boxes, the model learns to identify and "flip" erroneous background pixels inside the boxes, achieving performance nearly identical to fully supervised models at a fraction of the annotation cost.

What Problem Does This Paper Address?

Deep learning models for semantic segmentation are notoriously "data-hungry," requiring dense, pixel-perfect labels to perform well. Creating these labels is incredibly expensive and time-consuming. While bounding-box annotations are much faster and cheaper to produce, they are "noisy": every pixel inside the box is labeled as the object, even though many of those pixels are actually background.

Previous attempts to solve this "weakly-supervised" problem often rely on external "box-to-mask" proposal generators (like GrabCut or CRFs). However, these generators are often static and not tuned to the specific dataset. The authors of this paper sought a "proposal-free" method where the model refines its own training labels dynamically during the learning process.

Methods

The core of the approach is a two-stage loss function that leverages heteroscedastic uncertainty—a type of uncertainty that captures noise inherent in the input data.

  1. Learning Uncertainty: The model is modified to output not just a class prediction (mean $\mu$), but also a variance ($\sigma^2$) for every pixel. Using a specialized loss function (based on work by Kendall & Gal), the model can "attenuate" its loss by increasing $\sigma^2$ for pixels it finds confusing.
  2. Supervision Contradiction: The authors feed the model a mix of a few pixel-perfect (PP) labels and many bounding-box (BB) labels. At the edges of objects, the PP labels show "background," while the BB labels show "foreground." This contradiction forces the model to learn high uncertainty specifically for the noisy background pixels inside the bounding boxes.
  3. Uncertainty-Based Online Bootstrapping: Once the model identifies high-uncertainty pixels, the loss function performs "online bootstrapping." If the uncertainty $\sigma^2$ exceeds a threshold $\tau$, the training target is "flipped" to match the model’s own prediction. This effectively transforms a coarse bounding box into a refined segmentation mask on the fly.
Figure 1. Regression loss with uncertainty for target value 0. It is clear the loss is minimized when outputting a mean value of 0. However, by increasing the uncertainty, the loss is also lowered for other mean values which deviate from 0.

Datasets

The researchers evaluated their method using the CityScapes dataset, focusing on:

  • Binary Segmentation: Specifically the "car" class.
  • Multi-Class Segmentation: Combining "cars" and "persons" into a single task.

They used a training set of 2,780 images, typically split into a ratio of roughly 18% pixel-perfect labels and 82% bounding-box labels.

Key Insights and Ideas

  • The "Aha" Moment - Contradiction as a Teacher: The most clever insight is that you don't need many perfect labels to fix noisy ones. You only need enough to create "confusion" at the boundaries. This confusion is the signal the model uses to map out exactly where the bounding boxes are lying.
  • Proposal-Free Refinement: Unlike methods that use a separate pre-processing step to turn boxes into masks, this refinement happens inside the loss function. The model essentially teaches itself which parts of the bounding box to ignore.
  • Differentiable Flipping: The bootstrapping isn't a hard "if-else" switch; it uses a sigmoid-weighted sum to ensure the loss remains smooth and differentiable, allowing for stable gradient descent.
Figure 3. Output example of a binary segmentation model trained with an L2-loss with uncertainty using a small subset of pixel- perfect labels. The pixel-perfect labels enable the model to learn to increase the uncertainty for the erroneous bounding-box pixels. For these pixels, the uncertainty attenuation term lowers the loss, enabling the model to contradict the erroneous bounding-box su- pervision which results in a finer segmentation output.

Key Results

The results demonstrate that "near-perfect" segmentation is possible with very little "perfect" data:

  • Binary Task (Cars): Using only 500 pixel-perfect labels (and 2,280 boxes), the model achieved an 85.45% IoU. This is remarkably close to the 86.9% IoU achieved by a baseline model trained on 2,780 pixel-perfect labels.
  • Multi-Class Task: The method achieved 77.75 mIoU, which is 97.12% as good as the fully supervised baseline (79.80 mIoU).
  • Robustness: Even when reducing the pixel-perfect count to just 200 images, the IoU only dropped slightly, proving the efficiency of the uncertainty-based learning.
Figure 2. Output of a segmentation model trained on bounding box-data using the regression loss with uncertainty. It is clear that, when the dataset only consists of bounding-box targets, the seg- mentation output will also resemble rectangles.

Limitations and Future Work

  • Threshold Sensitivity: The bootstrapping depends on a threshold $\tau$. If set too low, the model might flip foreground pixels to background too early, stalling the learning process.
  • Scaling to Many Classes: While the method worked for 3 classes (background, car, person), the authors noted numerical instabilities when extending it further. This is due to the complexity of the Monte Carlo Integration (MCI) required for multi-class uncertainty.
  • Computational Overhead: While 20 samples per batch for MCI were sufficient for these tests, scaling to more complex scenes might increase the computational cost of calculating the loss.

The authors plan to investigate these numerical instabilities in future work to make the system viable for datasets with dozens of object categories.

Summary updated

BibTeX
@misc{neven2021weakly,
  author = {Robby Neven and Davy Neven and Bert De Brabandere and Marc Proesmans and Toon Goedemé},
  title = {{Weakly-Supervised Semantic Segmentation by Learning Label Uncertainty}},
  year = {2021},
  eprint = {2110.05926},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.05926},
}
Figure