Certifiable (Multi)Robustness Against Patch Attacks Using ERM

Saba Ahmadi, Avrim Blum, Omar Montasser, Kevin Stangl

Abstract

Consider patch attacks, where at test-time an adversary manipulates a test image with a patch in order to induce a targeted misclassification. We consider a recent defense to patch attacks, Patch-Cleanser (Xiang et al. [2022]). The Patch-Cleanser algorithm requires a prediction model to have a “two-mask correctness” property, meaning that the prediction model should correctly classify any image when any two blank masks replace portions of the image. Xiang et al. learn a prediction model to be robust to two-mask operations by augmenting the training set with pairs of masks at random locations of training images and performing empirical risk minimization (ERM) on the augmented dataset. However, in the non-realizable setting when no predictor is perfectly correct on all two-mask operations on all images, we exhibit an example where ERM fails. To overcome this challenge, we propose a different algorithm that provably learns a predictor robust to all two-mask operations using an ERM oracle, based on prior work by Feige et al. [2015]. We also extend this result to a multiple-group setting, where we can learn a predictor that achieves low robust loss on all groups simultaneously.

Introduction

Adversarial robustness is characterized by a significant asymmetry: while a learner must ensure correct classification across an exponential number of potential perturbations (such as a patch moved to any location on an image), an attacker only needs to identify a single successful perturbation to cause a failure. Recent defenses like Patch-Cleanser (Xiang et al., 2022) utilize "masking" to reduce this search space. However, these methods often assume a "realizable" setting where a classifier with zero robust error exists. In practice, data is often noisy, and such a classifier may not exist. This paper addresses the "agnostic" setting, where we seek to find a classifier that is as robust as possible, even if perfect robustness is unattainable.

The Failure of Standard ERM

A critical insight of this work is that standard Empirical Risk Minimization (ERM) on augmented data can fail spectacularly in the agnostic setting. ERM typically minimizes average loss, which may lead it to sacrifice robustness on a few specific examples to achieve slightly better accuracy on many others. In a security context, this "mostly right" approach can lead to catastrophic failures on targeted examples.

Synthetic 1D example demonstrating the failure of standard ERM in the agnostic robust setting.

As illustrated in the synthetic 1D example above, ERM might choose a hypothesis ($h_{ERM}$) that minimizes total error across all perturbations but results in significantly higher robust loss compared to the optimal robust classifier ($h^*$). This occurs because ERM treats all perturbations with equal weight, failing to prioritize the specific perturbations that determine the robust success of an individual example.

Algorithmic Framework

To address the limitations of ERM, the authors propose two primary algorithmic contributions based on a boosting framework:

  1. Agnostic Robust Learning via Boosting: Building on the reduction by Feige et al. (2015), the algorithm treats robust learning as a zero-sum game between a learner and an adversary. By maintaining weights over both examples and their perturbations, the algorithm iteratively calls an ERM oracle to find a "majority-vote" predictor. This forces the learner to focus on "hard" perturbations that standard ERM would ignore.
  2. Two-Layer Boosting for Multi-Robustness: The framework is extended to handle "multi-robustness," ensuring reliable performance across diverse subgroups (e.g., demographic groups or video frames). A two-layer boosting approach is used: the outer layer prevents the model from ignoring any specific subgroup to minimize global error, while the inner layer manages adversarial perturbations within those groups.
  3. Double-Masking Integration: The method incorporates the "Patch-Cleanser" strategy of zeroing out contiguous image blocks. This transforms an exponential number of attack possibilities into a manageable polynomial number of masks.

Theoretical Results

The paper establishes several key provable guarantees:

  • Robustness Bound: The boosting algorithm produces a predictor with a robust loss at most $2 \times \text{OPT}_{\mathcal{H}} + \epsilon$, where $\text{OPT}_{\mathcal{H}}$ is the best possible robust loss achievable within the hypothesis class $\mathcal{H}$.
  • Sample Complexity: The authors provide concrete bounds on the number of training examples required, showing that complexity scales with the VC-dimension of the hypothesis class and the number of subgroups.
  • Multi-Group Guarantee: The two-layer algorithm achieves "$\beta$-multi-robustness" (with $\beta=2$), meaning the robust loss on every defined subgroup is bounded relative to the best possible performance on that specific group.

Conclusion

This work provides a theoretical foundation for using standard ERM oracles to achieve certifiable robustness in the agnostic setting. While the proposed boosting framework introduces computational overhead by requiring multiple ERM calls, it offers a path toward models that are not just robust on average, but consistently reliable across all examples and subgroups. Future research may focus on reducing the multiplicative gap in the robustness bounds and improving the efficiency of these algorithms for large-scale deep learning applications.

Summary updated

Abstract

Consider patch attacks, where at test-time an adversary manipulates a test image with a patch in order to induce a targeted misclassification. We consider a recent defense to patch attacks, Patch-Cleanser (Xiang et al. [2022]). The Patch-Cleanser algorithm requires a prediction model to have a ``two-mask correctness'' property, meaning that the prediction model should correctly classify any image when any two blank masks replace portions of the image. Xiang et al. learn a prediction model to be robust to two-mask operations by augmenting the training set with pairs of masks at random locations of training images and performing empirical risk minimization (ERM) on the augmented dataset. However, in the non-realizable setting when no predictor is perfectly correct on all two-mask operations on all images, we exhibit an example where ERM fails. To overcome this challenge, we propose a different algorithm that provably learns a predictor robust to all two-mask operations using an ERM oracle, based on prior work by Feige et al. [2015]. We also extend this result to a multiple-group setting, where we can learn a predictor that achieves low robust loss on all groups simultaneously.
BibTeX
@inproceedings{ahmadi2024certifiable,
  author = {Saba Ahmadi and Avrim Blum and Omar Montasser and Kevin Stangl},
  title = {{Certifiable (Multi)Robustness Against Patch Attacks Using ERM}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2024},
}
Figure