Multitask Learning Strengthens Adversarial Robustness

Chengzhi Mao, Amogh Gupta, Vikram Nitin, Baishakhi Ray, Shuran Song, Junfeng Yang, Carl Vondrick

Introduction

Deep neural networks, despite their impressive performance, remain notoriously brittle. Small, human-imperceptible perturbations—known as adversarial attacks—can cause state-of-the-art models to fail catastrophically, misclassifying objects or hallucinating obstacles. While defenses like Adversarial Training (AT) exist, they often impose a "robustness tax," increasing computational costs and degrading performance on clean data.

This research explores a different path: Does training a model on multiple tasks simultaneously provide an inherent defense? The hypothesis is that the diversity of Multitask Learning (MTL) can offer a "free" boost to robustness without sacrificing clean accuracy.

Comparison of single-task vs. multi-task models under adversarial attack. The multi-task model demonstrates significantly higher resilience.

The Mechanism: Gradient Cancellation

The core finding of this study is that MTL's robustness stems from "gradient cancellation." Using first-order Taylor expansions, the researchers modeled adversarial vulnerability as proportional to the norm of input gradients. They proved that as the number of tasks ($M$) increases, the joint gradient norm generally decreases.

Unless tasks are perfectly correlated, the specific perturbations required to fool Task A often conflict with those needed for Task B. This internal competition makes it mathematically more difficult for an attacker to find a single noise pattern that successfully disrupts all tasks simultaneously.

Methods and Datasets

The researchers evaluated this phenomenon using two major computer vision benchmarks:

  • Cityscapes: Focused on urban driving scenes with tasks including semantic segmentation, depth estimation, and image reconstruction.
  • Taskonomy: A large-scale indoor scene dataset allowing for scaling up to 11 diverse tasks (e.g., 2D/3D edges, surface normals, keypoints).

They tested both Multitask Attacks (targeting all tasks) and Single-task Attacks (targeting one task within a multi-task model). Additionally, they proposed Multitask Adversarial Training, combining the benefits of MTL with standard AT.

Key Insights

Segmentation as "Micro-MTL"

The paper provides a formal explanation for why semantic segmentation is naturally more robust than simple image classification. Because segmentation requires a prediction for every pixel, it can be viewed as a multitask problem with thousands of tiny, spatially-distributed tasks. This high output dimensionality acts as a natural defense mechanism.

The "Free Lunch" of Robustness

Unlike many specialized defenses, MTL often improves performance on clean images due to better inductive bias, while simultaneously strengthening the model against attacks. This suggests that model fragility may partly be a symptom of training on too few tasks.

Results

Empirical results across both datasets confirmed the theoretical predictions:

  • Vulnerability Reduction: On Taskonomy, increasing the number of tasks led to a significant drop in the joint gradient norm.
  • Performance Gains: On Cityscapes, a multitask model (segmentation + depth + reconstruction) maintained a segmentation mIoU of 16.36 under a strong PGD attack, outperforming the single-task baseline of 15.75.
  • Additive Benefits: Combining MTL with Adversarial Training yielded the best results, improving segmentation mIoU by 2.4 points over standard AT alone.
Qualitative comparison on Cityscapes. As more tasks (s=segmentation, d=depth) and adversarial training (A) are added, the model's predictions become increasingly stable against attacks.

Limitations and Future Outlook

While promising, the study noted that adding depth estimation sometimes increased gradient norms due to the large, unbounded scale of depth values. Proper task normalization remains a technical challenge. Furthermore, the benefits of MTL depend on task diversity; highly correlated tasks offer less protection. Future research could investigate task selection strategies to maximize this "strength in numbers" effect and explore its applicability in domains beyond computer vision, such as NLP.

Summary updated

BibTeX
@inproceedings{mao2020multitask,
  author = {Chengzhi Mao and Amogh Gupta and Vikram Nitin and Baishakhi Ray and Shuran Song and Junfeng Yang and Carl Vondrick},
  title = {{Multitask Learning Strengthens Adversarial Robustness}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58536-5\_10},
}
Figure