Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics

Alex Kendall, Yarin Gal, Roberto Cipolla

Abstract

Numerous deep learning applications benefit from multi-task learning with multiple regression and classification objectives. In this paper we make the observation that the performance of such systems is strongly dependent on the relative weighting between each task's loss. Tuning these weights by hand is a difficult and expensive process, making multi-task learning prohibitive in practice. We propose a principled approach to multi-task deep learning which weighs multiple loss functions by considering the homoscedastic uncertainty of each task. This allows us to simultaneously learn various quantities with different units or scales in both classification and regression settings. We demonstrate our model learning per-pixel depth regression, semantic and instance segmentation from a monocular input image. Perhaps surprisingly, we show our model can learn multi-task weightings and outperform separate models trained individually on each task.

Introduction

In computer vision, the goal is often to build a single model capable of performing multiple tasks simultaneously—such as semantic segmentation, instance segmentation, and depth estimation for autonomous driving. However, a significant challenge in Multi-Task Learning (MTL) is the Weighting Problem. Different tasks have different units and scales: depth is a regression task (meters), while semantic labeling is a classification task (cross-entropy).

Simply summing these losses ($L_{total} = \sum w_i L_i$) often leads to suboptimal performance because one task may dominate the gradients. Traditionally, researchers relied on expensive manual grid searches to find the optimal weights ($w_i$). This paper proposes a principled mathematical approach to automate this balancing act.

Methods

The core innovation is using Homoscedastic Uncertainty (task-dependent uncertainty) to weight losses. Unlike heteroscedastic uncertainty, which varies with input data, homoscedastic uncertainty represents the inherent noise or difficulty of a specific task.

Multi-task learning architecture with uncertainty-based loss weighting

The Probabilistic Approach

By treating the model's output as a probability distribution (Gaussian for regression, softmax for classification) and maximizing the log-likelihood, the authors derive a loss function where each task's loss is divided by a learned noise parameter ($\sigma^2$). The derivation naturally includes a logarithmic penalty term ($\log \sigma$) that acts as a regularizer, preventing the model from simply increasing uncertainty to minimize the loss.

Architecture

The model utilizes a shared ResNet-101 encoder with Atrous Spatial Pyramid Pooling (ASPP) that branches into three task-specific decoders. For instance segmentation, the model uses a "voting" mechanism where each pixel predicts a vector pointing to its object's center, followed by clustering.

Datasets and Evaluation

The model was evaluated on the Cityscapes dataset, which provides high-resolution urban imagery with pixel-level semantic labels, instance masks, and depth maps. The authors conducted extensive ablation studies on a downsampled version of the dataset to compare their automated weighting against exhaustive manual tuning.

Key Results

The proposed uncertainty-based weighting consistently outperformed manual grid searches. As shown in the experimental results, the learned weights achieved better performance on both tasks simultaneously than any single manual weight configuration could achieve for either task individually.

Comparison of manual loss weighting vs. learned uncertainty-based weights for semantic/depth and instance/depth task pairs.

Key Insights

  • MTL as a Regularizer: The multi-task model outperformed single-task models (e.g., improving semantic segmentation from 59.4% to 62.7% IoU). This suggests that geometric cues from depth estimation help define semantic boundaries and vice versa.
  • Dynamic Balancing: The weights are not static; they evolve during training. As the model becomes more confident in a task, the uncertainty decreases and the task's weight increases, encouraging fine-tuning.
  • Efficiency: A single architecture performing three tasks is significantly more efficient for real-time robotics than running three separate models.

Conclusion and Future Work

This work provides a robust framework for multi-task learning by removing the "dark art" of manual hyperparameter tuning. While highly effective for the three tasks demonstrated, future work could explore how this approach scales to dozens of auxiliary tasks and how to automatically determine the optimal "split point" between shared and task-specific layers in the network architecture.

Summary updated

BibTeX
@inproceedings{kendall2018multi,
  author = {Alex Kendall and Yarin Gal and Roberto Cipolla},
  title = {{Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  url = {https://openreview.net/forum?id=SJ4ulpbOWH},
}
Figure