CAPGen: An Environment-Adaptive Generator of Adversarial Patches

Chaoqun Li, Zhuodong Liu, Huanqian Yan, Hang Su · Submission to ICLR 2025 · Rejected

TL;DR

Physical adversarial patches can blind object detectors, but their loud, psychedelic patterns make them immediately conspicuous to human observers. CAPGen resolves this tension by showing that an object detector's vulnerability is primarily driven by spatial patterns (relative pixel variations) rather than the exact colors used. By decoupling the two, the authors create adversarial patches that match the local environment’s palette—and enable rapid adaptation to new environments simply by swapping base colors without expensive retraining.

What Problem Does This Paper Address?

Physical adversarial attacks place tangible perturbations—such as printed stickers or customized clothing—into the physical world to fool computer vision models (e.g., evading pedestrian detection for autonomous vehicles or surveillance). However, current approaches face a major trade-off:

  1. Human Visual Inconspicuousness vs. Attack Efficacy: Traditional camouflage blends into the background to fool human eyes but fails against deep neural networks. Conversely, standard adversarial patches fool models effectively but feature garish, unnatural textures that immediately alert humans.
  2. Slow Adaptability: When moving an adversarial asset between vastly different environments (e.g., from a snowfield to green shrubbery), existing pipelines require lengthy data collection and retraining to generate a new camouflage pattern.

The paper investigates how adversarial components—specifically textures/patterns versus colors—influence detector failures, aiming to construct patches that are simultaneously stealthy to humans and lethal to object detectors.

Methods

CAPGen (Camouflaged Adversarial Pattern Generator) decouples patch design into environmental base colors and an optimized spatial layout:

  • Base Color Extraction: Uses K-means clustering on background images to identify a small palette of dominant environmental base colors (typically $K = 3$).
  • Color Probability Matrix Optimization: Instead of directly optimizing raw RGB values, CAPGen optimizes a matrix $m \in (0, 1)^{W \times H \times K}$. Each entry represents the probability that a pixel belongs to a given base color. A low-temperature Softmax ($\tau = 0.1$) acts as an argmax proxy, ensuring each pixel cleanly snaps to a single base color.
  • Physical Robustness (EOT): To withstand physical-world distortions, training incorporates Expectation Over Transformation (EOT), augmenting patches with jittered contrast, brightness, random noise, 2D rotation, scaling, and Gaussian smoothing.
  • Fast Adaptation Strategy: Because patterns dominate detector vulnerability, the authors adapt patches to new scenes without retraining: they keep the pre-optimized probability matrix (the "pattern") fixed and simply plug in the new scene's base color palette.
Background Scene ──[K-means]──► Base Colors (c) 
                                      │
                                      ▼
Optimized Pattern Matrix (m) ──[Softmax Blend]──► Stealthy Adversarial Patch

Datasets

The authors evaluated the method across digital and physical domains:

  • INRIA Person Dataset: Standard pedestrian benchmark consisting of 614 training and 288 testing images.
  • FLIR ADAS Dataset: Autonomous vehicle dataset; the authors filtered for visible-spectrum images containing vehicles (8,267 training, 859 testing images).
  • Pre-trained Object Detectors: Models pre-trained on MS COCO, including YOLOv2, YOLOv3, YOLOv4, YOLOv5s, YOLOv5m, Faster R-CNN, FCOS, and RetinaNet.
  • No new benchmarks were introduced; evaluations adhered to standard physical attack frameworks.

Key Insights and Ideas

  • Patterns matter far more than colors: When the authors froze the patch pattern and assigned random base colors, the attack retained strong performance. Conversely, optimizing patch colors over random spatial noise failed to fool detectors. Deep networks respond primarily to high-frequency edge gradients and relative pixel magnitudes, not specific hue values.
  • Decoupled optimization solves the stealth–deception dilemma: Prior works struggled because objective functions for stealth and adversarial loss directly competed on RGB values. By isolating color selection to match the background and letting gradients optimize only the spatial pattern, CAPGen achieves stealth and attack potency simultaneously.
  • Instantaneous scene transfer: Instead of re-running gradient descent for hours when shifting environments, swapping the palette instantly adapts the patch to new scenery with minimal performance loss.

Key Results

  • White-Box Attack (INRIA): CAPGen-P1 (color-adapted pattern) achieved a mean $\text{mAP}_{50}$ of 22.92% (lower indicates a stronger attack), vastly outperforming stealthy baselines like DAP (42.12%) and NAP (44.95%), and coming within 3.34 points of unconstrained, garish AdvPatch (19.58%).
  • Black-Box Transferability: Using YOLOv4 as the substitute detector, CAPGen-P1 achieved an average black-box $\text{mAP}_{50}$ of 37.99%, slightly outperforming standard AdvPatch (38.64%).
  • Human Stealth Assessment: In a 7-point Likert scale user study ($1 = \text{unnatural}$, $7 = \text{natural}$), AdvPatch received a score of $1.73 \pm 1.16$, whereas CAPGen-P1 scored $4.64 \pm 1.18$ (approaching clean background textures at $5.86 \pm 1.22$).
  • Physical Testing: Wearable coats tested outdoors in both snowfield and shrubbery environments successfully evaded YOLOv5s detection while visually matching their respective surroundings.

Limitations and Future Work

  • Fixed Color Palette Count: The method currently relies on a small pre-set number of base colors (defaulting to 3). While increasing base colors improves attack performance, highly diverse multi-colored environments may require dynamic palette sizing.
  • Palette Discretization: The strict assignment of pixels to discrete base colors introduces a slight performance gap compared to completely unconstrained color attacks.
  • Scope of Environmental Conditions: The authors demonstrate real-world utility in snow and shrubbery scenes, but complex lighting shifts (e.g., dynamic shadows, rapid day-to-night transitions) may require continuous adaptive palette updates.

Summary updated

Abstract

Adversarial patches, often used to provide physical stealth protection for critical assets and assess perception algorithm robustness, usually neglect the need for visual harmony with the background environment, making them easily noticeable. Moreover, existing methods primarily concentrate on improving attack performance, disregarding the intricate dynamics of adversarial patch elements. In this work, we introduce the Camouflaged Adversarial Pattern Generator (CAPGen), a novel approach that leverages specific base colors from the surrounding environment to produce patches that seamlessly blend with their background for superior visual stealthiness while maintaining robust adversarial performance. We delve into the influence of both patterns (i.e., color-agnostic texture information) and colors on the effectiveness of attacks facilitated by patches, discovering that patterns exert a more pronounced effect on performance than colors. Based on these findings, we propose a rapid generation strategy for adversarial patches. This involves updating the colors of high-performance adversarial patches to align with those of the new environment, ensuring visual stealthiness without compromising adversarial impact. This paper is the first to comprehensively examine the roles played by patterns and colors in the context of adversarial patches.
BibTeX
@misc{li2024capgen,
  author = {Chaoqun Li and Zhuodong Liu and Huanqian Yan and Hang Su},
  title = {{CAPGen: An Environment-Adaptive Generator of Adversarial Patches}},
  year = {2024},
  eprint = {2412.07253},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.07253},
}
Figure