Robust Multi-Task Vision at Single-Task Adversarial Cost

A network that predicts semantic segmentation, depth and surface normals from one shared image encoder can be attacked one task at a time. Stealthy Multi-Task Adversarial Attacks crafts small input perturbations that collapse segmentation on Cityscapes while leaving depth error untouched, so the damage is hard to spot. The standard defense is adversarial training, which means training on inputs deliberately perturbed to fool the model. Protecting every task this way requires an iterative attack per task at every training step. With $M$ tasks and $T$ attack steps, that is roughly $M \times T$ extra forward and backward passes per step, and no one has shown how to avoid that cost. The cheaper shortcut is to attack the sum of the task losses once. It will probably spend its whole perturbation budget on whichever task has the steepest loss, which leaves the other tasks exposed to exactly the targeted attacks that stealthy attackers use.

We propose a training procedure whose attack cost is one extra pass per step, which is about what fast single-task adversarial training costs. At each step it spends a single cheap attack on one task, chosen by how far behind that task's robustness currently is. It then combines that task's adversarial gradient with the clean gradients of all tasks using a conflict-averse solver. That solver finds one update direction that improves the worst-off objective while staying close to the average gradient. The claim is that three ingredients together give worst-task robustness comparable to full per-task multi-step adversarial training at a small fraction of its compute: a rotating attack target, an attack choice that adapts to each task's robustness deficit, and conflict-aware combination of the gradients.

Core Claim

In multi-task dense prediction, the expensive part of adversarial training is not the number of attack steps. It is that robustness has to be bought separately for each task. Tasks share an encoder, so a perturbation aimed at one task partly hardens features the other tasks use. Multi-Task Adversarial Attack shows this sharing from the attacker's side: one small generator degrades segmentation accuracy on NYUv2 from 53.50% to 6.27% and nearly triples depth error. The overlap is incomplete, though. The stealthy attacks show that some task-specific directions spare other tasks, and those are the gaps a rotating target has to cover over training.

Rotation creates its own problem. The adversarial gradient for task $k$ often points against the clean gradients of tasks $j \neq k$, which is the same seesaw effect documented for clean multi-task learning. Summing these gradients with fixed weights is what we expect to turn cheap rotation into a steady loss of clean accuracy.

Concretely, let $g_1,\dots,g_M$ be the clean-loss gradients of the $M$ tasks and $a_k$ the gradient of task $k$'s loss on its single-step adversarial input. The update is

$$d^\star = \arg\max_{d}\ \min_{v \in \{g_1,\dots,g_M,\,a_k\}} v^\top d \quad \text{s.t.}\quad \|d - \bar g\| \le c\,\|\bar g\|,$$

where $\bar g$ is the average of the $M+1$ gradients and $c \in [0,1)$ sets how far the update may move from that average. This is the conflict-averse gradient descent rule of Conflict-Averse Gradient Descent for Multi-task learning. That paper supplies the method. Its solver works in the space of task weights, so its cost grows with the number of objectives, not the number of parameters. Unlike the multiple-gradient descent algorithm, it still converges to a minimum of the average loss.

Relation to Prior Work

The closest work applies gradient-conflict reasoning to adversarial training in single-task classification. Conflict-Aware Adversarial Training shows that clean and adversarial gradients diverge as the attack budget grows. It projects the adversarial gradient into a cone around the clean gradient, using full iterative attacks on CIFAR and CUB-Bird. Rethinking Invariance Regularization in Adversarial Training avoids a similar conflict between feature-matching and classification losses by stopping gradients through the clean branch, and it runs about 1.15x slower than standard adversarial training. GAT balances auxiliary self-supervised tasks against robustness with the multiple-gradient descent algorithm, at considerable extra cost.

These three papers motivate the proposal by establishing that gradient conflict drives the loss of clean accuracy. They differ from it in three respects: each has one real task, each pays full attack cost, and none uses conflict resolution to decide where the attack budget goes. Our setting has several real tasks, all of which are under attack.

The efficiency literature constrains the design. A Training-Dynamics View of Catastrophic Overfitting shows that single-step training can collapse suddenly to near-zero multi-step robustness. The collapse follows a blow-up of the mixed input–parameter curvature. A KL regularizer prevents it, reaching 52.46% PGD-10 accuracy against 51.79% for 10-step training on CIFAR-10. Gradient-Guided Dynamic Efficient Adversarial Training adds attack steps only when the input-gradient norm spikes. Both are single-task classification methods.

We borrow one piece from each. The KL regularizer serves as a guard against collapse. The input-gradient-norm monitor serves as an escalation trigger. None of this has been tested on dense regression outputs such as depth and normals.

For choosing which task to attack, we treat the choice as an adversarial bandit problem, following BanditMTL (Mao et al.). That work weights task losses; here the same idea selects the attack target.

Research Program

The model is a shared encoder with task-specific decoders, the same setup used for NYUv2 and Cityscapes in the conflict-averse gradient paper. Each training step does three things.

First, it samples a target task $k$. The sampling distribution comes from an exponential-weights bandit whose reward for task $k$ is its normalized robustness gap: adversarial loss minus clean loss, divided by clean loss. The gap is estimated from recent steps.

Second, it builds one perturbation against task $k$ alone, using a random start and one signed-gradient step at budget $\epsilon$. This costs one extra forward and backward pass. It then computes the clean and adversarial losses.

Third, it combines the $M+1$ gradients with the conflict-averse rule above. To avoid $M+1$ full backward passes through the encoder, the gradients are computed with respect to the shared representation at the encoder output. This needs only one backward pass per decoder. The solved weights then define a single weighted loss, and one backward pass through the encoder completes the step.

