Attacking all tasks at once using adversarial examples in multi-task learning

Lijun Zhang, Xiao Liu, Kaleel Mahmood, Caiwen Ding, Hui Guan

Abstract

Multi-Task Learning (MTL) has become a cornerstone of efficient computer vision, enabling a single model to perform diverse tasks like depth estimation and semantic segmentation. However, this efficiency comes with hidden security risks. This paper introduces the Dynamic Gradient Balancing Attack (DGBA), a novel framework designed to simultaneously compromise all tasks in an MTL system. Unlike naive multi-task attacks that suffer from gradient dominance, DGBA utilizes dynamic weighting to ensure all tasks are effectively targeted. Our evaluation on NYUv2 and Tiny-Taxonomy datasets reveals that DGBA achieves up to 80.41% higher effectiveness than standard baselines. Crucially, we identify a positive correlation between parameter sharing and attack transferability, highlighting a fundamental trade-off between architectural efficiency and adversarial robustness.

Introduction

In resource-constrained environments such as autonomous driving and robotics, Multi-Task Learning (MTL) is indispensable. By sharing a common "backbone" of parameters across multiple tasks, MTL models reduce computational overhead and often improve performance through cross-task synergy. Despite these benefits, the adversarial robustness of MTL models remains a critical concern. While single-task adversarial attacks are well-studied, they often fail to compromise the entire MTL system. Existing multi-task attack strategies typically rely on a simple summation of task losses, which frequently leads to a "dominance trap" where the gradient of one task overwhelms the others, leaving the system partially functional.

Methodology

To address these limitations, we propose the Dynamic Gradient Balancing Attack (DGBA). DGBA reframes the adversarial attack as a multi-objective optimization problem. The core components of the framework include:

  • Linearization: Using Taylor expansion to approximate the complex loss landscape of the MTL model.
  • Dynamic Weighting: Instead of fixed weights, DGBA dynamically adjusts the weight of each task's gradient based on the inverse of its current loss. This ensures that tasks resisting the attack receive higher priority in the optimization process.
  • ILP Relaxation: The attack is formulated as an Integer Linear Programming (ILP) problem, which is solved through a relaxed Linear Programming approach followed by a sign operation to generate the final perturbation.

This framework is compatible with state-of-the-art attack algorithms like Auto Projected Gradient Descent (APGD).

Experimental Setup

We evaluated DGBA on two prominent MTL benchmarks:

  • NYUv2: Indoor scenes featuring semantic segmentation, surface normal prediction, and depth estimation.
  • Tiny-Taxonomy: A complex dataset involving five tasks: segmentation, surface normals, depth estimation, keypoint detection, and edge detection.

Testing was conducted across 45 distinct model architectures with varying levels of parameter sharing to investigate the relationship between architecture and vulnerability.

Results and Discussion

Our experiments demonstrate that DGBA is significantly more potent than existing methods. On clean MTL models, DGBA achieved up to 80.41% higher attack effectiveness compared to standard baselines. Even against models protected by adversarial training (FAT), DGBA maintained a performance lead of up to 18.65%.

Comparison of Attack Effectiveness (ARP %) across different methods on the NYUv2 dataset.

As shown in the figure above, standard "Total" attacks (summing losses) often fail to impact all tasks equally. In the NYUv2 benchmark, the segmentation task typically dominates the gradient in a naive sum, leaving surface normal prediction relatively unaffected. In contrast, DGBA successfully balances the attack signal, leading to high Attack Rate Percentage (ARP) across all three tasks, particularly excelling in compromising depth estimation.

A key finding of this study is the "Sharing Trade-off." We observed a strong positive correlation between the degree of parameter sharing and attack transferability. In models with high parameter sharing, an adversarial perturbation designed for one task is significantly more likely to compromise others. For instance, transferability increased by up to 23x for segmentation and 3.12x for normal prediction compared to independent models. This suggests that while sharing parameters improves efficiency, it creates a "single point of failure" where a single perturbation can dismantle the entire multi-task system.

Conclusion

The introduction of DGBA exposes a critical vulnerability in Multi-Task Learning architectures. While MTL offers significant advantages in efficiency and accuracy, the inherent parameter sharing facilitates the spread of adversarial perturbations across tasks. Future research should focus on developing "robust-by-design" MTL architectures that can maintain the benefits of information sharing while isolating tasks to prevent cross-task adversarial transfer. Additionally, exploring gradient-free attacks and the vulnerability of large-scale foundation models remains a vital frontier for securing multi-task systems.

Summary updated

BibTeX
@article{zhang2025attacking,
  author = {Lijun Zhang and Xiao Liu and Kaleel Mahmood and Caiwen Ding and Hui Guan},
  title = {{Attacking all tasks at once using adversarial examples in multi-task learning}},
  journal = {Neurocomputing},
  year = {2025},
  doi = {10.1016/j.neucom.2025.131503},
}
Figure