End-To-End Multi-Task Learning With Attention.

Shikun Liu, Edward Johns, Andrew J. Davison · DOI

Introduction

Multi-Task Learning (MTL) is a powerful paradigm in computer vision, enabling a single model to simultaneously execute multiple tasks, such as semantic segmentation and depth estimation. This approach offers significant efficiency gains over deploying separate models for each task. However, MTL faces two primary hurdles: designing an architecture that effectively balances shared and task-specific features, and managing the complex optimization process where different task losses may have vastly different scales and learning dynamics.

The Multi-Task Attention Network (MTAN)

To address the architectural challenge, the authors propose the Multi-Task Attention Network (MTAN). Traditional MTL often relies on "hard-parameter sharing," where a backbone is shared and the network splits only at the final layers. MTAN instead employs a shared backbone (e.g., VGG or ResNet) augmented with task-specific soft-attention modules at every layer.

Detailed architecture of the MTAN showing task-specific attention modules integrated with a shared backbone.

As shown in Figure 2, these attention modules allow each task to dynamically "select" relevant features from the global pool provided by the backbone. This mechanism enables non-linear feature sharing throughout the network's depth. By learning to mask out irrelevant information, the model becomes more parameter-efficient—adding only about 10% overhead per task—and more robust to the specific weighting of task losses.

Dynamic Weight Average (DWA)

Complementing the MTAN architecture is a novel loss-balancing strategy called Dynamic Weight Average (DWA). Unlike manual tuning or complex gradient-based methods, DWA automatically adjusts task weights based on the relative rate of loss change. If a task's progress stalls, DWA increases its relative importance in the total loss function. This computationally inexpensive method ensures that all tasks are learned effectively without requiring exhaustive hyperparameter searches.

Experimental Evaluation

The MTAN framework was evaluated on three diverse benchmarks:

  • CityScapes: Focused on urban scene understanding (segmentation and depth).
  • NYUv2: Indoor scene analysis involving segmentation, depth, and surface normal prediction.
  • Visual Decathlon: A large-scale challenge covering 10 distinct image classification tasks.

Key Results and Insights

MTAN achieved state-of-the-art performance on the NYUv2 and CityScapes datasets, consistently outperforming strong baselines like Cross-Stitch networks and dense MTL architectures. Notably, on CityScapes, MTAN matched the performance of much larger models while using less than half the parameters.

Qualitative comparison of MTAN against ground truth and single-task baselines for semantic segmentation and depth estimation.

Qualitative analysis (Figure 4) reveals that MTAN produces significantly sharper boundaries in semantic maps and more detailed depth estimations compared to vanilla single-task models. This improvement suggests that the attention mechanism successfully leverages cross-task synergies. Furthermore, visualizations of the attention masks indicate that different tasks develop distinct "preferences" for shared features; for instance, depth estimation tends to use a more sparse, high-contrast set of features compared to semantic segmentation.

Conclusion

The Multi-Task Attention Network provides a flexible and efficient solution for multi-task computer vision. By combining a shared feature backbone with task-specific attention and an automated loss-balancing scheme (DWA), MTAN achieves superior performance with minimal parameter overhead. Future work may explore the application of this attention mechanism to non-spatially aligned tasks, such as multi-modal learning involving vision and language.

Summary updated

BibTeX
@inproceedings{liu2019end,
  author = {Shikun Liu and Edward Johns and Andrew J. Davison},
  title = {{End-To-End Multi-Task Learning With Attention.}},
  booktitle = {CVPR},
  year = {2019},
  doi = {10.1109/cvpr.2019.00197},
}
Figure