Dynamic Gradient Balancing for Enhanced Adversarial Attacks on Multi-Task Models

Lijun Zhang, Xiao Liu, Kaleel Mahmood, Caiwen Ding, Hui GuanarXiv 2023 · OpenReview

Abstract

Multi-Task Learning (MTL) involves developing a singular model to concurrently perform multiple tasks. While the security of single-task models has been thoroughly studied, multi-task models pose several critical security questions regarding their vulnerability to single-task and multi-task adversarial attacks. This paper introduces the Dynamic Gradient Balancing Attack (DGBA), a novel framework that treats attacking a multi-task model as an optimization problem based on averaged relative loss change across tasks. Extensive evaluations on MTL benchmarks, NYUv2 and Tiny-Taxonomy, demonstrate DGBA's effectiveness against both standard and adversarially trained models. The results highlight a fundamental trade-off: while parameter sharing improves efficiency, it also increases model vulnerability due to enhanced attack transferability.

Introduction

In modern computer vision, Multi-Task Learning (MTL) is a standard paradigm where a single backbone network extracts features to simultaneously handle diverse tasks such as semantic segmentation, depth estimation, and edge detection. While efficient, this architecture introduces unique security vulnerabilities. Existing adversarial attack strategies often fail to compromise all tasks effectively. Single-task attacks typically do not transfer well to other tasks within the same model, and "Total Loss" attacks—which maximize the sum of all task losses—are frequently hindered by gradient dominance, where tasks with larger gradients drown out others.

Methodology: Dynamic Gradient Balancing Attack (DGBA)

To address these limitations, we propose the Dynamic Gradient Balancing Attack (DGBA). DGBA formulates the adversarial attack as an optimization problem aimed at maximizing the Average Relative Accuracy (ARA) drop across all tasks.

The core innovation lies in Dynamic Weighting. By weighting each task's gradient by the inverse of its current loss ($1/L_i$), DGBA ensures that tasks already significantly impacted do not dominate the optimization process. This allows the attack to focus on tasks that are still performing well, leading to a balanced degradation of the entire multi-task system. The objective is linearized using a first-order Taylor expansion and solved as an integer linear programming (ILP) problem, which can be integrated into standard iterative attack algorithms like PGD.

Experimental Setup

The effectiveness of DGBA was evaluated on two primary MTL benchmarks:

  • NYUv2: A 3-task dataset (Semantic Segmentation, Surface Normal Prediction, and Depth Estimation).
  • Tiny-Taskonomy: A 5-task benchmark (Segmentation, Surface Normals, Depth, Keypoint Detection, and Edge Detection).

Experiments were conducted across 25 different model architectures with varying degrees of parameter sharing, ranging from independent task-specific models to fully shared backbones.

Key Results and Discussion

DGBA consistently outperformed baseline methods in degrading multi-task model performance. On clean models, DGBA was up to 80.41% more effective than standard total-loss sum attacks.

Comparison of Average Relative Performance (ARP) drop across tasks for different attack methods. DGBA demonstrates superior balance and overall effectiveness compared to single-task and total-loss baselines.

As shown in Figure 1, single-task attacks (Single-Segm, Single-Norm, Single-Dept) primarily affect their target task with limited transferability. The "Total" loss attack is dominated by the segmentation and depth tasks, leaving surface normal prediction relatively intact. In contrast, DGBA achieves a high and balanced performance drop across all three tasks simultaneously.

Our analysis also revealed a critical "Sharing Trade-off." Increasing the number of shared layers enhances task accuracy but significantly boosts attack transferability—by up to 23x to 31x—making the model more vulnerable. Even models trained with specialized defenses, such as Friendly Adversarial Training (FAT), remained susceptible to DGBA, which outperformed standard baselines by nearly 19% in these scenarios.

Conclusion

This research demonstrates that multi-task models possess a unique vulnerability surface. DGBA provides a robust framework for evaluating this vulnerability by balancing gradients across tasks. The findings suggest that future MTL research must prioritize "robust-by-design" architectures that can maintain the efficiency of parameter sharing without compromising the security of individual task outputs. Future work will explore extending these techniques to large-scale multimodal foundation models.

Summary updated

BibTeX
@misc{zhang2023dynamic,
  author = {Lijun Zhang and Xiao Liu and Kaleel Mahmood and Caiwen Ding and Hui Guan},
  title = {{Dynamic Gradient Balancing for Enhanced Adversarial Attacks on Multi-Task Models}},
  year = {2023},
  eprint = {2305.12066},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.12066},
}
Figure