Attacking Perceptual Similarity Metrics

Abhijay Ghildyal, Feng Liu

TL;DR

This paper reveals that even advanced perceptual similarity metrics, designed to mimic human judgment, are surprisingly vulnerable to imperceptible adversarial attacks. The authors demonstrate that these metrics can be tricked into misjudging image similarity, a critical vulnerability for applications relying on these metrics for security and copyright protection.

What Problem Does This Paper Address?

Perceptual similarity metrics are crucial in modern computer vision for tasks like image enhancement, generation, and even in evaluating adversarial attacks themselves. These metrics aim to quantify how humans perceive the similarity between images, moving beyond simple pixel-wise differences. However, as these metrics become more sophisticated and integrated into security pipelines (e.g., for copyright protection or detecting manipulated images), their robustness against subtle, imperceptible manipulations becomes paramount. The authors identify a critical gap: while adversarial attacks are well-studied for image classification, their impact on perceptual similarity metrics, especially concerning imperceptible perturbations, has been largely unexplored. This paper aims to systematically investigate this vulnerability, asking: "How robust are perceptual similarity metrics against imperceptible adversarial perturbations?"

Methods

The core of the paper involves crafting adversarial perturbations to "fool" perceptual similarity metrics. The authors employ a two-alternative forced-choice (2AFC) experimental setup, where human judges decide which of two distorted images is more similar to a reference image. They then apply adversarial attacks to the less similar distorted image, aiming to make it appear more similar to the reference, thereby flipping the metric's judgment.

Key attack methods used include:

  • FGSM (Fast Gradient Sign Method) and PGD (Projected Gradient Descent): Standard white-box attacks that manipulate pixel intensities within an $\epsilon$-ball.
  • One-pixel attack: A black-box attack that modifies a single pixel.
  • stAdv (Spatial Attack): A novel spatial attack that deforms the image geometrically by optimizing a flow vector. This is a key contribution, as it targets structural changes rather than just pixel values.
  • Combined stAdv + PGD: The authors also combine the spatial stAdv attack with the $\ell_\infty$-bounded PGD attack to enhance transferability and the severity of adversarial examples.

The success of an attack is measured by whether the metric's rank flip (i.e., it now considers the perturbed image more similar to the reference than the other distorted image).

Datasets

The primary dataset used is the Berkeley-Adobe Perceptual Patch Similarity (BAPPS) dataset. This dataset was originally used to train perceptual similarity metrics and consists of triplets of images (two distorted, one reference) with human judgments collected via a 2AFC test. The authors specifically select samples where human judgments are unanimous to ensure a clear decision boundary for their experiments.

For additional testing, they also use:

  • PieAPP test dataset
  • CLIC validation dataset

Key Insights and Ideas

  • Ubiquitous Vulnerability: All tested perceptual similarity metrics, from traditional ones like L2 and SSIM to modern deep learning-based metrics like LPIPS and DISTS, are susceptible to imperceptible adversarial attacks.
  • Human vs. Metric Discrepancy: Adversarial perturbations that are imperceptible to humans can cause perceptual similarity metrics to flip their judgments, highlighting a disconnect between human perception and metric output.
  • Spatial Attacks are Potent: The novel spatial attack (stAdv) is effective at deforming images to fool metrics, demonstrating that attacks need not be limited to pixel intensity changes.
  • Transferability is Key: Adversarial examples crafted for one metric (e.g., LPIPS) can effectively transfer to attack other metrics, even in a black-box setting. This is a significant security concern.
  • Combined Attacks Amplify Transferability: Combining spatial attacks (stAdv) with gradient-based attacks (PGD) significantly increases the transferability of adversarial examples to other metrics.
  • Accuracy vs. Robustness Trade-off: While more accurate metrics (those better correlating with human judgment) are often less robust to these attacks, the relationship is not absolute, and some newer metrics show promise in balancing both.

Key Results

  • High Flip Rates: For many metrics, white-box attacks like FGSM and PGD could flip the rank of a significant percentage of samples (e.g., LPIPS(Alex) flipped in ~80% of samples for PGD).
  • stAdv Effectiveness: The stAdv attack, when applied to LPIPS(AlexNet), successfully flipped judgments on 4658 out of 11,303 accurate samples.
  • Transferability Success: When adversarial examples generated by attacking LPIPS(AlexNet) via stAdv were transferred to other metrics, a substantial number of flips were observed across various metrics, with some metrics showing flip rates as high as 39% (e.g., PIM-5).
  • Combined Attack Superiority: Combining stAdv with PGD(10) further increased transferability, with some metrics showing flip rates exceeding 40% (e.g., PIM-5).
  • PGD vs. FGSM: PGD was generally found to be more successful than FGSM at flipping ranks, often requiring less perturbation.

Limitations and Future Work

  • Dataset Bias: The study primarily uses the BAPPS dataset, and while additional datasets were tested, the selection criteria (e.g., high human preference margin) might influence results. The authors acknowledge that samples closer to the decision boundary are easier to flip.
  • Imperceptibility Thresholds: While visual inspection and RMSE were used to ensure imperceptibility, defining a universal threshold remains challenging.
  • Future Work: The authors suggest further research into developing more robust perceptual similarity metrics. They also highlight the need for defenses against these attacks and call for more discussion on mitigating such vulnerabilities. They plan to make their code and data publicly available to facilitate this research.

Summary updated

Abstract

Perceptual similarity metrics have progressively become more correlated with human judgments on perceptual similarity; however, despite recent advances, the addition of an imperceptible distortion can still compromise these metrics. To the best of our knowledge, no study to date has systematically examined the robustness of these metrics to imperceptible adversarial perturbations. Following the two-alternative forced choice experimental design with two distorted images, and one reference image, we perturb the distorted image closer to the reference via an adversarial attack until the metric flips its judgment. We first show that all metrics are susceptible to perturbations generated via common adversarial attacks such as FGSM, PGD, and the One-pixel attack. Next, we attack the widely adopted LPIPS metric using FlowAdv, our flow-based spatial attack, in a white-box setting to craft adversarial examples that can effectively transfer to other similarity metrics in a black-box setting. In addition, we combine the spatial attack FlowAdv with PGD ($l_\infty$-bounded) attack, to increase transferability and use these adversarial examples to benchmark the robustness of both traditional and recently developed metrics. Our benchmark provides a good starting point for discussion and further research on the robustness of metrics to imperceptible adversarial perturbations.
BibTeX
@article{ghildyal2023attacking,
  author = {Abhijay Ghildyal and Feng Liu},
  title = {{Attacking Perceptual Similarity Metrics}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=r9vGSpbbRO},
}
Figure