Skip to main content
QUICK REVIEW

[Paper Review] CosPGD: an efficient white-box adversarial attack for pixel-wise prediction tasks

Shashank Agnihotri, Jung, Steffen|arXiv (Cornell University)|Feb 4, 2023
Adversarial Robustness in Machine LearningComputer Science13 citations
TL;DR

CosPGD is a unified white-box adversarial attack for pixel-wise prediction tasks that uses per-pixel cosine similarity to scale loss, outperforming SegPGD and PGD on semantic segmentation and extending to optical flow and image restoration.

ABSTRACT

While neural networks allow highly accurate predictions in many tasks, their lack of robustness towards even slight input perturbations often hampers their deployment. Adversarial attacks such as the seminal projected gradient descent (PGD) offer an effective means to evaluate a model's robustness and dedicated solutions have been proposed for attacks on semantic segmentation or optical flow estimation. While they attempt to increase the attack's efficiency, a further objective is to balance its effect, so that it acts on the entire image domain instead of isolated point-wise predictions. This often comes at the cost of optimization stability and thus efficiency. Here, we propose CosPGD, an attack that encourages more balanced errors over the entire image domain while increasing the attack's overall efficiency. To this end, CosPGD leverages a simple alignment score computed from any pixel-wise prediction and its target to scale the loss in a smooth and fully differentiable way. It leads to efficient evaluations of a model's robustness for semantic segmentation as well as regression models (such as optical flow, disparity estimation, or image restoration), and it allows it to outperform the previous SotA attack on semantic segmentation. We provide code for the CosPGD algorithm and example usage at https://github.com/shashankskagnihotri/cospgd.

Motivation & Objective

  • Motivate robust evaluation of pixel-wise prediction models (segmentation, optical flow, restoration) under adversarial perturbations.
  • Provide a unified attack framework applicable to both classification-like and regression-like pixel-wise tasks.
  • Improve over prior pixel-wise attacks (SegPGD, PGD) by using cosine-based loss scaling for per-pixel robustness assessment.
  • Demonstrate applicability across multiple tasks and architectures with both untargeted and targeted settings.

Proposed method

  • Extend PGD with per-pixel cosine similarity between predictions and targets to scale the loss during optimization.
  • Compute cos similarity per pixel between predicted distributions and target distributions to form L_cos for backpropagation.
  • Support both l_infinity and l2 bounded perturbations and both targeted and untargeted attack modes.
  • Apply to pixel-wise predictions by using softmax-based predictions and appropriate target representations (one-hot for segmentation, softmax for vector targets).
  • Iteratively update adversarial examples with gradient of L_cos, followed by projection/clipping to the admissible perturbation and input ranges.
(a) Input at $time=t$
(a) Input at $time=t$

Experimental results

Research questions

  • RQ1Can a unified white-box attack based on pixel-wise cosine similarity provide stronger adversarial perturbations for pixel-wise prediction tasks than existing methods?
  • RQ2To what extent can CosPGD generalize across semantic segmentation, optical flow, and image restoration, and across both targeted and untargeted settings?
  • RQ3How does CosPGD compare to SegPGD and PGD in terms of effectiveness under common epsilon and alpha settings for both l_infinity and l2 norms?

Key findings

  • CosPGD considerably improves attack strength over SegPGD and PGD on semantic segmentation across tested architectures and datasets.
  • In PASCAL VOC 2012 with DeepLabV3, CosPGD reduces mIoU and mAcc far more than SegPGD/PGD (e.g., CosPGD achieves 0.08% mIoU after 40 iterations vs. 6.79% for PGD and 2.69% for SegPGD with the reported setup).
  • CosPGD extends to optical flow, achieving stronger targeted attacks that bring end-point error (epe) closer to the target (e.g., on Sintel final, epe as low as 1.55).
  • CosPGD also reveals weaker robustness in image restoration models (Baseline vs. NAFNet) and outperforms SegPGD, especially when pixel-wise information is leveraged.
  • Across tasks, CosPGD consistently benefits from per-pixel loss scaling via cosine similarity, outperforming traditional PGD and SegPGD under comparable perturbation budgets.
  • The method is suitable as a benchmarking tool for robustness of pixel-wise models and is applicable to both regression and classification-style pixel tasks.
(b) Input at $time=t+1$
(b) Input at $time=t+1$

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.