The total cost is about two full forward–backward passes plus $M$ passes through the decoders. Full per-task PGD-7 costs roughly $3 \times 7$ extra passes for NYUv2. Collapse is watched by periodic multi-step evaluation during training, and the KL curvature regularizer of Yeom and Lee is added if collapse appears. For a task whose input-gradient norm crosses the adaptive threshold, a second attack step is allowed, following the step-escalation idea of DEAT.

We will analyze three questions. The first is how much robustness transfers between tasks: a matrix where entry $(i,j)$ is task $j$'s robustness after training against task $i$ only. The second is how often the adversarial gradient conflicts with each other task's clean gradient over training. The third is whether the bandit's target choices track that conflict. Together these tell us whether the savings come from shared encoder features or from the solver, and they are useful results even if the method's headline numbers fall short.

Baselines

The naive reference is standard multi-task training with no defense. The same model is also trained with the conflict-averse solver on clean losses only, because that paper reports a per-task average drop $\Delta m$ of 0.20% on NYUv2 against 5.59% for MTAN, and that is the clean ceiling our clean-accuracy numbers should approach. Its robustness to per-task PGD should resemble the collapse reported by the stealthy-attack paper on Cityscapes. There, a PGD $\ell_\infty$ attack at $\epsilon = 8/255$ drops segmentation mIoU from 54.20 to 11.31, and the stealthy variant reaches 10.02 while disparity error stays at 81.50.

The strongest competitor on robustness is full per-task multi-step adversarial training. For every task, a 7-step PGD perturbation is crafted against that task. The model then trains on the sum of clean and adversarial losses, with conflict-averse combination of all $2M$ gradients. We treat this as an upper reference on robustness, not a cost-matched rival. No reported result was found on Lacuna for adversarially trained multi-task models on NYUv2 or Cityscapes, so we will run this reference ourselves.

The strongest cost-matched competitor is joint-loss fast adversarial training. One single-step perturbation is crafted against the summed multi-task loss, stabilized with the Yeom and Lee KL regularizer, and the summed loss is trained without surgery. This is what a practitioner would try first.

Two ablations isolate the key ingredients. One keeps the rotating single-task attack but replaces the conflict-averse solver with a plain sum. The other keeps the solver but samples the target task uniformly. A further variant applies CA-AT's cone projection pairwise in place of the solver.

All methods share the architecture, data, schedule and $\epsilon$. Each gets the same number of tuning trials for its main hyperparameter: $c$ for ours, the loss weight for the summed baselines, and the cone angle for CA-AT. Cost is reported both as wall-clock GPU-hours and as counts of backward passes.

We beat the cost-matched baseline if worst-task robust $\Delta m$ improves under targeted per-task PGD and stealthy attacks at equal or better clean $\Delta m$. We match the upper reference if we come within a few points of its worst-task robustness at no more than a third of its training time.

Why not just…?

Why not just attack the summed loss once per step? This is the real threat to the proposal. If shared-encoder hardening is strong enough, one summed-loss perturbation per step may already protect every task, and the rotating target adds nothing. Our prediction rests on the stealthy-attack results: task-sparing directions exist, and a summed-loss attack favors the task with the steepest loss. That prediction is exactly what the first experiment tests. If joint-loss fast training matches us on the worst task under stealthy attacks, we will report it as the answer and drop the rotation.

Why not just sum the losses with a tuned weight instead of running a solver? CA-AT reports that scalar weighting cannot reach the Pareto front that conflict-aware updates reach once clean and adversarial gradients diverge. The conflict-averse gradient paper shows the same failure for fixed linear combinations in clean multi-task learning. Our setting adds a new source of conflict, between task $k$'s adversarial gradient and the other tasks' clean gradients, and the plain-sum ablation measures directly whether it matters here. The solver is computed at the encoder output, so it adds little cost; if it gains nothing, it should be removed.

Why not just use full per-task PGD, or a cheaper scheduler like DEAT? Full per-task PGD is the upper reference, and its cost grows linearly with the number of tasks. DEAT's roughly 35% saving on CIFAR-10 cuts the number of attack steps but still pays for every task. Frozen-backbone robustness tokens are not an option either: Robustness Tokens needs Transformer token sequences, and on ADE20K it recovers attacked mIoU only from 4.7 to 23.3.

Proposed Experiments

The experiments use NYUv2 (13-class segmentation, depth, normals) and Cityscapes (segmentation, disparity) with the encoder–decoder models of the conflict-averse gradient paper. Training and evaluation use $\ell_\infty$ at $\epsilon = 8/255$, matching the stealthy-attack paper.

Evaluation covers four kinds of attack. The first is PGD-20 against each task separately. The second is PGD against the summed loss. The third is stealthy attacks with the other tasks' losses weighted negatively. The fourth is the multi-task generator attack. The main metric is worst-task robust $\Delta m$ relative to clean single-task models; we also report clean $\Delta m$, per-task metrics (mIoU, absolute depth error, mean angular error for normals) and GPU-hours.

The decisive checks come in order. The first test is whether joint-loss fast adversarial training leaves some task exposed to stealthy attacks. If it does not, the premise fails. The second test is whether the rotating attack with the solver closes that gap at matched cost, and whether each ablation loses part of the gain. The third is a check for single-step collapse on depth and normals, using multi-step evaluation throughout long training runs. The fourth reports the transfer matrix and the conflict frequencies, which explain where the savings come from.