Introduction
Adversarial attacks are traditionally viewed as a security vulnerability where micro-perturbations cause a model to fail. This research flips that perspective, repurposing adversarial techniques to enhance the utility of deterministic generative models. By applying micro-perturbations to the input condition rather than the model itself, the authors force deterministic models—such as those used for inpainting or style transfer—to produce diverse and controllable outputs without requiring any architectural changes or retraining.
The Determinism Problem in Generative Tasks
Many state-of-the-art image generation models are inherently deterministic. For a given input condition (e.g., a masked image for inpainting), these models produce a single, fixed output. This is problematic for "ill-posed" tasks where multiple valid solutions exist. For instance, a masked mouth in a portrait could be smiling, neutral, or frowning; a deterministic model will only ever generate one of these possibilities, typically the most statistically frequent one in the training set.
Existing attempts to introduce diversity usually involve significant overhead, such as redesigning architectures for noise injection, performing slow Gibbs sampling on feature sequences, or applying task-specific latent space transformations that often sacrifice structural integrity.
Proposed Methodology: Adversarial Diversity
The authors propose a "plug-in" method based on Projected Gradient Descent (PGD). Instead of seeking a perturbation that causes misclassification, they optimize a perturbation $z$ for the input $x$ such that the output $f(x+z)$ deviates from the default prediction $y$ while remaining within the manifold of plausible images.
Untargeted vs. Targeted Attacks
- Untargeted Attack for Diversity: By utilizing simple statistical losses (e.g., $L_1$ distance and variance) and varying the initial random seed of the perturbation, the model is nudged into different regions of its learned distribution. This results in a set of diverse yet visually consistent outputs.
- Targeted Attack for Controllability: By integrating a pre-trained CLIP model, the perturbation can be guided toward specific semantic features. By defining a direction in the CLIP embedding space (e.g., moving from "a face" toward "a face with a smile"), the adversarial input forces the deterministic model to generate the desired attribute.
To prevent the appearance of digital "adversarial artifacts," the authors employ a noise truncation method rather than standard PGD clipping, ensuring that the resulting images appear natural to the human eye.
Experimental Evaluation
The method was tested as a zero-retraining plug-in across three distinct task categories using popular pre-trained models:
- Inpainting (Ill-posed): Evaluated using the LaMa model.
- Style Transfer (Semi-ill-posed): Evaluated using StyTr².
- Super-Resolution (Well-posed): Evaluated using SwinIR.
Key Results
- Superior Diversity: The proposed method achieved significantly higher LPIPS (Learned Perceptual Image Patch Similarity) scores compared to models designed specifically for diversity. In style transfer, the method reached an LPIPS of 0.3199, outperforming the best baseline (0.2183).
- Efficiency: Each generation step takes approximately 0.2 seconds on a standard GPU, offering a significant speed advantage over optimization-based style transfer methods.
- Quality Stability: Unlike standard optimization which can lead to artifacts over many iterations, this method maintains a stable FID (Fréchet Inception Distance) score, preserving image quality throughout the process.
Insights and Discussion
This work suggests that the "non-robustness" of generative models is a latent feature that can be exploited for creativity. The authors hypothesize that these models learn "standard patterns" for degraded areas; adversarial attacks essentially trick the model into retrieving different patterns from its internal memory.
While highly effective, the method has limitations. Excessive perturbation strength ($\epsilon$) can still lead to artifacts, and the alignment between CLIP's embedding space and human perception is not always perfect, occasionally leading to "semantic overfitting." Nonetheless, this approach opens new avenues for using adversarial techniques in low-level vision tasks and provides a novel tool for studying model interpretability.
Summary updated