Abstract: Physical adversarial attacks in driving scenarios can expose critical vulnerabilities in visual perception models. However, developing such attacks remains challenging due to diverse real-world environments and the requirement for maintaining visual naturality. Building upon this challenge, we reformulate physical adversarial attacks as a one-shot patch generation problem. Our approach generates adversarial patches through a deep generative model that considers the specific scene context, enabling direct physical deployment in matching environments. The primary challenge lies in simultaneously achieving two objectives: generating adversarial patches that effectively mislead object detection systems while determining contextually appropriate deployment within the scene. We propose MAGIC (Mastering Physical Adversarial Generation In Context), a novel framework powered by multi-modal LLM agents to address these challenges. MAGIC automatically understands scene context and generates adversarial patch through the synergistic interaction of language and vision capabilities. In particular, MAGIC orchestrates three specialized LLM agents: The adv-patch generation agent (GAgent) masters the creation of deceptive patches through strategic prompt engineering for text-to-image models; the adv-patch deployment agent (DAgent) ensures contextual coherence by determining optimal deployment strategies based on scene understanding; and the self-examination agent (EAgent) completes this trilogy by providing critical oversight and iterative refinement of both processes. We validate our method on both digital and physical levels, i.e., nuImage and manually captured real-world scenes, where both statistical and visual results prove that our MAGIC is powerful and effective for attacking widely applied object detection systems, i.e., YOLO and DETR series.
Introduction
Physical adversarial attacks—such as placing a specifically designed sticker on a stop sign to make it "disappear" to an AI—pose a major safety risk for autonomous driving (AD) systems. Despite their potential impact, creating effective patches is difficult due to the Context Gap (digital-to-physical transferability) and the need for Visual Naturalness. Most existing adversarial patches look like digital glitches, making them easily detectable by humans. MAGIC addresses these issues by treating adversarial generation as a "one-shot" problem solved through reasoning and collaboration between AI agents, ensuring patches are both effective and contextually appropriate.
The MAGIC Framework
The core of MAGIC is a "trilogy" of specialized LLM agents, typically powered by GPT-4o, that work in an iterative loop to automate the end-to-end process of generating and placing physical adversarial patches.
- GAgent (Generation Agent): Acts as the artist, using strategic prompt engineering to guide text-to-image models (like Stable Diffusion) to create patches that look like abstract art to humans but contain semantic features that mislead detectors.
- DAgent (Deployment Agent): Acts as the strategist. It analyzes scene images to identify "natural" locations for a patch (e.g., billboards or utility boxes) and determines the optimal position and scale.
- EAgent (Self-Examination Agent): Acts as the critic, evaluating whether the target detector (e.g., YOLO) is fooled and judging if the patch looks natural in its environment. It provides feedback for iterative refinement.
Evaluation and Key Results
The framework was validated using the nuImage dataset for digital-level evaluation and custom Real-World Scenes (e.g., bus stops and college roads) for physical validation.
MAGIC achieved a superior Attack Success Rate (ASR) of ~80-90% across various detectors like YOLOv5, RT-DETR, and YOLOv10 in digital tests. Even under strict detection thresholds (0.8), MAGIC maintained an ASR of ~58%, significantly outperforming baseline methods. Physical tests confirmed that these LLM-optimized patches are robust to real-world lighting and viewing angles, successfully fooling the latest object detection models in "print-and-paste" scenarios.
Contextual Sensitivity and Reasoning
A key insight from this research is that where a patch is placed is as vital as its design. The same adversarial patch can have wildly different success rates depending on its environment and placement.
By shifting from traditional mathematical optimization to LLM-based reasoning, MAGIC employs an "Abstract Art" strategy. Instead of trying to be invisible, the patches "hide in plain sight" by resembling common urban elements like logos or street art. This approach proves more effective for physical deployment than subtle pixel perturbations that often fail under real-world conditions.
Conclusion and Future Work
MAGIC demonstrates the power of multi-agent LLM systems in identifying vulnerabilities in autonomous systems. While highly effective, future work will focus on improving the visual blending of patches into environments using diffusion-based techniques and testing performance under extreme weather or low-light conditions. Ultimately, this framework serves as a vital tool for "red-teaming" to improve the robustness of autonomous driving perception models.
Summary updated