Abstract
Certifiably robust defenses against adversarial patches for image classifiers ensure correct prediction against any changes to a constrained neighborhood of pixels. PatchCleanser, the state-of-the-art certified defense, uses a double-masking strategy for robust classification. The success of this strategy relies heavily on the model's invariance to image pixel masking. In this paper, we take a closer look at model training schemes to improve this invariance. Instead of using Random Cutout augmentations like PatchCleanser, we introduce the notion of worst-case masking, i.e., selecting masked images which maximize classification loss. However, finding worst-case masks requires an exhaustive search, which might be prohibitively expensive to do on-the-fly during training. To solve this problem, we propose a two-round greedy masking strategy (Greedy Cutout) which finds an approximate worst-case mask location with much less compute. We show that the models trained with our Greedy Cutout improves certified robust accuracy over Random Cutout in PatchCleanser across a range of datasets and architectures. Certified robust accuracy on ImageNet with a ViT-B16-224 model increases from 58.1% to 62.3% against a 3% square patch applied anywhere on the image.
TL;DR
Researchers have developed Greedy Cutout, a new training strategy that significantly boosts a model's "certified robustness" against adversarial patches. By using a two-round greedy search to identify the most damaging ways to mask an image during training, they force the model to become highly invariant to occlusions, improving state-of-the-art defense accuracy on ImageNet by over 4%.
The Challenge of Adversarial Patches
Deep learning models are notoriously fragile when faced with adversarial patches—small, localized perturbations, such as a sticker on a stop sign, that can trick a classifier into misidentification. To combat this, "certified" defenses like PatchCleanser were developed. PatchCleanser works by "double-masking" an image: it systematically hides parts of the image to ensure that at least one mask completely covers the malicious patch. If the model predicts the correct class for all masked versions of the image, the prediction is considered "certified."
However, the success of this defense depends entirely on the model's mask invariance. If a model cannot recognize an object because its key features are masked out, the defense fails—not because of the adversary, but because the model is too sensitive to missing pixels. Standard training typically uses "Random Cutout" (hiding random squares), but this often misses the "worst-case" occlusions that occur during the certification process.
Methods: Greedy Cutout for Worst-Case Masking
The authors propose shifting from random masking to worst-case masking during training. The goal is to find the specific mask locations that cause the highest classification loss and train the model to handle them.
- The Computational Hurdle: An exhaustive "Grid Search" for the worst-case double-mask is computationally ruinous. For a standard $6 \times 6$ grid, one would need 1,296 forward passes per image just to find the right mask for training.
- The Solution - Greedy Cutout: The researchers introduce a two-round greedy strategy. In Round 1, they find the single mask from a predefined set that causes the highest loss. In Round 2, keeping the first mask fixed, they find a second mask that further maximizes the loss.
- Multi-size Optimization: To further optimize, they use a coarse-to-fine approach. They start with a large $3 \times 3$ grid to find a general "bad" area, then refine the search using a smaller $6 \times 6$ grid only within that region. This reduces the number of forward passes to just 26, making it feasible for standard training loops.
Key Results
The "Greedy Cutout" training consistently outperformed the standard "Random Cutout" baseline across all architectures (ResNet, ViT, ConvNeXt) and datasets (ImageNet, CIFAR, SVHN).
- ImageNet (ViT-B16): Certified robust accuracy against a 3% square patch increased from 58.1% to 62.3%.
- CIFAR-10 (ResNet): Robust accuracy jumped from 77.8% to 84.3%.
- Generalizability: Models trained with $3 \times 3$ or $6 \times 6$ mask sets showed improved robustness even when the defense used different mask sizes, proving the model learned a general tolerance for occlusions.
Insights and Discussion
- Invariance is the Bottleneck: The paper demonstrates that the limiting factor in current certified defenses is the model's inability to handle partial occlusions, rather than the defense algorithm itself.
- Hard Examples Matter: Random Cutout is often "too easy." By specifically seeking out masks that hide the most salient features, the model learns to rely on redundant features, making it much more robust.
- Efficiency of Greedy Search: A greedy approximation provides nearly the same benefit as an exhaustive search but at a fraction of the cost, making robust training practical.
Limitations and Future Work
While much faster than a grid search, Greedy Cutout still requires 26 extra forward passes per training iteration, which increases total training time. Additionally, the current certification logic is optimized for a single adversarial patch and requires a conservative estimate of the patch size in advance. Future work may explore scaling this approach to multiple patches or non-square shapes.
Summary updated